Files
gui/apps/gui.hanzo.ai/features/studio/theme/steps/views/StudioThemesQuickPreviewSection.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

113 lines
3.1 KiB
TypeScript

import { Check as CheckIcon } from '@hanzogui/lucide-icons-2'
import { memo, useState } from 'react'
import {
Button,
Checkbox,
H3,
Label,
Paragraph,
ScrollView,
Separator,
Switch,
XStack,
YStack,
} from '@hanzo/gui'
import { AccentTheme } from '~/features/studio/components/AccentTheme'
import { accentThemeName } from '../../../accentThemeName'
export const StudioThemesQuickPreviewSection = memo(
({
scheme,
hasAccent,
onPressButton,
}: {
scheme: string
hasAccent: boolean
onPressButton?: any
}) => {
const [checked, setChecked] = useState(false)
const [subtleBg, setSubtleBg] = useState(false)
const checkId = `accept-check-${scheme}`
return (
<ScrollView
bg={subtleBg ? '$color2' : '$color1'}
flex={1}
rounded="$6"
borderWidth={1}
borderColor="$borderColor"
contentContainerStyle={{ flex: 1 }}
maxH={350}
maxW={400}
self="center"
>
<YStack gap="$3" height="100%" flex={1} pt="$4" px="$4" justify="space-between">
<YStack gap="$2">
<H3>Preview</H3>
<Paragraph color="$color11">
This is just an example, your actual components can use any values from the
palette.
</Paragraph>
</YStack>
<XStack width={200} items="center" gap="$4">
<Label pr="$0" minW={90} justify="flex-end" htmlFor="switch">
Label
</Label>
<Separator minH={20} vertical />
<>
<Switch
id="switch"
theme={checked ? accentThemeName : null}
size="$3"
onCheckedChange={setChecked}
>
<Switch.Thumb
animateOnly={['transform']}
transition={[
'quickest',
{
backgroundColor: {
overshootClamping: true,
},
},
]}
/>
</Switch>
</>
</XStack>
<YStack pb="$4" gap="$4">
<XStack my="$-2" justify="center">
<XStack width={300} items="center" gap="$4">
<Checkbox
id={checkId}
onCheckedChange={(val) => {
setSubtleBg(!!val)
}}
>
<Checkbox.Indicator>
<CheckIcon />
</Checkbox.Indicator>
</Checkbox>
<Label htmlFor={checkId}>Use subtle background</Label>
</XStack>
</XStack>
<Separator borderColor="$color2" />
<XStack gap="$4">
<Button flex={1}>Cancel</Button>
<AccentTheme>
<Button flex={1} onPress={onPressButton}>
Accept
</Button>
</AccentTheme>
</XStack>
</YStack>
</YStack>
</ScrollView>
)
}
)