Files
gui/apps/sandbox/use-cases/TestAdaptDialogToSheet.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

92 lines
2.4 KiB
TypeScript

import { useState } from 'react'
import { Adapt, Button, Dialog, ScrollView, Sheet, SizableText, YStack } from '@hanzo/gui'
export default function TestAdaptDialogToSheet() {
const [open, setOpen] = useState(false)
return (
<>
<Dialog modal open={open} onOpenChange={setOpen}>
<Dialog.Trigger asChild>
<Button
size="$6"
onPress={() => {
setOpen(true)
}}
>
Open Sheet
</Button>
</Dialog.Trigger>
<Adapt when="maxMd">
<Sheet
snapPointsMode="fit"
modal
zIndex={100_000}
transition="quick"
open={open}
onOpenChange={setOpen}
dismissOnSnapToBottom
>
<Sheet.Handle
position="relative"
margin="auto"
top={20}
width={40}
height={4}
/>
<Sheet.Overlay opacity={0.5} />
<Sheet.Frame>
<YStack>
<Adapt.Contents />
</YStack>
</Sheet.Frame>
</Sheet>
</Adapt>
<Dialog.Portal>
<Dialog.Overlay
key="overlay"
transition="quick"
opacity={0.9}
enterStyle={{ opacity: 0 }}
exitStyle={{ opacity: 0 }}
/>
<Dialog.Content
key="content"
p={0}
m="$0"
width="100%"
height="100%"
items="center"
rounded={0}
animateOnly={['transform', 'opacity']}
transition="quick"
enterStyle={{ x: '100%' }}
exitStyle={{ x: '100%' }}
>
<ScrollView width="100%">
<YStack items="center" justify="center">
<YStack gap={12}>
<SizableText>
This should be in a Sheet on SM screens but its not
</SizableText>
<Button
pointerEvents="auto"
onPress={() => {
setOpen(false)
}}
>
<Button.Text>Close</Button.Text>
</Button>
</YStack>
</YStack>
</ScrollView>
</Dialog.Content>
</Dialog.Portal>
</Dialog>
</>
)
}