@tamagui/demos 1.116.0 → 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,88 @@
|
|
|
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 ProgressDemo_exports = {};
|
|
24
|
+
__export(ProgressDemo_exports, {
|
|
25
|
+
ProgressDemo: () => ProgressDemo
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(ProgressDemo_exports);
|
|
28
|
+
var import_react = __toESM(require("react")), import_tamagui = require("tamagui"), import_jsx_runtime = require("react/jsx-runtime");
|
|
29
|
+
function ProgressDemo() {
|
|
30
|
+
const [key, setKey] = import_react.default.useState(0), [size, setSize] = import_react.default.useState(4), [progress, setProgress] = import_react.default.useState(0), sizeProp = `$${size}`;
|
|
31
|
+
return import_react.default.useEffect(() => {
|
|
32
|
+
const timer = setTimeout(() => setProgress(60), 1e3);
|
|
33
|
+
return () => {
|
|
34
|
+
clearTimeout(timer);
|
|
35
|
+
};
|
|
36
|
+
}, []), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
37
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.YStack, { height: 60, alignItems: "center", gap: "$4", children: [
|
|
38
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.Paragraph, { height: 30, opacity: 0.5, children: [
|
|
39
|
+
"Size: ",
|
|
40
|
+
size
|
|
41
|
+
] }),
|
|
42
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Progress, { size: sizeProp, value: progress, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Progress.Indicator, { animation: "bouncy" }) }, key)
|
|
43
|
+
] }),
|
|
44
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
45
|
+
import_tamagui.XStack,
|
|
46
|
+
{
|
|
47
|
+
alignItems: "center",
|
|
48
|
+
gap: "$2",
|
|
49
|
+
position: "absolute",
|
|
50
|
+
bottom: "$3",
|
|
51
|
+
left: "$4",
|
|
52
|
+
$xxs: { display: "none" },
|
|
53
|
+
children: [
|
|
54
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
55
|
+
import_tamagui.Slider,
|
|
56
|
+
{
|
|
57
|
+
size: "$2",
|
|
58
|
+
width: 130,
|
|
59
|
+
defaultValue: [4],
|
|
60
|
+
min: 2,
|
|
61
|
+
max: 6,
|
|
62
|
+
step: 1,
|
|
63
|
+
onValueChange: ([val]) => {
|
|
64
|
+
setSize(val);
|
|
65
|
+
},
|
|
66
|
+
children: [
|
|
67
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Slider.Track, { borderWidth: 1, borderColor: "$color5", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Slider.TrackActive, {}) }),
|
|
68
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Slider.Thumb, { circular: !0, index: 0 })
|
|
69
|
+
]
|
|
70
|
+
}
|
|
71
|
+
),
|
|
72
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Button, { size: "$2", onPress: () => setProgress((prev) => (prev + 20) % 100), children: "Load" }),
|
|
73
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
74
|
+
import_tamagui.Button,
|
|
75
|
+
{
|
|
76
|
+
size: "$2",
|
|
77
|
+
onPress: () => {
|
|
78
|
+
setKey(Math.random()), setProgress(0);
|
|
79
|
+
},
|
|
80
|
+
children: "Reset"
|
|
81
|
+
}
|
|
82
|
+
)
|
|
83
|
+
]
|
|
84
|
+
}
|
|
85
|
+
)
|
|
86
|
+
] });
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=ProgressDemo.js.map
|
|
@@ -0,0 +1,36 @@
|
|
|
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 RadioGroupDemo_exports = {};
|
|
16
|
+
__export(RadioGroupDemo_exports, {
|
|
17
|
+
RadioGroupDemo: () => RadioGroupDemo,
|
|
18
|
+
RadioGroupItemWithLabel: () => RadioGroupItemWithLabel
|
|
19
|
+
});
|
|
20
|
+
module.exports = __toCommonJS(RadioGroupDemo_exports);
|
|
21
|
+
var import_tamagui = require("tamagui"), import_jsx_runtime = require("react/jsx-runtime");
|
|
22
|
+
function RadioGroupDemo() {
|
|
23
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.RadioGroup, { "aria-labelledby": "Select one item", defaultValue: "3", name: "form", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.YStack, { width: 300, alignItems: "center", space: "$2", children: [
|
|
24
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(RadioGroupItemWithLabel, { size: "$3", value: "2", label: "Second value" }),
|
|
25
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(RadioGroupItemWithLabel, { size: "$4", value: "3", label: "Third value" }),
|
|
26
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(RadioGroupItemWithLabel, { size: "$5", value: "4", label: "Fourth value" })
|
|
27
|
+
] }) });
|
|
28
|
+
}
|
|
29
|
+
function RadioGroupItemWithLabel(props) {
|
|
30
|
+
const id = `radiogroup-${props.value}`;
|
|
31
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.XStack, { width: 300, alignItems: "center", space: "$4", children: [
|
|
32
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.RadioGroup.Item, { value: props.value, id, size: props.size, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.RadioGroup.Indicator, {}) }),
|
|
33
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Label, { size: props.size, htmlFor: id, children: props.label })
|
|
34
|
+
] });
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=RadioGroupDemo.js.map
|
|
@@ -0,0 +1,117 @@
|
|
|
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 RadioGroupHeadlessDemo_exports = {};
|
|
24
|
+
__export(RadioGroupHeadlessDemo_exports, {
|
|
25
|
+
RadioGroupHeadlessDemo: () => RadioGroupHeadlessDemo
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(RadioGroupHeadlessDemo_exports);
|
|
28
|
+
var import_radio_headless = require("@tamagui/radio-headless"), import_roving_focus = require("@tamagui/roving-focus"), import_react = __toESM(require("react")), import_react_native = require("react-native-web"), import_tamagui = require("tamagui"), import_jsx_runtime = require("react/jsx-runtime");
|
|
29
|
+
const RadioGroupContext = import_react.default.createContext({}), RadioGroupItemContext = import_react.default.createContext({
|
|
30
|
+
checked: !1,
|
|
31
|
+
disabled: !1
|
|
32
|
+
});
|
|
33
|
+
function RadioGroupHeadlessDemo() {
|
|
34
|
+
const { providerValue, frameAttrs, rovingFocusGroupAttrs } = (0, import_radio_headless.useRadioGroup)({
|
|
35
|
+
orientation: "vertical",
|
|
36
|
+
name: "form",
|
|
37
|
+
defaultValue: "3"
|
|
38
|
+
});
|
|
39
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RadioGroupContext.Provider, { value: providerValue, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_roving_focus.RovingFocusGroup, { ...rovingFocusGroupAttrs, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react_native.View, { style: styles.radioGroup, ...frameAttrs, children: [
|
|
40
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(RadioGroupItem, { value: "2", id: "2", label: "First Value" }),
|
|
41
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(RadioGroupItem, { value: "3", id: "3", label: "Second Value" }),
|
|
42
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(RadioGroupItem, { value: "4", id: "4", label: "Third Value" })
|
|
43
|
+
] }) }) });
|
|
44
|
+
}
|
|
45
|
+
function RadioGroupItem(props) {
|
|
46
|
+
const theme = (0, import_tamagui.useTheme)(), { value, id, label } = props, {
|
|
47
|
+
providerValue,
|
|
48
|
+
native,
|
|
49
|
+
bubbleInput,
|
|
50
|
+
rovingFocusGroupAttrs,
|
|
51
|
+
frameAttrs,
|
|
52
|
+
isFormControl,
|
|
53
|
+
checked
|
|
54
|
+
} = (0, import_radio_headless.useRadioGroupItem)({
|
|
55
|
+
radioGroupContext: RadioGroupContext,
|
|
56
|
+
value,
|
|
57
|
+
id
|
|
58
|
+
});
|
|
59
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RadioGroupItemContext.Provider, { value: providerValue, children: import_tamagui.isWeb && native ? bubbleInput : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react_native.View, { style: styles.radioGroupItemContainer, children: [
|
|
60
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_roving_focus.RovingFocusGroup.Item, { ...rovingFocusGroupAttrs, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
61
|
+
import_react_native.Pressable,
|
|
62
|
+
{
|
|
63
|
+
style: {
|
|
64
|
+
...styles.radioGroupItem,
|
|
65
|
+
borderColor: theme.borderColor.get(),
|
|
66
|
+
...checked ? { borderWidth: 4 } : { backgroundColor: theme.background.get() }
|
|
67
|
+
},
|
|
68
|
+
...frameAttrs,
|
|
69
|
+
onFocus: frameAttrs.onFocus,
|
|
70
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RadioGroupItemIndicator, {})
|
|
71
|
+
}
|
|
72
|
+
) }),
|
|
73
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.Text, { style: { color: theme.color.get() }, children: label }),
|
|
74
|
+
isFormControl && bubbleInput
|
|
75
|
+
] }) });
|
|
76
|
+
}
|
|
77
|
+
function RadioGroupItemIndicator() {
|
|
78
|
+
const theme = (0, import_tamagui.useTheme)(), params = (0, import_radio_headless.useRadioGroupItemIndicator)({
|
|
79
|
+
radioGroupItemContext: RadioGroupItemContext,
|
|
80
|
+
disabled: !1
|
|
81
|
+
});
|
|
82
|
+
return params.checked ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
83
|
+
import_react_native.View,
|
|
84
|
+
{
|
|
85
|
+
style: {
|
|
86
|
+
...styles.radioGroupItemIndicator,
|
|
87
|
+
backgroundColor: theme.color.get()
|
|
88
|
+
},
|
|
89
|
+
...params
|
|
90
|
+
}
|
|
91
|
+
) : null;
|
|
92
|
+
}
|
|
93
|
+
const styles = import_react_native.StyleSheet.create({
|
|
94
|
+
radioGroup: {
|
|
95
|
+
flexDirection: "column",
|
|
96
|
+
gap: 20,
|
|
97
|
+
alignItems: "flex-start"
|
|
98
|
+
},
|
|
99
|
+
radioGroupItem: {
|
|
100
|
+
borderWidth: 2,
|
|
101
|
+
width: 30,
|
|
102
|
+
height: 30,
|
|
103
|
+
justifyContent: "center",
|
|
104
|
+
alignItems: "center"
|
|
105
|
+
},
|
|
106
|
+
radioGroupItemIndicator: {
|
|
107
|
+
width: "35%",
|
|
108
|
+
height: "35%"
|
|
109
|
+
},
|
|
110
|
+
radioGroupItemContainer: {
|
|
111
|
+
justifyContent: "center",
|
|
112
|
+
alignItems: "center",
|
|
113
|
+
flexDirection: "row",
|
|
114
|
+
gap: 12
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
//# sourceMappingURL=RadioGroupHeadlessDemo.js.map
|
|
@@ -0,0 +1,107 @@
|
|
|
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 RadioGroupUnstyledDemo_exports = {};
|
|
16
|
+
__export(RadioGroupUnstyledDemo_exports, {
|
|
17
|
+
RadioGroupUnstyledDemo: () => RadioGroupUnstyledDemo
|
|
18
|
+
});
|
|
19
|
+
module.exports = __toCommonJS(RadioGroupUnstyledDemo_exports);
|
|
20
|
+
var import_tamagui = require("tamagui"), import_radio_group = require("@tamagui/radio-group"), import_jsx_runtime = require("react/jsx-runtime");
|
|
21
|
+
const RADIO_GROUP_ITEM_NAME = "RadioGroupItem", RadioGroupItemFrame = (0, import_tamagui.styled)(import_tamagui.ThemeableStack, {
|
|
22
|
+
name: RADIO_GROUP_ITEM_NAME,
|
|
23
|
+
tag: "button",
|
|
24
|
+
borderRadius: 1e3,
|
|
25
|
+
backgroundColor: "$background",
|
|
26
|
+
alignItems: "center",
|
|
27
|
+
justifyContent: "center",
|
|
28
|
+
borderWidth: 1,
|
|
29
|
+
borderColor: "$borderColor",
|
|
30
|
+
padding: 0,
|
|
31
|
+
hoverStyle: {
|
|
32
|
+
borderColor: "$borderColorHover",
|
|
33
|
+
backgroundColor: "$backgroundHover"
|
|
34
|
+
},
|
|
35
|
+
focusStyle: {
|
|
36
|
+
borderColor: "$borderColorHover",
|
|
37
|
+
backgroundColor: "$backgroundHover"
|
|
38
|
+
},
|
|
39
|
+
focusVisibleStyle: {
|
|
40
|
+
outlineStyle: "solid",
|
|
41
|
+
outlineWidth: 2,
|
|
42
|
+
outlineColor: "$outlineColor"
|
|
43
|
+
},
|
|
44
|
+
pressStyle: {
|
|
45
|
+
borderColor: "$borderColorFocus",
|
|
46
|
+
backgroundColor: "$backgroundFocus"
|
|
47
|
+
},
|
|
48
|
+
variants: {
|
|
49
|
+
disabled: {
|
|
50
|
+
true: {
|
|
51
|
+
pointerEvents: "none",
|
|
52
|
+
userSelect: "none",
|
|
53
|
+
cursor: "not-allowed",
|
|
54
|
+
hoverStyle: {
|
|
55
|
+
borderColor: "$borderColor",
|
|
56
|
+
backgroundColor: "$background"
|
|
57
|
+
},
|
|
58
|
+
pressStyle: {
|
|
59
|
+
borderColor: "$borderColor",
|
|
60
|
+
backgroundColor: "$background"
|
|
61
|
+
},
|
|
62
|
+
focusVisibleStyle: {
|
|
63
|
+
outlineWidth: 0
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}), RADIO_GROUP_INDICATOR_NAME = "RadioGroupIndicator", RadioGroupIndicatorFrame = (0, import_tamagui.styled)(import_tamagui.ThemeableStack, {
|
|
69
|
+
name: RADIO_GROUP_INDICATOR_NAME,
|
|
70
|
+
width: "53%",
|
|
71
|
+
height: "53%",
|
|
72
|
+
borderRadius: 1e3,
|
|
73
|
+
backgroundColor: "$color",
|
|
74
|
+
pressTheme: !0
|
|
75
|
+
}), RADIO_GROUP_NAME = "RadioGroup", RadioGroupFrame = (0, import_tamagui.styled)(import_tamagui.ThemeableStack, {
|
|
76
|
+
name: RADIO_GROUP_NAME,
|
|
77
|
+
variants: {
|
|
78
|
+
orientation: {
|
|
79
|
+
horizontal: {
|
|
80
|
+
flexDirection: "row",
|
|
81
|
+
spaceDirection: "horizontal"
|
|
82
|
+
},
|
|
83
|
+
vertical: {
|
|
84
|
+
flexDirection: "column",
|
|
85
|
+
spaceDirection: "vertical"
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}), RadioGroup = (0, import_radio_group.createRadioGroup)({
|
|
90
|
+
Frame: RadioGroupFrame,
|
|
91
|
+
Indicator: RadioGroupIndicatorFrame,
|
|
92
|
+
Item: RadioGroupItemFrame
|
|
93
|
+
});
|
|
94
|
+
function RadioGroupUnstyledDemo() {
|
|
95
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RadioGroup, { "aria-labelledby": "Select one item", defaultValue: "3", name: "form", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.YStack, { width: 200, alignItems: "center", space: "$2", children: [
|
|
96
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(RadioGroupItemWithLabel, { value: "2", label: "Option One" }),
|
|
97
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(RadioGroupItemWithLabel, { value: "3", label: "Option Two" })
|
|
98
|
+
] }) });
|
|
99
|
+
}
|
|
100
|
+
function RadioGroupItemWithLabel(props) {
|
|
101
|
+
const id = `radiogroup-${props.value}`;
|
|
102
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.XStack, { width: 300, alignItems: "center", gap: "$4", children: [
|
|
103
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(RadioGroup.Item, { value: props.value, id, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RadioGroup.Indicator, {}) }),
|
|
104
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Label, { htmlFor: id, children: props.label })
|
|
105
|
+
] });
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=RadioGroupUnstyledDemo.js.map
|
|
@@ -0,0 +1,58 @@
|
|
|
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 ReplaceThemeDemo_exports = {};
|
|
24
|
+
__export(ReplaceThemeDemo_exports, {
|
|
25
|
+
ReplaceThemeDemo: () => ReplaceThemeDemo
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(ReplaceThemeDemo_exports);
|
|
28
|
+
var import_react = __toESM(require("react")), import_theme = require("@tamagui/theme"), import_tamagui = require("tamagui"), import_jsx_runtime = require("react/jsx-runtime");
|
|
29
|
+
function ReplaceThemeDemo() {
|
|
30
|
+
const [theme, setTheme] = import_react.default.useState(), update = (0, import_tamagui.useForceUpdate)();
|
|
31
|
+
return (0, import_tamagui.useIsomorphicLayoutEffect)(() => {
|
|
32
|
+
(0, import_theme.addTheme)({
|
|
33
|
+
name: "mytheme",
|
|
34
|
+
insertCSS: !0,
|
|
35
|
+
theme: {
|
|
36
|
+
color: "red",
|
|
37
|
+
color2: "green"
|
|
38
|
+
}
|
|
39
|
+
}), setTheme("mytheme");
|
|
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
|
+
(0, import_theme.replaceTheme)({
|
|
47
|
+
name: "mytheme",
|
|
48
|
+
theme: {
|
|
49
|
+
color: "blue"
|
|
50
|
+
}
|
|
51
|
+
}), update();
|
|
52
|
+
},
|
|
53
|
+
children: "Replace theme to only have $color: blue"
|
|
54
|
+
}
|
|
55
|
+
)
|
|
56
|
+
] });
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=ReplaceThemeDemo.js.map
|
|
@@ -0,0 +1,43 @@
|
|
|
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 ScrollViewDemo_exports = {};
|
|
16
|
+
__export(ScrollViewDemo_exports, {
|
|
17
|
+
ScrollViewDemo: () => ScrollViewDemo
|
|
18
|
+
});
|
|
19
|
+
module.exports = __toCommonJS(ScrollViewDemo_exports);
|
|
20
|
+
var import_tamagui = require("tamagui"), import_jsx_runtime = require("react/jsx-runtime");
|
|
21
|
+
function ScrollViewDemo() {
|
|
22
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
23
|
+
import_tamagui.ScrollView,
|
|
24
|
+
{
|
|
25
|
+
maxHeight: 250,
|
|
26
|
+
width: "75%",
|
|
27
|
+
backgroundColor: "$background",
|
|
28
|
+
padding: "$4",
|
|
29
|
+
borderRadius: "$4",
|
|
30
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.XStack, { flexWrap: "wrap", alignItems: "center", justifyContent: "center", children: [
|
|
31
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Square, { margin: "$4", size: 120, backgroundColor: "$red9" }),
|
|
32
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Circle, { margin: "$4", size: 120, backgroundColor: "$orange9" }),
|
|
33
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Square, { margin: "$4", size: 120, backgroundColor: "$yellow9" }),
|
|
34
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Circle, { margin: "$4", size: 120, backgroundColor: "$green9" }),
|
|
35
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Square, { margin: "$4", size: 120, backgroundColor: "$blue9" }),
|
|
36
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Circle, { margin: "$4", size: 120, backgroundColor: "$purple9" }),
|
|
37
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Square, { margin: "$4", size: 120, backgroundColor: "$pink9" }),
|
|
38
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Circle, { margin: "$4", size: 120, backgroundColor: "$red9" })
|
|
39
|
+
] })
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=ScrollViewDemo.js.map
|
|
@@ -0,0 +1,190 @@
|
|
|
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 SelectDemo_exports = {};
|
|
24
|
+
__export(SelectDemo_exports, {
|
|
25
|
+
SelectDemo: () => SelectDemo,
|
|
26
|
+
SelectDemoItem: () => SelectDemoItem
|
|
27
|
+
});
|
|
28
|
+
module.exports = __toCommonJS(SelectDemo_exports);
|
|
29
|
+
var import_react = __toESM(require("react")), import_lucide_icons = require("@tamagui/lucide-icons"), import_tamagui = require("tamagui"), import_linear_gradient = require("tamagui/linear-gradient"), import_jsx_runtime = require("react/jsx-runtime");
|
|
30
|
+
function SelectDemo() {
|
|
31
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.YStack, { gap: "$4", children: [
|
|
32
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.XStack, { ai: "center", gap: "$4", children: [
|
|
33
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Label, { htmlFor: "select-demo-1", f: 1, miw: 80, children: "Custom" }),
|
|
34
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectDemoItem, { id: "select-demo-1" })
|
|
35
|
+
] }),
|
|
36
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.XStack, { ai: "center", gap: "$4", children: [
|
|
37
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Label, { htmlFor: "select-demo-2", f: 1, miw: 80, children: "Native" }),
|
|
38
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectDemoItem, { id: "select-demo-2", native: !0 })
|
|
39
|
+
] })
|
|
40
|
+
] });
|
|
41
|
+
}
|
|
42
|
+
function SelectDemoItem(props) {
|
|
43
|
+
const [val, setVal] = import_react.default.useState("apple");
|
|
44
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.Select, { value: val, onValueChange: setVal, disablePreventBodyScroll: !0, ...props, children: [
|
|
45
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Select.Trigger, { width: 220, iconAfter: import_lucide_icons.ChevronDown, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Select.Value, { placeholder: "Something" }) }),
|
|
46
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Adapt, { when: "sm", platform: "touch", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
47
|
+
import_tamagui.Sheet,
|
|
48
|
+
{
|
|
49
|
+
native: !!props.native,
|
|
50
|
+
modal: !0,
|
|
51
|
+
dismissOnSnapToBottom: !0,
|
|
52
|
+
animationConfig: {
|
|
53
|
+
type: "spring",
|
|
54
|
+
damping: 20,
|
|
55
|
+
mass: 1.2,
|
|
56
|
+
stiffness: 250
|
|
57
|
+
},
|
|
58
|
+
children: [
|
|
59
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Sheet.Frame, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Sheet.ScrollView, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Adapt.Contents, {}) }) }),
|
|
60
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
61
|
+
import_tamagui.Sheet.Overlay,
|
|
62
|
+
{
|
|
63
|
+
animation: "lazy",
|
|
64
|
+
enterStyle: { opacity: 0 },
|
|
65
|
+
exitStyle: { opacity: 0 }
|
|
66
|
+
}
|
|
67
|
+
)
|
|
68
|
+
]
|
|
69
|
+
}
|
|
70
|
+
) }),
|
|
71
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.Select.Content, { zIndex: 2e5, children: [
|
|
72
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
73
|
+
import_tamagui.Select.ScrollUpButton,
|
|
74
|
+
{
|
|
75
|
+
alignItems: "center",
|
|
76
|
+
justifyContent: "center",
|
|
77
|
+
position: "relative",
|
|
78
|
+
width: "100%",
|
|
79
|
+
height: "$3",
|
|
80
|
+
children: [
|
|
81
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.YStack, { zIndex: 10, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_icons.ChevronUp, { size: 20 }) }),
|
|
82
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
83
|
+
import_linear_gradient.LinearGradient,
|
|
84
|
+
{
|
|
85
|
+
start: [0, 0],
|
|
86
|
+
end: [0, 1],
|
|
87
|
+
fullscreen: !0,
|
|
88
|
+
colors: ["$background", "transparent"],
|
|
89
|
+
borderRadius: "$4"
|
|
90
|
+
}
|
|
91
|
+
)
|
|
92
|
+
]
|
|
93
|
+
}
|
|
94
|
+
),
|
|
95
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
96
|
+
import_tamagui.Select.Viewport,
|
|
97
|
+
{
|
|
98
|
+
minWidth: 200,
|
|
99
|
+
children: [
|
|
100
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.Select.Group, { children: [
|
|
101
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Select.Label, { children: "Fruits" }),
|
|
102
|
+
import_react.default.useMemo(
|
|
103
|
+
() => items.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
104
|
+
import_tamagui.Select.Item,
|
|
105
|
+
{
|
|
106
|
+
index: i,
|
|
107
|
+
value: item.name.toLowerCase(),
|
|
108
|
+
children: [
|
|
109
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Select.ItemText, { children: item.name }),
|
|
110
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Select.ItemIndicator, { marginLeft: "auto", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_icons.Check, { size: 16 }) })
|
|
111
|
+
]
|
|
112
|
+
},
|
|
113
|
+
item.name
|
|
114
|
+
)),
|
|
115
|
+
[items]
|
|
116
|
+
)
|
|
117
|
+
] }),
|
|
118
|
+
props.native && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
119
|
+
import_tamagui.YStack,
|
|
120
|
+
{
|
|
121
|
+
position: "absolute",
|
|
122
|
+
right: 0,
|
|
123
|
+
top: 0,
|
|
124
|
+
bottom: 0,
|
|
125
|
+
alignItems: "center",
|
|
126
|
+
justifyContent: "center",
|
|
127
|
+
width: "$4",
|
|
128
|
+
pointerEvents: "none",
|
|
129
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
130
|
+
import_lucide_icons.ChevronDown,
|
|
131
|
+
{
|
|
132
|
+
size: (0, import_tamagui.getFontSize)(props.size ?? "$true")
|
|
133
|
+
}
|
|
134
|
+
)
|
|
135
|
+
}
|
|
136
|
+
)
|
|
137
|
+
]
|
|
138
|
+
}
|
|
139
|
+
),
|
|
140
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
141
|
+
import_tamagui.Select.ScrollDownButton,
|
|
142
|
+
{
|
|
143
|
+
alignItems: "center",
|
|
144
|
+
justifyContent: "center",
|
|
145
|
+
position: "relative",
|
|
146
|
+
width: "100%",
|
|
147
|
+
height: "$3",
|
|
148
|
+
children: [
|
|
149
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.YStack, { zIndex: 10, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_icons.ChevronDown, { size: 20 }) }),
|
|
150
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
151
|
+
import_linear_gradient.LinearGradient,
|
|
152
|
+
{
|
|
153
|
+
start: [0, 0],
|
|
154
|
+
end: [0, 1],
|
|
155
|
+
fullscreen: !0,
|
|
156
|
+
colors: ["transparent", "$background"],
|
|
157
|
+
borderRadius: "$4"
|
|
158
|
+
}
|
|
159
|
+
)
|
|
160
|
+
]
|
|
161
|
+
}
|
|
162
|
+
)
|
|
163
|
+
] })
|
|
164
|
+
] });
|
|
165
|
+
}
|
|
166
|
+
const items = [
|
|
167
|
+
{ name: "Apple" },
|
|
168
|
+
{ name: "Pear" },
|
|
169
|
+
{ name: "Blackberry" },
|
|
170
|
+
{ name: "Peach" },
|
|
171
|
+
{ name: "Apricot" },
|
|
172
|
+
{ name: "Melon" },
|
|
173
|
+
{ name: "Honeydew" },
|
|
174
|
+
{ name: "Starfruit" },
|
|
175
|
+
{ name: "Blueberry" },
|
|
176
|
+
{ name: "Raspberry" },
|
|
177
|
+
{ name: "Strawberry" },
|
|
178
|
+
{ name: "Mango" },
|
|
179
|
+
{ name: "Pineapple" },
|
|
180
|
+
{ name: "Lime" },
|
|
181
|
+
{ name: "Lemon" },
|
|
182
|
+
{ name: "Coconut" },
|
|
183
|
+
{ name: "Guava" },
|
|
184
|
+
{ name: "Papaya" },
|
|
185
|
+
{ name: "Orange" },
|
|
186
|
+
{ name: "Grape" },
|
|
187
|
+
{ name: "Jackfruit" },
|
|
188
|
+
{ name: "Durian" }
|
|
189
|
+
];
|
|
190
|
+
//# sourceMappingURL=SelectDemo.js.map
|