diff --git a/README.md b/README.md new file mode 100644 index 0000000..f65fd1d --- /dev/null +++ b/README.md @@ -0,0 +1,52 @@ +# Medkit — `@medkit/ui` + +UI kit МИС «Медицина»: React 19 + Tailwind 4 + Radix (shadcn/ui). Живая витрина — `/ui` и `/ui-form` в medicine-ui. + +``` +src/ui/ базовые примитивы shadcn/ui +src/kit/ составные компоненты: формы, таблицы, пациенты, услуги, уведомления +src/charts/ SVG-графики без библиотек +src/hooks/ use-media-query, use-caret +src/lib/ cn, format, masks, clipboard +src/styles.css тема (токены, шрифты, тёмный режим) +``` + +Пакет поставляется исходниками (без сборки): TS/TSX компилирует бандлер приложения. + +## Подключение + +```tsx +import { Button, DataTable, DateInput, cn } from "@medkit/ui" +``` + +CSS приложения: + +```css +@import "tailwindcss"; +@import "@medkit/ui/styles.css"; +``` + +`styles.css` сам добавляет исходники кита в `@source`, так что классы находятся и из `node_modules`. Палитру можно переопределить своими `:root` / `.dark` после импорта. + +Корень приложения: + +```tsx + + + {/* внутри — для notify() */} + + + +``` + +`NotifyToaster` без `navigate` переходит по `href` через `window.location.assign`. + +Peer-зависимости: `react`, `react-dom` 19, `tailwindcss` 4. В Vite-проекте ничего настраивать не нужно. + +## Правила для кода пакета + +- Импорты внутри пакета — только относительные (`../lib/utils`), без `@/`: алиас принадлежит приложению. +- Никаких данных и роутера приложения — только пропсы. +- Новый компонент: файл в `src/kit/`, экспорт в `src/kit/index.ts`, пример на `/ui`. Новый shadcn-примитив — файл в `src/ui/` и строка в `src/index.ts`. +- Компоненты shadcn берутся исходниками с GitHub (`apps/v4/registry/new-york-v4/ui/*.tsx`), импорт `cn` заменяется на `../lib/utils`. +- Проверка типов: `npm run typecheck -w @medkit/ui`. diff --git a/package.json b/package.json new file mode 100644 index 0000000..28671e6 --- /dev/null +++ b/package.json @@ -0,0 +1,35 @@ +{ + "name": "@medkit/ui", + "version": "0.1.0", + "private": true, + "description": "Medkit — UI kit МИС «Медицина»: React 19 + Tailwind 4 + Radix (shadcn/ui)", + "type": "module", + "sideEffects": [ + "*.css" + ], + "exports": { + ".": "./src/index.ts", + "./styles.css": "./src/styles.css" + }, + "scripts": { + "typecheck": "tsc --noEmit -p ." + }, + "peerDependencies": { + "react": "^19.0.0", + "react-dom": "^19.0.0", + "tailwindcss": "^4.0.0" + }, + "dependencies": { + "@fontsource-variable/jetbrains-mono": "^5.3.0", + "@fontsource-variable/onest": "^5.3.1", + "class-variance-authority": "^0.7.1", + "clsx": "^2.1.1", + "cmdk": "^1.1.1", + "lucide-react": "^1.61.0", + "radix-ui": "^1.8.1", + "react-day-picker": "^9.14.0", + "sonner": "^2.0.8", + "tailwind-merge": "^3.7.0", + "tw-animate-css": "^1.4.0" + } +} diff --git a/src/charts/chart-hover.tsx b/src/charts/chart-hover.tsx index 41ba585..1fec26d 100644 --- a/src/charts/chart-hover.tsx +++ b/src/charts/chart-hover.tsx @@ -1,6 +1,6 @@ import * as React from "react" -import { cn } from "@/lib/utils" +import { cn } from "../lib/utils" /** Ширина контейнера — чтобы SVG рисовался в реальных пикселях и текст не масштабировался. */ export function useElementWidth() { diff --git a/src/charts/column-chart.tsx b/src/charts/column-chart.tsx index 2c41395..740d801 100644 --- a/src/charts/column-chart.tsx +++ b/src/charts/column-chart.tsx @@ -1,6 +1,6 @@ import * as React from "react" -import { cn } from "@/lib/utils" +import { cn } from "../lib/utils" import { ChartTooltip, TooltipRow, useChartHover, useElementWidth } from "./chart-hover" export interface ChartSeries { diff --git a/src/index.ts b/src/index.ts new file mode 100644 index 0000000..5b09e89 --- /dev/null +++ b/src/index.ts @@ -0,0 +1,44 @@ +// Medkit — UI kit МИС «Медицина». Витрина — /ui в medicine-ui. +export * from "./kit" +export * from "./ui/alert-dialog" +export * from "./ui/avatar" +export * from "./ui/badge" +export * from "./ui/button" +export * from "./ui/calendar" +export * from "./ui/card" +export * from "./ui/checkbox" +export * from "./ui/command" +export * from "./ui/context-menu" +export * from "./ui/dialog" +export * from "./ui/dropdown-menu" +export * from "./ui/empty" +export * from "./ui/hover-card" +export * from "./ui/input" +export * from "./ui/input-group" +export * from "./ui/kbd" +export * from "./ui/label" +export * from "./ui/popover" +export * from "./ui/progress" +export * from "./ui/scroll-area" +export * from "./ui/select" +export * from "./ui/separator" +export * from "./ui/sheet" +export * from "./ui/skeleton" +export * from "./ui/sonner" +export * from "./ui/switch" +export * from "./ui/table" +export * from "./ui/tabs" +export * from "./ui/textarea" +export * from "./ui/toggle" +export * from "./ui/toggle-group" +export * from "./ui/tooltip" +export * from "./charts/chart-hover" +export * from "./charts/column-chart" +export * from "./charts/sparkline" +export * from "./hooks/use-caret" +export * from "./hooks/use-media-query" +export * from "./lib/clipboard" +export * from "./lib/format" +export * from "./lib/masks" +export * from "./lib/utils" +export * from "./theme-provider" diff --git a/src/kit/code-block.tsx b/src/kit/code-block.tsx index a1f2e2e..a4ee9fd 100644 --- a/src/kit/code-block.tsx +++ b/src/kit/code-block.tsx @@ -1,7 +1,7 @@ import { CopyIcon } from "lucide-react" -import { cn } from "@/lib/utils" -import { copyToClipboard } from "@/lib/clipboard" +import { cn } from "../lib/utils" +import { copyToClipboard } from "../lib/clipboard" /** Фрагмент кода с кнопкой копирования. */ export function CodeBlock({ code, className }: { code: string; className?: string }) { diff --git a/src/kit/combobox.tsx b/src/kit/combobox.tsx index 926594a..e01e040 100644 --- a/src/kit/combobox.tsx +++ b/src/kit/combobox.tsx @@ -1,9 +1,9 @@ import * as React from "react" import { CheckIcon, ChevronDownIcon, PlusIcon, XIcon } from "lucide-react" -import { cn } from "@/lib/utils" -import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList } from "@/components/ui/command" -import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover" +import { cn } from "../lib/utils" +import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList } from "../ui/command" +import { Popover, PopoverContent, PopoverTrigger } from "../ui/popover" /** * Одиночный выбор из справочника с поиском и очисткой (как tui-combo-box). diff --git a/src/kit/confirm-dialog.tsx b/src/kit/confirm-dialog.tsx index 6747411..cff96e3 100644 --- a/src/kit/confirm-dialog.tsx +++ b/src/kit/confirm-dialog.tsx @@ -10,8 +10,8 @@ import { AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, -} from "@/components/ui/alert-dialog" -import { buttonVariants } from "@/components/ui/button" +} from "../ui/alert-dialog" +import { buttonVariants } from "../ui/button" /** Подтверждение необратимого действия: «Удалить профиль?» → Удалить / Отмена. */ export function ConfirmDialog({ diff --git a/src/kit/content-tabs.tsx b/src/kit/content-tabs.tsx index fc40189..d282c15 100644 --- a/src/kit/content-tabs.tsx +++ b/src/kit/content-tabs.tsx @@ -1,6 +1,6 @@ import { type LucideIcon } from "lucide-react" -import { cn } from "@/lib/utils" +import { cn } from "../lib/utils" export interface ContentTabItem { readonly id: T diff --git a/src/kit/data-table.tsx b/src/kit/data-table.tsx index 3eb5b8b..dd3daaa 100644 --- a/src/kit/data-table.tsx +++ b/src/kit/data-table.tsx @@ -1,7 +1,7 @@ import * as React from "react" import { ArrowDownIcon, ArrowUpIcon, ChevronsUpDownIcon } from "lucide-react" -import { cn } from "@/lib/utils" +import { cn } from "../lib/utils" export type SortDirection = "asc" | "desc" diff --git a/src/kit/date-input.tsx b/src/kit/date-input.tsx index f6bf9d8..a8ad552 100644 --- a/src/kit/date-input.tsx +++ b/src/kit/date-input.tsx @@ -1,13 +1,13 @@ import * as React from "react" import { CalendarIcon } from "lucide-react" -import { Button } from "@/components/ui/button" -import { Calendar } from "@/components/ui/calendar" -import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput } from "@/components/ui/input-group" -import { Popover, PopoverAnchor, PopoverContent } from "@/components/ui/popover" -import { formatRuDate, isDatePrefixValid, isSameDay, maskDate, maskWithCaret, parseRuDate } from "@/lib/masks" -import { useCaret } from "@/hooks/use-caret" -import { cn } from "@/lib/utils" +import { Button } from "../ui/button" +import { Calendar } from "../ui/calendar" +import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput } from "../ui/input-group" +import { Popover, PopoverAnchor, PopoverContent } from "../ui/popover" +import { formatRuDate, isDatePrefixValid, isSameDay, maskDate, maskWithCaret, parseRuDate } from "../lib/masks" +import { useCaret } from "../hooks/use-caret" +import { cn } from "../lib/utils" export interface DateLimits { min?: Date diff --git a/src/kit/date-leaf.tsx b/src/kit/date-leaf.tsx index b4b732f..647156f 100644 --- a/src/kit/date-leaf.tsx +++ b/src/kit/date-leaf.tsx @@ -1,4 +1,4 @@ -import { cn } from "@/lib/utils" +import { cn } from "../lib/utils" const WEEKDAYS = ["вс", "пн", "вт", "ср", "чт", "пт", "сб"] const MONTHS = ["янв", "фев", "мар", "апр", "мая", "июн", "июл", "авг", "сен", "окт", "ноя", "дек"] diff --git a/src/kit/date-range-input.tsx b/src/kit/date-range-input.tsx index 760d17a..2366d3d 100644 --- a/src/kit/date-range-input.tsx +++ b/src/kit/date-range-input.tsx @@ -1,13 +1,13 @@ import * as React from "react" import { CalendarRangeIcon } from "lucide-react" -import { Button } from "@/components/ui/button" -import { Calendar } from "@/components/ui/calendar" -import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText } from "@/components/ui/input-group" -import { Popover, PopoverAnchor, PopoverContent } from "@/components/ui/popover" -import { useMediaQuery } from "@/hooks/use-media-query" -import { isSameDay } from "@/lib/masks" -import { cn } from "@/lib/utils" +import { Button } from "../ui/button" +import { Calendar } from "../ui/calendar" +import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText } from "../ui/input-group" +import { Popover, PopoverAnchor, PopoverContent } from "../ui/popover" +import { useMediaQuery } from "../hooks/use-media-query" +import { isSameDay } from "../lib/masks" +import { cn } from "../lib/utils" import { calendarBounds, startOfDay, useCalendarPopover, useDateText, type DateLimits } from "./date-input" diff --git a/src/kit/edit-dialog.tsx b/src/kit/edit-dialog.tsx index d485e8b..e872303 100644 --- a/src/kit/edit-dialog.tsx +++ b/src/kit/edit-dialog.tsx @@ -1,9 +1,9 @@ import * as React from "react" import type { LucideIcon } from "lucide-react" -import { Button } from "@/components/ui/button" -import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle } from "@/components/ui/dialog" -import { cn } from "@/lib/utils" +import { Button } from "../ui/button" +import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle } from "../ui/dialog" +import { cn } from "../lib/utils" /** * Модальное редактирование одного смыслового блока (InfoSection): форма, «Отмена» / «Сохранить». diff --git a/src/kit/file-drop.tsx b/src/kit/file-drop.tsx index 95c0ac7..81112b0 100644 --- a/src/kit/file-drop.tsx +++ b/src/kit/file-drop.tsx @@ -1,7 +1,7 @@ import * as React from "react" import { UploadCloudIcon } from "lucide-react" -import { cn } from "@/lib/utils" +import { cn } from "../lib/utils" /** Зона загрузки: перетащить файлы или выбрать в диалоге. */ export function FileDrop({ diff --git a/src/kit/file-gallery.tsx b/src/kit/file-gallery.tsx index b65c231..0f9464f 100644 --- a/src/kit/file-gallery.tsx +++ b/src/kit/file-gallery.tsx @@ -10,9 +10,9 @@ import { XIcon, } from "lucide-react" -import { cn } from "@/lib/utils" -import { formatBytes } from "@/lib/format" -import { Dialog, DialogContent, DialogDescription, DialogTitle } from "@/components/ui/dialog" +import { cn } from "../lib/utils" +import { formatBytes } from "../lib/format" +import { Dialog, DialogContent, DialogDescription, DialogTitle } from "../ui/dialog" export interface FileItem { readonly name: string diff --git a/src/kit/form-field.tsx b/src/kit/form-field.tsx index 6cd759a..1fac69b 100644 --- a/src/kit/form-field.tsx +++ b/src/kit/form-field.tsx @@ -1,7 +1,7 @@ import * as React from "react" -import { cn } from "@/lib/utils" -import { Label } from "@/components/ui/label" +import { cn } from "../lib/utils" +import { Label } from "../ui/label" /** Подзаголовок группы полей формы. */ export function FormSection({ title, children }: { title: string; children: React.ReactNode }) { diff --git a/src/kit/index.ts b/src/kit/index.ts index 8f79dfd..3aa0abb 100644 --- a/src/kit/index.ts +++ b/src/kit/index.ts @@ -1,4 +1,4 @@ -// Переиспользуемые компоненты МИС «Медицина». Витрина — /ui (src/pages/ui/ui-page.tsx). +// Составные компоненты Medkit. Витрина — /ui в medicine-ui (src/pages/ui/ui-page.tsx). export * from "./code-block" export * from "./combobox" export * from "./confirm-dialog" diff --git a/src/kit/info-section.tsx b/src/kit/info-section.tsx index 9abe850..c31e47e 100644 --- a/src/kit/info-section.tsx +++ b/src/kit/info-section.tsx @@ -1,8 +1,8 @@ import * as React from "react" import { CopyIcon, PencilIcon, type LucideIcon } from "lucide-react" -import { cn } from "@/lib/utils" -import { copyToClipboard } from "@/lib/clipboard" +import { cn } from "../lib/utils" +import { copyToClipboard } from "../lib/clipboard" /** Смысловой блок на мягкой подложке: иконка + заголовок, справа — действие; с `onEdit` — карандаш при наведении. */ export function InfoSection({ diff --git a/src/kit/multi-select.tsx b/src/kit/multi-select.tsx index d2425f7..2e8aedb 100644 --- a/src/kit/multi-select.tsx +++ b/src/kit/multi-select.tsx @@ -1,9 +1,9 @@ import * as React from "react" import { CheckIcon, ChevronDownIcon, XIcon } from "lucide-react" -import { cn } from "@/lib/utils" -import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList } from "@/components/ui/command" -import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover" +import { cn } from "../lib/utils" +import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList } from "../ui/command" +import { Popover, PopoverContent, PopoverTrigger } from "../ui/popover" export interface MultiSelectOption { readonly value: T diff --git a/src/kit/notify.tsx b/src/kit/notify.tsx index d58c1f1..4374f70 100644 --- a/src/kit/notify.tsx +++ b/src/kit/notify.tsx @@ -7,15 +7,18 @@ import { XIcon, type LucideIcon, } from "lucide-react" -import { useNavigate } from "react-router-dom" +import * as React from "react" import { toast, Toaster } from "sonner" -import { cn } from "@/lib/utils" +import { cn } from "../lib/utils" export type NotifyType = "success" | "info" | "warning" | "error" const TOASTER_ID = "notify" +/** Переход по href из карточки; без роутера — обычная навигация браузера. */ +const NavigateContext = React.createContext<(href: string) => void>((href) => window.location.assign(href)) + const typeMeta: Record = { success: { icon: CircleCheckIcon, tile: "bg-success-soft text-success", bar: "bg-success", duration: 5000 }, info: { icon: InfoIcon, tile: "bg-info-soft text-info", bar: "bg-info", duration: 6000 }, @@ -49,9 +52,12 @@ notify.warning = (o: Omit) => notify({ ...o, type: "warni notify.error = (o: Omit) => notify({ ...o, type: "error" }) notify.dismiss = (id?: string | number) => toast.dismiss(id) -/** Контейнер уведомлений. Монтируется один раз внутри BrowserRouter — карточке нужен роутер для «Перейти». */ -export function NotifyToaster() { - return ( +/** + * Контейнер уведомлений, монтируется один раз. `navigate` — переход для кнопки «Перейти» + * (с react-router: `useNavigate()`), по умолчанию `window.location.assign`. + */ +export function NotifyToaster({ navigate }: { navigate?: (href: string) => void }) { + const toaster = ( ) + return navigate ? {toaster} : toaster } function NotifyCard({ @@ -71,7 +78,7 @@ function NotifyCard({ href, actionLabel = "Перейти", }: Omit & { id: string | number; type: NotifyType }) { - const navigate = useNavigate() + const navigate = React.useContext(NavigateContext) const { icon: Icon, tile, bar } = typeMeta[type] return ( diff --git a/src/kit/page-frame.tsx b/src/kit/page-frame.tsx index 8be0c68..3cff0df 100644 --- a/src/kit/page-frame.tsx +++ b/src/kit/page-frame.tsx @@ -1,8 +1,8 @@ import * as React from "react" import { type LucideIcon } from "lucide-react" -import { cn } from "@/lib/utils" -import { ScrollArea } from "@/components/ui/scroll-area" +import { cn } from "../lib/utils" +import { ScrollArea } from "../ui/scroll-area" /** * Рамка раздела без вкладок: карточка с шапкой (иконка, заголовок, действия) diff --git a/src/kit/page-tabs.tsx b/src/kit/page-tabs.tsx index 13ea5aa..4f72160 100644 --- a/src/kit/page-tabs.tsx +++ b/src/kit/page-tabs.tsx @@ -1,17 +1,17 @@ import * as React from "react" import { ChevronDownIcon, XIcon, type LucideIcon } from "lucide-react" -import { cn } from "@/lib/utils" -import { ContextMenu, ContextMenuContent, ContextMenuTrigger } from "@/components/ui/context-menu" +import { cn } from "../lib/utils" +import { ContextMenu, ContextMenuContent, ContextMenuTrigger } from "../ui/context-menu" import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuTrigger, -} from "@/components/ui/dropdown-menu" -import { Kbd } from "@/components/ui/kbd" -import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip" +} from "../ui/dropdown-menu" +import { Kbd } from "../ui/kbd" +import { Tooltip, TooltipContent, TooltipTrigger } from "../ui/tooltip" export type PageTabTone = "male" | "female" | "neutral" diff --git a/src/kit/pagination.tsx b/src/kit/pagination.tsx index 6ff8b73..4d620b4 100644 --- a/src/kit/pagination.tsx +++ b/src/kit/pagination.tsx @@ -1,6 +1,6 @@ import { ChevronLeftIcon, ChevronRightIcon } from "lucide-react" -import { cn } from "@/lib/utils" +import { cn } from "../lib/utils" const DEFAULT_SIZES = [15, 30, 50] as const diff --git a/src/kit/patient-avatar.tsx b/src/kit/patient-avatar.tsx index 8d317dc..ed7f03b 100644 --- a/src/kit/patient-avatar.tsx +++ b/src/kit/patient-avatar.tsx @@ -1,5 +1,5 @@ -import { cn } from "@/lib/utils" -import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar" +import { cn } from "../lib/utils" +import { Avatar, AvatarFallback, AvatarImage } from "../ui/avatar" export type Gender = "male" | "female" diff --git a/src/kit/patient-panel.tsx b/src/kit/patient-panel.tsx index ab6e780..982f4f2 100644 --- a/src/kit/patient-panel.tsx +++ b/src/kit/patient-panel.tsx @@ -1,9 +1,9 @@ import * as React from "react" import { CopyIcon, IdCardIcon, PhoneIcon, StethoscopeIcon } from "lucide-react" -import { cn } from "@/lib/utils" -import { copyToClipboard } from "@/lib/clipboard" -import { pluralYears } from "@/lib/format" +import { cn } from "../lib/utils" +import { copyToClipboard } from "../lib/clipboard" +import { pluralYears } from "../lib/format" import { ContentTabs, type ContentTabItem } from "./content-tabs" import { GenderMark, PatientAvatar, type AvatarPerson } from "./patient-avatar" diff --git a/src/kit/patient-picker.tsx b/src/kit/patient-picker.tsx index fdb4fb8..a053b67 100644 --- a/src/kit/patient-picker.tsx +++ b/src/kit/patient-picker.tsx @@ -1,9 +1,9 @@ import * as React from "react" import { ChevronsUpDownIcon, UserSearchIcon, XIcon } from "lucide-react" -import { cn } from "@/lib/utils" -import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList } from "@/components/ui/command" -import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover" +import { cn } from "../lib/utils" +import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList } from "../ui/command" +import { Popover, PopoverContent, PopoverTrigger } from "../ui/popover" import { GenderMark, PatientAvatar, type AvatarPerson } from "./patient-avatar" export interface PickerPatient extends AvatarPerson { diff --git a/src/kit/person-chip.tsx b/src/kit/person-chip.tsx index 0059725..1b6b7a9 100644 --- a/src/kit/person-chip.tsx +++ b/src/kit/person-chip.tsx @@ -1,6 +1,6 @@ import { XIcon } from "lucide-react" -import { cn } from "@/lib/utils" +import { cn } from "../lib/utils" export function initialsOf(name: string) { const parts = name.replace(/\./g, " ").trim().split(/\s+/) diff --git a/src/kit/save-bar.tsx b/src/kit/save-bar.tsx index f34f513..8547e04 100644 --- a/src/kit/save-bar.tsx +++ b/src/kit/save-bar.tsx @@ -1,8 +1,8 @@ import * as React from "react" import { CircleAlertIcon, CircleCheckIcon } from "lucide-react" -import { cn } from "@/lib/utils" -import { Button } from "@/components/ui/button" +import { cn } from "../lib/utils" +import { Button } from "../ui/button" /** * Липкая панель внизу формы: показывает, есть ли несохранённые изменения, diff --git a/src/kit/search-input.tsx b/src/kit/search-input.tsx index f648cf5..a9cd876 100644 --- a/src/kit/search-input.tsx +++ b/src/kit/search-input.tsx @@ -1,7 +1,7 @@ import * as React from "react" import { SearchIcon, XIcon } from "lucide-react" -import { cn } from "@/lib/utils" +import { cn } from "../lib/utils" /** Поле поиска на мягкой подложке: иконка, крестик очистки. */ export const SearchInput = React.forwardRef< diff --git a/src/kit/service-lines.tsx b/src/kit/service-lines.tsx index 82a7f3f..dc44b63 100644 --- a/src/kit/service-lines.tsx +++ b/src/kit/service-lines.tsx @@ -1,8 +1,8 @@ import { MinusIcon, PlusIcon, Trash2Icon } from "lucide-react" -import { cn } from "@/lib/utils" -import { formatMoney } from "@/lib/format" -import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select" +import { cn } from "../lib/utils" +import { formatMoney } from "../lib/format" +import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "../ui/select" import { StatusBadge, type StatusTone } from "./status-badge" export type ServiceLineStatus = "unpaid" | "paid" | "refunded" | "declined" diff --git a/src/kit/service-picker.tsx b/src/kit/service-picker.tsx index e84000b..881b061 100644 --- a/src/kit/service-picker.tsx +++ b/src/kit/service-picker.tsx @@ -1,13 +1,13 @@ import * as React from "react" import { CheckIcon } from "lucide-react" -import { cn } from "@/lib/utils" -import { formatMoney } from "@/lib/format" -import { Button } from "@/components/ui/button" -import { Checkbox } from "@/components/ui/checkbox" -import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle } from "@/components/ui/dialog" -import { ScrollArea } from "@/components/ui/scroll-area" -import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select" +import { cn } from "../lib/utils" +import { formatMoney } from "../lib/format" +import { Button } from "../ui/button" +import { Checkbox } from "../ui/checkbox" +import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle } from "../ui/dialog" +import { ScrollArea } from "../ui/scroll-area" +import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "../ui/select" import { ContentTabs } from "./content-tabs" import { SearchInput } from "./search-input" diff --git a/src/kit/snils-input.tsx b/src/kit/snils-input.tsx index 122ebc6..74b8989 100644 --- a/src/kit/snils-input.tsx +++ b/src/kit/snils-input.tsx @@ -1,10 +1,10 @@ import * as React from "react" import { CircleCheckIcon } from "lucide-react" -import { InputGroup, InputGroupAddon, InputGroupInput } from "@/components/ui/input-group" -import { isSnilsValid, maskSnils, maskWithCaret, onlyDigits } from "@/lib/masks" -import { useCaret } from "@/hooks/use-caret" -import { cn } from "@/lib/utils" +import { InputGroup, InputGroupAddon, InputGroupInput } from "../ui/input-group" +import { isSnilsValid, maskSnils, maskWithCaret, onlyDigits } from "../lib/masks" +import { useCaret } from "../hooks/use-caret" +import { cn } from "../lib/utils" /** Текст ошибки для СНИЛС; пустое значение ошибкой не считается. */ export function snilsError(value: string) { diff --git a/src/kit/stat-tile.tsx b/src/kit/stat-tile.tsx index c5d164c..157cde6 100644 --- a/src/kit/stat-tile.tsx +++ b/src/kit/stat-tile.tsx @@ -1,6 +1,6 @@ import { type LucideIcon } from "lucide-react" -import { cn } from "@/lib/utils" +import { cn } from "../lib/utils" import type { StatusTone } from "./status-badge" const toneClass: Record = { diff --git a/src/kit/status-badge.tsx b/src/kit/status-badge.tsx index 731c0aa..d9dcf5b 100644 --- a/src/kit/status-badge.tsx +++ b/src/kit/status-badge.tsx @@ -1,4 +1,4 @@ -import { cn } from "@/lib/utils" +import { cn } from "../lib/utils" export type StatusTone = "positive" | "info" | "warning" | "negative" | "neutral" diff --git a/src/kit/stepper.tsx b/src/kit/stepper.tsx index 60f8689..5537a77 100644 --- a/src/kit/stepper.tsx +++ b/src/kit/stepper.tsx @@ -1,6 +1,6 @@ import { CheckIcon } from "lucide-react" -import { cn } from "@/lib/utils" +import { cn } from "../lib/utils" export interface StepItem { readonly label: string diff --git a/src/kit/time-input.tsx b/src/kit/time-input.tsx index 16de449..f441dbc 100644 --- a/src/kit/time-input.tsx +++ b/src/kit/time-input.tsx @@ -1,12 +1,12 @@ import * as React from "react" import { ClockIcon } from "lucide-react" -import { Button } from "@/components/ui/button" -import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput } from "@/components/ui/input-group" -import { Popover, PopoverAnchor, PopoverContent } from "@/components/ui/popover" -import { isTimePrefixValid, maskTime, maskWithCaret } from "@/lib/masks" -import { useCaret } from "@/hooks/use-caret" -import { cn } from "@/lib/utils" +import { Button } from "../ui/button" +import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput } from "../ui/input-group" +import { Popover, PopoverAnchor, PopoverContent } from "../ui/popover" +import { isTimePrefixValid, maskTime, maskWithCaret } from "../lib/masks" +import { useCaret } from "../hooks/use-caret" +import { cn } from "../lib/utils" import { useCalendarPopover } from "./date-input" diff --git a/src/kit/time-range-input.tsx b/src/kit/time-range-input.tsx index c3d7f31..f97a6ad 100644 --- a/src/kit/time-range-input.tsx +++ b/src/kit/time-range-input.tsx @@ -1,6 +1,6 @@ import { XIcon } from "lucide-react" -import { cn } from "@/lib/utils" +import { cn } from "../lib/utils" export interface TimeRangeValue { from: string diff --git a/src/styles.css b/src/styles.css new file mode 100644 index 0000000..2bb6eb7 --- /dev/null +++ b/src/styles.css @@ -0,0 +1,187 @@ +/* + * Medkit — тема и базовые стили. Подключение в приложении (после tailwindcss): + * @import "tailwindcss"; + * @import "@medkit/ui/styles.css"; + * Переопределить палитру можно своими :root / .dark после импорта. + */ +@import "tw-animate-css"; +@import "@fontsource-variable/onest"; +@import "@fontsource-variable/jetbrains-mono"; + +/* Классы компонентов kit — чтобы Tailwind видел их и из node_modules */ +@source "."; + +@custom-variant dark (&:is(.dark *)); + +/* + * Палитра «клинический бирюзовый». + * Основной цвет — глубокий бирюзовый (доверие, медицина), акцент — коралл + * для тревожных отметок (аллергии, неявки). Сайдбар тёмный, чтобы рабочая + * область читалась как «лист» поверх приборной панели. + */ +:root { + --radius: 0.75rem; + + --background: oklch(0.972 0.006 210); + --foreground: oklch(0.22 0.025 240); + --card: oklch(1 0 0); + --card-foreground: oklch(0.22 0.025 240); + --popover: oklch(1 0 0); + --popover-foreground: oklch(0.22 0.025 240); + --primary: oklch(0.52 0.105 195); + --primary-foreground: oklch(0.99 0.005 195); + --secondary: oklch(0.955 0.012 200); + --secondary-foreground: oklch(0.3 0.04 220); + --muted: oklch(0.962 0.006 220); + --muted-foreground: oklch(0.52 0.02 240); + --accent: oklch(0.95 0.025 190); + --accent-foreground: oklch(0.33 0.07 200); + --destructive: oklch(0.6 0.2 25); + --border: oklch(0.915 0.01 220); + --input: oklch(0.9 0.012 220); + --ring: oklch(0.62 0.1 195); + + /* Семантика клиники */ + --coral: oklch(0.66 0.17 30); + --coral-soft: oklch(0.96 0.03 30); + --success: oklch(0.6 0.13 160); + --success-soft: oklch(0.955 0.04 160); + --warning: oklch(0.72 0.14 75); + --warning-soft: oklch(0.965 0.045 85); + --info: oklch(0.58 0.13 245); + --info-soft: oklch(0.955 0.025 245); + --male: oklch(0.6 0.12 240); + --female: oklch(0.63 0.16 350); + + /* Тёмная «приборная» боковая панель */ + --sidebar: oklch(0.235 0.035 228); + --sidebar-foreground: oklch(0.84 0.02 220); + --sidebar-muted: oklch(0.6 0.03 225); + --sidebar-accent: oklch(0.3 0.045 220); + --sidebar-primary: oklch(0.8 0.12 185); + --sidebar-border: oklch(0.3 0.035 228); + + /* Графики: категориальные слоты проверены на различимость при дальтонизме */ + --chart-1: #2a78d6; + --chart-2: #eb6834; + --chart-3: #1baf7a; + --chart-bad: #e34948; + --chart-muted: #c3c8d0; + --chart-grid: oklch(0.93 0.008 220); +} + +.dark { + --background: oklch(0.17 0.02 235); + --foreground: oklch(0.94 0.01 220); + --card: oklch(0.215 0.024 235); + --card-foreground: oklch(0.94 0.01 220); + --popover: oklch(0.23 0.025 235); + --popover-foreground: oklch(0.94 0.01 220); + --primary: oklch(0.74 0.12 190); + --primary-foreground: oklch(0.2 0.04 220); + --secondary: oklch(0.27 0.025 230); + --secondary-foreground: oklch(0.9 0.01 220); + --muted: oklch(0.255 0.02 235); + --muted-foreground: oklch(0.68 0.02 230); + --accent: oklch(0.3 0.04 205); + --accent-foreground: oklch(0.9 0.05 190); + --destructive: oklch(0.66 0.19 25); + --border: oklch(0.3 0.022 235); + --input: oklch(0.33 0.025 235); + --ring: oklch(0.65 0.11 190); + + --coral: oklch(0.72 0.15 30); + --coral-soft: oklch(0.3 0.06 30); + --success: oklch(0.72 0.13 160); + --success-soft: oklch(0.28 0.05 160); + --warning: oklch(0.8 0.13 80); + --warning-soft: oklch(0.3 0.05 80); + --info: oklch(0.7 0.12 245); + --info-soft: oklch(0.28 0.05 245); + --male: oklch(0.7 0.11 240); + --female: oklch(0.72 0.14 350); + + --sidebar: oklch(0.14 0.02 235); + --sidebar-foreground: oklch(0.82 0.015 220); + --sidebar-muted: oklch(0.55 0.02 225); + --sidebar-accent: oklch(0.22 0.03 225); + --sidebar-primary: oklch(0.8 0.12 185); + --sidebar-border: oklch(0.22 0.02 235); + + --chart-1: #3987e5; + --chart-2: #d95926; + --chart-3: #199e70; + --chart-bad: #e66767; + --chart-muted: #4a5561; + --chart-grid: oklch(0.28 0.02 235); +} + +@theme inline { + --font-sans: "Onest Variable", ui-sans-serif, system-ui, sans-serif; + --font-mono: "JetBrains Mono Variable", ui-monospace, monospace; + + --radius-sm: calc(var(--radius) - 4px); + --radius-md: calc(var(--radius) - 2px); + --radius-lg: var(--radius); + --radius-xl: calc(var(--radius) + 4px); + + --color-background: var(--background); + --color-foreground: var(--foreground); + --color-card: var(--card); + --color-card-foreground: var(--card-foreground); + --color-popover: var(--popover); + --color-popover-foreground: var(--popover-foreground); + --color-primary: var(--primary); + --color-primary-foreground: var(--primary-foreground); + --color-secondary: var(--secondary); + --color-secondary-foreground: var(--secondary-foreground); + --color-muted: var(--muted); + --color-muted-foreground: var(--muted-foreground); + --color-accent: var(--accent); + --color-accent-foreground: var(--accent-foreground); + --color-destructive: var(--destructive); + --color-border: var(--border); + --color-input: var(--input); + --color-ring: var(--ring); + + --color-coral: var(--coral); + --color-coral-soft: var(--coral-soft); + --color-success: var(--success); + --color-success-soft: var(--success-soft); + --color-warning: var(--warning); + --color-warning-soft: var(--warning-soft); + --color-info: var(--info); + --color-info-soft: var(--info-soft); + --color-male: var(--male); + --color-female: var(--female); + + --color-sidebar: var(--sidebar); + --color-sidebar-foreground: var(--sidebar-foreground); + --color-sidebar-muted: var(--sidebar-muted); + --color-sidebar-accent: var(--sidebar-accent); + --color-sidebar-primary: var(--sidebar-primary); + --color-sidebar-border: var(--sidebar-border); +} + +@layer base { + * { + @apply border-border outline-ring/50; + } + html { + font-feature-settings: "tnum" 0; + } + body { + @apply bg-background text-foreground antialiased; + } + .tabular { + font-variant-numeric: tabular-nums; + } +} + +/* Тонкий скроллбар для полосы вкладок */ +.scrollbar-none { + scrollbar-width: none; +} +.scrollbar-none::-webkit-scrollbar { + display: none; +} diff --git a/src/ui/alert-dialog.tsx b/src/ui/alert-dialog.tsx index 0872b14..5c7eb4f 100644 --- a/src/ui/alert-dialog.tsx +++ b/src/ui/alert-dialog.tsx @@ -1,9 +1,9 @@ import * as React from "react" -import { cn } from "@/lib/utils" +import { cn } from "../lib/utils" import { AlertDialog as AlertDialogPrimitive } from "radix-ui" -import { Button } from "@/components/ui/button" +import { Button } from "./button" function AlertDialog({ ...props diff --git a/src/ui/avatar.tsx b/src/ui/avatar.tsx index 9c5f7d8..75bca7b 100644 --- a/src/ui/avatar.tsx +++ b/src/ui/avatar.tsx @@ -1,6 +1,6 @@ import * as React from "react" -import { cn } from "@/lib/utils" +import { cn } from "../lib/utils" import { Avatar as AvatarPrimitive } from "radix-ui" function Avatar({ diff --git a/src/ui/badge.tsx b/src/ui/badge.tsx index 2b41c16..b859605 100644 --- a/src/ui/badge.tsx +++ b/src/ui/badge.tsx @@ -1,6 +1,6 @@ import * as React from "react" import { cva, type VariantProps } from "class-variance-authority" -import { cn } from "@/lib/utils" +import { cn } from "../lib/utils" import { Slot } from "radix-ui" const badgeVariants = cva( diff --git a/src/ui/button.tsx b/src/ui/button.tsx index 0d202d6..d08ed38 100644 --- a/src/ui/button.tsx +++ b/src/ui/button.tsx @@ -1,6 +1,6 @@ import * as React from "react" import { cva, type VariantProps } from "class-variance-authority" -import { cn } from "@/lib/utils" +import { cn } from "../lib/utils" import { Slot } from "radix-ui" const buttonVariants = cva( diff --git a/src/ui/calendar.tsx b/src/ui/calendar.tsx index 1663b09..38baf28 100644 --- a/src/ui/calendar.tsx +++ b/src/ui/calendar.tsx @@ -1,6 +1,6 @@ import * as React from "react" -import { cn } from "@/lib/utils" +import { cn } from "../lib/utils" import { ChevronDownIcon, ChevronLeftIcon, @@ -13,7 +13,7 @@ import { } from "react-day-picker" import { ru } from "react-day-picker/locale" -import { Button, buttonVariants } from "@/components/ui/button" +import { Button, buttonVariants } from "./button" function Calendar({ className, diff --git a/src/ui/card.tsx b/src/ui/card.tsx index 6c922ec..c9f42c7 100644 --- a/src/ui/card.tsx +++ b/src/ui/card.tsx @@ -1,5 +1,5 @@ import * as React from "react" -import { cn } from "@/lib/utils" +import { cn } from "../lib/utils" function Card({ className, ...props }: React.ComponentProps<"div">) { return ( diff --git a/src/ui/checkbox.tsx b/src/ui/checkbox.tsx index 85ff86d..24e79e6 100644 --- a/src/ui/checkbox.tsx +++ b/src/ui/checkbox.tsx @@ -1,6 +1,6 @@ import * as React from "react" -import { cn } from "@/lib/utils" +import { cn } from "../lib/utils" import { CheckIcon } from "lucide-react" import { Checkbox as CheckboxPrimitive } from "radix-ui" diff --git a/src/ui/command.tsx b/src/ui/command.tsx index 018258f..59123a3 100644 --- a/src/ui/command.tsx +++ b/src/ui/command.tsx @@ -1,7 +1,7 @@ import * as React from "react" import { Command as CommandPrimitive } from "cmdk" -import { cn } from "@/lib/utils" +import { cn } from "../lib/utils" import { SearchIcon } from "lucide-react" import { @@ -10,7 +10,7 @@ import { DialogDescription, DialogHeader, DialogTitle, -} from "@/components/ui/dialog" +} from "./dialog" function Command({ className, diff --git a/src/ui/context-menu.tsx b/src/ui/context-menu.tsx index 0598280..64670e9 100644 --- a/src/ui/context-menu.tsx +++ b/src/ui/context-menu.tsx @@ -1,6 +1,6 @@ import * as React from "react" -import { cn } from "@/lib/utils" +import { cn } from "../lib/utils" import { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react" import { ContextMenu as ContextMenuPrimitive } from "radix-ui" diff --git a/src/ui/dialog.tsx b/src/ui/dialog.tsx index 671c8b6..f01bcc4 100644 --- a/src/ui/dialog.tsx +++ b/src/ui/dialog.tsx @@ -1,10 +1,10 @@ import * as React from "react" -import { cn } from "@/lib/utils" +import { cn } from "../lib/utils" import { XIcon } from "lucide-react" import { Dialog as DialogPrimitive } from "radix-ui" -import { Button } from "@/components/ui/button" +import { Button } from "./button" function Dialog({ ...props diff --git a/src/ui/dropdown-menu.tsx b/src/ui/dropdown-menu.tsx index 1b4ec7f..80da117 100644 --- a/src/ui/dropdown-menu.tsx +++ b/src/ui/dropdown-menu.tsx @@ -1,6 +1,6 @@ import * as React from "react" -import { cn } from "@/lib/utils" +import { cn } from "../lib/utils" import { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react" import { DropdownMenu as DropdownMenuPrimitive } from "radix-ui" diff --git a/src/ui/empty.tsx b/src/ui/empty.tsx index ebcce89..21c7992 100644 --- a/src/ui/empty.tsx +++ b/src/ui/empty.tsx @@ -1,5 +1,5 @@ import { cva, type VariantProps } from "class-variance-authority" -import { cn } from "@/lib/utils" +import { cn } from "../lib/utils" function Empty({ className, ...props }: React.ComponentProps<"div">) { return ( diff --git a/src/ui/hover-card.tsx b/src/ui/hover-card.tsx index 0e7a9a8..0bc6899 100644 --- a/src/ui/hover-card.tsx +++ b/src/ui/hover-card.tsx @@ -1,6 +1,6 @@ import * as React from "react" -import { cn } from "@/lib/utils" +import { cn } from "../lib/utils" import { HoverCard as HoverCardPrimitive } from "radix-ui" function HoverCard({ diff --git a/src/ui/input-group.tsx b/src/ui/input-group.tsx index cb36bf1..b4ea188 100644 --- a/src/ui/input-group.tsx +++ b/src/ui/input-group.tsx @@ -1,11 +1,11 @@ import * as React from "react" import { cva, type VariantProps } from "class-variance-authority" -import { cn } from "@/lib/utils" +import { cn } from "../lib/utils" -import { Button } from "@/components/ui/button" -import { Input } from "@/components/ui/input" -import { Textarea } from "@/components/ui/textarea" +import { Button } from "./button" +import { Input } from "./input" +import { Textarea } from "./textarea" function InputGroup({ className, ...props }: React.ComponentProps<"div">) { return ( diff --git a/src/ui/input.tsx b/src/ui/input.tsx index 1e3b932..3a7d873 100644 --- a/src/ui/input.tsx +++ b/src/ui/input.tsx @@ -1,5 +1,5 @@ import * as React from "react" -import { cn } from "@/lib/utils" +import { cn } from "../lib/utils" function Input({ className, type, ...props }: React.ComponentProps<"input">) { return ( diff --git a/src/ui/kbd.tsx b/src/ui/kbd.tsx index 2459224..cf440b5 100644 --- a/src/ui/kbd.tsx +++ b/src/ui/kbd.tsx @@ -1,4 +1,4 @@ -import { cn } from "@/lib/utils" +import { cn } from "../lib/utils" function Kbd({ className, ...props }: React.ComponentProps<"kbd">) { return ( diff --git a/src/ui/label.tsx b/src/ui/label.tsx index 00f7d60..c7008d2 100644 --- a/src/ui/label.tsx +++ b/src/ui/label.tsx @@ -1,6 +1,6 @@ import * as React from "react" -import { cn } from "@/lib/utils" +import { cn } from "../lib/utils" import { Label as LabelPrimitive } from "radix-ui" function Label({ diff --git a/src/ui/popover.tsx b/src/ui/popover.tsx index c3401d0..2eb5339 100644 --- a/src/ui/popover.tsx +++ b/src/ui/popover.tsx @@ -1,6 +1,6 @@ import * as React from "react" -import { cn } from "@/lib/utils" +import { cn } from "../lib/utils" import { Popover as PopoverPrimitive } from "radix-ui" function Popover({ diff --git a/src/ui/progress.tsx b/src/ui/progress.tsx index 7c704b2..d874392 100644 --- a/src/ui/progress.tsx +++ b/src/ui/progress.tsx @@ -1,6 +1,6 @@ import * as React from "react" -import { cn } from "@/lib/utils" +import { cn } from "../lib/utils" import { Progress as ProgressPrimitive } from "radix-ui" function Progress({ diff --git a/src/ui/scroll-area.tsx b/src/ui/scroll-area.tsx index 31ac007..9fae11b 100644 --- a/src/ui/scroll-area.tsx +++ b/src/ui/scroll-area.tsx @@ -1,6 +1,6 @@ import * as React from "react" -import { cn } from "@/lib/utils" +import { cn } from "../lib/utils" import { ScrollArea as ScrollAreaPrimitive } from "radix-ui" // Как tui-scrollbar в старом UI: нативный скролл скрыт, поверх контента — diff --git a/src/ui/select.tsx b/src/ui/select.tsx index 17a82cd..c5ad851 100644 --- a/src/ui/select.tsx +++ b/src/ui/select.tsx @@ -1,6 +1,6 @@ import * as React from "react" -import { cn } from "@/lib/utils" +import { cn } from "../lib/utils" import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react" import { Select as SelectPrimitive } from "radix-ui" diff --git a/src/ui/separator.tsx b/src/ui/separator.tsx index 89269d4..6e0340b 100644 --- a/src/ui/separator.tsx +++ b/src/ui/separator.tsx @@ -1,6 +1,6 @@ import * as React from "react" -import { cn } from "@/lib/utils" +import { cn } from "../lib/utils" import { Separator as SeparatorPrimitive } from "radix-ui" function Separator({ diff --git a/src/ui/sheet.tsx b/src/ui/sheet.tsx index ada93ce..ac739db 100644 --- a/src/ui/sheet.tsx +++ b/src/ui/sheet.tsx @@ -1,6 +1,6 @@ import * as React from "react" -import { cn } from "@/lib/utils" +import { cn } from "../lib/utils" import { XIcon } from "lucide-react" import { Dialog as SheetPrimitive } from "radix-ui" diff --git a/src/ui/skeleton.tsx b/src/ui/skeleton.tsx index 3ec6be7..fe08ad7 100644 --- a/src/ui/skeleton.tsx +++ b/src/ui/skeleton.tsx @@ -1,4 +1,4 @@ -import { cn } from "@/lib/utils" +import { cn } from "../lib/utils" function Skeleton({ className, ...props }: React.ComponentProps<"div">) { return ( diff --git a/src/ui/sonner.tsx b/src/ui/sonner.tsx index f58a6d1..98b34b6 100644 --- a/src/ui/sonner.tsx +++ b/src/ui/sonner.tsx @@ -6,7 +6,7 @@ import { OctagonXIcon, TriangleAlertIcon, } from "lucide-react" -import { useTheme } from "@/components/theme-provider" +import { useTheme } from "../theme-provider" import { Toaster as Sonner, type ToasterProps } from "sonner" const Toaster = ({ ...props }: ToasterProps) => { diff --git a/src/ui/switch.tsx b/src/ui/switch.tsx index bddbec7..bc59792 100644 --- a/src/ui/switch.tsx +++ b/src/ui/switch.tsx @@ -1,6 +1,6 @@ import * as React from "react" -import { cn } from "@/lib/utils" +import { cn } from "../lib/utils" import { Switch as SwitchPrimitive } from "radix-ui" function Switch({ diff --git a/src/ui/table.tsx b/src/ui/table.tsx index 1b302cd..bbd5589 100644 --- a/src/ui/table.tsx +++ b/src/ui/table.tsx @@ -1,6 +1,6 @@ import * as React from "react" -import { cn } from "@/lib/utils" +import { cn } from "../lib/utils" function Table({ className, ...props }: React.ComponentProps<"table">) { return ( diff --git a/src/ui/tabs.tsx b/src/ui/tabs.tsx index 25014f5..cc9c547 100644 --- a/src/ui/tabs.tsx +++ b/src/ui/tabs.tsx @@ -1,7 +1,7 @@ import * as React from "react" import { cva, type VariantProps } from "class-variance-authority" -import { cn } from "@/lib/utils" +import { cn } from "../lib/utils" import { Tabs as TabsPrimitive } from "radix-ui" function Tabs({ diff --git a/src/ui/textarea.tsx b/src/ui/textarea.tsx index 8d02e03..4b2b7ad 100644 --- a/src/ui/textarea.tsx +++ b/src/ui/textarea.tsx @@ -1,5 +1,5 @@ import * as React from "react" -import { cn } from "@/lib/utils" +import { cn } from "../lib/utils" function Textarea({ className, ...props }: React.ComponentProps<"textarea">) { return ( diff --git a/src/ui/toggle-group.tsx b/src/ui/toggle-group.tsx index 02b2529..52049dd 100644 --- a/src/ui/toggle-group.tsx +++ b/src/ui/toggle-group.tsx @@ -1,10 +1,10 @@ import * as React from "react" import { type VariantProps } from "class-variance-authority" -import { cn } from "@/lib/utils" +import { cn } from "../lib/utils" import { ToggleGroup as ToggleGroupPrimitive } from "radix-ui" -import { toggleVariants } from "@/components/ui/toggle" +import { toggleVariants } from "./toggle" const ToggleGroupContext = React.createContext< VariantProps & { diff --git a/src/ui/toggle.tsx b/src/ui/toggle.tsx index 458b628..4d73cf0 100644 --- a/src/ui/toggle.tsx +++ b/src/ui/toggle.tsx @@ -1,7 +1,7 @@ import * as React from "react" import { cva, type VariantProps } from "class-variance-authority" -import { cn } from "@/lib/utils" +import { cn } from "../lib/utils" import { Toggle as TogglePrimitive } from "radix-ui" const toggleVariants = cva( diff --git a/src/ui/tooltip.tsx b/src/ui/tooltip.tsx index a78268f..10efec4 100644 --- a/src/ui/tooltip.tsx +++ b/src/ui/tooltip.tsx @@ -1,6 +1,6 @@ import * as React from "react" -import { cn } from "@/lib/utils" +import { cn } from "../lib/utils" import { Tooltip as TooltipPrimitive } from "radix-ui" function TooltipProvider({ diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..7f0ea95 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "tsBuildInfoFile": "../../node_modules/.tmp/tsconfig.medkit.tsbuildinfo", + "target": "es2023", + "lib": ["ES2023", "DOM", "DOM.Iterable"], + "module": "esnext", + "types": [], + "skipLibCheck": true, + + /* Bundler mode */ + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "verbatimModuleSyntax": true, + "moduleDetection": "force", + "noEmit": true, + "jsx": "react-jsx", + + /* Linting */ + "noUnusedLocals": true, + "noUnusedParameters": true, + "erasableSyntaxOnly": true, + "noFallthroughCasesInSwitch": true + }, + "include": ["src"] +}