131 lines
4.9 KiB
TypeScript
131 lines
4.9 KiB
TypeScript
/**
|
||
* Barrel re-export для UI primitives.
|
||
*
|
||
* <p>Стратегия миграции (Phase 2 stack migration):
|
||
* <ul>
|
||
* <li>{@code @nstart/ui} остаётся подключённым — все его компоненты
|
||
* pass-through через этот barrel, чтобы существующий код работал без
|
||
* рефактора props (Checkbox.label/description, Modal.panelClassName,
|
||
* FormActions.align, и т.п.).</li>
|
||
* <li>shadcn-style primitives в {@code ./components/*} добавлены как
|
||
* параллельный набор. Новый код использует их через alias'ы где они
|
||
* чище nstart'а ({@code Button}, {@code Badge}, {@code Alert} с
|
||
* Tailwind v4 tokens; {@code Cap}, {@code ScopeBadge}, {@code ScopeDot},
|
||
* {@code ScopeStrip} — handoff design system primitives).</li>
|
||
* <li>Phase 3: компоненты которые имеют bug'и или missing features в nstart
|
||
* (Combobox vs MultiSelect, TanStack Table vs Table) — заменяются
|
||
* per-file rewrite.</li>
|
||
* <li>Phase 4: @nstart/ui удаляется из package.json когда все callsites
|
||
* переписаны.</li>
|
||
* </ul>
|
||
*
|
||
* <p>Текущая семантика: import {X} from '@/ui' — Х берётся приоритетно из
|
||
* наших shadcn primitives (overrides ниже), иначе passthrough из @nstart/ui.
|
||
* Этот файл — single source of truth для UI imports.
|
||
*/
|
||
|
||
// === Полная re-export из @nstart/ui — все компоненты, hooks, locale const ===
|
||
// Дальше будут selective overrides где наши shadcn primitives лучше.
|
||
export * from '@nstart/ui'
|
||
|
||
// === Overrides: наши shadcn primitives с Tailwind v4 tokens ===
|
||
// Эти именованные re-export'ы перекрывают одноимённые из @nstart/ui выше
|
||
// (TS resolves last declaration → наши берут верх). Mostly cosmetic — общий
|
||
// API design сохранён, добавлены теневые props (loading, error-variant и т.д.).
|
||
export { Button, buttonVariants, type ButtonProps } from './components/button'
|
||
export { Badge, type BadgeProps } from './components/badge'
|
||
export { Alert, type AlertProps } from './components/alert'
|
||
|
||
// === Handoff design system primitives — новые компоненты без nstart-аналога ===
|
||
export { Cap, type CapProps } from './components/cap'
|
||
export {
|
||
ScopeDot,
|
||
ScopeBadge,
|
||
ScopeStrip,
|
||
type DataScope as ScopeKind,
|
||
} from './components/scope'
|
||
|
||
// === shadcn primitives для НОВОГО кода (Phase 3) ===
|
||
// Эти именованные exports НЕ конфликтуют с nstart (имена не пересекаются).
|
||
// Используются в редизайне catalog/editor/drawer per handoff README.
|
||
export { IconButton as ShadcnIconButton, type IconButtonProps } from './components/icon-button'
|
||
export { Input as ShadcnInput, type InputProps as ShadcnInputProps } from './components/input'
|
||
export { Label as ShadcnLabel } from './components/label'
|
||
export { SearchInput as ShadcnSearchInput, type SearchInputProps as ShadcnSearchInputProps } from './components/search-input'
|
||
export {
|
||
Card as ShadcnCard,
|
||
CardHeader,
|
||
CardTitle,
|
||
CardDescription,
|
||
CardContent,
|
||
CardFooter,
|
||
} from './components/card'
|
||
export { Separator } from './components/separator'
|
||
export { Skeleton } from './components/skeleton'
|
||
export {
|
||
Dialog,
|
||
DialogTrigger,
|
||
DialogPortal,
|
||
DialogClose,
|
||
DialogOverlay,
|
||
DialogContent,
|
||
DialogHeader,
|
||
DialogFooter,
|
||
DialogTitle,
|
||
DialogDescription,
|
||
type DialogContentProps,
|
||
} from './components/dialog'
|
||
export {
|
||
Sheet,
|
||
SheetTrigger,
|
||
SheetClose,
|
||
SheetPortal,
|
||
SheetContent,
|
||
SheetHeader,
|
||
SheetFooter,
|
||
SheetTitle,
|
||
SheetDescription,
|
||
type SheetContentProps,
|
||
} from './components/sheet'
|
||
export {
|
||
Popover,
|
||
PopoverTrigger,
|
||
PopoverAnchor,
|
||
PopoverContent,
|
||
} from './components/popover'
|
||
export {
|
||
Tooltip,
|
||
TooltipProvider,
|
||
TooltipTrigger,
|
||
TooltipContent,
|
||
} from './components/tooltip'
|
||
// Tabs из shadcn — composition API.
|
||
export {
|
||
Tabs as ShadcnTabsRoot,
|
||
TabsList as ShadcnTabsList,
|
||
TabsTrigger as ShadcnTabsTrigger,
|
||
TabsContent as ShadcnTabsContent,
|
||
} from './components/tabs'
|
||
export {
|
||
DropdownMenu,
|
||
DropdownMenuTrigger,
|
||
DropdownMenuContent,
|
||
DropdownMenuItem,
|
||
DropdownMenuCheckboxItem,
|
||
DropdownMenuRadioItem,
|
||
DropdownMenuLabel,
|
||
DropdownMenuSeparator,
|
||
DropdownMenuGroup,
|
||
DropdownMenuPortal,
|
||
DropdownMenuSub,
|
||
DropdownMenuSubTrigger,
|
||
DropdownMenuSubContent,
|
||
DropdownMenuRadioGroup,
|
||
} from './components/dropdown-menu'
|
||
export { Switch as ShadcnSwitch } from './components/switch'
|
||
|
||
// Toast notifications через sonner (rich, accessible, themable).
|
||
// Mount <Toaster /> один раз в main.tsx; call toast.success/error/etc.
|
||
// в callbacks / effects.
|
||
export { Toaster, toast } from './components/toaster'
|