@tamagui/demos 1.113.0 → 1.113.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.
Files changed (121) hide show
  1. package/dist/esm/AccordionDemo.native.js +79 -66
  2. package/dist/esm/AccordionDemo.native.js.map +6 -1
  3. package/dist/esm/AddThemeDemo.native.js +34 -25
  4. package/dist/esm/AddThemeDemo.native.js.map +6 -1
  5. package/dist/esm/AlertDialogDemo.native.js +84 -66
  6. package/dist/esm/AlertDialogDemo.native.js.map +6 -1
  7. package/dist/esm/AnimationsDemo.native.js +75 -65
  8. package/dist/esm/AnimationsDemo.native.js.map +6 -1
  9. package/dist/esm/AnimationsEnterDemo.native.js +38 -33
  10. package/dist/esm/AnimationsEnterDemo.native.js.map +6 -1
  11. package/dist/esm/AnimationsHoverDemo.native.js +6 -4
  12. package/dist/esm/AnimationsHoverDemo.native.js.map +6 -1
  13. package/dist/esm/AnimationsPresenceDemo.native.js +91 -78
  14. package/dist/esm/AnimationsPresenceDemo.native.js.map +6 -1
  15. package/dist/esm/AnimationsTimingDemo.native.js +6 -4
  16. package/dist/esm/AnimationsTimingDemo.native.js.map +6 -1
  17. package/dist/esm/AvatarDemo.native.js +34 -23
  18. package/dist/esm/AvatarDemo.native.js.map +6 -1
  19. package/dist/esm/BuildAButtonDemo.native.js +94 -73
  20. package/dist/esm/BuildAButtonDemo.native.js.map +6 -1
  21. package/dist/esm/ButtonDemo.native.js +68 -51
  22. package/dist/esm/ButtonDemo.native.js.map +6 -1
  23. package/dist/esm/CardDemo.native.js +63 -47
  24. package/dist/esm/CardDemo.native.js.map +6 -1
  25. package/dist/esm/CheckboxDemo.native.js +36 -31
  26. package/dist/esm/CheckboxDemo.native.js.map +6 -1
  27. package/dist/esm/CheckboxHeadlessDemo.native.js +33 -26
  28. package/dist/esm/CheckboxHeadlessDemo.native.js.map +6 -1
  29. package/dist/esm/CheckboxUnstyledDemo.native.js +40 -36
  30. package/dist/esm/CheckboxUnstyledDemo.native.js.map +6 -1
  31. package/dist/esm/ColorsDemo.native.js +106 -84
  32. package/dist/esm/ColorsDemo.native.js.map +6 -1
  33. package/dist/esm/DialogDemo.native.js +156 -122
  34. package/dist/esm/DialogDemo.native.js.map +6 -1
  35. package/dist/esm/FormsDemo.native.js +25 -18
  36. package/dist/esm/FormsDemo.native.js.map +6 -1
  37. package/dist/esm/Grid.native.js +22 -23
  38. package/dist/esm/Grid.native.js.map +6 -1
  39. package/dist/esm/GroupDemo.native.js +72 -55
  40. package/dist/esm/GroupDemo.native.js.map +6 -1
  41. package/dist/esm/HeadingsDemo.native.js +25 -16
  42. package/dist/esm/HeadingsDemo.native.js.map +6 -1
  43. package/dist/esm/ImageDemo.native.js +5 -3
  44. package/dist/esm/ImageDemo.native.js.map +6 -1
  45. package/dist/esm/InputsDemo.native.js +31 -21
  46. package/dist/esm/InputsDemo.native.js.map +6 -1
  47. package/dist/esm/LabelDemo.native.js +40 -29
  48. package/dist/esm/LabelDemo.native.js.map +6 -1
  49. package/dist/esm/LinearGradientDemo.native.js +43 -20
  50. package/dist/esm/LinearGradientDemo.native.js.map +6 -1
  51. package/dist/esm/ListItemDemo.native.js +63 -50
  52. package/dist/esm/ListItemDemo.native.js.map +6 -1
  53. package/dist/esm/LucideIconsDemo.native.js +44 -38
  54. package/dist/esm/LucideIconsDemo.native.js.map +6 -1
  55. package/dist/esm/NewInputsDemo.native.js +31 -21
  56. package/dist/esm/NewInputsDemo.native.js.map +6 -1
  57. package/dist/esm/PopoverDemo.native.js +139 -108
  58. package/dist/esm/PopoverDemo.native.js.map +6 -1
  59. package/dist/esm/ProgressDemo.native.js +85 -68
  60. package/dist/esm/ProgressDemo.native.js.map +6 -1
  61. package/dist/esm/RadioGroupDemo.native.js +38 -28
  62. package/dist/esm/RadioGroupDemo.native.js.map +6 -1
  63. package/dist/esm/RadioGroupHeadlessDemo.native.js +65 -75
  64. package/dist/esm/RadioGroupHeadlessDemo.native.js.map +6 -1
  65. package/dist/esm/RadioGroupUnstyledDemo.native.js +96 -94
  66. package/dist/esm/RadioGroupUnstyledDemo.native.js.map +6 -1
  67. package/dist/esm/ReplaceThemeDemo.native.js +29 -25
  68. package/dist/esm/ReplaceThemeDemo.native.js.map +6 -1
  69. package/dist/esm/ScrollViewDemo.native.js +48 -37
  70. package/dist/esm/ScrollViewDemo.native.js.map +6 -1
  71. package/dist/esm/SelectDemo.native.js +267 -187
  72. package/dist/esm/SelectDemo.native.js.map +6 -1
  73. package/dist/esm/SeparatorDemo.native.js +42 -29
  74. package/dist/esm/SeparatorDemo.native.js.map +6 -1
  75. package/dist/esm/ShapesDemo.native.js +17 -12
  76. package/dist/esm/ShapesDemo.native.js.map +6 -1
  77. package/dist/esm/SheetDemo.native.js +183 -133
  78. package/dist/esm/SheetDemo.native.js.map +6 -1
  79. package/dist/esm/SliderDemo.native.js +30 -22
  80. package/dist/esm/SliderDemo.native.js.map +6 -1
  81. package/dist/esm/SpinnerDemo.native.js +15 -10
  82. package/dist/esm/SpinnerDemo.native.js.map +6 -1
  83. package/dist/esm/StacksDemo.native.js +85 -67
  84. package/dist/esm/StacksDemo.native.js.map +6 -1
  85. package/dist/esm/SwitchDemo.native.js +76 -57
  86. package/dist/esm/SwitchDemo.native.js.map +6 -1
  87. package/dist/esm/SwitchHeadlessDemo.native.js +63 -45
  88. package/dist/esm/SwitchHeadlessDemo.native.js.map +6 -1
  89. package/dist/esm/SwitchUnstyledDemo.native.js +50 -46
  90. package/dist/esm/SwitchUnstyledDemo.native.js.map +6 -1
  91. package/dist/esm/TabsAdvancedDemo.native.js +297 -297
  92. package/dist/esm/TabsAdvancedDemo.native.js.map +6 -1
  93. package/dist/esm/TabsDemo.native.js +149 -126
  94. package/dist/esm/TabsDemo.native.js.map +6 -1
  95. package/dist/esm/TextDemo.native.js +30 -21
  96. package/dist/esm/TextDemo.native.js.map +6 -1
  97. package/dist/esm/ThemeBuilderDemo.native.js +170 -137
  98. package/dist/esm/ThemeBuilderDemo.native.js.map +6 -1
  99. package/dist/esm/ThemeInverseDemo.native.js +43 -30
  100. package/dist/esm/ThemeInverseDemo.native.js.map +6 -1
  101. package/dist/esm/ToastDemo.native.js +83 -73
  102. package/dist/esm/ToastDemo.native.js.map +6 -1
  103. package/dist/esm/ToastDuplicateDemo.native.js +61 -45
  104. package/dist/esm/ToastDuplicateDemo.native.js.map +6 -1
  105. package/dist/esm/ToggleGroupDemo.native.js +76 -58
  106. package/dist/esm/ToggleGroupDemo.native.js.map +6 -1
  107. package/dist/esm/TokensDemo.native.js +107 -94
  108. package/dist/esm/TokensDemo.native.js.map +6 -1
  109. package/dist/esm/TooltipDemo.native.js +109 -85
  110. package/dist/esm/TooltipDemo.native.js.map +6 -1
  111. package/dist/esm/UpdateThemeDemo.native.js +31 -28
  112. package/dist/esm/UpdateThemeDemo.native.js.map +6 -1
  113. package/dist/esm/WebNativeImageDemo.native.js +5 -3
  114. package/dist/esm/WebNativeImageDemo.native.js.map +6 -1
  115. package/dist/esm/index.native.js +58 -58
  116. package/dist/esm/index.native.js.map +6 -1
  117. package/dist/esm/tamagui.config.native.js +5 -2
  118. package/dist/esm/tamagui.config.native.js.map +6 -1
  119. package/dist/esm/useOnIntersecting.native.js +39 -42
  120. package/dist/esm/useOnIntersecting.native.js.map +6 -1
  121. package/package.json +19 -19
