mirror of
https://github.com/hanzoai/gui.git
synced 2026-10-25 02:31:41 +00:00
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]>
95 lines
2.3 KiB
TypeScript
95 lines
2.3 KiB
TypeScript
import { Paragraph, Separator, XStack, YStack } from '@hanzo/gui'
|
|
|
|
const PaletteExample = ({
|
|
showIndices,
|
|
showNegativeIndices,
|
|
theme,
|
|
}: {
|
|
showIndices?: boolean | undefined
|
|
showNegativeIndices?: boolean | undefined
|
|
theme?: string | undefined
|
|
}) => (
|
|
<YStack gap="$2">
|
|
{theme && (
|
|
<XStack items="center" theme={theme as any} gap="$4">
|
|
<Separator />
|
|
<Paragraph text="center" size="$2" color="$color10">
|
|
{theme[0].toUpperCase() + theme.slice(1)}
|
|
</Paragraph>
|
|
<Separator />
|
|
</XStack>
|
|
)}
|
|
{showNegativeIndices && (
|
|
<XStack rounded="$5" overflow="hidden">
|
|
{new Array(12).fill(0).map((_, i) => (
|
|
<Paragraph flex={1} text="center" key={i}>
|
|
-{11 - i}
|
|
</Paragraph>
|
|
))}
|
|
</XStack>
|
|
)}
|
|
<XStack rounded="$5" overflow="hidden" borderWidth={1} borderColor="$borderColor">
|
|
{new Array(12).fill(0).map((_, i) => (
|
|
<XStack key={i} height={40} flex={1} bg={`$${theme || 'blue'}${i}` as any} />
|
|
))}
|
|
</XStack>
|
|
{showIndices && (
|
|
<XStack rounded="$5" overflow="hidden">
|
|
{new Array(12).fill(0).map((_, i) => (
|
|
<Paragraph flex={1} text="center" key={i}>
|
|
{i}
|
|
</Paragraph>
|
|
))}
|
|
</XStack>
|
|
)}
|
|
</YStack>
|
|
)
|
|
|
|
export const ExamplePalette = ({
|
|
showIndices,
|
|
showNegativeIndices,
|
|
showLabels,
|
|
theme,
|
|
}: {
|
|
showIndices?: boolean
|
|
showNegativeIndices?: boolean
|
|
showLabels?: boolean
|
|
theme?: string
|
|
}) => {
|
|
return (
|
|
<YStack my="$4" gap="$2">
|
|
{showLabels && (
|
|
<XStack justify="space-between">
|
|
<Paragraph size="$2" color="$color9">
|
|
Background
|
|
</Paragraph>
|
|
<Paragraph size="$2" color="$color9">
|
|
Foreground
|
|
</Paragraph>
|
|
</XStack>
|
|
)}
|
|
<PaletteExample
|
|
showIndices={showIndices}
|
|
showNegativeIndices={showNegativeIndices}
|
|
theme={theme}
|
|
/>
|
|
</YStack>
|
|
)
|
|
}
|
|
|
|
export const ExampleTemplate = () => {
|
|
return (
|
|
<YStack my="$4" gap="$2">
|
|
<XStack justify="space-between">
|
|
<Paragraph size="$2" color="$color9">
|
|
Background
|
|
</Paragraph>
|
|
<Paragraph size="$2" color="$color9">
|
|
Foreground
|
|
</Paragraph>
|
|
</XStack>
|
|
<PaletteExample />
|
|
</YStack>
|
|
)
|
|
}
|