@hanzo/ui 8.0.6 → 8.0.8
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/ThemeToggleNext-7727UR5W.js +4 -0
- package/dist/ThemeToggleNext-7727UR5W.js.map +1 -0
- package/dist/ThemeToggleNext-ICB5KL5J.cjs +19 -0
- package/dist/ThemeToggleNext-ICB5KL5J.cjs.map +1 -0
- package/dist/billing.cjs +15 -0
- package/dist/billing.cjs.map +1 -0
- package/{types → dist}/billing.d.ts +0 -1
- package/dist/billing.js +4 -0
- package/dist/billing.js.map +1 -0
- package/dist/canvas.cjs +15 -0
- package/dist/canvas.cjs.map +1 -0
- package/dist/canvas.d.ts +1 -0
- package/dist/canvas.js +4 -0
- package/dist/canvas.js.map +1 -0
- package/{types → dist}/cd/layout.d.ts +0 -1
- package/{types → dist}/cd/status.d.ts +0 -1
- package/{types → dist}/cd/time.d.ts +0 -1
- package/{types → dist}/cd/types.d.ts +0 -1
- package/dist/chunk-42CU5GSF.js +98 -0
- package/dist/chunk-42CU5GSF.js.map +1 -0
- package/dist/chunk-GDGVXU7W.js +1999 -0
- package/dist/chunk-GDGVXU7W.js.map +1 -0
- package/dist/chunk-HSPMQQVJ.cjs +2066 -0
- package/dist/chunk-HSPMQQVJ.cjs.map +1 -0
- package/dist/chunk-YBXVUV7P.cjs +103 -0
- package/dist/chunk-YBXVUV7P.cjs.map +1 -0
- package/dist/dashboard.cjs +15 -0
- package/dist/dashboard.cjs.map +1 -0
- package/dist/dashboard.d.ts +1 -0
- package/dist/dashboard.js +4 -0
- package/dist/dashboard.js.map +1 -0
- package/dist/data.cjs +15 -0
- package/dist/data.cjs.map +1 -0
- package/dist/data.d.ts +1 -0
- package/dist/data.js +4 -0
- package/dist/data.js.map +1 -0
- package/dist/gitops.cjs +15 -0
- package/dist/gitops.cjs.map +1 -0
- package/dist/gitops.d.ts +1 -0
- package/dist/gitops.js +4 -0
- package/dist/gitops.js.map +1 -0
- package/dist/index.cjs +291 -0
- package/dist/index.cjs.map +1 -0
- package/{types → dist}/index.d.ts +0 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/network.cjs +15 -0
- package/dist/network.cjs.map +1 -0
- package/{types → dist}/network.d.ts +0 -1
- package/dist/network.js +4 -0
- package/dist/network.js.map +1 -0
- package/dist/primitives/bases/data/index.cjs +15 -0
- package/dist/primitives/bases/data/index.cjs.map +1 -0
- package/dist/primitives/bases/data/index.d.ts +1 -0
- package/dist/primitives/bases/data/index.js +4 -0
- package/dist/primitives/bases/data/index.js.map +1 -0
- package/{types → dist}/product/AppHeader.d.ts +0 -1
- package/{types → dist}/product/BrandMark.d.ts +0 -1
- package/{types → dist}/product/Charts.d.ts +0 -1
- package/{types → dist}/product/ComboBox.d.ts +0 -1
- package/{types → dist}/product/DataTable.d.ts +0 -1
- package/{types → dist}/product/Donut.d.ts +0 -1
- package/{types → dist}/product/EmptyState.d.ts +0 -1
- package/{types → dist}/product/FadeIn.d.ts +0 -1
- package/{types → dist}/product/Field.d.ts +0 -1
- package/{types → dist}/product/HanzoMark.d.ts +0 -1
- package/{types → dist}/product/Metric.d.ts +0 -1
- package/{types → dist}/product/OrgSwitcher.d.ts +0 -1
- package/{types → dist}/product/PageHeader.d.ts +0 -1
- package/{types → dist}/product/PrimaryButton.d.ts +0 -1
- package/{types → dist}/product/ProductIcon.d.ts +0 -1
- package/{types → dist}/product/ProviderLogo.d.ts +0 -1
- package/{types → dist}/product/Reorder.d.ts +0 -1
- package/{types → dist}/product/SelectMenu.d.ts +7 -6
- package/{types → dist}/product/SlideOver.d.ts +0 -1
- package/{types → dist}/product/StatusTag.d.ts +0 -1
- package/dist/product/ThemeToggle.d.ts +21 -0
- package/dist/product/ThemeToggleNext.d.ts +4 -0
- package/{types → dist}/product/Toast.d.ts +0 -1
- package/{types → dist}/product/color.d.ts +0 -1
- package/{types → dist}/product/combobox/filter.d.ts +0 -1
- package/dist/product/index.cjs +278 -0
- package/dist/product/index.cjs.map +1 -0
- package/{types → dist}/product/index.d.ts +2 -1
- package/dist/product/index.js +5 -0
- package/dist/product/index.js.map +1 -0
- package/dist/product/menu/ContextMenu.d.ts +21 -0
- package/dist/product/menu/DropdownMenu.d.ts +29 -0
- package/dist/product/menu/FloatingMenu.d.ts +36 -0
- package/dist/product/menu/index.d.ts +5 -0
- package/dist/product/menu/items.d.ts +68 -0
- package/dist/product/menu/portal-theme.d.ts +28 -0
- package/dist/product/menu/roving.d.ts +8 -0
- package/{types → dist}/product/scope.d.ts +0 -1
- package/{types → dist}/product/surfaces.data.d.ts +0 -1
- package/dist/usage.cjs +15 -0
- package/dist/usage.cjs.map +1 -0
- package/dist/usage.d.ts +1 -0
- package/dist/usage.js +4 -0
- package/dist/usage.js.map +1 -0
- package/dist/wallet.cjs +15 -0
- package/dist/wallet.cjs.map +1 -0
- package/{types → dist}/wallet.d.ts +0 -1
- package/dist/wallet.js +4 -0
- package/dist/wallet.js.map +1 -0
- package/package.json +58 -32
- package/src/billing.ts +0 -9
- package/src/canvas.ts +0 -11
- package/src/cd/layout.ts +0 -184
- package/src/cd/status.ts +0 -158
- package/src/cd/time.ts +0 -52
- package/src/cd/types.ts +0 -318
- package/src/dashboard.ts +0 -8
- package/src/data.ts +0 -12
- package/src/gitops.ts +0 -5
- package/src/gui-env.d.ts +0 -27
- package/src/index.ts +0 -22
- package/src/network.ts +0 -11
- package/src/primitives/bases/data/index.ts +0 -13
- package/src/product/AppHeader.tsx +0 -183
- package/src/product/BrandMark.tsx +0 -27
- package/src/product/Charts.tsx +0 -471
- package/src/product/ComboBox.tsx +0 -147
- package/src/product/DataTable.tsx +0 -99
- package/src/product/Donut.tsx +0 -83
- package/src/product/EmptyState.tsx +0 -129
- package/src/product/FadeIn.tsx +0 -38
- package/src/product/Field.tsx +0 -160
- package/src/product/HanzoMark.tsx +0 -31
- package/src/product/Metric.tsx +0 -253
- package/src/product/OrgSwitcher.tsx +0 -332
- package/src/product/PageHeader.tsx +0 -31
- package/src/product/PrimaryButton.tsx +0 -17
- package/src/product/ProductIcon.tsx +0 -61
- package/src/product/ProviderLogo.tsx +0 -137
- package/src/product/Reorder.test.ts +0 -41
- package/src/product/Reorder.tsx +0 -110
- package/src/product/SelectMenu.tsx +0 -94
- package/src/product/SlideOver.tsx +0 -197
- package/src/product/StatusTag.tsx +0 -49
- package/src/product/ThemeToggle.tsx +0 -25
- package/src/product/Toast.tsx +0 -166
- package/src/product/color.ts +0 -17
- package/src/product/combobox/filter.test.ts +0 -51
- package/src/product/combobox/filter.ts +0 -39
- package/src/product/index.ts +0 -70
- package/src/product/scope.test.ts +0 -92
- package/src/product/scope.ts +0 -123
- package/src/product/surfaces.data.ts +0 -42
- package/src/usage.ts +0 -8
- package/src/wallet.ts +0 -11
- package/types/billing.d.ts.map +0 -1
- package/types/canvas.d.ts +0 -2
- package/types/canvas.d.ts.map +0 -1
- package/types/cd/layout.d.ts.map +0 -1
- package/types/cd/status.d.ts.map +0 -1
- package/types/cd/time.d.ts.map +0 -1
- package/types/cd/types.d.ts.map +0 -1
- package/types/dashboard.d.ts +0 -2
- package/types/dashboard.d.ts.map +0 -1
- package/types/data.d.ts +0 -2
- package/types/data.d.ts.map +0 -1
- package/types/gitops.d.ts +0 -2
- package/types/gitops.d.ts.map +0 -1
- package/types/index.d.ts.map +0 -1
- package/types/network.d.ts.map +0 -1
- package/types/primitives/bases/data/index.d.ts +0 -2
- package/types/primitives/bases/data/index.d.ts.map +0 -1
- package/types/product/AppHeader.d.ts.map +0 -1
- package/types/product/BrandMark.d.ts.map +0 -1
- package/types/product/Charts.d.ts.map +0 -1
- package/types/product/ComboBox.d.ts.map +0 -1
- package/types/product/DataTable.d.ts.map +0 -1
- package/types/product/Donut.d.ts.map +0 -1
- package/types/product/EmptyState.d.ts.map +0 -1
- package/types/product/FadeIn.d.ts.map +0 -1
- package/types/product/Field.d.ts.map +0 -1
- package/types/product/HanzoMark.d.ts.map +0 -1
- package/types/product/Metric.d.ts.map +0 -1
- package/types/product/OrgSwitcher.d.ts.map +0 -1
- package/types/product/PageHeader.d.ts.map +0 -1
- package/types/product/PrimaryButton.d.ts.map +0 -1
- package/types/product/ProductIcon.d.ts.map +0 -1
- package/types/product/ProviderLogo.d.ts.map +0 -1
- package/types/product/Reorder.d.ts.map +0 -1
- package/types/product/SelectMenu.d.ts.map +0 -1
- package/types/product/SlideOver.d.ts.map +0 -1
- package/types/product/StatusTag.d.ts.map +0 -1
- package/types/product/ThemeToggle.d.ts +0 -2
- package/types/product/ThemeToggle.d.ts.map +0 -1
- package/types/product/Toast.d.ts.map +0 -1
- package/types/product/color.d.ts.map +0 -1
- package/types/product/combobox/filter.d.ts.map +0 -1
- package/types/product/index.d.ts.map +0 -1
- package/types/product/scope.d.ts.map +0 -1
- package/types/product/surfaces.data.d.ts.map +0 -1
- package/types/usage.d.ts +0 -2
- package/types/usage.d.ts.map +0 -1
- package/types/wallet.d.ts.map +0 -1
- /package/{src → dist}/styles/hanzo-motion.css +0 -0
package/src/product/Toast.tsx
DELETED
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Toast — the ONE feedback primitive. Every mutation reports through `useToast()`
|
|
5
|
-
* so success/failure looks and behaves the same everywhere. A single provider
|
|
6
|
-
* holds the queue and renders the viewport (portalled top-right); there is no
|
|
7
|
-
* per-call markup. Built from GUI primitives only.
|
|
8
|
-
*
|
|
9
|
-
* Mount `<ToastProvider>` once (the dashboard layout does). Call:
|
|
10
|
-
* const toast = useToast()
|
|
11
|
-
* toast.success('Created my-db')
|
|
12
|
-
* toast.error(err instanceof ApiError ? err.message : 'Failed to create')
|
|
13
|
-
*/
|
|
14
|
-
import { createContext, useCallback, useContext, useEffect, useRef, useState, type ReactNode } from 'react'
|
|
15
|
-
import { createPortal } from 'react-dom'
|
|
16
|
-
import { Button, Card, Text, XStack, YStack } from '@hanzo/gui'
|
|
17
|
-
import { CircleCheck, CircleX, Info, X } from '@hanzogui/lucide-icons-2'
|
|
18
|
-
|
|
19
|
-
export type ToastKind = 'success' | 'error' | 'info'
|
|
20
|
-
|
|
21
|
-
export type ToastInput = {
|
|
22
|
-
title: string
|
|
23
|
-
description?: string
|
|
24
|
-
kind?: ToastKind
|
|
25
|
-
/** Auto-dismiss after this many ms; 0 keeps it until dismissed. */
|
|
26
|
-
durationMs?: number
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
type Toast = Required<Omit<ToastInput, 'description'>> & { id: number; description?: string }
|
|
30
|
-
|
|
31
|
-
type ToastApi = {
|
|
32
|
-
toast: (t: ToastInput) => void
|
|
33
|
-
success: (title: string, description?: string) => void
|
|
34
|
-
error: (title: string, description?: string) => void
|
|
35
|
-
info: (title: string, description?: string) => void
|
|
36
|
-
dismiss: (id: number) => void
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
const ToastContext = createContext<ToastApi | null>(null)
|
|
40
|
-
|
|
41
|
-
/** Theme-aware accent per kind (adapts to light/dark). */
|
|
42
|
-
const ACCENT = {
|
|
43
|
-
success: '$green10',
|
|
44
|
-
error: '$red10',
|
|
45
|
-
info: '$color11',
|
|
46
|
-
} as const
|
|
47
|
-
|
|
48
|
-
const ICON: Record<ToastKind, typeof Info> = {
|
|
49
|
-
success: CircleCheck,
|
|
50
|
-
error: CircleX,
|
|
51
|
-
info: Info,
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
function ToastCard({ t, onClose }: { t: Toast; onClose: () => void }) {
|
|
55
|
-
const Icon = ICON[t.kind]
|
|
56
|
-
const accent = ACCENT[t.kind]
|
|
57
|
-
return (
|
|
58
|
-
<Card
|
|
59
|
-
width={360}
|
|
60
|
-
maxWidth="90%"
|
|
61
|
-
p="$3"
|
|
62
|
-
gap="$2"
|
|
63
|
-
bg="$color2"
|
|
64
|
-
borderWidth={1}
|
|
65
|
-
borderColor="$borderColor"
|
|
66
|
-
borderLeftWidth={3}
|
|
67
|
-
borderLeftColor={accent}
|
|
68
|
-
rounded="$4"
|
|
69
|
-
elevation="$2"
|
|
70
|
-
>
|
|
71
|
-
<XStack gap="$2.5" items="flex-start">
|
|
72
|
-
<YStack pt={1}>
|
|
73
|
-
<Icon size={18} color={accent} />
|
|
74
|
-
</YStack>
|
|
75
|
-
<YStack flex={1} gap="$1">
|
|
76
|
-
<Text fontSize="$3" fontWeight="700" color="$color12">
|
|
77
|
-
{t.title}
|
|
78
|
-
</Text>
|
|
79
|
-
{t.description ? (
|
|
80
|
-
<Text fontSize="$2" color="$color11">
|
|
81
|
-
{t.description}
|
|
82
|
-
</Text>
|
|
83
|
-
) : null}
|
|
84
|
-
</YStack>
|
|
85
|
-
<Button size="$1" chromeless icon={<X size={14} />} onPress={onClose} aria-label="Dismiss" />
|
|
86
|
-
</XStack>
|
|
87
|
-
</Card>
|
|
88
|
-
)
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
/** Portalled, fixed top-right stack. Rendered only after mount (SSR-safe). */
|
|
92
|
-
function ToastViewport({ toasts, dismiss }: { toasts: Toast[]; dismiss: (id: number) => void }) {
|
|
93
|
-
const [mounted, setMounted] = useState(false)
|
|
94
|
-
useEffect(() => setMounted(true), [])
|
|
95
|
-
if (!mounted || typeof document === 'undefined') return null
|
|
96
|
-
return createPortal(
|
|
97
|
-
<div style={{ position: 'fixed', top: 16, right: 16, zIndex: 100000, pointerEvents: 'none' }}>
|
|
98
|
-
<YStack gap="$2" items="flex-end">
|
|
99
|
-
{toasts.map((t) => (
|
|
100
|
-
<YStack key={t.id} pointerEvents="auto">
|
|
101
|
-
<ToastCard t={t} onClose={() => dismiss(t.id)} />
|
|
102
|
-
</YStack>
|
|
103
|
-
))}
|
|
104
|
-
</YStack>
|
|
105
|
-
</div>,
|
|
106
|
-
document.body,
|
|
107
|
-
)
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
export function ToastProvider({ children }: { children: ReactNode }) {
|
|
111
|
-
const [toasts, setToasts] = useState<Toast[]>([])
|
|
112
|
-
const timers = useRef(new Map<number, ReturnType<typeof setTimeout>>())
|
|
113
|
-
const seq = useRef(0)
|
|
114
|
-
|
|
115
|
-
const dismiss = useCallback((id: number) => {
|
|
116
|
-
setToasts((ts) => ts.filter((t) => t.id !== id))
|
|
117
|
-
const timer = timers.current.get(id)
|
|
118
|
-
if (timer) {
|
|
119
|
-
clearTimeout(timer)
|
|
120
|
-
timers.current.delete(id)
|
|
121
|
-
}
|
|
122
|
-
}, [])
|
|
123
|
-
|
|
124
|
-
const toast = useCallback(
|
|
125
|
-
(input: ToastInput) => {
|
|
126
|
-
const id = ++seq.current
|
|
127
|
-
const kind = input.kind ?? 'info'
|
|
128
|
-
const durationMs = input.durationMs ?? (kind === 'error' ? 6000 : 3500)
|
|
129
|
-
setToasts((ts) => [...ts, { id, kind, title: input.title, description: input.description, durationMs }])
|
|
130
|
-
if (durationMs > 0) {
|
|
131
|
-
timers.current.set(
|
|
132
|
-
id,
|
|
133
|
-
setTimeout(() => dismiss(id), durationMs),
|
|
134
|
-
)
|
|
135
|
-
}
|
|
136
|
-
},
|
|
137
|
-
[dismiss],
|
|
138
|
-
)
|
|
139
|
-
|
|
140
|
-
// Clear any pending timers on unmount.
|
|
141
|
-
useEffect(() => {
|
|
142
|
-
const map = timers.current
|
|
143
|
-
return () => map.forEach((t) => clearTimeout(t))
|
|
144
|
-
}, [])
|
|
145
|
-
|
|
146
|
-
const api: ToastApi = {
|
|
147
|
-
toast,
|
|
148
|
-
success: (title, description) => toast({ title, description, kind: 'success' }),
|
|
149
|
-
error: (title, description) => toast({ title, description, kind: 'error' }),
|
|
150
|
-
info: (title, description) => toast({ title, description, kind: 'info' }),
|
|
151
|
-
dismiss,
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
return (
|
|
155
|
-
<ToastContext.Provider value={api}>
|
|
156
|
-
{children}
|
|
157
|
-
<ToastViewport toasts={toasts} dismiss={dismiss} />
|
|
158
|
-
</ToastContext.Provider>
|
|
159
|
-
)
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
export function useToast(): ToastApi {
|
|
163
|
-
const ctx = useContext(ToastContext)
|
|
164
|
-
if (!ctx) throw new Error('useToast must be used within <ToastProvider>')
|
|
165
|
-
return ctx
|
|
166
|
-
}
|
package/src/product/color.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { ComponentType } from 'react'
|
|
2
|
-
import type { GetThemeValueForKey } from '@hanzo/gui'
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Bridge between raw CSS colors (product hex accents) and Gui's typed `color`
|
|
6
|
-
* prop. Gui types `color` as a theme-token template (`$color12`, …), but ANY CSS
|
|
7
|
-
* color is valid at runtime — so tinting an icon with a product hex needs one
|
|
8
|
-
* sanctioned cast, in ONE place, rather than `as any` scattered around.
|
|
9
|
-
*/
|
|
10
|
-
export type IconColor = GetThemeValueForKey<'color'>
|
|
11
|
-
|
|
12
|
-
/** Cast a raw CSS color (e.g. `#5E6AD2`) to Gui's `color` prop type. */
|
|
13
|
-
export const asColor = (hex: string): IconColor => hex as unknown as IconColor
|
|
14
|
-
|
|
15
|
-
/** A lucide/Gui icon component that accepts a size + a (token-or-cast) color —
|
|
16
|
-
* the shape the shell passes around for product/nav icons. */
|
|
17
|
-
export type IconLike = ComponentType<{ size?: number; color?: IconColor }>
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect } from 'vitest'
|
|
2
|
-
|
|
3
|
-
import { filterOptions, isKnownOption, type ComboOption } from './filter'
|
|
4
|
-
|
|
5
|
-
const opts: ComboOption[] = [
|
|
6
|
-
{ value: 'zen-omni', label: 'Zen Omni', hint: 'hanzo' },
|
|
7
|
-
{ value: 'gpt-4o-mini', label: 'GPT-4o mini', hint: 'openai' },
|
|
8
|
-
{ value: 'claude-sonnet-4-5', hint: 'anthropic' },
|
|
9
|
-
]
|
|
10
|
-
|
|
11
|
-
describe('filterOptions', () => {
|
|
12
|
-
it('returns every option for an empty / whitespace query', () => {
|
|
13
|
-
expect(filterOptions(opts, '')).toHaveLength(3)
|
|
14
|
-
expect(filterOptions(opts, ' ')).toHaveLength(3)
|
|
15
|
-
})
|
|
16
|
-
|
|
17
|
-
it('matches on value (case-insensitive substring)', () => {
|
|
18
|
-
expect(filterOptions(opts, 'ZEN').map((o) => o.value)).toEqual(['zen-omni'])
|
|
19
|
-
expect(filterOptions(opts, 'sonnet').map((o) => o.value)).toEqual(['claude-sonnet-4-5'])
|
|
20
|
-
})
|
|
21
|
-
|
|
22
|
-
it('matches on label', () => {
|
|
23
|
-
expect(filterOptions(opts, 'GPT-4o').map((o) => o.value)).toEqual(['gpt-4o-mini'])
|
|
24
|
-
})
|
|
25
|
-
|
|
26
|
-
it('matches on hint (the provider)', () => {
|
|
27
|
-
expect(filterOptions(opts, 'anthropic').map((o) => o.value)).toEqual(['claude-sonnet-4-5'])
|
|
28
|
-
expect(filterOptions(opts, 'openai').map((o) => o.value)).toEqual(['gpt-4o-mini'])
|
|
29
|
-
})
|
|
30
|
-
|
|
31
|
-
it('returns nothing when nothing matches (the typed value is still usable by the caller)', () => {
|
|
32
|
-
expect(filterOptions(opts, 'llama')).toEqual([])
|
|
33
|
-
})
|
|
34
|
-
|
|
35
|
-
it('treats the query as a LITERAL string, never a regex (no ReDoS / injection)', () => {
|
|
36
|
-
// A regex-special query must match literally (or not at all) — never be compiled.
|
|
37
|
-
expect(filterOptions(opts, '.*')).toEqual([]) // no option literally contains ".*"
|
|
38
|
-
expect(filterOptions(opts, '(')).toEqual([]) // an unbalanced paren would throw if compiled
|
|
39
|
-
expect(filterOptions(opts, '[a-z')).toEqual([]) // an invalid char class would throw if compiled
|
|
40
|
-
// A literal hyphen (regex-benign but proves substring semantics):
|
|
41
|
-
expect(filterOptions(opts, '4o-mini').map((o) => o.value)).toEqual(['gpt-4o-mini'])
|
|
42
|
-
})
|
|
43
|
-
})
|
|
44
|
-
|
|
45
|
-
describe('isKnownOption', () => {
|
|
46
|
-
it('is true only for an exact value match (case-sensitive)', () => {
|
|
47
|
-
expect(isKnownOption(opts, 'zen-omni')).toBe(true)
|
|
48
|
-
expect(isKnownOption(opts, 'ZEN-OMNI')).toBe(false)
|
|
49
|
-
expect(isKnownOption(opts, 'custom-model')).toBe(false)
|
|
50
|
-
})
|
|
51
|
-
})
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Combobox option filtering — pure, unit-tested.
|
|
3
|
-
*
|
|
4
|
-
* The ONE matcher the ComboBox uses to narrow a live option list against typed
|
|
5
|
-
* text. Matching is a LITERAL, case-insensitive substring over the option's
|
|
6
|
-
* value + label + hint — NEVER a compiled RegExp of user input (that would be a
|
|
7
|
-
* ReDoS / injection surface; the whole codebase filters with literal `includes`,
|
|
8
|
-
* e.g. marketplace/logic + filterOrgs). Kept dependency-free so it lifts into
|
|
9
|
-
* `@hanzo/ui` alongside the ComboBox.
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
/** One option in a combobox list. `value` is what gets committed; label/hint are display. */
|
|
13
|
-
export type ComboOption = {
|
|
14
|
-
/** The value committed to the field when this option is chosen. */
|
|
15
|
-
value: string
|
|
16
|
-
/** Display label (defaults to `value`). */
|
|
17
|
-
label?: string
|
|
18
|
-
/** Optional secondary text (e.g. a provider, a description) — also searched. */
|
|
19
|
-
hint?: string
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/** The searchable haystack for one option (value + label + hint), lowercased. */
|
|
23
|
-
const hay = (o: ComboOption): string => `${o.value} ${o.label ?? ''} ${o.hint ?? ''}`.toLowerCase()
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Filter `options` by `query` — a literal, case-insensitive substring over
|
|
27
|
-
* value/label/hint. An empty/whitespace query returns every option (no filter).
|
|
28
|
-
* PURE. The input is treated as a plain string, never a pattern.
|
|
29
|
-
*/
|
|
30
|
-
export function filterOptions(options: ComboOption[], query: string): ComboOption[] {
|
|
31
|
-
const q = query.trim().toLowerCase()
|
|
32
|
-
if (!q) return options
|
|
33
|
-
return options.filter((o) => hay(o).includes(q))
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/** True iff `value` exactly matches an option's `value` (case-sensitive). */
|
|
37
|
-
export function isKnownOption(options: ComboOption[], value: string): boolean {
|
|
38
|
-
return options.some((o) => o.value === value)
|
|
39
|
-
}
|
package/src/product/index.ts
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
// @hanzo/ui/product — the product/app component layer on @hanzo/gui.
|
|
2
|
-
//
|
|
3
|
-
// Charts, metrics, page headers, status tags, rich empty states, combobox,
|
|
4
|
-
// slide-over, toasts, drag-reorder, labeled field rows, provider/product marks,
|
|
5
|
-
// theme toggle. Presentational + host-agnostic: data and effects are INJECTED as
|
|
6
|
-
// props — nothing here imports an app's `~/lib`. Cross-platform (web + native +
|
|
7
|
-
// desktop) because it builds only on @hanzo/gui primitives. Clean-room.
|
|
8
|
-
//
|
|
9
|
-
// Single collision-free namespace: where a name exists in two files the canonical
|
|
10
|
-
// (Charts) keeps the name and the variant is aliased, so NOTHING is dropped.
|
|
11
|
-
|
|
12
|
-
// Charts — the canonical Sparkline + Donut live here (dependency-free inline SVG:
|
|
13
|
-
// hover tooltips, axis ticks, honest null under 2 real points).
|
|
14
|
-
export * from './Charts'
|
|
15
|
-
|
|
16
|
-
// Metric — resource-console stat tiles/panels/bars. Its own near-identical
|
|
17
|
-
// Sparkline is preserved as `MetricSparkline` (zero loss; see CONSOLIDATION.md
|
|
18
|
-
// for the eventual single-Sparkline dedup).
|
|
19
|
-
export {
|
|
20
|
-
SERIES,
|
|
21
|
-
colorForIndex,
|
|
22
|
-
utilColor,
|
|
23
|
-
Sparkline as MetricSparkline,
|
|
24
|
-
MiniBars,
|
|
25
|
-
UtilBar,
|
|
26
|
-
LegendDot,
|
|
27
|
-
MetricCard,
|
|
28
|
-
HintButton,
|
|
29
|
-
Panel,
|
|
30
|
-
} from './Metric'
|
|
31
|
-
|
|
32
|
-
// Standalone dependency-free ring — aliased to avoid the Charts.Donut clash.
|
|
33
|
-
export { Donut as DonutRing, type DonutSegment } from './Donut'
|
|
34
|
-
|
|
35
|
-
// ComboBox — the typeable select. `ComboOption` comes from the ONE pure filter
|
|
36
|
-
// module (ReDoS-safe literal substring), so export the component here and the
|
|
37
|
-
// option type + matchers from there.
|
|
38
|
-
export { ComboBox } from './ComboBox'
|
|
39
|
-
export * from './combobox/filter'
|
|
40
|
-
|
|
41
|
-
// The shared shell — brand mark, org scope + switcher, app header (the
|
|
42
|
-
// console's org-scope contract + switcher hoisted here; hanzoai/ui#36).
|
|
43
|
-
// `surfaces.data` is the ONE canonical cross-surface list every launcher consumes.
|
|
44
|
-
export * from './surfaces.data'
|
|
45
|
-
export * from './AppHeader'
|
|
46
|
-
export * from './BrandMark'
|
|
47
|
-
export * from './OrgSwitcher'
|
|
48
|
-
export * from './scope'
|
|
49
|
-
|
|
50
|
-
// The rest — every exported name below is unique across the layer.
|
|
51
|
-
export * from './DataTable'
|
|
52
|
-
export * from './EmptyState'
|
|
53
|
-
export * from './FadeIn'
|
|
54
|
-
export * from './Field'
|
|
55
|
-
export * from './HanzoMark'
|
|
56
|
-
export * from './PageHeader'
|
|
57
|
-
export * from './PrimaryButton'
|
|
58
|
-
export * from './ProductIcon'
|
|
59
|
-
export * from './ProviderLogo'
|
|
60
|
-
export * from './Reorder'
|
|
61
|
-
export * from './SelectMenu'
|
|
62
|
-
export * from './SlideOver'
|
|
63
|
-
export * from './StatusTag'
|
|
64
|
-
export * from './ThemeToggle'
|
|
65
|
-
export * from './Toast'
|
|
66
|
-
export * from './color'
|
|
67
|
-
|
|
68
|
-
// Usage — the canonical AI-usage surface (totals, chart, spend-by-model, activity)
|
|
69
|
-
// now lives in ONE home: `@hanzo/usage/panel` (<UsagePanel>). The former meter/card/
|
|
70
|
-
// dashboard kit here was orphaned (zero consumers) and folded into it.
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from 'vitest'
|
|
2
|
-
|
|
3
|
-
import { filterOrgs, orgScope } from './scope'
|
|
4
|
-
|
|
5
|
-
/** In-memory Storage double. */
|
|
6
|
-
function memory(): Pick<Storage, 'getItem' | 'setItem' | 'removeItem'> {
|
|
7
|
-
const m = new Map<string, string>()
|
|
8
|
-
return {
|
|
9
|
-
getItem: (k) => m.get(k) ?? null,
|
|
10
|
-
setItem: (k, v) => void m.set(k, v),
|
|
11
|
-
removeItem: (k) => void m.delete(k),
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
function harness() {
|
|
16
|
-
const calls: string[] = []
|
|
17
|
-
const scope = orgScope({
|
|
18
|
-
brandOrg: 'hanzo',
|
|
19
|
-
storage: memory(),
|
|
20
|
-
navigate: (path) => calls.push(`nav:${path}`),
|
|
21
|
-
reload: () => calls.push('reload'),
|
|
22
|
-
})
|
|
23
|
-
return { scope, calls }
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
describe('orgScope', () => {
|
|
27
|
-
it('defaults to the brand org, un-selected', () => {
|
|
28
|
-
const { scope } = harness()
|
|
29
|
-
expect(scope.currentOrg()).toBe('hanzo')
|
|
30
|
-
expect(scope.isScopedAway()).toBe(false)
|
|
31
|
-
expect(scope.hasSelectedOrg()).toBe(false)
|
|
32
|
-
})
|
|
33
|
-
|
|
34
|
-
it('setCurrentOrg persists; the brand org clears the override', () => {
|
|
35
|
-
const { scope } = harness()
|
|
36
|
-
scope.setCurrentOrg('acme')
|
|
37
|
-
expect(scope.currentOrg()).toBe('acme')
|
|
38
|
-
expect(scope.isScopedAway()).toBe(true)
|
|
39
|
-
scope.setCurrentOrg('hanzo')
|
|
40
|
-
expect(scope.currentOrg()).toBe('hanzo')
|
|
41
|
-
expect(scope.isScopedAway()).toBe(false)
|
|
42
|
-
})
|
|
43
|
-
|
|
44
|
-
it('enterOrg selects + scopes + navigates home', () => {
|
|
45
|
-
const { scope, calls } = harness()
|
|
46
|
-
scope.enterOrg('acme')
|
|
47
|
-
expect(scope.currentOrg()).toBe('acme')
|
|
48
|
-
expect(scope.hasSelectedOrg()).toBe(true)
|
|
49
|
-
expect(calls).toEqual(['nav:/'])
|
|
50
|
-
})
|
|
51
|
-
|
|
52
|
-
it('leaveOrg de-selects, resets to the brand org, navigates home', () => {
|
|
53
|
-
const { scope, calls } = harness()
|
|
54
|
-
scope.enterOrg('acme')
|
|
55
|
-
scope.leaveOrg()
|
|
56
|
-
expect(scope.currentOrg()).toBe('hanzo')
|
|
57
|
-
expect(scope.hasSelectedOrg()).toBe(false)
|
|
58
|
-
expect(calls).toEqual(['nav:/', 'nav:/'])
|
|
59
|
-
})
|
|
60
|
-
|
|
61
|
-
it('switchOrg persists, keeps the selection, reloads; same org is a no-op', () => {
|
|
62
|
-
const { scope, calls } = harness()
|
|
63
|
-
scope.enterOrg('acme')
|
|
64
|
-
scope.switchOrg('zoo')
|
|
65
|
-
expect(scope.currentOrg()).toBe('zoo')
|
|
66
|
-
expect(scope.hasSelectedOrg()).toBe(true)
|
|
67
|
-
expect(calls).toEqual(['nav:/', 'reload'])
|
|
68
|
-
scope.switchOrg('zoo')
|
|
69
|
-
expect(calls).toEqual(['nav:/', 'reload'])
|
|
70
|
-
})
|
|
71
|
-
|
|
72
|
-
it('two scopes with different keys never collide', () => {
|
|
73
|
-
const store = memory()
|
|
74
|
-
const a = orgScope({ brandOrg: 'hanzo', key: 'a', storage: store })
|
|
75
|
-
const b = orgScope({ brandOrg: 'hanzo', key: 'b', storage: store })
|
|
76
|
-
a.setCurrentOrg('acme')
|
|
77
|
-
expect(b.currentOrg()).toBe('hanzo')
|
|
78
|
-
})
|
|
79
|
-
})
|
|
80
|
-
|
|
81
|
-
describe('filterOrgs', () => {
|
|
82
|
-
const orgs = [
|
|
83
|
-
{ name: 'acme', displayName: 'Acme Corp' },
|
|
84
|
-
{ name: 'zoo', displayName: 'Zoo Labs' },
|
|
85
|
-
]
|
|
86
|
-
it('matches name and displayName, case-insensitive; blank returns all', () => {
|
|
87
|
-
expect(filterOrgs(orgs, '')).toHaveLength(2)
|
|
88
|
-
expect(filterOrgs(orgs, 'ACME')).toEqual([orgs[0]])
|
|
89
|
-
expect(filterOrgs(orgs, 'labs')).toEqual([orgs[1]])
|
|
90
|
-
expect(filterOrgs(orgs, 'nope')).toEqual([])
|
|
91
|
-
})
|
|
92
|
-
})
|
package/src/product/scope.ts
DELETED
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* orgScope — the active-organization contract every Hanzo surface shares
|
|
3
|
-
* (hoisted from the console; see hanzoai/ui#36).
|
|
4
|
-
*
|
|
5
|
-
* Brand identity (which IAM you log into, the wordmark + logo) is fixed per
|
|
6
|
-
* host; the DATA scope — which org's identity, secrets and resources the app
|
|
7
|
-
* acts on — is orthogonal. This module owns only that switch. Every
|
|
8
|
-
* tenant-scoped call reads `currentOrg()` and stamps it as `X-Org-Id`.
|
|
9
|
-
*
|
|
10
|
-
* Two-level model: the org VALUE (which org) and the SELECTION (has one been
|
|
11
|
-
* chosen yet) are orthogonal. A fresh login is org-LESS: `hasSelectedOrg()` is
|
|
12
|
-
* false so the host can show its org picker even for a one-org user. Entering
|
|
13
|
-
* (`enterOrg`) sets value + flag and navigates home; leaving (`leaveOrg`)
|
|
14
|
-
* clears the flag back to the picker; the in-shell quick switch (`switchOrg`)
|
|
15
|
-
* persists and reloads so every module refetches under the new `X-Org-Id`.
|
|
16
|
-
*
|
|
17
|
-
* Host-agnostic: storage + navigation are injected (browser defaults), so the
|
|
18
|
-
* same contract runs in Next, Vite, Svelte or a test.
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
export type Org = { name: string; displayName?: string; logo?: string }
|
|
22
|
-
|
|
23
|
-
export type OrgScopeConfig = {
|
|
24
|
-
/** The brand's own org — the default scope (e.g. `config.iamOrgName`). */
|
|
25
|
-
brandOrg: string
|
|
26
|
-
/** Storage key namespace — ONE per surface. Default `'hanzo.org'`. */
|
|
27
|
-
key?: string
|
|
28
|
-
/** Storage — defaults to `window.localStorage`, null-safe on SSR/blocked. */
|
|
29
|
-
storage?: Pick<Storage, 'getItem' | 'setItem' | 'removeItem'>
|
|
30
|
-
/** Navigate to a path (enter/leave land on home). Default `location.assign`. */
|
|
31
|
-
navigate?: (path: string) => void
|
|
32
|
-
/** Hard reload (quick-switch refetches everything). Default `location.reload`. */
|
|
33
|
-
reload?: () => void
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export type OrgScope = {
|
|
37
|
-
/** The org the surface is currently scoped to (default: the brand org). */
|
|
38
|
-
currentOrg(): string
|
|
39
|
-
/** Switch the active scope. Passing the brand org clears the override. */
|
|
40
|
-
setCurrentOrg(org: string): void
|
|
41
|
-
/** True when scoped to a non-default (switched) org. */
|
|
42
|
-
isScopedAway(): boolean
|
|
43
|
-
/** True once an org has been explicitly ENTERED (picker → shell). */
|
|
44
|
-
hasSelectedOrg(): boolean
|
|
45
|
-
/** Enter an org from the picker: scope + select + navigate home. */
|
|
46
|
-
enterOrg(org: string): void
|
|
47
|
-
/** Leave the org (back to the picker): de-select + reset + navigate home. */
|
|
48
|
-
leaveOrg(): void
|
|
49
|
-
/** In-shell quick switch: persist + keep selection + reload. Same org: no-op. */
|
|
50
|
-
switchOrg(org: string): void
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
function browserStorage(): Pick<Storage, 'getItem' | 'setItem' | 'removeItem'> | null {
|
|
54
|
-
if (typeof window === 'undefined') return null
|
|
55
|
-
try {
|
|
56
|
-
return window.localStorage
|
|
57
|
-
} catch {
|
|
58
|
-
return null
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export function orgScope(config: OrgScopeConfig): OrgScope {
|
|
63
|
-
const key = config.key ?? 'hanzo.org'
|
|
64
|
-
const selectedKey = `${key}.selected`
|
|
65
|
-
const store = () => config.storage ?? browserStorage()
|
|
66
|
-
const read = (k: string): string | null => {
|
|
67
|
-
try {
|
|
68
|
-
return store()?.getItem(k) ?? null
|
|
69
|
-
} catch {
|
|
70
|
-
return null
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
const write = (k: string, v: string | null): void => {
|
|
74
|
-
try {
|
|
75
|
-
if (v === null) store()?.removeItem(k)
|
|
76
|
-
else store()?.setItem(k, v)
|
|
77
|
-
} catch {
|
|
78
|
-
// Storage blocked — the scope simply stays at the brand org.
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
const goHome = () => {
|
|
82
|
-
if (config.navigate) return config.navigate('/')
|
|
83
|
-
if (typeof window !== 'undefined') window.location.assign('/')
|
|
84
|
-
}
|
|
85
|
-
const doReload = () => {
|
|
86
|
-
if (config.reload) return config.reload()
|
|
87
|
-
if (typeof window !== 'undefined') window.location.reload()
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
const scope: OrgScope = {
|
|
91
|
-
currentOrg: () => read(key) || config.brandOrg,
|
|
92
|
-
setCurrentOrg: (org) => write(key, !org || org === config.brandOrg ? null : org),
|
|
93
|
-
isScopedAway: () => scope.currentOrg() !== config.brandOrg,
|
|
94
|
-
hasSelectedOrg: () => read(selectedKey) === '1',
|
|
95
|
-
enterOrg: (org) => {
|
|
96
|
-
if (!org) return
|
|
97
|
-
scope.setCurrentOrg(org)
|
|
98
|
-
write(selectedKey, '1')
|
|
99
|
-
goHome()
|
|
100
|
-
},
|
|
101
|
-
leaveOrg: () => {
|
|
102
|
-
write(selectedKey, null)
|
|
103
|
-
scope.setCurrentOrg(config.brandOrg)
|
|
104
|
-
goHome()
|
|
105
|
-
},
|
|
106
|
-
switchOrg: (org) => {
|
|
107
|
-
if (!org || org === scope.currentOrg()) return
|
|
108
|
-
scope.setCurrentOrg(org)
|
|
109
|
-
write(selectedKey, '1')
|
|
110
|
-
doReload()
|
|
111
|
-
},
|
|
112
|
-
}
|
|
113
|
-
return scope
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
/** Case-insensitive filter over org name + display name (the switcher search). */
|
|
117
|
-
export function filterOrgs<T extends Org>(orgs: T[], query: string): T[] {
|
|
118
|
-
const q = query.trim().toLowerCase()
|
|
119
|
-
if (!q) return orgs
|
|
120
|
-
return orgs.filter(
|
|
121
|
-
(o) => o.name.toLowerCase().includes(q) || (o.displayName ?? '').toLowerCase().includes(q),
|
|
122
|
-
)
|
|
123
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
// The ONE canonical list of Hanzo product surfaces the cross-surface app switcher
|
|
2
|
-
// offers — consumed by EVERY surface's launcher so the set never diverges.
|
|
3
|
-
//
|
|
4
|
-
// Framework-agnostic (plain TS, zero imports): React consumers (the @hanzo/ui
|
|
5
|
-
// `AppHeader`, the console `AppLauncher`) import it directly; a surface that
|
|
6
|
-
// cannot resolve THIS package — the Svelte Huly-fork `team` (whose own `@hanzo/ui`
|
|
7
|
-
// is the workbench UI framework, a name clash) and the shadcn-aliased `app` — keeps
|
|
8
|
-
// a byte-identical MIRROR that points back here. Add or reorder a surface HERE and
|
|
9
|
-
// every launcher moves together (mirrors are updated in the same change).
|
|
10
|
-
//
|
|
11
|
-
// `id` is the stable key AND the icon key: each framework maps it to its own glyph
|
|
12
|
-
// (React → lucide, Svelte → SurfaceIcon), so the DATA itself stays glyph-free.
|
|
13
|
-
|
|
14
|
-
export type SurfaceId = 'ai' | 'console' | 'app' | 'chat' | 'bot' | 'team' | 'billing'
|
|
15
|
-
|
|
16
|
-
/** One Hanzo surface the app switcher offers. */
|
|
17
|
-
export type Surface = {
|
|
18
|
-
/** Stable id; also the per-surface icon key. */
|
|
19
|
-
id: SurfaceId
|
|
20
|
-
/** Menu label. */
|
|
21
|
-
label: string
|
|
22
|
-
/** Absolute product URL (opened in a new tab). */
|
|
23
|
-
href: string
|
|
24
|
-
/** The domain, shown as the tile subtitle. */
|
|
25
|
-
hint: string
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/** The seven Hanzo surfaces (`console` opens the cloud AI console). */
|
|
29
|
-
export const SURFACES: Surface[] = [
|
|
30
|
-
{ id: 'ai', label: 'Hanzo AI', href: 'https://hanzo.ai', hint: 'hanzo.ai' },
|
|
31
|
-
{ id: 'console', label: 'Console', href: 'https://console.hanzo.ai', hint: 'console.hanzo.ai' },
|
|
32
|
-
{ id: 'app', label: 'App', href: 'https://hanzo.app', hint: 'hanzo.app' },
|
|
33
|
-
{ id: 'chat', label: 'Chat', href: 'https://hanzo.chat', hint: 'hanzo.chat' },
|
|
34
|
-
{ id: 'bot', label: 'Bot', href: 'https://hanzo.bot', hint: 'hanzo.bot' },
|
|
35
|
-
{ id: 'team', label: 'Team', href: 'https://hanzo.team', hint: 'hanzo.team' },
|
|
36
|
-
{ id: 'billing', label: 'Billing', href: 'https://billing.hanzo.ai', hint: 'billing.hanzo.ai' },
|
|
37
|
-
]
|
|
38
|
-
|
|
39
|
-
/** Every surface except `current` — a launcher never links to itself. */
|
|
40
|
-
export function otherSurfaces(current?: SurfaceId): Surface[] {
|
|
41
|
-
return current ? SURFACES.filter((s) => s.id !== current) : SURFACES
|
|
42
|
-
}
|
package/src/usage.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
// @hanzo/ui/usage — the shared AI-usage surface (the meter bar → provider card →
|
|
2
|
-
// dashboard progression), re-exported from its home package @hanzo/usage. Thin
|
|
3
|
-
// subpath so every console shows the same quota UI:
|
|
4
|
-
//
|
|
5
|
-
// import { UsageMeter, UsageProviderCard, UsageDashboard } from '@hanzo/ui/usage'
|
|
6
|
-
//
|
|
7
|
-
// Optional peer — only pulled when the subpath is used.
|
|
8
|
-
export * from '@hanzo/usage'
|
package/src/wallet.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// @hanzo/ui/wallet — the ONE wallet surface, re-exported from its home module
|
|
2
|
-
// @hanzo/ui-shadcn/wallet. `WalletMenu` is presentation only (address, PQ
|
|
3
|
-
// identity, selected-network alignment, explorer link, connect/disconnect);
|
|
4
|
-
// custody lives in the injected `WalletAdapter` (desktop wallet, web EIP-1193).
|
|
5
|
-
// Thin subpath so every console imports the same wallet surface:
|
|
6
|
-
//
|
|
7
|
-
// import { WalletMenu, injectedEvmAdapter, walletAvailable, ensureEvmNetwork,
|
|
8
|
-
// shortAddress, type WalletAdapter } from '@hanzo/ui/wallet'
|
|
9
|
-
//
|
|
10
|
-
// Optional peer — only pulled when the subpath is used.
|
|
11
|
-
export * from '@hanzo/ui-shadcn/wallet'
|
package/types/billing.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"billing.d.ts","sourceRoot":"","sources":["../src/billing.ts"],"names":[],"mappings":"AAQA,cAAc,0BAA0B,CAAA"}
|
package/types/canvas.d.ts
DELETED
package/types/canvas.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"canvas.d.ts","sourceRoot":"","sources":["../src/canvas.ts"],"names":[],"mappings":"AAUA,cAAc,eAAe,CAAA"}
|
package/types/cd/layout.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../src/cd/layout.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAA;IACV,gEAAgE;IAChE,CAAC,EAAE,MAAM,CAAA;CACV;AAED,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,aAAa;IAC5B,sEAAsE;IACtE,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,wEAAwE;IACxE,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,sDAAsD;IACtD,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAA;IACV,2BAA2B;IAC3B,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;IACT,C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,MAAM,EAAE,UAAU,GAAG,WAAW,CAGzD;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,cAAc,GAAG,WAAW,CAGjE;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,QAAQ,GAAG,WAAW,CAGrD;AAED,2EAA2E;AAC3E,wBAAgB,OAAO,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,CAEhD;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,YAAY,EAAE,GAAG,YAAY,CAKlE;AAED,4EAA4E;AAC5E,wBAAgB,SAAS,CAAC,QAAQ,EAAE,UAAU,EAAE,GAAG,UAAU,CAK5D;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAU5D"}
|
package/types/cd/time.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"time.d.ts","sourceRoot":"","sources":["../../src/cd/time.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,EAClC,GAAG,GAAE,MAAmB,GACvB,MAAM,CAmBR;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,MAAM,GAAG,SAAS,CASnF;AAED,0EAA0E;AAC1E,wBAAgB,cAAc,CAC5B,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,IAAI,EACrC,GAAG,GAAE,MAAmB,GACvB,MAAM,CAER"}
|
package/types/cd/types.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/cd/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAMH;;;GAGG;AACH,MAAM,MAAM,YAAY,G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