@@ -1,16 +1,18 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import React from "react";
3
3
  import { AnimatePresence, Button, H5, SizableText, Tabs, XStack, YStack, styled } from "tamagui";
4
- var demos = ["background", "underline"],
5
- demosTitle = {
6
- background: "Background Indicator",
7
- underline: "Underline Indicator"
8
- },
9
- TabsAdvancedDemo = function () {
10
- var [demoIndex, setDemoIndex] = React.useState(0),
11
- demo = demos[demoIndex];
12
- return /* @__PURE__ */_jsxs(_Fragment, {
13
- children: [demo === "underline" ? /* @__PURE__ */_jsx(TabsAdvancedUnderline, {}) : /* @__PURE__ */_jsx(TabsAdvancedBackground, {}), /* @__PURE__ */_jsx(XStack, {
4
+ var demos = [
5
+ "background",
6
+ "underline"
7
+ ], demosTitle = {
8
+ background: "Background Indicator",
9
+ underline: "Underline Indicator"
10
+ }, TabsAdvancedDemo = function() {
11
+ var [demoIndex, setDemoIndex] = React.useState(0), demo = demos[demoIndex];
12
+ return /* @__PURE__ */ _jsxs(_Fragment, {
13
+ children: [
14
+ demo === "underline" ? /* @__PURE__ */ _jsx(TabsAdvancedUnderline, {}) : /* @__PURE__ */ _jsx(TabsAdvancedBackground, {}),
15
+ /* @__PURE__ */ _jsx(XStack, {
14
16
  alignItems: "center",
15
17
  gap: "$4",
16
18
  position: "absolute",
@@ -19,333 +21,331 @@ var demos = ["background", "underline"],
19
21
  $xxs: {
20
22
  display: "none"
21
23
  },
22
- children: /* @__PURE__ */_jsx(Button, {
24
+ children: /* @__PURE__ */ _jsx(Button, {
23
25
  size: "$2",
24
- onPress: function () {
25
- return setDemoIndex(function (x) {
26
+ onPress: function() {
27
+ return setDemoIndex(function(x) {
26
28
  return (x + 1) % demos.length;
27
29
  });
28
30
  },
29
31
  children: demosTitle[demo]
30
32
  })
31
- })]
33
+ })
34
+ ]
35
+ });
36
+ }, TabsAdvancedBackground = function() {
37
+ var [tabState, setTabState] = React.useState(
38
+ /**
39
+ * Layout of the Tab user might intend to select (hovering / focusing)
40
+ */
41
+ /**
42
+ * Layout of the Tab user selected
43
+ */
44
+ /**
45
+ * Used to get the direction of activation for animating the active indicator
46
+ */
47
+ {
48
+ activeAt: null,
49
+ currentTab: "tab1",
50
+ intentAt: null,
51
+ prevActiveAt: null
52
+ }
53
+ ), setCurrentTab = function(currentTab2) {
54
+ return setTabState({
55
+ ...tabState,
56
+ currentTab: currentTab2
32
57
  });
33
- },
34
- TabsAdvancedBackground = function () {
35
- var [tabState, setTabState] = React.useState(
36
- /**
37
- * Layout of the Tab user might intend to select (hovering / focusing)
38
- */
39
- /**
40
- * Layout of the Tab user selected
41
- */
42
- /**
43
- * Used to get the direction of activation for animating the active indicator
44
- */
45
- {
46
- activeAt: null,
47
- currentTab: "tab1",
48
- intentAt: null,
49
- prevActiveAt: null
50
- }),
51
- setCurrentTab = function (currentTab2) {
52
- return setTabState({
53
- ...tabState,
54
- currentTab: currentTab2
55
- });
56
- },
57
- setIntentIndicator = function (intentAt2) {
58
- return setTabState({
59
- ...tabState,
60
- intentAt: intentAt2
61
- });
62
- },
63
- setActiveIndicator = function (activeAt2) {
64
- return setTabState({
65
- ...tabState,
66
- prevActiveAt: tabState.activeAt,
67
- activeAt: activeAt2
68
- });
69
- },
70
- {
71
- activeAt,
72
- intentAt,
73
- prevActiveAt,
74
- currentTab
75
- } = tabState,
76
- direction = function () {
77
- return !activeAt || !prevActiveAt || activeAt.x === prevActiveAt.x ? 0 : activeAt.x > prevActiveAt.x ? -1 : 1;
78
- }(),
79
- handleOnInteraction = function (type, layout) {
80
- type === "select" ? setActiveIndicator(layout) : setIntentIndicator(layout);
81
- };
82
- return /* @__PURE__ */_jsxs(Tabs, {
83
- value: currentTab,
84
- onValueChange: setCurrentTab,
85
- orientation: "horizontal",
86
- size: "$4",
87
- padding: "$2",
88
- height: 150,
89
- flexDirection: "column",
90
- activationMode: "manual",
91
- backgroundColor: "$background",
92
- borderRadius: "$4",
93
- position: "relative",
94
- children: [/* @__PURE__ */_jsxs(YStack, {
95
- children: [/* @__PURE__ */_jsx(AnimatePresence, {
96
- children: intentAt && /* @__PURE__ */_jsx(TabsRovingIndicator, {
97
- borderRadius: "$4",
98
- width: intentAt.width,
99
- height: intentAt.height,
100
- x: intentAt.x,
101
- y: intentAt.y
102
- })
103
- }), /* @__PURE__ */_jsx(AnimatePresence, {
104
- children: activeAt && /* @__PURE__ */_jsx(TabsRovingIndicator, {
105
- borderRadius: "$4",
106
- theme: "active",
107
- width: activeAt.width,
108
- height: activeAt.height,
109
- x: activeAt.x,
110
- y: activeAt.y
111
- })
112
- }), /* @__PURE__ */_jsxs(Tabs.List, {
113
- disablePassBorderRadius: !0,
114
- loop: !1,
115
- "aria-label": "Manage your account",
116
- gap: "$2",
117
- backgroundColor: "transparent",
118
- children: [/* @__PURE__ */_jsx(Tabs.Tab, {
119
- unstyled: !0,
120
- paddingVertical: "$2",
121
- paddingHorizontal: "$3",
122
- value: "tab1",
123
- onInteraction: handleOnInteraction,
124
- children: /* @__PURE__ */_jsx(SizableText, {
125
- children: "Profile"
126
- })
127
- }), /* @__PURE__ */_jsx(Tabs.Tab, {
128
- unstyled: !0,
129
- paddingVertical: "$2",
130
- paddingHorizontal: "$3",
131
- value: "tab2",
132
- onInteraction: handleOnInteraction,
133
- children: /* @__PURE__ */_jsx(SizableText, {
134
- children: "Connections"
58
+ }, setIntentIndicator = function(intentAt2) {
59
+ return setTabState({
60
+ ...tabState,
61
+ intentAt: intentAt2
62
+ });
63
+ }, setActiveIndicator = function(activeAt2) {
64
+ return setTabState({
65
+ ...tabState,
66
+ prevActiveAt: tabState.activeAt,
67
+ activeAt: activeAt2
68
+ });
69
+ }, { activeAt, intentAt, prevActiveAt, currentTab } = tabState, direction = function() {
70
+ return !activeAt || !prevActiveAt || activeAt.x === prevActiveAt.x ? 0 : activeAt.x > prevActiveAt.x ? -1 : 1;
71
+ }(), handleOnInteraction = function(type, layout) {
72
+ type === "select" ? setActiveIndicator(layout) : setIntentIndicator(layout);
73
+ };
74
+ return /* @__PURE__ */ _jsxs(Tabs, {
75
+ value: currentTab,
76
+ onValueChange: setCurrentTab,
77
+ orientation: "horizontal",
78
+ size: "$4",
79
+ padding: "$2",
80
+ height: 150,
81
+ flexDirection: "column",
82
+ activationMode: "manual",
83
+ backgroundColor: "$background",
84
+ borderRadius: "$4",
85
+ position: "relative",
86
+ children: [
87
+ /* @__PURE__ */ _jsxs(YStack, {
88
+ children: [
89
+ /* @__PURE__ */ _jsx(AnimatePresence, {
90
+ children: intentAt && /* @__PURE__ */ _jsx(TabsRovingIndicator, {
91
+ borderRadius: "$4",
92
+ width: intentAt.width,
93
+ height: intentAt.height,
94
+ x: intentAt.x,
95
+ y: intentAt.y
135
96
  })
136
- }), /* @__PURE__ */_jsx(Tabs.Tab, {
137
- unstyled: !0,
138
- paddingVertical: "$2",
139
- paddingHorizontal: "$3",
140
- value: "tab3",
141
- onInteraction: handleOnInteraction,
142
- children: /* @__PURE__ */_jsx(SizableText, {
143
- children: "Notifications"
97
+ }),
98
+ /* @__PURE__ */ _jsx(AnimatePresence, {
99
+ children: activeAt && /* @__PURE__ */ _jsx(TabsRovingIndicator, {
100
+ borderRadius: "$4",
101
+ theme: "active",
102
+ width: activeAt.width,
103
+ height: activeAt.height,
104
+ x: activeAt.x,
105
+ y: activeAt.y
144
106
  })
145
- })]
146
- })]
147
- }), /* @__PURE__ */_jsx(AnimatePresence, {
107
+ }),
108
+ /* @__PURE__ */ _jsxs(Tabs.List, {
109
+ disablePassBorderRadius: !0,
110
+ loop: !1,
111
+ "aria-label": "Manage your account",
112
+ gap: "$2",
113
+ backgroundColor: "transparent",
114
+ children: [
115
+ /* @__PURE__ */ _jsx(Tabs.Tab, {
116
+ unstyled: !0,
117
+ paddingVertical: "$2",
118
+ paddingHorizontal: "$3",
119
+ value: "tab1",
120
+ onInteraction: handleOnInteraction,
121
+ children: /* @__PURE__ */ _jsx(SizableText, {
122
+ children: "Profile"
123
+ })
124
+ }),
125
+ /* @__PURE__ */ _jsx(Tabs.Tab, {
126
+ unstyled: !0,
127
+ paddingVertical: "$2",
128
+ paddingHorizontal: "$3",
129
+ value: "tab2",
130
+ onInteraction: handleOnInteraction,
131
+ children: /* @__PURE__ */ _jsx(SizableText, {
132
+ children: "Connections"
133
+ })
134
+ }),
135
+ /* @__PURE__ */ _jsx(Tabs.Tab, {
136
+ unstyled: !0,
137
+ paddingVertical: "$2",
138
+ paddingHorizontal: "$3",
139
+ value: "tab3",
140
+ onInteraction: handleOnInteraction,
141
+ children: /* @__PURE__ */ _jsx(SizableText, {
142
+ children: "Notifications"
143
+ })
144
+ })
145
+ ]
146
+ })
147
+ ]
148
+ }),
149
+ /* @__PURE__ */ _jsx(AnimatePresence, {
148
150
  exitBeforeEnter: !0,
149
151
  custom: {
150
152
  direction
151
153
  },
152
154
  initial: !1,
153
- children: /* @__PURE__ */_jsx(AnimatedYStack, {
154
- children: /* @__PURE__ */_jsx(Tabs.Content, {
155
+ children: /* @__PURE__ */ _jsx(AnimatedYStack, {
156
+ children: /* @__PURE__ */ _jsx(Tabs.Content, {
155
157
  value: currentTab,
156
158
  forceMount: !0,
157
159
  flex: 1,
158
160
  justifyContent: "center",
159
- children: /* @__PURE__ */_jsx(H5, {
161
+ children: /* @__PURE__ */ _jsx(H5, {
160
162
  textAlign: "center",
161
163
  children: currentTab
162
164
  })
163
165
  })
164
166
  }, currentTab)
165
- })]
167
+ })
168
+ ]
169
+ });
170
+ }, TabsAdvancedUnderline = function() {
171
+ var [tabState, setTabState] = React.useState(
172
+ /**
173
+ * Layout of the Tab user might intend to select (hovering / focusing)
174
+ */
175
+ /**
176
+ * Layout of the Tab user selected
177
+ */
178
+ /**
179
+ * Used to get the direction of activation for animating the active indicator
180
+ */
181
+ {
182
+ activeAt: null,
183
+ currentTab: "tab1",
184
+ intentAt: null,
185
+ prevActiveAt: null
186
+ }
187
+ ), setCurrentTab = function(currentTab2) {
188
+ return setTabState({
189
+ ...tabState,
190
+ currentTab: currentTab2
166
191
  });
167
- },
168
- TabsAdvancedUnderline = function () {
169
- var [tabState, setTabState] = React.useState(
170
- /**
171
- * Layout of the Tab user might intend to select (hovering / focusing)
172
- */
173
- /**
174
- * Layout of the Tab user selected
175
- */
176
- /**
177
- * Used to get the direction of activation for animating the active indicator
178
- */
179
- {
180
- activeAt: null,
181
- currentTab: "tab1",
182
- intentAt: null,
183
- prevActiveAt: null
184
- }),
185
- setCurrentTab = function (currentTab2) {
186
- return setTabState({
187
- ...tabState,
188
- currentTab: currentTab2
189
- });
190
- },
191
- setIntentIndicator = function (intentAt2) {
192
- return setTabState({
193
- ...tabState,
194
- intentAt: intentAt2
195
- });
196
- },
197
- setActiveIndicator = function (activeAt2) {
198
- return setTabState({
199
- ...tabState,
200
- prevActiveAt: tabState.activeAt,
201
- activeAt: activeAt2
202
- });
203
- },
204
- {
205
- activeAt,
206
- intentAt,
207
- prevActiveAt,
208
- currentTab
209
- } = tabState,
210
- direction = function () {
211
- return !activeAt || !prevActiveAt || activeAt.x === prevActiveAt.x ? 0 : activeAt.x > prevActiveAt.x ? -1 : 1;
212
- }(),
213
- handleOnInteraction = function (type, layout) {
214
- type === "select" ? setActiveIndicator(layout) : setIntentIndicator(layout);
215
- };
216
- return /* @__PURE__ */_jsxs(Tabs, {
217
- value: currentTab,
218
- onValueChange: setCurrentTab,
219
- orientation: "horizontal",
220
- size: "$4",
221
- height: 150,
222
- flexDirection: "column",
223
- activationMode: "manual",
224
- backgroundColor: "$background",
225
- borderRadius: "$4",
226
- children: [/* @__PURE__ */_jsxs(YStack, {
227
- children: [/* @__PURE__ */_jsx(AnimatePresence, {
228
- children: intentAt && /* @__PURE__ */_jsx(TabsRovingIndicator, {
229
- width: intentAt.width,
230
- height: "$0.5",
231
- x: intentAt.x,
232
- bottom: 0
233
- })
234
- }), /* @__PURE__ */_jsx(AnimatePresence, {
235
- children: activeAt && /* @__PURE__ */_jsx(TabsRovingIndicator, {
236
- theme: "active",
237
- active: !0,
238
- width: activeAt.width,
239
- height: "$0.5",
240
- x: activeAt.x,
241
- bottom: 0
242
- })
243
- }), /* @__PURE__ */_jsxs(Tabs.List, {
244
- disablePassBorderRadius: !0,
245
- loop: !1,
246
- "aria-label": "Manage your account",
247
- borderBottomLeftRadius: 0,
248
- borderBottomRightRadius: 0,
249
- paddingBottom: "$1.5",
250
- borderColor: "$color3",
251
- borderBottomWidth: "$0.5",
252
- backgroundColor: "transparent",
253
- children: [/* @__PURE__ */_jsx(Tabs.Tab, {
254
- unstyled: !0,
255
- paddingHorizontal: "$3",
256
- paddingVertical: "$2",
257
- value: "tab1",
258
- onInteraction: handleOnInteraction,
259
- children: /* @__PURE__ */_jsx(SizableText, {
260
- children: "Profile"
261
- })
262
- }), /* @__PURE__ */_jsx(Tabs.Tab, {
263
- unstyled: !0,
264
- paddingHorizontal: "$3",
265
- paddingVertical: "$2",
266
- value: "tab2",
267
- onInteraction: handleOnInteraction,
268
- children: /* @__PURE__ */_jsx(SizableText, {
269
- children: "Connections"
192
+ }, setIntentIndicator = function(intentAt2) {
193
+ return setTabState({
194
+ ...tabState,
195
+ intentAt: intentAt2
196
+ });
197
+ }, setActiveIndicator = function(activeAt2) {
198
+ return setTabState({
199
+ ...tabState,
200
+ prevActiveAt: tabState.activeAt,
201
+ activeAt: activeAt2
202
+ });
203
+ }, { activeAt, intentAt, prevActiveAt, currentTab } = tabState, direction = function() {
204
+ return !activeAt || !prevActiveAt || activeAt.x === prevActiveAt.x ? 0 : activeAt.x > prevActiveAt.x ? -1 : 1;
205
+ }(), handleOnInteraction = function(type, layout) {
206
+ type === "select" ? setActiveIndicator(layout) : setIntentIndicator(layout);
207
+ };
208
+ return /* @__PURE__ */ _jsxs(Tabs, {
209
+ value: currentTab,
210
+ onValueChange: setCurrentTab,
211
+ orientation: "horizontal",
212
+ size: "$4",
213
+ height: 150,
214
+ flexDirection: "column",
215
+ activationMode: "manual",
216
+ backgroundColor: "$background",
217
+ borderRadius: "$4",
218
+ children: [
219
+ /* @__PURE__ */ _jsxs(YStack, {
220
+ children: [
221
+ /* @__PURE__ */ _jsx(AnimatePresence, {
222
+ children: intentAt && /* @__PURE__ */ _jsx(TabsRovingIndicator, {
223
+ width: intentAt.width,
224
+ height: "$0.5",
225
+ x: intentAt.x,
226
+ bottom: 0
270
227
  })
271
- }), /* @__PURE__ */_jsx(Tabs.Tab, {
272
- unstyled: !0,
273
- paddingHorizontal: "$3",
274
- paddingVertical: "$2",
275
- value: "tab3",
276
- onInteraction: handleOnInteraction,
277
- children: /* @__PURE__ */_jsx(SizableText, {
278
- children: "Notifications"
228
+ }),
229
+ /* @__PURE__ */ _jsx(AnimatePresence, {
230
+ children: activeAt && /* @__PURE__ */ _jsx(TabsRovingIndicator, {
231
+ theme: "active",
232
+ active: !0,
233
+ width: activeAt.width,
234
+ height: "$0.5",
235
+ x: activeAt.x,
236
+ bottom: 0
279
237
  })
280
- })]
281
- })]
282
- }), /* @__PURE__ */_jsx(AnimatePresence, {
238
+ }),
239
+ /* @__PURE__ */ _jsxs(Tabs.List, {
240
+ disablePassBorderRadius: !0,
241
+ loop: !1,
242
+ "aria-label": "Manage your account",
243
+ borderBottomLeftRadius: 0,
244
+ borderBottomRightRadius: 0,
245
+ paddingBottom: "$1.5",
246
+ borderColor: "$color3",
247
+ borderBottomWidth: "$0.5",
248
+ backgroundColor: "transparent",
249
+ children: [
250
+ /* @__PURE__ */ _jsx(Tabs.Tab, {
251
+ unstyled: !0,
252
+ paddingHorizontal: "$3",
253
+ paddingVertical: "$2",
254
+ value: "tab1",
255
+ onInteraction: handleOnInteraction,
256
+ children: /* @__PURE__ */ _jsx(SizableText, {
257
+ children: "Profile"
258
+ })
259
+ }),
260
+ /* @__PURE__ */ _jsx(Tabs.Tab, {
261
+ unstyled: !0,
262
+ paddingHorizontal: "$3",
263
+ paddingVertical: "$2",
264
+ value: "tab2",
265
+ onInteraction: handleOnInteraction,
266
+ children: /* @__PURE__ */ _jsx(SizableText, {
267
+ children: "Connections"
268
+ })
269
+ }),
270
+ /* @__PURE__ */ _jsx(Tabs.Tab, {
271
+ unstyled: !0,
272
+ paddingHorizontal: "$3",
273
+ paddingVertical: "$2",
274
+ value: "tab3",
275
+ onInteraction: handleOnInteraction,
276
+ children: /* @__PURE__ */ _jsx(SizableText, {
277
+ children: "Notifications"
278
+ })
279
+ })
280
+ ]
281
+ })
282
+ ]
283
+ }),
284
+ /* @__PURE__ */ _jsx(AnimatePresence, {
283
285
  exitBeforeEnter: !0,
284
286
  custom: {
285
287
  direction
286
288
  },
287
289
  initial: !1,
288
- children: /* @__PURE__ */_jsx(AnimatedYStack, {
289
- children: /* @__PURE__ */_jsx(Tabs.Content, {
290
+ children: /* @__PURE__ */ _jsx(AnimatedYStack, {
291
+ children: /* @__PURE__ */ _jsx(Tabs.Content, {
290
292
  value: currentTab,
291
293
  forceMount: !0,
292
294
  flex: 1,
293
295
  justifyContent: "center",
294
- children: /* @__PURE__ */_jsx(H5, {
296
+ children: /* @__PURE__ */ _jsx(H5, {
295
297
  textAlign: "center",
296
298
  children: currentTab
297
299
  })
298
300
  })
299
301
  }, currentTab)
300
- })]
301
- });
302
- },
303
- TabsRovingIndicator = function (param) {
304
- var {
305
- active,
306
- ...props
307
- } = param;
308
- return /* @__PURE__ */_jsx(YStack, {
309
- position: "absolute",
310
- backgroundColor: "$color5",
311
- opacity: 0.7,
312
- animation: "100ms",
313
- enterStyle: {
314
- opacity: 0
315
- },
316
- exitStyle: {
317
- opacity: 0
318
- },
319
- ...(active && {
320
- backgroundColor: "$color8",
321
- opacity: 0.6
322
- }),
323
- ...props
324
- });
325
- },
326
- AnimatedYStack = styled(YStack, {
327
- flex: 1,
328
- x: 0,
329
- opacity: 1,
302
+ })
303
+ ]
304
+ });
305
+ }, TabsRovingIndicator = function(param) {
306
+ var { active, ...props } = param;
307
+ return /* @__PURE__ */ _jsx(YStack, {
308
+ position: "absolute",
309
+ backgroundColor: "$color5",
310
+ opacity: 0.7,
330
311
  animation: "100ms",
331
- variants: {
332
- // 1 = right, 0 = nowhere, -1 = left
333
- direction: {
334
- ":number": function (direction) {
335
- return {
336
- enterStyle: {
337
- x: direction > 0 ? -25 : 25,
338
- opacity: 0
339
- },
340
- exitStyle: {
341
- zIndex: 0,
342
- x: direction < 0 ? -25 : 25,
343
- opacity: 0
344
- }
345
- };
346
- }
312
+ enterStyle: {
313
+ opacity: 0
314
+ },
315
+ exitStyle: {
316
+ opacity: 0
317
+ },
318
+ ...active && {
319
+ backgroundColor: "$color8",
320
+ opacity: 0.6
321
+ },
322
+ ...props
323
+ });
324
+ }, AnimatedYStack = styled(YStack, {
325
+ flex: 1,
326
+ x: 0,
327
+ opacity: 1,
328
+ animation: "100ms",
329
+ variants: {
330
+ // 1 = right, 0 = nowhere, -1 = left
331
+ direction: {
332
+ ":number": function(direction) {
333
+ return {
334
+ enterStyle: {
335
+ x: direction > 0 ? -25 : 25,
336
+ opacity: 0
337
+ },
338
+ exitStyle: {
339
+ zIndex: 0,
340
+ x: direction < 0 ? -25 : 25,
341
+ opacity: 0
342
+ }
343
+ };
347
344
  }
348
345
  }
349
- });
350
- export { TabsAdvancedDemo };
351
- //# sourceMappingURL=TabsAdvancedDemo.native.js.map
346
+ }
347
+ });
348
+ export {
349
+ TabsAdvancedDemo
350
+ };
351
+ //# sourceMappingURL=TabsAdvancedDemo.js.map