Files
gui/apps/sandbox/app/tooltip-ssr+ssr.tsx
zeekayandHanzo Dev 751ef5c778 rename the framework to @hanzo/gui and the loader to @hanzogui/loader
Both old names are owned by a different npm account (artemis-prime), so
publishing them returns 403 — which is how this surfaced: the 8.0.0 run
shipped @hanzogui/logo and @hanzogui/demos depending on [email protected], a
version that cannot be published and therefore does not exist. Those two
were uninstallable.

@hanzo/gui and @hanzogui/* are ours, so the framework now carries the name
it is imported by everywhere downstream, and the loader moves under the
scope we control.

The rewrite is limited to package references. `DEBUG?.startsWith('hanzogui')`
is a log-namespace filter and join(dir, 'hanzogui') is a path — rewriting
either would change behaviour, so both are untouched.

Co-authored-by: Hanzo Dev <[email protected]>
2026-07-30 20:23:18 -07:00

85 lines
2.5 KiB
TypeScript

import React, { useState, useRef } from 'react'
import { Paragraph, Tooltip, TooltipGroup, YStack, XStack, Button } from '@hanzo/gui'
// matches PromoLinksRow pattern exactly:
// scoped tooltip, multiple triggers, asChild, nested structure, animatePosition
type NavId = 'a' | 'b' | 'c'
const LABELS: Record<NavId, string> = {
a: 'Takeout — universal RN starter kit',
b: 'Bento — Free + paid pre-made UI',
c: 'Add Even — Expert React Native developers',
}
const tooltipDelay = { open: 0, close: 150 }
export default function TooltipSSRTest() {
const [label, setLabel] = useState('')
const rootRef = useRef<any>(null)
React.useEffect(() => {
rootRef.current?.setAttribute('data-hydrated', 'true')
}, [])
return (
<YStack ref={rootRef} p="$4" gap="$4" id="tooltip-ssr-root">
<YStack height={120} />
<TooltipGroup delay={tooltipDelay}>
<Tooltip scope="promo-tooltip" offset={20} placement="bottom">
<XStack gap="$2" id="tip-triggers" justifyContent="center">
<Tooltip.Trigger
scope="promo-tooltip"
asChild
onMouseEnter={() => setLabel(LABELS.a)}
>
<XStack id="tip-trigger-a">
<Button size="$3">Starter Kit</Button>
</XStack>
</Tooltip.Trigger>
<Tooltip.Trigger
scope="promo-tooltip"
asChild
onMouseEnter={() => setLabel(LABELS.b)}
>
<XStack id="tip-trigger-b">
<Button size="$3">Copy-Paste UI</Button>
</XStack>
</Tooltip.Trigger>
<Tooltip.Trigger
scope="promo-tooltip"
asChild
onMouseEnter={() => setLabel(LABELS.c)}
>
<XStack id="tip-trigger-c">
<Button size="$3">Hire Us</Button>
</XStack>
</Tooltip.Trigger>
</XStack>
<Tooltip.Content
id="tip-content"
scope="promo-tooltip"
animatePosition
transition="medium"
bg="$background"
elevation="$2"
rounded="$4"
px="$2.5"
py="$1"
enterStyle={{ y: -4, opacity: 0 }}
exitStyle={{ y: -4, opacity: 0 }}
>
<Tooltip.Arrow scope="promo-tooltip" id="tip-arrow" />
<Paragraph id="tip-label" size="$3">
{label}
</Paragraph>
</Tooltip.Content>
</Tooltip>
</TooltipGroup>
</YStack>
)
}