@yuhuanowo/yunui 0.2.12 → 0.2.14
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/ai.d.ts +109 -1
- package/dist/ai.js +451 -64
- package/dist/ai.js.map +1 -1
- package/dist/{chunk-TFZKMJGF.js → chunk-GHO4RCDR.js} +5 -5
- package/dist/{chunk-TFZKMJGF.js.map → chunk-GHO4RCDR.js.map} +1 -1
- package/dist/{chunk-BO6CDGJS.js → chunk-N53PNMPJ.js} +3 -3
- package/dist/chunk-N53PNMPJ.js.map +1 -0
- package/dist/{chunk-65XAR7FY.js → chunk-VXFEANVX.js} +128 -84
- package/dist/chunk-VXFEANVX.js.map +1 -0
- package/dist/index.d.ts +24 -5
- package/dist/index.js +2 -2
- package/dist/patterns.d.ts +220 -3
- package/dist/patterns.js +468 -57
- package/dist/patterns.js.map +1 -1
- package/package.json +1 -1
- package/styles/yunui.css +161 -31
- package/dist/chunk-65XAR7FY.js.map +0 -1
- package/dist/chunk-BO6CDGJS.js.map +0 -1
package/dist/ai.d.ts
CHANGED
|
@@ -55,6 +55,102 @@ interface ModelCardProps {
|
|
|
55
55
|
/** Card summarizing an AI model: icon, name, capability chips, id badges, description, and a developer/context/tier/price footer. */
|
|
56
56
|
declare function ModelCard({ name, icon, ids, description, capabilities, developer, context, tier, price, nonofficial, suspended, labels, onClick, className, }: ModelCardProps): React.JSX.Element;
|
|
57
57
|
|
|
58
|
+
interface ModelSelectOption {
|
|
59
|
+
/** Stable id used as the value. */
|
|
60
|
+
id: string;
|
|
61
|
+
/** Display name (trigger label + primary search corpus). */
|
|
62
|
+
label: string;
|
|
63
|
+
/** Group key — models are grouped and provider-filtered by this. */
|
|
64
|
+
group: string;
|
|
65
|
+
/** Human label for the group (defaults to `group`). */
|
|
66
|
+
groupLabel?: string;
|
|
67
|
+
/** Extra text folded into search (ids, aliases, owner). */
|
|
68
|
+
searchText?: string;
|
|
69
|
+
/** Leading model icon (trigger + row). */
|
|
70
|
+
icon?: ReactNode;
|
|
71
|
+
/** Group/provider icon (filter chip + group header). */
|
|
72
|
+
groupIcon?: ReactNode;
|
|
73
|
+
/** Inline capability glyphs shown after the name. */
|
|
74
|
+
badges?: ReactNode;
|
|
75
|
+
/** Secondary line under the name (ids/aliases/pricing). */
|
|
76
|
+
detail?: ReactNode;
|
|
77
|
+
/** Right-aligned meta chip(s) (context length / max tokens). */
|
|
78
|
+
meta?: ReactNode;
|
|
79
|
+
disabled?: boolean;
|
|
80
|
+
}
|
|
81
|
+
/** A capability filter chip; `match` decides whether an option passes it. */
|
|
82
|
+
interface ModelSelectFilter {
|
|
83
|
+
key: string;
|
|
84
|
+
/** Chip content (e.g. a capability badge). */
|
|
85
|
+
node: ReactNode;
|
|
86
|
+
title?: string;
|
|
87
|
+
/** Whether an option satisfies this filter (all active filters must pass). */
|
|
88
|
+
match: (option: ModelSelectOption) => boolean;
|
|
89
|
+
}
|
|
90
|
+
interface ModelSelectLabels {
|
|
91
|
+
placeholder?: string;
|
|
92
|
+
search?: string;
|
|
93
|
+
clearSearch?: string;
|
|
94
|
+
clearFilters?: string;
|
|
95
|
+
all?: string;
|
|
96
|
+
pinned?: string;
|
|
97
|
+
noResults?: string;
|
|
98
|
+
}
|
|
99
|
+
interface ModelSelectProps {
|
|
100
|
+
options: ModelSelectOption[];
|
|
101
|
+
/** Selected option id. */
|
|
102
|
+
value: string;
|
|
103
|
+
onChange: (id: string) => void;
|
|
104
|
+
className?: string;
|
|
105
|
+
labels?: ModelSelectLabels;
|
|
106
|
+
/** Controlled pinned ids. Pass with `onTogglePin` to show the pin column. */
|
|
107
|
+
pinned?: string[];
|
|
108
|
+
onTogglePin?: (id: string) => void;
|
|
109
|
+
/** Capability filter chips. */
|
|
110
|
+
filters?: ModelSelectFilter[];
|
|
111
|
+
/** Optional footer bar; receives the current (filtered) result count. */
|
|
112
|
+
renderFooter?: (count: number) => ReactNode;
|
|
113
|
+
}
|
|
114
|
+
/** A generic, searchable model picker: provider grouping + provider/capability
|
|
115
|
+
* filters + a pinned section + a styled dropdown. Domain-agnostic. */
|
|
116
|
+
declare function ModelSelect({ options, value, onChange, className, labels, pinned, onTogglePin, filters, renderFooter, }: ModelSelectProps): React.JSX.Element;
|
|
117
|
+
|
|
118
|
+
/** One labelled spec shown in the card's spec grid. */
|
|
119
|
+
interface ModelManagerField {
|
|
120
|
+
label: ReactNode;
|
|
121
|
+
value: ReactNode;
|
|
122
|
+
/** Span both grid columns (e.g. a long price line). */
|
|
123
|
+
full?: boolean;
|
|
124
|
+
}
|
|
125
|
+
interface ModelManagerCardProps {
|
|
126
|
+
/** Leading model icon. */
|
|
127
|
+
icon?: ReactNode;
|
|
128
|
+
/** Model display name (the card title). */
|
|
129
|
+
name: ReactNode;
|
|
130
|
+
/** Inline status badges next to the name (YAML, deprecated, inactive, suspended…). */
|
|
131
|
+
nameBadges?: ReactNode;
|
|
132
|
+
/** Id / alias chips rendered under the name. */
|
|
133
|
+
ids?: ReactNode;
|
|
134
|
+
/** Row-select control (a checkbox). Sits at the left of the top control bar. */
|
|
135
|
+
selectSlot?: ReactNode;
|
|
136
|
+
/** Row actions (edit / enable / inspect / delete …) — sit at the right of the
|
|
137
|
+
* top control bar (no footer rule). */
|
|
138
|
+
actions?: ReactNode;
|
|
139
|
+
/** Labelled specs — provider, developer, type, status, context/resolution,
|
|
140
|
+
* max output, price, … — laid out in a 2-column grid. */
|
|
141
|
+
fields?: ModelManagerField[];
|
|
142
|
+
/** Capability badges + an optional label. */
|
|
143
|
+
capabilities?: {
|
|
144
|
+
label?: ReactNode;
|
|
145
|
+
value: ReactNode;
|
|
146
|
+
};
|
|
147
|
+
/** Mark the row selected (a ring + tint). */
|
|
148
|
+
selected?: boolean;
|
|
149
|
+
className?: string;
|
|
150
|
+
}
|
|
151
|
+
/** A model-management row as a card (all admin columns, top-to-bottom). */
|
|
152
|
+
declare function ModelManagerCard({ icon, name, nameBadges, ids, selectSlot, actions, fields, capabilities, selected, className, }: ModelManagerCardProps): React.JSX.Element;
|
|
153
|
+
|
|
58
154
|
/** Click-to-copy mono ID badge (faithful port of Yunxin's IDBadge). */
|
|
59
155
|
declare function IDBadge({ text, truncate }: {
|
|
60
156
|
text: string;
|
|
@@ -78,6 +174,16 @@ interface CapabilitySelectorProps {
|
|
|
78
174
|
/** Multi-select grid of toggleable model capabilities; the option set adapts to `modelType`. */
|
|
79
175
|
declare function CapabilitySelector({ selected, onChange, disabled, size, columns, modelType }: CapabilitySelectorProps): React.JSX.Element;
|
|
80
176
|
|
|
177
|
+
/** Whether a capability key has a known icon/color in the design system. */
|
|
178
|
+
declare function isKnownCapability(capability: string): boolean;
|
|
179
|
+
/** Just the colored capability glyph — e.g. the inline icons shown after a model
|
|
180
|
+
* name. Renders nothing for an unknown capability. */
|
|
181
|
+
declare function CapabilityIcon({ capability, size, className, }: {
|
|
182
|
+
capability: string;
|
|
183
|
+
size?: number;
|
|
184
|
+
className?: string;
|
|
185
|
+
}): React.JSX.Element | null;
|
|
186
|
+
|
|
81
187
|
/**
|
|
82
188
|
* Rounded provider icon — a thin alias over the canonical {@link ProviderIcon}
|
|
83
189
|
* (rounded avatar style). Kept for call sites that prefer the short name.
|
|
@@ -166,6 +272,8 @@ declare function ModelAvatar({ iconUrl, developer, provider, size, className, }:
|
|
|
166
272
|
className?: string;
|
|
167
273
|
}): React.JSX.Element;
|
|
168
274
|
|
|
275
|
+
declare const PROVIDER_ICON_SLUGS: ReadonlySet<string>;
|
|
276
|
+
|
|
169
277
|
interface LanguageOption {
|
|
170
278
|
/** Locale code (e.g. "en", "zh-TW"). */
|
|
171
279
|
value: string;
|
|
@@ -230,4 +338,4 @@ interface NavbarProps {
|
|
|
230
338
|
/** Floating top navigation bar: logo, center links with scroll-spy, theme/language slots, and auth buttons with a mobile menu. */
|
|
231
339
|
declare function Navbar({ appName, logoSrc, links, currentPath, variant, labels, languageSwitcher, themeToggle, homeHref, loginHref, signupHref, }: NavbarProps): React.JSX.Element;
|
|
232
340
|
|
|
233
|
-
export { type ButtonProps, CapabilitySelector, IDBadge, type LanguageOption, LanguageSwitcher, ModelAvatar, ModelCard, type ModelCardProps, ModelIcon, ModelTypeIcon, type NavLink, Navbar, ProviderAvatar, ProviderIcon, ProviderIconImg, ProviderNames, ThinkingBlock, buttonVariants, getDeveloperIconPath, getIconPath, getProviderIconOptions, getProviderName, normalizeProviderId };
|
|
341
|
+
export { type ButtonProps, CapabilityIcon, CapabilitySelector, IDBadge, type LanguageOption, LanguageSwitcher, ModelAvatar, ModelCard, type ModelCardProps, ModelIcon, ModelManagerCard, type ModelManagerCardProps, type ModelManagerField, ModelSelect, type ModelSelectFilter, type ModelSelectLabels, type ModelSelectOption, type ModelSelectProps, ModelTypeIcon, type NavLink, Navbar, PROVIDER_ICON_SLUGS, ProviderAvatar, ProviderIcon, ProviderIconImg, ProviderNames, ThinkingBlock, buttonVariants, getDeveloperIconPath, getIconPath, getProviderIconOptions, getProviderName, isKnownCapability, normalizeProviderId };
|