@tamagui/demos 1.116.1 → 1.116.3
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,35 @@
|
|
|
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 SeparatorDemo_exports = {};
|
|
16
|
+
__export(SeparatorDemo_exports, {
|
|
17
|
+
SeparatorDemo: () => SeparatorDemo
|
|
18
|
+
});
|
|
19
|
+
module.exports = __toCommonJS(SeparatorDemo_exports);
|
|
20
|
+
var import_tamagui = require("tamagui"), import_jsx_runtime = require("react/jsx-runtime");
|
|
21
|
+
function SeparatorDemo() {
|
|
22
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.YStack, { width: "100%", maxWidth: 300, marginHorizontal: 15, children: [
|
|
23
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Paragraph, { fontWeight: "800", children: "Tamagui" }),
|
|
24
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Paragraph, { children: "A cross-platform component library." }),
|
|
25
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Separator, { marginVertical: 15 }),
|
|
26
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.XStack, { height: 20, alignItems: "center", children: [
|
|
27
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Paragraph, { children: "Blog" }),
|
|
28
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Separator, { alignSelf: "stretch", vertical: !0, marginHorizontal: 15 }),
|
|
29
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Paragraph, { children: "Docs" }),
|
|
30
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Separator, { alignSelf: "stretch", vertical: !0, marginHorizontal: 15 }),
|
|
31
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Paragraph, { children: "Source" })
|
|
32
|
+
] })
|
|
33
|
+
] });
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=SeparatorDemo.js.map
|
|
@@ -0,0 +1,27 @@
|
|
|
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 ShapesDemo_exports = {};
|
|
16
|
+
__export(ShapesDemo_exports, {
|
|
17
|
+
ShapesDemo: () => ShapesDemo
|
|
18
|
+
});
|
|
19
|
+
module.exports = __toCommonJS(ShapesDemo_exports);
|
|
20
|
+
var import_tamagui = require("tamagui"), import_jsx_runtime = require("react/jsx-runtime");
|
|
21
|
+
function ShapesDemo() {
|
|
22
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.XStack, { padding: "$2", space: "$4", children: [
|
|
23
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Square, { size: 100, backgroundColor: "$color", elevation: "$4" }),
|
|
24
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Circle, { size: 100, backgroundColor: "$color", elevation: "$4" })
|
|
25
|
+
] });
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=ShapesDemo.js.map
|
|
@@ -0,0 +1,120 @@
|
|
|
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 SheetDemo_exports = {};
|
|
24
|
+
__export(SheetDemo_exports, {
|
|
25
|
+
SheetDemo: () => SheetDemo
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(SheetDemo_exports);
|
|
28
|
+
var import_lucide_icons = require("@tamagui/lucide-icons"), import_sheet = require("@tamagui/sheet"), import_react = __toESM(require("react")), import_tamagui = require("tamagui"), import_jsx_runtime = require("react/jsx-runtime");
|
|
29
|
+
const spModes = ["percent", "constant", "fit", "mixed"], SheetDemo = () => {
|
|
30
|
+
const [position, setPosition] = import_react.default.useState(0), [open, setOpen] = import_react.default.useState(!1), [modal, setModal] = import_react.default.useState(!0), [innerOpen, setInnerOpen] = import_react.default.useState(!1), [snapPointsMode, setSnapPointsMode] = import_react.default.useState("percent"), [mixedFitDemo, setMixedFitDemo] = import_react.default.useState(!1), isPercent = snapPointsMode === "percent", isConstant = snapPointsMode === "constant", isFit = snapPointsMode === "fit", isMixed = snapPointsMode === "mixed", snapPoints = isPercent ? [85, 50, 25] : isConstant ? [256, 190] : isFit ? void 0 : mixedFitDemo ? ["fit", 110] : ["80%", 256, 190];
|
|
31
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
32
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.YStack, { gap: "$4", children: [
|
|
33
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.XStack, { gap: "$4", $sm: { flexDirection: "column", alignItems: "center" }, children: [
|
|
34
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Button, { onPress: () => setOpen(!0), children: "Open" }),
|
|
35
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Button, { onPress: () => setModal((x) => !x), children: modal ? "Type: Modal" : "Type: Inline" }),
|
|
36
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
37
|
+
import_tamagui.Button,
|
|
38
|
+
{
|
|
39
|
+
onPress: () => setSnapPointsMode(
|
|
40
|
+
(prev) => spModes[(spModes.indexOf(prev) + 1) % spModes.length]
|
|
41
|
+
),
|
|
42
|
+
children: `Mode: ${{ percent: "Percentage", constant: "Constant", fit: "Fit", mixed: "Mixed" }[snapPointsMode]}`
|
|
43
|
+
}
|
|
44
|
+
)
|
|
45
|
+
] }),
|
|
46
|
+
isMixed ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Button, { onPress: () => setMixedFitDemo((x) => !x), children: `Snap Points: ${JSON.stringify(snapPoints)}` }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.XStack, { paddingVertical: "$2.5", justifyContent: "center", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Paragraph, { children: `Snap Points: ${isFit ? "(none)" : JSON.stringify(snapPoints)}` }) })
|
|
47
|
+
] }),
|
|
48
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
49
|
+
import_sheet.Sheet,
|
|
50
|
+
{
|
|
51
|
+
forceRemoveScrollEnabled: open,
|
|
52
|
+
modal,
|
|
53
|
+
open,
|
|
54
|
+
onOpenChange: setOpen,
|
|
55
|
+
snapPoints,
|
|
56
|
+
snapPointsMode,
|
|
57
|
+
dismissOnSnapToBottom: !0,
|
|
58
|
+
position,
|
|
59
|
+
onPositionChange: setPosition,
|
|
60
|
+
zIndex: 1e5,
|
|
61
|
+
animation: "medium",
|
|
62
|
+
children: [
|
|
63
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
64
|
+
import_sheet.Sheet.Overlay,
|
|
65
|
+
{
|
|
66
|
+
animation: "lazy",
|
|
67
|
+
enterStyle: { opacity: 0 },
|
|
68
|
+
exitStyle: { opacity: 0 }
|
|
69
|
+
}
|
|
70
|
+
),
|
|
71
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_sheet.Sheet.Handle, {}),
|
|
72
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_sheet.Sheet.Frame, { padding: "$4", justifyContent: "center", alignItems: "center", gap: "$5", children: [
|
|
73
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Button, { size: "$6", circular: !0, icon: import_lucide_icons.ChevronDown, onPress: () => setOpen(!1) }),
|
|
74
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Input, { width: 200 }),
|
|
75
|
+
modal && isPercent && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
76
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(InnerSheet, { open: innerOpen, onOpenChange: setInnerOpen }),
|
|
77
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
78
|
+
import_tamagui.Button,
|
|
79
|
+
{
|
|
80
|
+
size: "$6",
|
|
81
|
+
circular: !0,
|
|
82
|
+
icon: import_lucide_icons.ChevronUp,
|
|
83
|
+
onPress: () => setInnerOpen(!0)
|
|
84
|
+
}
|
|
85
|
+
)
|
|
86
|
+
] })
|
|
87
|
+
] })
|
|
88
|
+
]
|
|
89
|
+
}
|
|
90
|
+
)
|
|
91
|
+
] });
|
|
92
|
+
};
|
|
93
|
+
function InnerSheet(props) {
|
|
94
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_sheet.Sheet, { animation: "medium", modal: !0, snapPoints: [90], dismissOnSnapToBottom: !0, ...props, children: [
|
|
95
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
96
|
+
import_sheet.Sheet.Overlay,
|
|
97
|
+
{
|
|
98
|
+
animation: "medium",
|
|
99
|
+
enterStyle: { opacity: 0 },
|
|
100
|
+
exitStyle: { opacity: 0 }
|
|
101
|
+
}
|
|
102
|
+
),
|
|
103
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_sheet.Sheet.Handle, {}),
|
|
104
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_sheet.Sheet.Frame, { flex: 1, justifyContent: "center", alignItems: "center", gap: "$5", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_sheet.Sheet.ScrollView, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.YStack, { p: "$5", gap: "$8", children: [
|
|
105
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
106
|
+
import_tamagui.Button,
|
|
107
|
+
{
|
|
108
|
+
size: "$6",
|
|
109
|
+
circular: !0,
|
|
110
|
+
alignSelf: "center",
|
|
111
|
+
icon: import_lucide_icons.ChevronDown,
|
|
112
|
+
onPress: () => props.onOpenChange?.(!1)
|
|
113
|
+
}
|
|
114
|
+
),
|
|
115
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.H2, { children: "Hello world" }),
|
|
116
|
+
[1, 2, 3, 4, 5, 6, 7, 8].map((i) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Paragraph, { size: "$8", 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))
|
|
117
|
+
] }) }) })
|
|
118
|
+
] });
|
|
119
|
+
}
|
|
120
|
+
//# sourceMappingURL=SheetDemo.js.map
|
|
@@ -0,0 +1,34 @@
|
|
|
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 SliderDemo_exports = {};
|
|
16
|
+
__export(SliderDemo_exports, {
|
|
17
|
+
SliderDemo: () => SliderDemo
|
|
18
|
+
});
|
|
19
|
+
module.exports = __toCommonJS(SliderDemo_exports);
|
|
20
|
+
var import_tamagui = require("tamagui"), import_jsx_runtime = require("react/jsx-runtime");
|
|
21
|
+
function SliderDemo() {
|
|
22
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.XStack, { height: 200, alignItems: "center", gap: "$8", children: [
|
|
23
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(SimpleSlider, { height: 200, orientation: "vertical" }),
|
|
24
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(SimpleSlider, { width: 200 })
|
|
25
|
+
] });
|
|
26
|
+
}
|
|
27
|
+
function SimpleSlider({ children, ...props }) {
|
|
28
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.Slider, { defaultValue: [50], max: 100, step: 1, ...props, children: [
|
|
29
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Slider.Track, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Slider.TrackActive, {}) }),
|
|
30
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Slider.Thumb, { size: "$2", index: 0, circular: !0 }),
|
|
31
|
+
children
|
|
32
|
+
] });
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=SliderDemo.js.map
|
|
@@ -0,0 +1,27 @@
|
|
|
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 SpinnerDemo_exports = {};
|
|
16
|
+
__export(SpinnerDemo_exports, {
|
|
17
|
+
SpinnerDemo: () => SpinnerDemo
|
|
18
|
+
});
|
|
19
|
+
module.exports = __toCommonJS(SpinnerDemo_exports);
|
|
20
|
+
var import_tamagui = require("tamagui"), import_jsx_runtime = require("react/jsx-runtime");
|
|
21
|
+
function SpinnerDemo() {
|
|
22
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.YStack, { padding: "$3", space: "$4", alignItems: "center", children: [
|
|
23
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Spinner, { size: "small", color: "$green10" }),
|
|
24
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Spinner, { size: "large", color: "$orange10" })
|
|
25
|
+
] });
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=SpinnerDemo.js.map
|
|
@@ -0,0 +1,93 @@
|
|
|
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 StacksDemo_exports = {};
|
|
16
|
+
__export(StacksDemo_exports, {
|
|
17
|
+
StacksDemo: () => StacksDemo
|
|
18
|
+
});
|
|
19
|
+
module.exports = __toCommonJS(StacksDemo_exports);
|
|
20
|
+
var import_tamagui = require("tamagui"), import_jsx_runtime = require("react/jsx-runtime");
|
|
21
|
+
function StacksDemo() {
|
|
22
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.XStack, { maxWidth: 250, padding: "$2", alignSelf: "center", space: !0, children: [
|
|
23
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
24
|
+
import_tamagui.YStack,
|
|
25
|
+
{
|
|
26
|
+
flex: 1,
|
|
27
|
+
space: "$2",
|
|
28
|
+
borderWidth: 2,
|
|
29
|
+
borderColor: "$color",
|
|
30
|
+
borderRadius: "$4",
|
|
31
|
+
padding: "$2",
|
|
32
|
+
children: [
|
|
33
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.YStack, { backgroundColor: "$color", borderRadius: "$3", padding: "$2" }),
|
|
34
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.YStack, { backgroundColor: "$color", borderRadius: "$3", padding: "$2" }),
|
|
35
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.YStack, { backgroundColor: "$color", borderRadius: "$3", padding: "$2" })
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
),
|
|
39
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
40
|
+
import_tamagui.XStack,
|
|
41
|
+
{
|
|
42
|
+
flex: 1,
|
|
43
|
+
space: "$2",
|
|
44
|
+
borderWidth: 2,
|
|
45
|
+
borderColor: "$color",
|
|
46
|
+
borderRadius: "$4",
|
|
47
|
+
padding: "$2",
|
|
48
|
+
children: [
|
|
49
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.YStack, { backgroundColor: "$color", borderRadius: "$3", padding: "$2" }),
|
|
50
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.YStack, { backgroundColor: "$color", borderRadius: "$3", padding: "$2" }),
|
|
51
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.YStack, { backgroundColor: "$color", borderRadius: "$3", padding: "$2" })
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
),
|
|
55
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.ZStack, { maxWidth: 50, maxHeight: 85, width: 100, flex: 1, children: [
|
|
56
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
57
|
+
import_tamagui.YStack,
|
|
58
|
+
{
|
|
59
|
+
fullscreen: !0,
|
|
60
|
+
borderRadius: "$4",
|
|
61
|
+
padding: "$2",
|
|
62
|
+
borderColor: "$color",
|
|
63
|
+
borderWidth: 2
|
|
64
|
+
}
|
|
65
|
+
),
|
|
66
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
67
|
+
import_tamagui.YStack,
|
|
68
|
+
{
|
|
69
|
+
borderColor: "$color",
|
|
70
|
+
fullscreen: !0,
|
|
71
|
+
y: 10,
|
|
72
|
+
x: 10,
|
|
73
|
+
borderWidth: 2,
|
|
74
|
+
borderRadius: "$4",
|
|
75
|
+
padding: "$2"
|
|
76
|
+
}
|
|
77
|
+
),
|
|
78
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
79
|
+
import_tamagui.YStack,
|
|
80
|
+
{
|
|
81
|
+
borderColor: "$color",
|
|
82
|
+
fullscreen: !0,
|
|
83
|
+
y: 20,
|
|
84
|
+
x: 20,
|
|
85
|
+
borderWidth: 2,
|
|
86
|
+
borderRadius: "$4",
|
|
87
|
+
padding: "$2"
|
|
88
|
+
}
|
|
89
|
+
)
|
|
90
|
+
] })
|
|
91
|
+
] });
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=StacksDemo.js.map
|
|
@@ -0,0 +1,56 @@
|
|
|
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 SwitchDemo_exports = {};
|
|
16
|
+
__export(SwitchDemo_exports, {
|
|
17
|
+
SwitchDemo: () => SwitchDemo,
|
|
18
|
+
SwitchWithLabel: () => SwitchWithLabel
|
|
19
|
+
});
|
|
20
|
+
module.exports = __toCommonJS(SwitchDemo_exports);
|
|
21
|
+
var import_tamagui = require("tamagui"), import_jsx_runtime = require("react/jsx-runtime");
|
|
22
|
+
function SwitchDemo() {
|
|
23
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.YStack, { width: 200, alignItems: "center", gap: "$3", children: [
|
|
24
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.XStack, { gap: "$3", $xs: { flexDirection: "column" }, children: [
|
|
25
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(SwitchWithLabel, { size: "$2" }),
|
|
26
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(SwitchWithLabel, { size: "$2", defaultChecked: !0 })
|
|
27
|
+
] }),
|
|
28
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.XStack, { gap: "$3", $xs: { flexDirection: "column" }, children: [
|
|
29
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(SwitchWithLabel, { size: "$3" }),
|
|
30
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(SwitchWithLabel, { size: "$3", defaultChecked: !0 })
|
|
31
|
+
] }),
|
|
32
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.XStack, { gap: "$3", $xs: { flexDirection: "column" }, children: [
|
|
33
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(SwitchWithLabel, { size: "$4" }),
|
|
34
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(SwitchWithLabel, { size: "$4", defaultChecked: !0 })
|
|
35
|
+
] })
|
|
36
|
+
] });
|
|
37
|
+
}
|
|
38
|
+
function SwitchWithLabel(props) {
|
|
39
|
+
const id = `switch-${props.size.toString().slice(1)}-${props.defaultChecked ?? ""}}`;
|
|
40
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.XStack, { width: 200, alignItems: "center", gap: "$4", children: [
|
|
41
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
42
|
+
import_tamagui.Label,
|
|
43
|
+
{
|
|
44
|
+
paddingRight: "$0",
|
|
45
|
+
minWidth: 90,
|
|
46
|
+
justifyContent: "flex-end",
|
|
47
|
+
size: props.size,
|
|
48
|
+
htmlFor: id,
|
|
49
|
+
children: "Accept"
|
|
50
|
+
}
|
|
51
|
+
),
|
|
52
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Separator, { minHeight: 20, vertical: !0 }),
|
|
53
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Switch, { id, size: props.size, defaultChecked: props.defaultChecked, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Switch.Thumb, { animation: "quicker" }) })
|
|
54
|
+
] });
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=SwitchDemo.js.map
|
|
@@ -0,0 +1,87 @@
|
|
|
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 SwitchHeadlessDemo_exports = {};
|
|
24
|
+
__export(SwitchHeadlessDemo_exports, {
|
|
25
|
+
SwitchHeadlessDemo: () => SwitchHeadlessDemo
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(SwitchHeadlessDemo_exports);
|
|
28
|
+
var import_react = __toESM(require("react")), import_switch_headless = require("@tamagui/switch-headless"), import_react_native = require("react-native-web"), import_tamagui = require("tamagui"), import_jsx_runtime = require("react/jsx-runtime");
|
|
29
|
+
function SwitchHeadlessDemo() {
|
|
30
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.YStack, { width: 200, alignItems: "center", space: "$3", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.XStack, { gap: "$3", alignItems: "center", children: [
|
|
31
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Label, { htmlFor: "headless", children: "Headless" }),
|
|
32
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(HeadlessSwitch, { defaultChecked: !0, id: "headless" })
|
|
33
|
+
] }) });
|
|
34
|
+
}
|
|
35
|
+
const HeadlessSwitch = import_react.default.forwardRef((props, ref) => {
|
|
36
|
+
const [checked, setChecked] = import_react.default.useState(props.defaultChecked || !1), { switchProps, switchRef, bubbleInput } = (0, import_switch_headless.useSwitch)(
|
|
37
|
+
props,
|
|
38
|
+
[checked, setChecked],
|
|
39
|
+
ref
|
|
40
|
+
), animation = import_react.default.useRef(new import_react_native.Animated.Value(checked ? 1 : 0)).current;
|
|
41
|
+
return import_react.default.useEffect(() => {
|
|
42
|
+
import_react_native.Animated.timing(animation, {
|
|
43
|
+
toValue: checked ? 1 : 0,
|
|
44
|
+
duration: 100,
|
|
45
|
+
useNativeDriver: !0
|
|
46
|
+
}).start();
|
|
47
|
+
}, [checked]), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
48
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
49
|
+
import_react_native.Pressable,
|
|
50
|
+
{
|
|
51
|
+
style: {
|
|
52
|
+
width: 40,
|
|
53
|
+
height: 20,
|
|
54
|
+
borderRadius: 100,
|
|
55
|
+
backgroundColor: checked ? "lightblue" : "silver"
|
|
56
|
+
},
|
|
57
|
+
ref: switchRef,
|
|
58
|
+
...switchProps,
|
|
59
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
60
|
+
import_react_native.Animated.View,
|
|
61
|
+
{
|
|
62
|
+
style: [
|
|
63
|
+
{
|
|
64
|
+
backgroundColor: "black",
|
|
65
|
+
borderRadius: 100,
|
|
66
|
+
width: 20,
|
|
67
|
+
height: 20
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
transform: [
|
|
71
|
+
{
|
|
72
|
+
translateX: animation.interpolate({
|
|
73
|
+
inputRange: [0, 1],
|
|
74
|
+
outputRange: [0, 20]
|
|
75
|
+
})
|
|
76
|
+
}
|
|
77
|
+
]
|
|
78
|
+
}
|
|
79
|
+
]
|
|
80
|
+
}
|
|
81
|
+
)
|
|
82
|
+
}
|
|
83
|
+
),
|
|
84
|
+
bubbleInput
|
|
85
|
+
] });
|
|
86
|
+
});
|
|
87
|
+
//# sourceMappingURL=SwitchHeadlessDemo.js.map
|
|
@@ -0,0 +1,64 @@
|
|
|
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 SwitchUnstyledDemo_exports = {};
|
|
16
|
+
__export(SwitchUnstyledDemo_exports, {
|
|
17
|
+
Switch: () => Switch,
|
|
18
|
+
SwitchUnstyledDemo: () => SwitchUnstyledDemo
|
|
19
|
+
});
|
|
20
|
+
module.exports = __toCommonJS(SwitchUnstyledDemo_exports);
|
|
21
|
+
var import_core = require("@tamagui/core"), import_switch = require("@tamagui/switch"), import_tamagui = require("tamagui"), import_jsx_runtime = require("react/jsx-runtime");
|
|
22
|
+
const Frame = (0, import_core.styled)(import_core.Stack, {
|
|
23
|
+
width: 40,
|
|
24
|
+
height: 20,
|
|
25
|
+
borderRadius: 20,
|
|
26
|
+
variants: {
|
|
27
|
+
checked: {
|
|
28
|
+
true: {
|
|
29
|
+
backgroundColor: "lightblue"
|
|
30
|
+
},
|
|
31
|
+
false: {
|
|
32
|
+
backgroundColor: "silver"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
defaultVariants: {
|
|
37
|
+
checked: !1
|
|
38
|
+
}
|
|
39
|
+
}), Thumb = (0, import_core.styled)(import_core.Stack, {
|
|
40
|
+
width: 20,
|
|
41
|
+
height: 20,
|
|
42
|
+
backgroundColor: "black",
|
|
43
|
+
borderRadius: 20,
|
|
44
|
+
variants: {
|
|
45
|
+
checked: {
|
|
46
|
+
true: {
|
|
47
|
+
opacity: 0.8
|
|
48
|
+
},
|
|
49
|
+
false: {
|
|
50
|
+
opacity: 0.5
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}), Switch = (0, import_switch.createSwitch)({
|
|
55
|
+
Frame,
|
|
56
|
+
Thumb
|
|
57
|
+
});
|
|
58
|
+
function SwitchUnstyledDemo() {
|
|
59
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.YStack, { width: 200, alignItems: "center", space: "$3", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.XStack, { gap: "$3", alignItems: "center", children: [
|
|
60
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Label, { htmlFor: "unstyled-switch", children: "Unstyled" }),
|
|
61
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Switch, { defaultChecked: !0, id: "unstyled-switch", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Switch.Thumb, { animation: "quick" }) })
|
|
62
|
+
] }) });
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=SwitchUnstyledDemo.js.map
|