@tamagui/demos 1.15.24 → 1.15.26
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/CardDemo.js +1 -1
- package/dist/cjs/CardDemo.js.map +1 -1
- package/dist/cjs/ColorsDemo.js +1 -1
- package/dist/cjs/ColorsDemo.js.map +1 -1
- package/dist/cjs/InputsDemo.js +17 -6
- package/dist/cjs/InputsDemo.js.map +1 -1
- package/dist/cjs/LucideIconsDemo.js +27 -18
- package/dist/cjs/LucideIconsDemo.js.map +1 -1
- package/dist/cjs/ProgressDemo.js +32 -21
- package/dist/cjs/ProgressDemo.js.map +1 -1
- package/dist/cjs/ReplaceThemeDemo.js +65 -0
- package/dist/cjs/ReplaceThemeDemo.js.map +6 -0
- package/dist/cjs/StacksDemo.js +1 -1
- package/dist/cjs/StacksDemo.js.map +1 -1
- package/dist/cjs/TabsAdvancedDemo.js +12 -1
- package/dist/cjs/TabsAdvancedDemo.js.map +1 -1
- package/dist/cjs/UpdateThemeDemo.js +6 -2
- package/dist/cjs/UpdateThemeDemo.js.map +1 -1
- package/dist/cjs/index.js +3 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/CardDemo.js +1 -1
- package/dist/esm/CardDemo.js.map +1 -1
- package/dist/esm/CardDemo.mjs +1 -1
- package/dist/esm/CardDemo.mjs.map +1 -1
- package/dist/esm/ColorsDemo.js +1 -1
- package/dist/esm/ColorsDemo.js.map +1 -1
- package/dist/esm/ColorsDemo.mjs +1 -1
- package/dist/esm/ColorsDemo.mjs.map +1 -1
- package/dist/esm/InputsDemo.js +17 -6
- package/dist/esm/InputsDemo.js.map +1 -1
- package/dist/esm/InputsDemo.mjs +17 -6
- package/dist/esm/InputsDemo.mjs.map +1 -1
- package/dist/esm/LucideIconsDemo.js +27 -18
- package/dist/esm/LucideIconsDemo.js.map +1 -1
- package/dist/esm/LucideIconsDemo.mjs +27 -18
- package/dist/esm/LucideIconsDemo.mjs.map +1 -1
- package/dist/esm/ProgressDemo.js +32 -21
- package/dist/esm/ProgressDemo.js.map +1 -1
- package/dist/esm/ProgressDemo.mjs +32 -21
- package/dist/esm/ProgressDemo.mjs.map +1 -1
- package/dist/esm/ReplaceThemeDemo.js +49 -0
- package/dist/esm/ReplaceThemeDemo.js.map +6 -0
- package/dist/esm/ReplaceThemeDemo.mjs +49 -0
- package/dist/esm/ReplaceThemeDemo.mjs.map +6 -0
- package/dist/esm/StacksDemo.js +1 -1
- package/dist/esm/StacksDemo.js.map +1 -1
- package/dist/esm/StacksDemo.mjs +1 -1
- package/dist/esm/StacksDemo.mjs.map +1 -1
- package/dist/esm/TabsAdvancedDemo.js +12 -1
- package/dist/esm/TabsAdvancedDemo.js.map +1 -1
- package/dist/esm/TabsAdvancedDemo.mjs +12 -1
- package/dist/esm/TabsAdvancedDemo.mjs.map +1 -1
- package/dist/esm/UpdateThemeDemo.js +7 -2
- package/dist/esm/UpdateThemeDemo.js.map +1 -1
- package/dist/esm/UpdateThemeDemo.mjs +7 -2
- package/dist/esm/UpdateThemeDemo.mjs.map +1 -1
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.mjs +2 -0
- package/dist/esm/index.mjs.map +1 -1
- package/dist/jsx/CardDemo.js +1 -1
- package/dist/jsx/CardDemo.js.map +1 -1
- package/dist/jsx/CardDemo.mjs +1 -1
- package/dist/jsx/CardDemo.mjs.map +1 -1
- package/dist/jsx/ColorsDemo.js +1 -1
- package/dist/jsx/ColorsDemo.js.map +1 -1
- package/dist/jsx/ColorsDemo.mjs +1 -1
- package/dist/jsx/ColorsDemo.mjs.map +1 -1
- package/dist/jsx/InputsDemo.js +8 -1
- package/dist/jsx/InputsDemo.js.map +1 -1
- package/dist/jsx/InputsDemo.mjs +8 -1
- package/dist/jsx/InputsDemo.mjs.map +1 -1
- package/dist/jsx/LucideIconsDemo.js +13 -8
- package/dist/jsx/LucideIconsDemo.js.map +1 -1
- package/dist/jsx/LucideIconsDemo.mjs +13 -8
- package/dist/jsx/LucideIconsDemo.mjs.map +1 -1
- package/dist/jsx/ProgressDemo.js +8 -1
- package/dist/jsx/ProgressDemo.js.map +1 -1
- package/dist/jsx/ProgressDemo.mjs +8 -1
- package/dist/jsx/ProgressDemo.mjs.map +1 -1
- package/dist/jsx/ReplaceThemeDemo.js +44 -0
- package/dist/jsx/ReplaceThemeDemo.js.map +6 -0
- package/dist/jsx/ReplaceThemeDemo.mjs +44 -0
- package/dist/jsx/ReplaceThemeDemo.mjs.map +6 -0
- package/dist/jsx/StacksDemo.js +1 -1
- package/dist/jsx/StacksDemo.js.map +1 -1
- package/dist/jsx/StacksDemo.mjs +1 -1
- package/dist/jsx/StacksDemo.mjs.map +1 -1
- package/dist/jsx/TabsAdvancedDemo.js +8 -1
- package/dist/jsx/TabsAdvancedDemo.js.map +1 -1
- package/dist/jsx/TabsAdvancedDemo.mjs +8 -1
- package/dist/jsx/TabsAdvancedDemo.mjs.map +1 -1
- package/dist/jsx/UpdateThemeDemo.js +7 -2
- package/dist/jsx/UpdateThemeDemo.js.map +1 -1
- package/dist/jsx/UpdateThemeDemo.mjs +7 -2
- package/dist/jsx/UpdateThemeDemo.mjs.map +1 -1
- package/dist/jsx/index.js +2 -0
- package/dist/jsx/index.js.map +1 -1
- package/dist/jsx/index.mjs +2 -0
- package/dist/jsx/index.mjs.map +1 -1
- package/package.json +18 -18
- package/src/CardDemo.tsx +1 -1
- package/src/ColorsDemo.tsx +2 -2
- package/src/InputsDemo.tsx +9 -2
- package/src/LucideIconsDemo.tsx +13 -8
- package/src/ProgressDemo.tsx +8 -1
- package/src/ReplaceThemeDemo.tsx +52 -0
- package/src/StacksDemo.tsx +1 -1
- package/src/TabsAdvancedDemo.tsx +8 -1
- package/src/UpdateThemeDemo.tsx +8 -3
- package/src/index.tsx +1 -0
- package/types/InputsDemo.d.ts.map +1 -1
- package/types/LucideIconsDemo.d.ts.map +1 -1
- package/types/ProgressDemo.d.ts.map +1 -1
- package/types/ReplaceThemeDemo.d.ts +3 -0
- package/types/ReplaceThemeDemo.d.ts.map +1 -0
- package/types/TabsAdvancedDemo.d.ts.map +1 -1
- package/types/UpdateThemeDemo.d.ts.map +1 -1
- package/types/index.d.ts +1 -0
- package/types/index.d.ts.map +1 -1
- package/dist/cjs/AccordionDemo.js +0 -42
- package/dist/cjs/AccordionDemo.js.map +0 -7
- package/dist/cjs/DrawerDemo.js +0 -79
- package/dist/cjs/DrawerDemo.js.map +0 -7
- package/dist/cjs/FeatherIconsDemo.js +0 -67
- package/dist/cjs/FeatherIconsDemo.js.map +0 -7
- package/dist/cjs/MenuDemo.js +0 -62
- package/dist/cjs/MenuDemo.js.map +0 -7
- package/dist/cjs/PopperDemo.js +0 -111
- package/dist/cjs/PopperDemo.js.map +0 -7
- package/dist/cjs/TabsAnimatedDemo.js +0 -167
- package/dist/cjs/TabsAnimatedDemo.js.map +0 -7
- package/dist/cjs/TabsHighlightedDemo.js +0 -184
- package/dist/cjs/TabsHighlightedDemo.js.map +0 -7
- package/dist/cjs/TabsUnderlinedDemo.js +0 -176
- package/dist/cjs/TabsUnderlinedDemo.js.map +0 -7
- package/dist/cjs/TamaguiLogo.js +0 -127
- package/dist/cjs/TamaguiLogo.js.map +0 -7
- package/dist/cjs/fixtures/zstack.js +0 -2
- package/dist/cjs/fixtures/zstack.js.map +0 -7
- package/dist/cjs/snapshots/zstack.js +0 -48
- package/dist/cjs/snapshots/zstack.js.map +0 -7
- package/dist/cjs/tests/zstack.js +0 -48
- package/dist/cjs/tests/zstack.js.map +0 -7
- package/dist/esm/AccordionDemo.js +0 -18
- package/dist/esm/AccordionDemo.js.map +0 -7
- package/dist/esm/AccordionDemo.mjs +0 -18
- package/dist/esm/AccordionDemo.mjs.map +0 -7
- package/dist/esm/DrawerDemo.js +0 -55
- package/dist/esm/DrawerDemo.js.map +0 -7
- package/dist/esm/FeatherIconsDemo.js +0 -33
- package/dist/esm/FeatherIconsDemo.js.map +0 -7
- package/dist/esm/FeatherIconsDemo.mjs +0 -33
- package/dist/esm/FeatherIconsDemo.mjs.map +0 -7
- package/dist/esm/MenuDemo.js +0 -38
- package/dist/esm/MenuDemo.js.map +0 -7
- package/dist/esm/PopperDemo.js +0 -97
- package/dist/esm/PopperDemo.js.map +0 -7
- package/dist/esm/TabsAnimatedDemo.js +0 -143
- package/dist/esm/TabsAnimatedDemo.js.map +0 -7
- package/dist/esm/TabsAnimatedDemo.mjs +0 -143
- package/dist/esm/TabsAnimatedDemo.mjs.map +0 -7
- package/dist/esm/TabsHighlightedDemo.js +0 -168
- package/dist/esm/TabsHighlightedDemo.js.map +0 -7
- package/dist/esm/TabsHighlightedDemo.mjs +0 -168
- package/dist/esm/TabsHighlightedDemo.mjs.map +0 -7
- package/dist/esm/TabsUnderlinedDemo.js +0 -160
- package/dist/esm/TabsUnderlinedDemo.js.map +0 -7
- package/dist/esm/TabsUnderlinedDemo.mjs +0 -160
- package/dist/esm/TabsUnderlinedDemo.mjs.map +0 -7
- package/dist/esm/TamaguiLogo.js +0 -96
- package/dist/esm/TamaguiLogo.js.map +0 -7
- package/dist/esm/fixtures/zstack.js +0 -1
- package/dist/esm/fixtures/zstack.js.map +0 -7
- package/dist/esm/snapshots/zstack.js +0 -24
- package/dist/esm/snapshots/zstack.js.map +0 -7
- package/dist/esm/tests/zstack.js +0 -24
- package/dist/esm/tests/zstack.js.map +0 -7
- package/dist/jsx/AccordionDemo.js +0 -17
- package/dist/jsx/AccordionDemo.js.map +0 -7
- package/dist/jsx/AccordionDemo.mjs +0 -17
- package/dist/jsx/AccordionDemo.mjs.map +0 -7
- package/dist/jsx/DrawerDemo.js +0 -18
- package/dist/jsx/DrawerDemo.js.map +0 -7
- package/dist/jsx/FeatherIconsDemo.js +0 -32
- package/dist/jsx/FeatherIconsDemo.js.map +0 -7
- package/dist/jsx/FeatherIconsDemo.mjs +0 -32
- package/dist/jsx/FeatherIconsDemo.mjs.map +0 -7
- package/dist/jsx/MenuDemo.js +0 -15
- package/dist/jsx/MenuDemo.js.map +0 -7
- package/dist/jsx/PopperDemo.js +0 -41
- package/dist/jsx/PopperDemo.js.map +0 -7
- package/dist/jsx/TabsAnimatedDemo.js +0 -114
- package/dist/jsx/TabsAnimatedDemo.js.map +0 -7
- package/dist/jsx/TabsAnimatedDemo.mjs +0 -114
- package/dist/jsx/TabsAnimatedDemo.mjs.map +0 -7
- package/dist/jsx/TabsHighlightedDemo.js +0 -137
- package/dist/jsx/TabsHighlightedDemo.js.map +0 -7
- package/dist/jsx/TabsHighlightedDemo.mjs +0 -137
- package/dist/jsx/TabsHighlightedDemo.mjs.map +0 -7
- package/dist/jsx/TabsUnderlinedDemo.js +0 -133
- package/dist/jsx/TabsUnderlinedDemo.js.map +0 -7
- package/dist/jsx/TabsUnderlinedDemo.mjs +0 -133
- package/dist/jsx/TabsUnderlinedDemo.mjs.map +0 -7
- package/dist/jsx/TamaguiLogo.js +0 -42
- package/dist/jsx/TamaguiLogo.js.map +0 -7
- package/dist/jsx/fixtures/zstack.js +0 -1
- package/dist/jsx/fixtures/zstack.js.map +0 -7
- package/dist/jsx/snapshots/zstack.js +0 -11
- package/dist/jsx/snapshots/zstack.js.map +0 -7
- package/dist/jsx/tests/zstack.js +0 -11
- package/dist/jsx/tests/zstack.js.map +0 -7
- package/types/AccordionDemo.d.ts.map +0 -1
- package/types/DrawerDemo.d.ts.map +0 -1
- package/types/FeatherIconsDemo.d.ts.map +0 -1
- package/types/MenuDemo.d.ts.map +0 -1
- package/types/PopperDemo.d.ts.map +0 -1
- package/types/TabsHighlightedDemo.d.ts.map +0 -1
- package/types/TabsUnderlinedDemo.d.ts.map +0 -1
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
import { useMemo, useRef, useState } from "react";
|
|
2
|
-
import {
|
|
3
|
-
AnimatePresence,
|
|
4
|
-
H5,
|
|
5
|
-
Stack,
|
|
6
|
-
Tabs,
|
|
7
|
-
XStack,
|
|
8
|
-
YStack,
|
|
9
|
-
styled
|
|
10
|
-
} from "tamagui";
|
|
11
|
-
function TabsHighlightedDemo() {
|
|
12
|
-
return <XStack maxHeight="100%" maxWidth="100%" justifyContent="flex-start" px="$4"><HighlightTabs /></XStack>;
|
|
13
|
-
}
|
|
14
|
-
const TabsRovingIndicator = styled(Stack, {
|
|
15
|
-
name: "TabsRovingIndicator",
|
|
16
|
-
variants: {
|
|
17
|
-
active: {
|
|
18
|
-
true: {
|
|
19
|
-
backgroundColor: "$color8"
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
variants: {
|
|
23
|
-
active: {
|
|
24
|
-
true: {
|
|
25
|
-
backgroundColor: "$color8"
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
enter: {
|
|
29
|
-
true: {
|
|
30
|
-
opacity: 0
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
exit: {
|
|
34
|
-
true: {
|
|
35
|
-
opacity: 0
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
defaultVariants: {
|
|
41
|
-
position: "absolute",
|
|
42
|
-
backgroundColor: "$color5",
|
|
43
|
-
opacity: 1,
|
|
44
|
-
animation: "100ms",
|
|
45
|
-
borderRadius: "$4"
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
const AnimatedYStack = styled(YStack, {
|
|
49
|
-
variants: {
|
|
50
|
-
isLeft: { true: { x: -25, opacity: 0 } },
|
|
51
|
-
isRight: { true: { x: 25, opacity: 0 } }
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
const HighlightTabs = () => {
|
|
55
|
-
const [currentTab, setCurrentTab] = useState("tab1");
|
|
56
|
-
const [focusIndicatorLayout, setFocusIndicatorLayout] = useState(null);
|
|
57
|
-
const [hoverIndicatorLayout, setHoverIndicatorLayout] = useState(null);
|
|
58
|
-
const [selectionIndicatorLayout, setSelectionIndicatorLayout] = useState(null);
|
|
59
|
-
const prevSelectionIndicatorLayout = useRef(null);
|
|
60
|
-
const handleUpdateSelectionIndicator = (newSize) => {
|
|
61
|
-
prevSelectionIndicatorLayout.current = selectionIndicatorLayout;
|
|
62
|
-
setSelectionIndicatorLayout(newSize);
|
|
63
|
-
};
|
|
64
|
-
const intentIndicatorLayout = hoverIndicatorLayout || focusIndicatorLayout;
|
|
65
|
-
const direction = useMemo(() => {
|
|
66
|
-
if (!selectionIndicatorLayout || !prevSelectionIndicatorLayout.current || selectionIndicatorLayout.x === prevSelectionIndicatorLayout.current.x) {
|
|
67
|
-
return 0;
|
|
68
|
-
}
|
|
69
|
-
return selectionIndicatorLayout.x > prevSelectionIndicatorLayout.current.x ? 1 : -1;
|
|
70
|
-
}, [selectionIndicatorLayout]);
|
|
71
|
-
const enterVariant = direction === 1 ? "isLeft" : direction === -1 ? "isRight" : void 0;
|
|
72
|
-
const exitVariant = direction === 1 ? "isRight" : direction === -1 ? "isLeft" : void 0;
|
|
73
|
-
return <Tabs
|
|
74
|
-
value={currentTab}
|
|
75
|
-
onValueChange={setCurrentTab}
|
|
76
|
-
orientation="horizontal"
|
|
77
|
-
br="$4"
|
|
78
|
-
height={150}
|
|
79
|
-
flexDirection="column"
|
|
80
|
-
activationMode="manual"
|
|
81
|
-
>
|
|
82
|
-
<Tabs.List
|
|
83
|
-
scrollable
|
|
84
|
-
loop={false}
|
|
85
|
-
aria-label="Manage your account"
|
|
86
|
-
disablePassBorderRadius
|
|
87
|
-
>
|
|
88
|
-
{intentIndicatorLayout && <TabsRovingIndicator
|
|
89
|
-
width={intentIndicatorLayout.width}
|
|
90
|
-
height={intentIndicatorLayout.height}
|
|
91
|
-
x={intentIndicatorLayout.x}
|
|
92
|
-
y={intentIndicatorLayout.y}
|
|
93
|
-
/>}
|
|
94
|
-
{selectionIndicatorLayout && <TabsRovingIndicator
|
|
95
|
-
theme="active"
|
|
96
|
-
active
|
|
97
|
-
width={selectionIndicatorLayout.width}
|
|
98
|
-
height={selectionIndicatorLayout.height}
|
|
99
|
-
x={selectionIndicatorLayout.x}
|
|
100
|
-
y={selectionIndicatorLayout.y}
|
|
101
|
-
/>}
|
|
102
|
-
<Tabs.Trigger
|
|
103
|
-
unstyled
|
|
104
|
-
color="$color12"
|
|
105
|
-
value="tab1"
|
|
106
|
-
onSelectedLayoutChange={handleUpdateSelectionIndicator}
|
|
107
|
-
onHoveredLayoutChange={setHoverIndicatorLayout}
|
|
108
|
-
onFocusedLayoutChange={setFocusIndicatorLayout}
|
|
109
|
-
>Profile</Tabs.Trigger>
|
|
110
|
-
<Tabs.Trigger
|
|
111
|
-
unstyled
|
|
112
|
-
color="$color12"
|
|
113
|
-
value="tab2"
|
|
114
|
-
onSelectedLayoutChange={handleUpdateSelectionIndicator}
|
|
115
|
-
onHoveredLayoutChange={setHoverIndicatorLayout}
|
|
116
|
-
onFocusedLayoutChange={setFocusIndicatorLayout}
|
|
117
|
-
>Connections</Tabs.Trigger>
|
|
118
|
-
<Tabs.Trigger
|
|
119
|
-
unstyled
|
|
120
|
-
color="$color12"
|
|
121
|
-
value="tab3"
|
|
122
|
-
onSelectedLayoutChange={handleUpdateSelectionIndicator}
|
|
123
|
-
onHoveredLayoutChange={setHoverIndicatorLayout}
|
|
124
|
-
onFocusedLayoutChange={setFocusIndicatorLayout}
|
|
125
|
-
>Notifications</Tabs.Trigger>
|
|
126
|
-
</Tabs.List>
|
|
127
|
-
<AnimatePresence
|
|
128
|
-
exitBeforeEnter
|
|
129
|
-
enterVariant={enterVariant}
|
|
130
|
-
exitVariant={exitVariant}
|
|
131
|
-
><AnimatedYStack key={currentTab} animation="100ms" x={0} o={1}><Tabs.Content value={currentTab} forceMount p="$2"><H5 ta="center">{currentTab}</H5></Tabs.Content></AnimatedYStack></AnimatePresence>
|
|
132
|
-
</Tabs>;
|
|
133
|
-
};
|
|
134
|
-
export {
|
|
135
|
-
TabsHighlightedDemo
|
|
136
|
-
};
|
|
137
|
-
//# sourceMappingURL=TabsHighlightedDemo.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/TabsHighlightedDemo.tsx"],
|
|
4
|
-
"sourcesContent": ["import { useMemo, useRef, useState } from 'react'\nimport {\n AnimatePresence,\n H5,\n Stack,\n TabTriggerLayout,\n Tabs,\n XStack,\n YStack,\n styled,\n} from 'tamagui'\n\nexport function TabsHighlightedDemo() {\n return (\n <XStack maxHeight=\"100%\" maxWidth=\"100%\" justifyContent=\"flex-start\" px=\"$4\">\n <HighlightTabs />\n </XStack>\n )\n}\n\nconst TabsRovingIndicator = styled(Stack, {\n name: 'TabsRovingIndicator',\n variants: {\n active: {\n true: {\n backgroundColor: '$color8',\n },\n },\n variants: {\n active: {\n true: {\n backgroundColor: '$color8',\n },\n },\n enter: {\n true: {\n opacity: 0,\n },\n },\n exit: {\n true: {\n opacity: 0,\n },\n },\n },\n },\n defaultVariants: {\n position: 'absolute',\n backgroundColor: '$color5',\n opacity: 1,\n animation: '100ms',\n borderRadius: '$4',\n },\n})\n\nconst AnimatedYStack = styled(YStack, {\n variants: {\n isLeft: { true: { x: -25, opacity: 0 } },\n isRight: { true: { x: 25, opacity: 0 } },\n } as const,\n})\n\nconst HighlightTabs = () => {\n const [currentTab, setCurrentTab] = useState('tab1')\n const [focusIndicatorLayout, setFocusIndicatorLayout] =\n useState<TabTriggerLayout | null>(null)\n const [hoverIndicatorLayout, setHoverIndicatorLayout] =\n useState<TabTriggerLayout | null>(null)\n const [selectionIndicatorLayout, setSelectionIndicatorLayout] =\n useState<TabTriggerLayout | null>(null)\n const prevSelectionIndicatorLayout = useRef<TabTriggerLayout | null>(null)\n const handleUpdateSelectionIndicator = (newSize: TabTriggerLayout | null) => {\n prevSelectionIndicatorLayout.current = selectionIndicatorLayout\n setSelectionIndicatorLayout(newSize)\n }\n\n const intentIndicatorLayout = hoverIndicatorLayout || focusIndicatorLayout\n\n /**\n * -1: from left\n * 0: n/a\n * 1: from right\n */\n const direction = useMemo(() => {\n if (\n !selectionIndicatorLayout ||\n !prevSelectionIndicatorLayout.current ||\n selectionIndicatorLayout.x === prevSelectionIndicatorLayout.current.x\n ) {\n return 0\n }\n return selectionIndicatorLayout.x > prevSelectionIndicatorLayout.current.x ? 1 : -1\n }, [selectionIndicatorLayout])\n\n const enterVariant =\n direction === 1 ? 'isLeft' : direction === -1 ? 'isRight' : undefined\n const exitVariant =\n direction === 1 ? 'isRight' : direction === -1 ? 'isLeft' : undefined\n\n return (\n <Tabs\n value={currentTab}\n onValueChange={setCurrentTab}\n orientation=\"horizontal\"\n br=\"$4\"\n height={150}\n flexDirection=\"column\"\n activationMode=\"manual\"\n >\n <Tabs.List\n scrollable\n loop={false}\n aria-label=\"Manage your account\"\n disablePassBorderRadius\n >\n {intentIndicatorLayout && (\n <TabsRovingIndicator\n width={intentIndicatorLayout.width}\n height={intentIndicatorLayout.height}\n x={intentIndicatorLayout.x}\n y={intentIndicatorLayout.y}\n />\n )}\n {selectionIndicatorLayout && (\n <TabsRovingIndicator\n theme=\"active\"\n active\n width={selectionIndicatorLayout.width}\n height={selectionIndicatorLayout.height}\n x={selectionIndicatorLayout.x}\n y={selectionIndicatorLayout.y}\n />\n )}\n <Tabs.Trigger\n unstyled\n color=\"$color12\"\n value=\"tab1\"\n onSelectedLayoutChange={handleUpdateSelectionIndicator}\n onHoveredLayoutChange={setHoverIndicatorLayout}\n onFocusedLayoutChange={setFocusIndicatorLayout}\n >\n Profile\n </Tabs.Trigger>\n <Tabs.Trigger\n unstyled\n color=\"$color12\"\n value=\"tab2\"\n onSelectedLayoutChange={handleUpdateSelectionIndicator}\n onHoveredLayoutChange={setHoverIndicatorLayout}\n onFocusedLayoutChange={setFocusIndicatorLayout}\n >\n Connections\n </Tabs.Trigger>\n <Tabs.Trigger\n unstyled\n color=\"$color12\"\n value=\"tab3\"\n onSelectedLayoutChange={handleUpdateSelectionIndicator}\n onHoveredLayoutChange={setHoverIndicatorLayout}\n onFocusedLayoutChange={setFocusIndicatorLayout}\n >\n Notifications\n </Tabs.Trigger>\n </Tabs.List>\n\n <AnimatePresence\n exitBeforeEnter\n enterVariant={enterVariant}\n exitVariant={exitVariant}\n >\n <AnimatedYStack key={currentTab} animation=\"100ms\" x={0} o={1}>\n <Tabs.Content value={currentTab} forceMount p=\"$2\">\n <H5 ta=\"center\">{currentTab}</H5>\n </Tabs.Content>\n </AnimatedYStack>\n </AnimatePresence>\n </Tabs>\n )\n}\n"],
|
|
5
|
-
"mappings": "AAAA,SAAS,SAAS,QAAQ,gBAAgB;AAC1C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEA,SAAS,sBAAsB;AACpC,SACE,CAAC,OAAO,UAAU,OAAO,SAAS,OAAO,eAAe,aAAa,GAAG,KACtE,CAAC,cAAc,EACjB,EAFC;AAIL;AAEA,MAAM,sBAAsB,OAAO,OAAO;AAAA,EACxC,MAAM;AAAA,EACN,UAAU;AAAA,IACR,QAAQ;AAAA,MACN,MAAM;AAAA,QACJ,iBAAiB;AAAA,MACnB;AAAA,IACF;AAAA,IACA,UAAU;AAAA,MACR,QAAQ;AAAA,QACN,MAAM;AAAA,UACJ,iBAAiB;AAAA,QACnB;AAAA,MACF;AAAA,MACA,OAAO;AAAA,QACL,MAAM;AAAA,UACJ,SAAS;AAAA,QACX;AAAA,MACF;AAAA,MACA,MAAM;AAAA,QACJ,MAAM;AAAA,UACJ,SAAS;AAAA,QACX;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAAA,EACA,iBAAiB;AAAA,IACf,UAAU;AAAA,IACV,iBAAiB;AAAA,IACjB,SAAS;AAAA,IACT,WAAW;AAAA,IACX,cAAc;AAAA,EAChB;AACF,CAAC;AAED,MAAM,iBAAiB,OAAO,QAAQ;AAAA,EACpC,UAAU;AAAA,IACR,QAAQ,EAAE,MAAM,EAAE,GAAG,KAAK,SAAS,EAAE,EAAE;AAAA,IACvC,SAAS,EAAE,MAAM,EAAE,GAAG,IAAI,SAAS,EAAE,EA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;AAAA,QACjC,GAAG,yBAAyB;AAAA,QAC5B,GAAG,yBAAyB;AAAA,MAC9B;AAAA,MAEF,CAAC,KAAK;AAAA,QACJ;AAAA,QACA,MAAM;AAAA,QACN,MAAM;AAAA,QACN,wBAAwB;AAAA,QACxB,uBAAuB;AAAA,QACvB,uBAAuB;AAAA,OACxB,OAED,EATC,KAAK;AAAA,MAUN,CAAC,KAAK;AAAA,QACJ;AAAA,QACA,MAAM;AAAA,QACN,MAAM;AAAA,QACN,wBAAwB;AAAA,QACxB,uBAAuB;AAAA,QACvB,uBAAuB;AAAA,OACxB,WAED,EATC,KAAK;AAAA,MAUN,CAAC,KAAK;AAAA,QACJ;AAAA,QACA,MAAM;AAAA,QACN,MAAM;AAAA,QACN,wBAAwB;AAAA,QACxB,uBAAuB;AAAA,QACvB,uBAAuB;AAAA,OACxB,aAED,EATC,KAAK;AAAA,IAUR,EAtDC,KAAK;AAAA,IAwDN,CAAC;AAAA,MACC;AAAA,MACA,cAAc;AAAA,MACd,aAAa;AAAA,KAEb,CAAC,eAAe,KAAK,YAAY,UAAU,QAAQ,GAAG,GAAG,GAAG,GAC1D,CAAC,KAAK,QAAQ,OAAO,YAAY,WAAW,EAAE,KAC5C,CAAC,GAAG,GAAG,UAAU,WAAW,EAA3B,GACH,EAFC,KAAK,QAGR,EAJC,eAKH,EAVC;AAAA,EAWH,EA5EC;AA8EL;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
import { useMemo, useRef, useState } from "react";
|
|
2
|
-
import {
|
|
3
|
-
AnimatePresence,
|
|
4
|
-
H5,
|
|
5
|
-
Stack,
|
|
6
|
-
Tabs,
|
|
7
|
-
XStack,
|
|
8
|
-
YStack,
|
|
9
|
-
styled
|
|
10
|
-
} from "tamagui";
|
|
11
|
-
function TabsUnderlinedDemo() {
|
|
12
|
-
return <XStack maxHeight="100%" maxWidth="100%" justifyContent="flex-start" px="$4"><UnderlineTabs /></XStack>;
|
|
13
|
-
}
|
|
14
|
-
const TabsRovingIndicator = styled(Stack, {
|
|
15
|
-
name: "TabsRovingIndicator",
|
|
16
|
-
variants: {
|
|
17
|
-
active: {
|
|
18
|
-
true: {
|
|
19
|
-
backgroundColor: "$color8"
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
variants: {
|
|
23
|
-
active: {
|
|
24
|
-
true: {
|
|
25
|
-
backgroundColor: "$color8"
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
enter: {
|
|
29
|
-
true: {
|
|
30
|
-
opacity: 0
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
exit: {
|
|
34
|
-
true: {
|
|
35
|
-
opacity: 0
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
defaultVariants: {
|
|
41
|
-
position: "absolute",
|
|
42
|
-
backgroundColor: "$color5",
|
|
43
|
-
opacity: 1,
|
|
44
|
-
animation: "100ms"
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
const AnimatedYStack = styled(YStack, {
|
|
48
|
-
variants: {
|
|
49
|
-
isTop: { true: { y: -25, opacity: 0 } },
|
|
50
|
-
isBottom: { true: { y: 25, opacity: 0 } }
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
const UnderlineTabs = () => {
|
|
54
|
-
const [currentTab, setCurrentTab] = useState("tab1");
|
|
55
|
-
const [focusIndicatorLayout, setFocusIndicatorLayout] = useState(null);
|
|
56
|
-
const [hoverIndicatorLayout, setHoverIndicatorLayout] = useState(null);
|
|
57
|
-
const [selectionIndicatorLayout, setSelectionIndicatorLayout] = useState(null);
|
|
58
|
-
const prevSelectionIndicatorLayout = useRef(null);
|
|
59
|
-
const handleUpdateSelectionIndicator = (newSize) => {
|
|
60
|
-
prevSelectionIndicatorLayout.current = selectionIndicatorLayout;
|
|
61
|
-
setSelectionIndicatorLayout(newSize);
|
|
62
|
-
};
|
|
63
|
-
const intentIndicatorLayout = hoverIndicatorLayout || focusIndicatorLayout;
|
|
64
|
-
const direction = useMemo(() => {
|
|
65
|
-
if (!selectionIndicatorLayout || !prevSelectionIndicatorLayout.current || selectionIndicatorLayout.y === prevSelectionIndicatorLayout.current.y) {
|
|
66
|
-
return 0;
|
|
67
|
-
}
|
|
68
|
-
return selectionIndicatorLayout.y > prevSelectionIndicatorLayout.current.y ? 1 : -1;
|
|
69
|
-
}, [selectionIndicatorLayout]);
|
|
70
|
-
const enterVariant = direction === 1 ? "isTop" : direction === -1 ? "isBottom" : void 0;
|
|
71
|
-
const exitVariant = direction === 1 ? "isBottom" : direction === -1 ? "isTop" : void 0;
|
|
72
|
-
return <Tabs
|
|
73
|
-
value={currentTab}
|
|
74
|
-
onValueChange={setCurrentTab}
|
|
75
|
-
orientation="vertical"
|
|
76
|
-
width={300}
|
|
77
|
-
br="$4"
|
|
78
|
-
ai="center"
|
|
79
|
-
activationMode="manual"
|
|
80
|
-
>
|
|
81
|
-
<YStack borderColor="$color3" borderRightWidth="$0.5" mr="$2"><Tabs.List loop={false} aria-label="Manage your account" disablePassBorderRadius>
|
|
82
|
-
{intentIndicatorLayout && <TabsRovingIndicator
|
|
83
|
-
width="$0.5"
|
|
84
|
-
height={intentIndicatorLayout.height}
|
|
85
|
-
x={intentIndicatorLayout.x}
|
|
86
|
-
y={intentIndicatorLayout.y}
|
|
87
|
-
right={0}
|
|
88
|
-
/>}
|
|
89
|
-
{selectionIndicatorLayout && <TabsRovingIndicator
|
|
90
|
-
theme="active"
|
|
91
|
-
active
|
|
92
|
-
width="$0.5"
|
|
93
|
-
height={selectionIndicatorLayout.height}
|
|
94
|
-
x={selectionIndicatorLayout.x}
|
|
95
|
-
y={selectionIndicatorLayout.y}
|
|
96
|
-
right={0}
|
|
97
|
-
/>}
|
|
98
|
-
<Tabs.Trigger
|
|
99
|
-
unstyled
|
|
100
|
-
color="$color12"
|
|
101
|
-
value="tab1"
|
|
102
|
-
onSelectedLayoutChange={handleUpdateSelectionIndicator}
|
|
103
|
-
onHoveredLayoutChange={setHoverIndicatorLayout}
|
|
104
|
-
onFocusedLayoutChange={setFocusIndicatorLayout}
|
|
105
|
-
>Profile</Tabs.Trigger>
|
|
106
|
-
<Tabs.Trigger
|
|
107
|
-
unstyled
|
|
108
|
-
color="$color12"
|
|
109
|
-
value="tab2"
|
|
110
|
-
onSelectedLayoutChange={handleUpdateSelectionIndicator}
|
|
111
|
-
onHoveredLayoutChange={setHoverIndicatorLayout}
|
|
112
|
-
onFocusedLayoutChange={setFocusIndicatorLayout}
|
|
113
|
-
>Connections</Tabs.Trigger>
|
|
114
|
-
<Tabs.Trigger
|
|
115
|
-
unstyled
|
|
116
|
-
color="$color12"
|
|
117
|
-
value="tab3"
|
|
118
|
-
onSelectedLayoutChange={handleUpdateSelectionIndicator}
|
|
119
|
-
onHoveredLayoutChange={setHoverIndicatorLayout}
|
|
120
|
-
onFocusedLayoutChange={setFocusIndicatorLayout}
|
|
121
|
-
>Notifications</Tabs.Trigger>
|
|
122
|
-
</Tabs.List></YStack>
|
|
123
|
-
<AnimatePresence
|
|
124
|
-
exitBeforeEnter
|
|
125
|
-
enterVariant={enterVariant}
|
|
126
|
-
exitVariant={exitVariant}
|
|
127
|
-
><AnimatedYStack key={currentTab} animation="100ms" y={0} o={1}><Tabs.Content value={currentTab} forceMount p="$2"><H5 ta="center">{currentTab}</H5></Tabs.Content></AnimatedYStack></AnimatePresence>
|
|
128
|
-
</Tabs>;
|
|
129
|
-
};
|
|
130
|
-
export {
|
|
131
|
-
TabsUnderlinedDemo
|
|
132
|
-
};
|
|
133
|
-
//# sourceMappingURL=TabsUnderlinedDemo.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/TabsUnderlinedDemo.tsx"],
|
|
4
|
-
"sourcesContent": ["import { useMemo, useRef, useState } from 'react'\nimport {\n AnimatePresence,\n H5,\n Stack,\n TabTriggerLayout,\n Tabs,\n XStack,\n YStack,\n styled,\n} from 'tamagui'\n\nexport function TabsUnderlinedDemo() {\n return (\n <XStack maxHeight=\"100%\" maxWidth=\"100%\" justifyContent=\"flex-start\" px=\"$4\">\n <UnderlineTabs />\n </XStack>\n )\n}\n\nconst TabsRovingIndicator = styled(Stack, {\n name: 'TabsRovingIndicator',\n variants: {\n active: {\n true: {\n backgroundColor: '$color8',\n },\n },\n variants: {\n active: {\n true: {\n backgroundColor: '$color8',\n },\n },\n enter: {\n true: {\n opacity: 0,\n },\n },\n exit: {\n true: {\n opacity: 0,\n },\n },\n },\n },\n defaultVariants: {\n position: 'absolute',\n backgroundColor: '$color5',\n opacity: 1,\n animation: '100ms',\n },\n})\n\nconst AnimatedYStack = styled(YStack, {\n variants: {\n isTop: { true: { y: -25, opacity: 0 } },\n isBottom: { true: { y: 25, opacity: 0 } },\n } as const,\n})\n\nconst UnderlineTabs = () => {\n const [currentTab, setCurrentTab] = useState('tab1')\n const [focusIndicatorLayout, setFocusIndicatorLayout] =\n useState<TabTriggerLayout | null>(null)\n const [hoverIndicatorLayout, setHoverIndicatorLayout] =\n useState<TabTriggerLayout | null>(null)\n const [selectionIndicatorLayout, setSelectionIndicatorLayout] =\n useState<TabTriggerLayout | null>(null)\n const prevSelectionIndicatorLayout = useRef<TabTriggerLayout | null>(null)\n const handleUpdateSelectionIndicator = (newSize: TabTriggerLayout | null) => {\n prevSelectionIndicatorLayout.current = selectionIndicatorLayout\n setSelectionIndicatorLayout(newSize)\n }\n\n const intentIndicatorLayout = hoverIndicatorLayout || focusIndicatorLayout\n\n /**\n * -1: from top\n * 0: n/a\n * 1: from bottom\n */\n const direction = useMemo(() => {\n if (\n !selectionIndicatorLayout ||\n !prevSelectionIndicatorLayout.current ||\n selectionIndicatorLayout.y === prevSelectionIndicatorLayout.current.y\n ) {\n return 0\n }\n return selectionIndicatorLayout.y > prevSelectionIndicatorLayout.current.y ? 1 : -1\n }, [selectionIndicatorLayout])\n\n const enterVariant =\n direction === 1 ? 'isTop' : direction === -1 ? 'isBottom' : undefined\n const exitVariant =\n direction === 1 ? 'isBottom' : direction === -1 ? 'isTop' : undefined\n\n return (\n <Tabs\n value={currentTab}\n onValueChange={setCurrentTab}\n orientation=\"vertical\"\n width={300}\n br=\"$4\"\n ai=\"center\"\n activationMode=\"manual\"\n >\n <YStack borderColor=\"$color3\" borderRightWidth=\"$0.5\" mr=\"$2\">\n <Tabs.List loop={false} aria-label=\"Manage your account\" disablePassBorderRadius>\n {intentIndicatorLayout && (\n <TabsRovingIndicator\n width=\"$0.5\"\n height={intentIndicatorLayout.height}\n x={intentIndicatorLayout.x}\n y={intentIndicatorLayout.y}\n right={0}\n />\n )}\n {selectionIndicatorLayout && (\n <TabsRovingIndicator\n theme=\"active\"\n active\n width=\"$0.5\"\n height={selectionIndicatorLayout.height}\n x={selectionIndicatorLayout.x}\n y={selectionIndicatorLayout.y}\n right={0}\n />\n )}\n <Tabs.Trigger\n unstyled\n color=\"$color12\"\n value=\"tab1\"\n onSelectedLayoutChange={handleUpdateSelectionIndicator}\n onHoveredLayoutChange={setHoverIndicatorLayout}\n onFocusedLayoutChange={setFocusIndicatorLayout}\n >\n Profile\n </Tabs.Trigger>\n <Tabs.Trigger\n unstyled\n color=\"$color12\"\n value=\"tab2\"\n onSelectedLayoutChange={handleUpdateSelectionIndicator}\n onHoveredLayoutChange={setHoverIndicatorLayout}\n onFocusedLayoutChange={setFocusIndicatorLayout}\n >\n Connections\n </Tabs.Trigger>\n <Tabs.Trigger\n unstyled\n color=\"$color12\"\n value=\"tab3\"\n onSelectedLayoutChange={handleUpdateSelectionIndicator}\n onHoveredLayoutChange={setHoverIndicatorLayout}\n onFocusedLayoutChange={setFocusIndicatorLayout}\n >\n Notifications\n </Tabs.Trigger>\n </Tabs.List>\n </YStack>\n <AnimatePresence\n exitBeforeEnter\n enterVariant={enterVariant}\n exitVariant={exitVariant}\n >\n <AnimatedYStack key={currentTab} animation=\"100ms\" y={0} o={1}>\n <Tabs.Content value={currentTab} forceMount p=\"$2\">\n <H5 ta=\"center\">{currentTab}</H5>\n </Tabs.Content>\n </AnimatedYStack>\n </AnimatePresence>\n </Tabs>\n )\n}\n"],
|
|
5
|
-
"mappings": "AAAA,SAAS,SAAS,QAAQ,gBAAgB;AAC1C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEA,SAAS,qBAAqB;AACnC,SACE,CAAC,OAAO,UAAU,OAAO,SAAS,OAAO,eAAe,aAAa,GAAG,KACtE,CAAC,cAAc,EACjB,EAFC;AAIL;AAEA,MAAM,sBAAsB,OAAO,OAAO;AAAA,EACxC,MAAM;AAAA,EACN,UAAU;AAAA,IACR,QAAQ;AAAA,MACN,MAAM;AAAA,QACJ,iBAAiB;AAAA,MACnB;AAAA,IACF;AAAA,IACA,UAAU;AAAA,MACR,QAAQ;AAAA,QACN,MAAM;AAAA,UACJ,iBAAiB;AAAA,QACnB;AAAA,MACF;AAAA,MACA,OAAO;AAAA,QACL,MAAM;AAAA,UACJ,SAAS;AAAA,QACX;AAAA,MACF;AAAA,MACA,MAAM;AAAA,QACJ,MAAM;AAAA,UACJ,SAAS;AAAA,QACX;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAAA,EACA,iBAAiB;AAAA,IACf,UAAU;AAAA,IACV,iBAAiB;AAAA,IACjB,SAAS;AAAA,IACT,WAAW;AAAA,EACb;AACF,CAAC;AAED,MAAM,iBAAiB,OAAO,QAAQ;AAAA,EACpC,UAAU;AAAA,IACR,OAAO,EAAE,MAAM,EAAE,GAAG,KAAK,SAAS,EAAE,EAAE;AAAA,IACtC,UAAU,EAAE,MAAM,EAAE,GAAG,IAAI,SAAS,EAAE,EAAE;AAAA,EAC1C;AACF,CAAC;AAED,MAAM,gBAAgB,MAAM;AAC1B,QAAM,CAAC,YAAY,aAAa,IAAI,SAAS,MAAM;AACnD,QAAM,CAAC,sBAAsB,uBAAuB,IAClD,SAA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,MAAM;AAAA,QACN,MAAM;AAAA,QACN,wBAAwB;AAAA,QACxB,uBAAuB;AAAA,QACvB,uBAAuB;AAAA,OACxB,OAED,EATC,KAAK;AAAA,MAUN,CAAC,KAAK;AAAA,QACJ;AAAA,QACA,MAAM;AAAA,QACN,MAAM;AAAA,QACN,wBAAwB;AAAA,QACxB,uBAAuB;AAAA,QACvB,uBAAuB;AAAA,OACxB,WAED,EATC,KAAK;AAAA,MAUN,CAAC,KAAK;AAAA,QACJ;AAAA,QACA,MAAM;AAAA,QACN,MAAM;AAAA,QACN,wBAAwB;AAAA,QACxB,uBAAuB;AAAA,QACvB,uBAAuB;AAAA,OACxB,aAED,EATC,KAAK;AAAA,IAUR,EAnDC,KAAK,KAoDR,EArDC;AAAA,IAsDD,CAAC;AAAA,MACC;AAAA,MACA,cAAc;AAAA,MACd,aAAa;AAAA,KAEb,CAAC,eAAe,KAAK,YAAY,UAAU,QAAQ,GAAG,GAAG,GAAG,GAC1D,CAAC,KAAK,QAAQ,OAAO,YAAY,WAAW,EAAE,KAC5C,CAAC,GAAG,GAAG,UAAU,WAAW,EAA3B,GACH,EAFC,KAAK,QAGR,EAJC,eAKH,EAVC;AAAA,EAWH,EA1EC;AA4EL;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
import { useMemo, useRef, useState } from "react";
|
|
2
|
-
import {
|
|
3
|
-
AnimatePresence,
|
|
4
|
-
H5,
|
|
5
|
-
Stack,
|
|
6
|
-
Tabs,
|
|
7
|
-
XStack,
|
|
8
|
-
YStack,
|
|
9
|
-
styled
|
|
10
|
-
} from "tamagui";
|
|
11
|
-
function TabsUnderlinedDemo() {
|
|
12
|
-
return <XStack maxHeight="100%" maxWidth="100%" justifyContent="flex-start" px="$4"><UnderlineTabs /></XStack>;
|
|
13
|
-
}
|
|
14
|
-
const TabsRovingIndicator = styled(Stack, {
|
|
15
|
-
name: "TabsRovingIndicator",
|
|
16
|
-
variants: {
|
|
17
|
-
active: {
|
|
18
|
-
true: {
|
|
19
|
-
backgroundColor: "$color8"
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
variants: {
|
|
23
|
-
active: {
|
|
24
|
-
true: {
|
|
25
|
-
backgroundColor: "$color8"
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
enter: {
|
|
29
|
-
true: {
|
|
30
|
-
opacity: 0
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
exit: {
|
|
34
|
-
true: {
|
|
35
|
-
opacity: 0
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
defaultVariants: {
|
|
41
|
-
position: "absolute",
|
|
42
|
-
backgroundColor: "$color5",
|
|
43
|
-
opacity: 1,
|
|
44
|
-
animation: "100ms"
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
const AnimatedYStack = styled(YStack, {
|
|
48
|
-
variants: {
|
|
49
|
-
isTop: { true: { y: -25, opacity: 0 } },
|
|
50
|
-
isBottom: { true: { y: 25, opacity: 0 } }
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
const UnderlineTabs = () => {
|
|
54
|
-
const [currentTab, setCurrentTab] = useState("tab1");
|
|
55
|
-
const [focusIndicatorLayout, setFocusIndicatorLayout] = useState(null);
|
|
56
|
-
const [hoverIndicatorLayout, setHoverIndicatorLayout] = useState(null);
|
|
57
|
-
const [selectionIndicatorLayout, setSelectionIndicatorLayout] = useState(null);
|
|
58
|
-
const prevSelectionIndicatorLayout = useRef(null);
|
|
59
|
-
const handleUpdateSelectionIndicator = (newSize) => {
|
|
60
|
-
prevSelectionIndicatorLayout.current = selectionIndicatorLayout;
|
|
61
|
-
setSelectionIndicatorLayout(newSize);
|
|
62
|
-
};
|
|
63
|
-
const intentIndicatorLayout = hoverIndicatorLayout || focusIndicatorLayout;
|
|
64
|
-
const direction = useMemo(() => {
|
|
65
|
-
if (!selectionIndicatorLayout || !prevSelectionIndicatorLayout.current || selectionIndicatorLayout.y === prevSelectionIndicatorLayout.current.y) {
|
|
66
|
-
return 0;
|
|
67
|
-
}
|
|
68
|
-
return selectionIndicatorLayout.y > prevSelectionIndicatorLayout.current.y ? 1 : -1;
|
|
69
|
-
}, [selectionIndicatorLayout]);
|
|
70
|
-
const enterVariant = direction === 1 ? "isTop" : direction === -1 ? "isBottom" : void 0;
|
|
71
|
-
const exitVariant = direction === 1 ? "isBottom" : direction === -1 ? "isTop" : void 0;
|
|
72
|
-
return <Tabs
|
|
73
|
-
value={currentTab}
|
|
74
|
-
onValueChange={setCurrentTab}
|
|
75
|
-
orientation="vertical"
|
|
76
|
-
width={300}
|
|
77
|
-
br="$4"
|
|
78
|
-
ai="center"
|
|
79
|
-
activationMode="manual"
|
|
80
|
-
>
|
|
81
|
-
<YStack borderColor="$color3" borderRightWidth="$0.5" mr="$2"><Tabs.List loop={false} aria-label="Manage your account" disablePassBorderRadius>
|
|
82
|
-
{intentIndicatorLayout && <TabsRovingIndicator
|
|
83
|
-
width="$0.5"
|
|
84
|
-
height={intentIndicatorLayout.height}
|
|
85
|
-
x={intentIndicatorLayout.x}
|
|
86
|
-
y={intentIndicatorLayout.y}
|
|
87
|
-
right={0}
|
|
88
|
-
/>}
|
|
89
|
-
{selectionIndicatorLayout && <TabsRovingIndicator
|
|
90
|
-
theme="active"
|
|
91
|
-
active
|
|
92
|
-
width="$0.5"
|
|
93
|
-
height={selectionIndicatorLayout.height}
|
|
94
|
-
x={selectionIndicatorLayout.x}
|
|
95
|
-
y={selectionIndicatorLayout.y}
|
|
96
|
-
right={0}
|
|
97
|
-
/>}
|
|
98
|
-
<Tabs.Trigger
|
|
99
|
-
unstyled
|
|
100
|
-
color="$color12"
|
|
101
|
-
value="tab1"
|
|
102
|
-
onSelectedLayoutChange={handleUpdateSelectionIndicator}
|
|
103
|
-
onHoveredLayoutChange={setHoverIndicatorLayout}
|
|
104
|
-
onFocusedLayoutChange={setFocusIndicatorLayout}
|
|
105
|
-
>Profile</Tabs.Trigger>
|
|
106
|
-
<Tabs.Trigger
|
|
107
|
-
unstyled
|
|
108
|
-
color="$color12"
|
|
109
|
-
value="tab2"
|
|
110
|
-
onSelectedLayoutChange={handleUpdateSelectionIndicator}
|
|
111
|
-
onHoveredLayoutChange={setHoverIndicatorLayout}
|
|
112
|
-
onFocusedLayoutChange={setFocusIndicatorLayout}
|
|
113
|
-
>Connections</Tabs.Trigger>
|
|
114
|
-
<Tabs.Trigger
|
|
115
|
-
unstyled
|
|
116
|
-
color="$color12"
|
|
117
|
-
value="tab3"
|
|
118
|
-
onSelectedLayoutChange={handleUpdateSelectionIndicator}
|
|
119
|
-
onHoveredLayoutChange={setHoverIndicatorLayout}
|
|
120
|
-
onFocusedLayoutChange={setFocusIndicatorLayout}
|
|
121
|
-
>Notifications</Tabs.Trigger>
|
|
122
|
-
</Tabs.List></YStack>
|
|
123
|
-
<AnimatePresence
|
|
124
|
-
exitBeforeEnter
|
|
125
|
-
enterVariant={enterVariant}
|
|
126
|
-
exitVariant={exitVariant}
|
|
127
|
-
><AnimatedYStack key={currentTab} animation="100ms" y={0} o={1}><Tabs.Content value={currentTab} forceMount p="$2"><H5 ta="center">{currentTab}</H5></Tabs.Content></AnimatedYStack></AnimatePresence>
|
|
128
|
-
</Tabs>;
|
|
129
|
-
};
|
|
130
|
-
export {
|
|
131
|
-
TabsUnderlinedDemo
|
|
132
|
-
};
|
|
133
|
-
//# sourceMappingURL=TabsUnderlinedDemo.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/TabsUnderlinedDemo.tsx"],
|
|
4
|
-
"sourcesContent": ["import { useMemo, useRef, useState } from 'react'\nimport {\n AnimatePresence,\n H5,\n Stack,\n TabTriggerLayout,\n Tabs,\n XStack,\n YStack,\n styled,\n} from 'tamagui'\n\nexport function TabsUnderlinedDemo() {\n return (\n <XStack maxHeight=\"100%\" maxWidth=\"100%\" justifyContent=\"flex-start\" px=\"$4\">\n <UnderlineTabs />\n </XStack>\n )\n}\n\nconst TabsRovingIndicator = styled(Stack, {\n name: 'TabsRovingIndicator',\n variants: {\n active: {\n true: {\n backgroundColor: '$color8',\n },\n },\n variants: {\n active: {\n true: {\n backgroundColor: '$color8',\n },\n },\n enter: {\n true: {\n opacity: 0,\n },\n },\n exit: {\n true: {\n opacity: 0,\n },\n },\n },\n },\n defaultVariants: {\n position: 'absolute',\n backgroundColor: '$color5',\n opacity: 1,\n animation: '100ms',\n },\n})\n\nconst AnimatedYStack = styled(YStack, {\n variants: {\n isTop: { true: { y: -25, opacity: 0 } },\n isBottom: { true: { y: 25, opacity: 0 } },\n } as const,\n})\n\nconst UnderlineTabs = () => {\n const [currentTab, setCurrentTab] = useState('tab1')\n const [focusIndicatorLayout, setFocusIndicatorLayout] =\n useState<TabTriggerLayout | null>(null)\n const [hoverIndicatorLayout, setHoverIndicatorLayout] =\n useState<TabTriggerLayout | null>(null)\n const [selectionIndicatorLayout, setSelectionIndicatorLayout] =\n useState<TabTriggerLayout | null>(null)\n const prevSelectionIndicatorLayout = useRef<TabTriggerLayout | null>(null)\n const handleUpdateSelectionIndicator = (newSize: TabTriggerLayout | null) => {\n prevSelectionIndicatorLayout.current = selectionIndicatorLayout\n setSelectionIndicatorLayout(newSize)\n }\n\n const intentIndicatorLayout = hoverIndicatorLayout || focusIndicatorLayout\n\n /**\n * -1: from top\n * 0: n/a\n * 1: from bottom\n */\n const direction = useMemo(() => {\n if (\n !selectionIndicatorLayout ||\n !prevSelectionIndicatorLayout.current ||\n selectionIndicatorLayout.y === prevSelectionIndicatorLayout.current.y\n ) {\n return 0\n }\n return selectionIndicatorLayout.y > prevSelectionIndicatorLayout.current.y ? 1 : -1\n }, [selectionIndicatorLayout])\n\n const enterVariant =\n direction === 1 ? 'isTop' : direction === -1 ? 'isBottom' : undefined\n const exitVariant =\n direction === 1 ? 'isBottom' : direction === -1 ? 'isTop' : undefined\n\n return (\n <Tabs\n value={currentTab}\n onValueChange={setCurrentTab}\n orientation=\"vertical\"\n width={300}\n br=\"$4\"\n ai=\"center\"\n activationMode=\"manual\"\n >\n <YStack borderColor=\"$color3\" borderRightWidth=\"$0.5\" mr=\"$2\">\n <Tabs.List loop={false} aria-label=\"Manage your account\" disablePassBorderRadius>\n {intentIndicatorLayout && (\n <TabsRovingIndicator\n width=\"$0.5\"\n height={intentIndicatorLayout.height}\n x={intentIndicatorLayout.x}\n y={intentIndicatorLayout.y}\n right={0}\n />\n )}\n {selectionIndicatorLayout && (\n <TabsRovingIndicator\n theme=\"active\"\n active\n width=\"$0.5\"\n height={selectionIndicatorLayout.height}\n x={selectionIndicatorLayout.x}\n y={selectionIndicatorLayout.y}\n right={0}\n />\n )}\n <Tabs.Trigger\n unstyled\n color=\"$color12\"\n value=\"tab1\"\n onSelectedLayoutChange={handleUpdateSelectionIndicator}\n onHoveredLayoutChange={setHoverIndicatorLayout}\n onFocusedLayoutChange={setFocusIndicatorLayout}\n >\n Profile\n </Tabs.Trigger>\n <Tabs.Trigger\n unstyled\n color=\"$color12\"\n value=\"tab2\"\n onSelectedLayoutChange={handleUpdateSelectionIndicator}\n onHoveredLayoutChange={setHoverIndicatorLayout}\n onFocusedLayoutChange={setFocusIndicatorLayout}\n >\n Connections\n </Tabs.Trigger>\n <Tabs.Trigger\n unstyled\n color=\"$color12\"\n value=\"tab3\"\n onSelectedLayoutChange={handleUpdateSelectionIndicator}\n onHoveredLayoutChange={setHoverIndicatorLayout}\n onFocusedLayoutChange={setFocusIndicatorLayout}\n >\n Notifications\n </Tabs.Trigger>\n </Tabs.List>\n </YStack>\n <AnimatePresence\n exitBeforeEnter\n enterVariant={enterVariant}\n exitVariant={exitVariant}\n >\n <AnimatedYStack key={currentTab} animation=\"100ms\" y={0} o={1}>\n <Tabs.Content value={currentTab} forceMount p=\"$2\">\n <H5 ta=\"center\">{currentTab}</H5>\n </Tabs.Content>\n </AnimatedYStack>\n </AnimatePresence>\n </T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ED,EATC,KAAK;AAAA,MAUN,CAAC,KAAK;AAAA,QACJ;AAAA,QACA,MAAM;AAAA,QACN,MAAM;AAAA,QACN,wBAAwB;AAAA,QACxB,uBAAuB;AAAA,QACvB,uBAAuB;AAAA,OACxB,WAED,EATC,KAAK;AAAA,MAUN,CAAC,KAAK;AAAA,QACJ;AAAA,QACA,MAAM;AAAA,QACN,MAAM;AAAA,QACN,wBAAwB;AAAA,QACxB,uBAAuB;AAAA,QACvB,uBAAuB;AAAA,OACxB,aAED,EATC,KAAK;AAAA,IAUR,EAnDC,KAAK,KAoDR,EArDC;AAAA,IAsDD,CAAC;AAAA,MACC;AAAA,MACA,cAAc;AAAA,MACd,aAAa;AAAA,KAEb,CAAC,eAAe,KAAK,YAAY,UAAU,QAAQ,GAAG,GAAG,GAAG,GAC1D,CAAC,KAAK,QAAQ,OAAO,YAAY,WAAW,EAAE,KAC5C,CAAC,GAAG,GAAG,UAAU,WAAW,EAA3B,GACH,EAFC,KAAK,QAGR,EAJC,eAKH,EAVC;AAAA,EAWH,EA1EC;AA4EL;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/dist/jsx/TamaguiLogo.js
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { forwardRef } from "react";
|
|
2
|
-
import { XStack, YStack } from "tamagui";
|
|
3
|
-
const tints = ["red", "orange", "yellow", "green", "blue", "purple", "pink"];
|
|
4
|
-
const logoColors = tints.map((t) => `var(--${t}9)`);
|
|
5
|
-
const TamaguiLogo = forwardRef(({
|
|
6
|
-
showWords,
|
|
7
|
-
color,
|
|
8
|
-
downscale,
|
|
9
|
-
onHoverLetter,
|
|
10
|
-
...props
|
|
11
|
-
}, ref) => <XStack ref={ref} ai="center" jc="center" space="$5" {...props}>
|
|
12
|
-
<LogoIcon downscale={(downscale != null ? downscale : 1) * (showWords ? 2 : 1.5)} color={color} />
|
|
13
|
-
{showWords && <YStack mb={-4}><LogoWords onHoverLetter={onHoverLetter} downscale={downscale != null ? downscale : 2} color={color} /></YStack>}
|
|
14
|
-
</XStack>);
|
|
15
|
-
const LogoWords = ({
|
|
16
|
-
color,
|
|
17
|
-
downscale = 1,
|
|
18
|
-
onHoverLetter
|
|
19
|
-
}) => {
|
|
20
|
-
return <svg width={373 * (1 / downscale) * 0.333333334} height={41 * (1 / downscale) * 0.333333334} viewBox="0 0 373 41">
|
|
21
|
-
<polygon shapeRendering="crispEdges" fill={color || logoColors[0]} points="24.3870968 40.1612903 24.3870968 8.67741935 32.2580645 8.67741935 32.2580645 0.806451613 0.774193548 0.806451613 0.774193548 8.67741935 8.64516129 8.67741935 8.64516129 40.1612903" onMouseEnter={onHoverLetter ? () => onHoverLetter(0) : void 0} />
|
|
22
|
-
<path shapeRendering="crispEdges" fill={color || logoColors[1]} d="M87.3548387,0.806451613 L87.3548387,8.67741935 L95.2258065,8.67741935 L95.2258065,40.1612903 L79.483871,40.1612903 L79.483871,24.4193548 L71.6129032,24.4193548 L71.6129032,40.1612903 L55.8709677,40.1612903 L55.8709677,8.67741935 L63.7419355,8.67741935 L63.7419355,0.806451613 L87.3548387,0.806451613 Z M79.483871,8.67741935 L71.6129032,8.67741935 L71.6129032,16.5483871 L79.483871,16.5483871 L79.483871,8.67741935 Z" fillRule="nonzero" onMouseEnter={onHoverLetter ? () => onHoverLetter(1) : void 0} />
|
|
23
|
-
<polygon shapeRendering="crispEdges" fill={color || logoColors[2]} points="130.645161 40.1612903 130.645161 22.4516129 138.516129 22.4516129 138.516129 40.1612903 154.258065 40.1612903 154.258065 0.806451613 142.451613 0.806451613 142.451613 8.67741935 126.709677 8.67741935 126.709677 0.806451613 114.903226 0.806451613 114.903226 40.1612903" onMouseEnter={onHoverLetter ? () => onHoverLetter(2) : void 0} />
|
|
24
|
-
<path fill={color || logoColors[3]} d="M205.419355,0.806451613 L205.419355,8.67741935 L213.290323,8.67741935 L213.290323,40.1612903 L197.548387,40.1612903 L197.548387,24.4193548 L189.677419,24.4193548 L189.677419,40.1612903 L173.935484,40.1612903 L173.935484,8.67741935 L181.806452,8.67741935 L181.806452,0.806451613 L205.419355,0.806451613 Z M197.548387,8.67741935 L189.677419,8.67741935 L189.677419,16.5483871 L197.548387,16.5483871 L197.548387,8.67741935 Z" fillRule="nonzero" onMouseEnter={onHoverLetter ? () => onHoverLetter(3) : void 0} />
|
|
25
|
-
<polygon shapeRendering="crispEdges" fill={color || logoColors[4]} points="264.451613 40.1612903 264.451613 32.2903226 272.322581 32.2903226 272.322581 16.5483871 256.580645 16.5483871 256.580645 32.2903226 248.709677 32.2903226 248.709677 8.67741935 272.322581 8.67741935 272.322581 0.806451613 240.83871 0.806451613 240.83871 8.67741935 232.967742 8.67741935 232.967742 32.2903226 240.83871 32.2903226 240.83871 40.1612903" onMouseEnter={onHoverLetter ? () => onHoverLetter(4) : void 0} />
|
|
26
|
-
<polygon shapeRendering="crispEdges" fill={color || logoColors[5]} points="323.483871 40.1612903 323.483871 32.2903226 331.354839 32.2903226 331.354839 0.806451613 315.612903 0.806451613 315.612903 32.2903226 307.741935 32.2903226 307.741935 0.806451613 292 0.806451613 292 32.2903226 299.870968 32.2903226 299.870968 40.1612903" onMouseEnter={onHoverLetter ? () => onHoverLetter(5) : void 0} />
|
|
27
|
-
<polygon shapeRendering="crispEdges" fill={color || logoColors[6]} points="372.677419 40.1612903 372.677419 0.806451613 356.935484 0.806451613 356.935484 40.1612903" onMouseEnter={onHoverLetter ? () => onHoverLetter(6) : void 0} />
|
|
28
|
-
</svg>;
|
|
29
|
-
};
|
|
30
|
-
const LogoIcon = ({ downscale = 2 }) => {
|
|
31
|
-
return <YStack className="unselectable" als="center" marginVertical={-10} pressStyle={{
|
|
32
|
-
opacity: 0.7
|
|
33
|
-
}}><img className="tamagui-icon" width={450 / 8 / downscale} height={420 / 8 / downscale} src="/tamagui-icon.svg" /></YStack>;
|
|
34
|
-
};
|
|
35
|
-
export {
|
|
36
|
-
LogoIcon,
|
|
37
|
-
LogoWords,
|
|
38
|
-
TamaguiLogo,
|
|
39
|
-
logoColors,
|
|
40
|
-
tints
|
|
41
|
-
};
|
|
42
|
-
//# sourceMappingURL=TamaguiLogo.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/TamaguiLogo.tsx"],
|
|
4
|
-
"sourcesContent": ["import React, { forwardRef } from 'react'\nimport { ThemeName, XStack, XStackProps, YStack } from 'tamagui'\n\nexport const tints: ThemeName[] = ['red', 'orange', 'yellow', 'green', 'blue', 'purple', 'pink']\n\nexport const logoColors = tints.map((t) => `var(--${t}9)`)\n\nexport const TamaguiLogo = forwardRef(\n (\n {\n showWords,\n color,\n downscale,\n onHoverLetter,\n ...props\n }: {\n onHoverLetter?: (i: number) => void\n showWords?: boolean\n color?: string\n downscale?: number\n } & XStackProps,\n ref\n ) => (\n <XStack ref={ref} ai=\"center\" jc=\"center\" space=\"$5\" {...props}>\n <LogoIcon downscale={(downscale ?? 1) * (showWords ? 2 : 1.5)} color={color} />\n {showWords && (\n <YStack mb={-4}>\n <LogoWords onHoverLetter={onHoverLetter} downscale={downscale ?? 2} color={color} />\n </YStack>\n )}\n </XStack>\n )\n)\n\nexport const LogoWords = ({\n color,\n downscale = 1,\n onHoverLetter,\n}: {\n color?: string\n downscale?: number\n onHoverLetter?: any\n}) => {\n return (\n <svg\n width={373 * (1 / downscale) * 0.333333334}\n height={41 * (1 / downscale) * 0.333333334}\n viewBox=\"0 0 373 41\"\n >\n <polygon\n shapeRendering=\"crispEdges\"\n fill={color || logoColors[0]}\n points=\"24.3870968 40.1612903 24.3870968 8.67741935 32.2580645 8.67741935 32.2580645 0.806451613 0.774193548 0.806451613 0.774193548 8.67741935 8.64516129 8.67741935 8.64516129 40.1612903\"\n onMouseEnter={onHoverLetter ? () => onHoverLetter(0) : undefined}\n />\n <path\n shapeRendering=\"crispEdges\"\n fill={color || logoColors[1]}\n d=\"M87.3548387,0.806451613 L87.3548387,8.67741935 L95.2258065,8.67741935 L95.2258065,40.1612903 L79.483871,40.1612903 L79.483871,24.4193548 L71.6129032,24.4193548 L71.6129032,40.1612903 L55.8709677,40.1612903 L55.8709677,8.67741935 L63.7419355,8.67741935 L63.7419355,0.806451613 L87.3548387,0.806451613 Z M79.483871,8.67741935 L71.6129032,8.67741935 L71.6129032,16.5483871 L79.483871,16.5483871 L79.483871,8.67741935 Z\"\n fillRule=\"nonzero\"\n onMouseEnter={onHoverLetter ? () => onHoverLetter(1) : undefined}\n />\n <polygon\n shapeRendering=\"crispEdges\"\n fill={color || logoColors[2]}\n points=\"130.645161 40.1612903 130.645161 22.4516129 138.516129 22.4516129 138.516129 40.1612903 154.258065 40.1612903 154.258065 0.806451613 142.451613 0.806451613 142.451613 8.67741935 126.709677 8.67741935 126.709677 0.806451613 114.903226 0.806451613 114.903226 40.1612903\"\n onMouseEnter={onHoverLetter ? () => onHoverLetter(2) : undefined}\n />\n <path\n fill={color || logoColors[3]}\n d=\"M205.419355,0.806451613 L205.419355,8.67741935 L213.290323,8.67741935 L213.290323,40.1612903 L197.548387,40.1612903 L197.548387,24.4193548 L189.677419,24.4193548 L189.677419,40.1612903 L173.935484,40.1612903 L173.935484,8.67741935 L181.806452,8.67741935 L181.806452,0.806451613 L205.419355,0.806451613 Z M197.548387,8.67741935 L189.677419,8.67741935 L189.677419,16.5483871 L197.548387,16.5483871 L197.548387,8.67741935 Z\"\n fillRule=\"nonzero\"\n onMouseEnter={onHoverLetter ? () => onHoverLetter(3) : undefined}\n />\n <polygon\n shapeRendering=\"crispEdges\"\n fill={color || logoColors[4]}\n points=\"264.451613 40.1612903 264.451613 32.2903226 272.322581 32.2903226 272.322581 16.5483871 256.580645 16.5483871 256.580645 32.2903226 248.709677 32.2903226 248.709677 8.67741935 272.322581 8.67741935 272.322581 0.806451613 240.83871 0.806451613 240.83871 8.67741935 232.967742 8.67741935 232.967742 32.2903226 240.83871 32.2903226 240.83871 40.1612903\"\n onMouseEnter={onHoverLetter ? () => onHoverLetter(4) : undefined}\n />\n <polygon\n shapeRendering=\"crispEdges\"\n fill={color || logoColors[5]}\n points=\"323.483871 40.1612903 323.483871 32.2903226 331.354839 32.2903226 331.354839 0.806451613 315.612903 0.806451613 315.612903 32.2903226 307.741935 32.2903226 307.741935 0.806451613 292 0.806451613 292 32.2903226 299.870968 32.2903226 299.870968 40.1612903\"\n onMouseEnter={onHoverLetter ? () => onHoverLetter(5) : undefined}\n />\n <polygon\n shapeRendering=\"crispEdges\"\n fill={color || logoColors[6]}\n points=\"372.677419 40.1612903 372.677419 0.806451613 356.935484 0.806451613 356.935484 40.1612903\"\n onMouseEnter={onHoverLetter ? () => onHoverLetter(6) : undefined}\n />\n </svg>\n )\n}\n\nexport const LogoIcon = ({ downscale = 2 }: any) => {\n return (\n <YStack\n className=\"unselectable\"\n als=\"center\"\n marginVertical={-10}\n pressStyle={{\n opacity: 0.7,\n }}\n >\n <img\n className=\"tamagui-icon\"\n width={450 / 8 / downscale}\n height={420 / 8 / downscale}\n src=\"/tamagui-icon.svg\"\n />\n </YStack>\n )\n}\n"],
|
|
5
|
-
"mappings": "AAAA;AACA;AAEO,MAAM,QAAqB,CAAC,OAAO,UAAU,UAAU,SAAS,QAAQ,UAAU,MAAM;AAExF,MAAM,aAAa,MAAM,IAAI,CAAC,MAAM,SAAS,KAAK;AAElD,MAAM,cAAc,WACzB,CACE;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,KACG;AAAA,GAOL,QAEA,CAAC,OAAO,KAAK,KAAK,GAAG,SAAS,GAAG,SAAS,MAAM,SAAS;AAAA,EACvD,CAAC,SAAS,WAAY,iCAAa,KAAM,aAAY,IAAI,MAAM,OAAO,OAAO;AAAA,GAC5E,aACC,CAAC,OAAO,IAAI,IACV,CAAC,UAAU,eAAe,eAAe,WAAW,gCAAa,GAAG,OAAO,OAAO,EACpF,EAFC;AAIL,EAPC,OASL;AAEO,MAAM,YAAY,CAAC;AAAA,EACxB;AAAA,EACA,YAAY;AAAA,EACZ;AAAA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@
|
|
|
1
|
-
//# sourceMappingURL=zstack.js.map
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Separator, ZStack } from "tamagui";
|
|
2
|
-
const Crosshairs = () => {
|
|
3
|
-
return <ZStack ai="center" jc="center" bc="green" fullscreen zi={1e11}>
|
|
4
|
-
<Separator borderColor="red" />
|
|
5
|
-
<Separator vertical borderColor="red" />
|
|
6
|
-
</ZStack>;
|
|
7
|
-
};
|
|
8
|
-
export {
|
|
9
|
-
Crosshairs
|
|
10
|
-
};
|
|
11
|
-
//# sourceMappingURL=zstack.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/snapshots/zstack.tsx"],
|
|
4
|
-
"sourcesContent": ["import { Separator, ZStack } from 'tamagui'\n\nexport const Crosshairs = () => {\n return (\n <ZStack ai=\"center\" jc=\"center\" bc=\"green\" fullscreen zi={100000000000}>\n <Separator borderColor=\"red\" />\n <Separator vertical borderColor=\"red\" />\n </ZStack>\n )\n}\n"],
|
|
5
|
-
"mappings": "AAAA,SAAS,WAAW,cAAc;AAE3B,MAAM,aAAa,MAAM;AAC9B,SACE,CAAC,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,WAAW,IAAI;AAAA,IACxD,CAAC,UAAU,YAAY,MAAM;AAAA,IAC7B,CAAC,UAAU,SAAS,YAAY,MAAM;AAAA,EACxC,EAHC;AAKL;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/dist/jsx/tests/zstack.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Separator, ZStack } from "tamagui";
|
|
2
|
-
const Crosshairs = () => {
|
|
3
|
-
return <ZStack ai="center" jc="center" bc="green" fullscreen zi={1e11}>
|
|
4
|
-
<Separator borderColor="red" />
|
|
5
|
-
<Separator vertical borderColor="red" />
|
|
6
|
-
</ZStack>;
|
|
7
|
-
};
|
|
8
|
-
export {
|
|
9
|
-
Crosshairs
|
|
10
|
-
};
|
|
11
|
-
//# sourceMappingURL=zstack.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/tests/zstack.tsx"],
|
|
4
|
-
"sourcesContent": ["import { Separator, ZStack } from 'tamagui'\n\nexport const Crosshairs = () => {\n return (\n <ZStack ai=\"center\" jc=\"center\" bc=\"green\" fullscreen zi={100000000000}>\n <Separator borderColor=\"red\" />\n <Separator vertical borderColor=\"red\" />\n </ZStack>\n )\n}\n"],
|
|
5
|
-
"mappings": "AAAA,SAAS,WAAW,cAAc;AAE3B,MAAM,aAAa,MAAM;AAC9B,SACE,CAAC,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,WAAW,IAAI;AAAA,IACxD,CAAC,UAAU,YAAY,MAAM;AAAA,IAC7B,CAAC,UAAU,SAAS,YAAY,MAAM;AAAA,EACxC,EAHC;AAKL;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AccordionDemo.d.ts","sourceRoot":"","sources":["../src/AccordionDemo.tsx"],"names":[],"mappings":";AAEA,wBAAgB,aAAa,gBA4B5B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DrawerDemo.d.ts","sourceRoot":"","sources":["../src/DrawerDemo.tsx"],"names":[],"mappings":";AAMA,wBAAgB,UAAU,gBA2BzB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FeatherIconsDemo.d.ts","sourceRoot":"","sources":["../src/FeatherIconsDemo.tsx"],"names":[],"mappings":";AAYA,wBAAgB,gBAAgB,gBAgC/B"}
|
package/types/MenuDemo.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MenuDemo.d.ts","sourceRoot":"","sources":["../src/MenuDemo.tsx"],"names":[],"mappings":";AAKA,wBAAgB,QAAQ,gBA2BvB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PopperDemo.d.ts","sourceRoot":"","sources":["../src/PopperDemo.tsx"],"names":[],"mappings":";AACA,OAAO,EASL,WAAW,EAOZ,MAAM,SAAS,CAAA;AAEhB,wBAAgB,UAAU,gBAYzB;AAED,wBAAgB,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,KAAK,EAAE,EAAE,WAAW,GAAG;IAAE,IAAI,CAAC,EAAE,GAAG,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAA;CAAE,eAoCrF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TabsHighlightedDemo.d.ts","sourceRoot":"","sources":["../src/TabsHighlightedDemo.tsx"],"names":[],"mappings":";AAYA,wBAAgB,mBAAmB,gBAMlC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TabsUnderlinedDemo.d.ts","sourceRoot":"","sources":["../src/TabsUnderlinedDemo.tsx"],"names":[],"mappings":";AAYA,wBAAgB,kBAAkB,gBAMjC"}
|