From 87d12b72ecf607040d45c0558d6106b181397074 Mon Sep 17 00:00:00 2001 From: Ilya Mukhortov Date: Mon, 26 Oct 2026 09:14:11 +1000 Subject: [PATCH] Text sizes through cn(), tab underline, sticky table header, release 0.7.1 - cn(): tailwind-merge knows text-ui / text-2xs / text-3xs. Before, text-ui was taken for a colour and dropped next to text-, so section tabs and other text-ui labels rendered at 16px instead of 13px (regression from 0.7.0). - ContentTabs: the line underline no longer overflows the strip by 1px (the strip stopped being vertically scrollable); new `actions` slot puts buttons in the same row with one shared bottom line. - DataTable: sticky header has a solid background and its divider is a cell shadow, so it scrolls with the header and rows don't show through. - PageFrame: the title is a pill like the SectionTabsBar root tab (13px medium, same height and position). - ScheduleGrid: solid sticky header. Co-Authored-By: Claude Opus 5.5 --- README.md | 2 +- package.json | 2 +- src/kit/content-tabs.tsx | 34 +++++++++++++++++++++++++++++----- src/kit/data-table.tsx | 8 ++++++-- src/kit/page-frame.tsx | 12 ++++++++---- src/kit/schedule-grid.tsx | 2 +- src/lib/utils.ts | 8 +++++++- 7 files changed, 53 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index ec026e6..ed0de9d 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ src/styles.css тема (токены, шрифты, тёмный режим) Пакет ставится прямо из git, версии — теги `vX.Y.Z`: ```bash -npm i "git+https://git.med-logic.ru/medlogic/medkit.git#semver:^0.7.0" +npm i "git+https://git.med-logic.ru/medlogic/medkit.git#semver:^0.7.1" ``` `package-lock.json` фиксирует коммит; обновиться до свежего тега — `npm update @medkit/ui`. В medicine-ui kit подключён git-submodule в `packages/medkit` (npm workspace) — правки видны сразу. diff --git a/package.json b/package.json index e2202e3..5327f56 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@medkit/ui", - "version": "0.7.0", + "version": "0.7.1", "private": true, "description": "Medkit — UI kit МИС «Медицина»: React 19 + Tailwind 4 + Radix (shadcn/ui)", "repository": { diff --git a/src/kit/content-tabs.tsx b/src/kit/content-tabs.tsx index 2223e62..0627478 100644 --- a/src/kit/content-tabs.tsx +++ b/src/kit/content-tabs.tsx @@ -1,3 +1,4 @@ +import * as React from "react" import { type LucideIcon } from "lucide-react" import { cn } from "../lib/utils" @@ -18,28 +19,37 @@ export interface ContentTabItem { * Контентные вкладки внутри страницы/карточки. * `line` — подчёркивание (разделы карточки), `pill` — заливка (переключатели в блоках). * Вкладки-фильтры по статусам: `{ id, label, count, tone }`, первая — «Все» без тона. + * `actions` — кнопки справа в той же строке («Наклейки», «Excel»): у вкладок и кнопок одна + * нижняя линия, подчёркивание лежит прямо на ней. Не собирать такую строку вручную + * из ContentTabs с `border-b-0` — подчёркивание повиснет над линией. */ export function ContentTabs({ tabs, value, onValueChange, variant = "line", + actions, className, }: { tabs: readonly ContentTabItem[] value: T onValueChange: (value: T) => void variant?: "line" | "pill" + /** Кнопки справа в строке вкладок. */ + actions?: React.ReactNode className?: string }) { - return ( + const list = (
{tabs.map((tab) => { @@ -76,11 +86,25 @@ export function ContentTabs({ )} {variant === "line" && active && ( - + )} ) })}
) + + if (!actions) return list + return ( +
+ {list} +
{actions}
+
+ ) } diff --git a/src/kit/data-table.tsx b/src/kit/data-table.tsx index 6b1e0a0..c467325 100644 --- a/src/kit/data-table.tsx +++ b/src/kit/data-table.tsx @@ -122,7 +122,8 @@ export function DataTable({ return ( - + {/* Липкая шапка: фон непрозрачный, линия — тенью ячеек (border у thead при прокрутке остаётся на месте). */} + {columns.map((col) => { const active = sort?.id === col.id @@ -131,7 +132,10 @@ export function DataTable({
{col.sort && onSortChange ? (