@mednet/ui 0.0.0-stage → 1.0.0
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/LICENSE +21 -0
- package/README.md +46 -2
- package/THIRD_PARTY_NOTICES.md +27 -0
- package/dist/brand/logo/logo-horizontal.d.ts +6 -0
- package/dist/brand/logo/logo-horizontal.js +7 -0
- package/dist/brand/logo/logo-mark.d.ts +6 -0
- package/dist/brand/logo/logo-mark.js +7 -0
- package/dist/brand/logo/logo-vertical.d.ts +6 -0
- package/dist/brand/logo/logo-vertical.js +7 -0
- package/dist/brand/logo.d.ts +18 -0
- package/dist/brand/logo.js +12 -0
- package/dist/brand/site-footer.d.ts +24 -0
- package/dist/brand/site-footer.js +15 -0
- package/dist/brand/site-header.d.ts +11 -0
- package/dist/brand/site-header.js +7 -0
- package/dist/components/accordion.d.ts +6 -0
- package/dist/components/accordion.js +17 -0
- package/dist/components/alert-dialog.d.ts +18 -0
- package/dist/components/alert-dialog.js +42 -0
- package/dist/components/alert.d.ts +10 -0
- package/dist/components/alert.js +27 -0
- package/dist/components/aspect-ratio.d.ts +4 -0
- package/dist/components/aspect-ratio.js +8 -0
- package/dist/components/attachment.d.ts +23 -0
- package/dist/components/attachment.js +68 -0
- package/dist/components/avatar.d.ts +11 -0
- package/dist/components/avatar.js +23 -0
- package/dist/components/badge.d.ts +7 -0
- package/dist/components/badge.js +33 -0
- package/dist/components/breadcrumb.d.ts +10 -0
- package/dist/components/breadcrumb.js +36 -0
- package/dist/components/bubble.d.ts +16 -0
- package/dist/components/bubble.js +59 -0
- package/dist/components/button-group.d.ts +10 -0
- package/dist/components/button-group.js +36 -0
- package/dist/components/button.d.ts +8 -0
- package/dist/components/button.js +34 -0
- package/dist/components/calendar.d.ts +10 -0
- package/dist/components/calendar.js +76 -0
- package/dist/components/card.d.ts +11 -0
- package/dist/components/card.js +24 -0
- package/dist/components/carousel.d.ts +28 -0
- package/dist/components/carousel.js +91 -0
- package/dist/components/chart.d.ts +44 -0
- package/dist/components/chart.js +132 -0
- package/dist/components/checkbox.d.ts +3 -0
- package/dist/components/checkbox.js +9 -0
- package/dist/components/collapsible.d.ts +5 -0
- package/dist/components/collapsible.js +13 -0
- package/dist/components/combobox.d.ts +24 -0
- package/dist/components/combobox.js +58 -0
- package/dist/components/command.d.ts +19 -0
- package/dist/components/command.js +35 -0
- package/dist/components/context-menu.d.ts +29 -0
- package/dist/components/context-menu.js +51 -0
- package/dist/components/dialog.d.ts +17 -0
- package/dist/components/dialog.js +37 -0
- package/dist/components/direction.d.ts +1 -0
- package/dist/components/direction.js +2 -0
- package/dist/components/drawer.d.ts +16 -0
- package/dist/components/drawer.js +75 -0
- package/dist/components/dropdown-menu.d.ts +29 -0
- package/dist/components/dropdown-menu.js +51 -0
- package/dist/components/empty.d.ts +11 -0
- package/dist/components/empty.js +33 -0
- package/dist/components/field.d.ts +24 -0
- package/dist/components/field.js +68 -0
- package/dist/components/hover-card.d.ts +5 -0
- package/dist/components/hover-card.js +14 -0
- package/dist/components/input-group.d.ts +18 -0
- package/dist/components/input-group.js +57 -0
- package/dist/components/input-otp.d.ts +11 -0
- package/dist/components/input-otp.js +21 -0
- package/dist/components/input.d.ts +3 -0
- package/dist/components/input.js +7 -0
- package/dist/components/item.d.ts +22 -0
- package/dist/components/item.js +78 -0
- package/dist/components/kbd.d.ts +3 -0
- package/dist/components/kbd.js +9 -0
- package/dist/components/label.d.ts +3 -0
- package/dist/components/label.js +7 -0
- package/dist/components/marker.d.ts +10 -0
- package/dist/components/marker.js +34 -0
- package/dist/components/menubar.d.ts +29 -0
- package/dist/components/menubar.js +56 -0
- package/dist/components/message-scroller.d.ts +10 -0
- package/dist/components/message-scroller.js +25 -0
- package/dist/components/message.d.ts +10 -0
- package/dist/components/message.js +21 -0
- package/dist/components/native-select.d.ts +8 -0
- package/dist/components/native-select.js +13 -0
- package/dist/components/navigation-menu.d.ts +11 -0
- package/dist/components/navigation-menu.js +31 -0
- package/dist/components/pagination.d.ts +17 -0
- package/dist/components/pagination.js +26 -0
- package/dist/components/popover.d.ts +9 -0
- package/dist/components/popover.js +23 -0
- package/dist/components/progress.d.ts +7 -0
- package/dist/components/progress.js +20 -0
- package/dist/components/questionnaire.d.ts +19 -0
- package/dist/components/questionnaire.js +52 -0
- package/dist/components/radio-group.d.ts +5 -0
- package/dist/components/radio-group.js +12 -0
- package/dist/components/resizable.d.ts +7 -0
- package/dist/components/resizable.js +14 -0
- package/dist/components/scroll-area.d.ts +5 -0
- package/dist/components/scroll-area.js +11 -0
- package/dist/components/select.d.ts +15 -0
- package/dist/components/select.js +34 -0
- package/dist/components/separator.d.ts +3 -0
- package/dist/components/separator.js +8 -0
- package/dist/components/sheet.d.ts +14 -0
- package/dist/components/sheet.js +37 -0
- package/dist/components/sidebar.d.ts +63 -0
- package/dist/components/sidebar.js +256 -0
- package/dist/components/skeleton.d.ts +2 -0
- package/dist/components/skeleton.js +6 -0
- package/dist/components/slider.d.ts +3 -0
- package/dist/components/slider.js +12 -0
- package/dist/components/spinner.d.ts +2 -0
- package/dist/components/spinner.js +7 -0
- package/dist/components/switch.d.ts +5 -0
- package/dist/components/switch.js +8 -0
- package/dist/components/table.d.ts +10 -0
- package/dist/components/table.js +28 -0
- package/dist/components/tabs.d.ts +10 -0
- package/dist/components/tabs.js +29 -0
- package/dist/components/textarea.d.ts +3 -0
- package/dist/components/textarea.js +6 -0
- package/dist/components/toast.d.ts +16 -0
- package/dist/components/toast.js +66 -0
- package/dist/components/toggle-group.d.ts +11 -0
- package/dist/components/toggle-group.js +24 -0
- package/dist/components/toggle.d.ts +8 -0
- package/dist/components/toggle.js +26 -0
- package/dist/components/tooltip.d.ts +6 -0
- package/dist/components/tooltip.js +17 -0
- package/dist/hooks/use-mobile.d.ts +1 -0
- package/dist/hooks/use-mobile.js +15 -0
- package/dist/index.d.ts +67 -0
- package/dist/index.js +69 -0
- package/dist/layouts/app-shell.d.ts +19 -0
- package/dist/layouts/app-shell.js +9 -0
- package/dist/layouts/public-layout.d.ts +14 -0
- package/dist/layouts/public-layout.js +8 -0
- package/dist/layouts/skip-link.d.ts +2 -0
- package/dist/layouts/skip-link.js +5 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/lib/utils.js +7 -0
- package/llms.md +521 -0
- package/package.json +128 -3
- package/postcss.cjs +163 -0
- package/src/brand.css +69 -0
- package/src/shadcn-tailwind.css +638 -0
- package/src/styles.css +48 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Toast as ToastPrimitive } from "@base-ui/react/toast";
|
|
4
|
+
import { cn } from "#lib/utils";
|
|
5
|
+
import { Button } from "#components/button";
|
|
6
|
+
import { XIcon, CircleCheckIcon, InfoIcon, TriangleAlertIcon, OctagonXIcon, Loader2Icon } from "lucide-react";
|
|
7
|
+
const toast = ToastPrimitive.createToastManager();
|
|
8
|
+
function ToastProvider({ ...props }) {
|
|
9
|
+
return _jsx(ToastPrimitive.Provider, { ...props });
|
|
10
|
+
}
|
|
11
|
+
function ToastPortal({ ...props }) {
|
|
12
|
+
return _jsx(ToastPrimitive.Portal, { "data-slot": "toast-portal", ...props });
|
|
13
|
+
}
|
|
14
|
+
function ToastViewport({ className, ...props }) {
|
|
15
|
+
return (_jsx(ToastPrimitive.Viewport, { "data-slot": "toast-viewport", className: cn("pointer-events-none fixed inset-x-4 bottom-4 z-50 mx-auto w-auto max-w-sm outline-none sm:right-4 sm:left-auto sm:mx-0 sm:w-full", className), ...props }));
|
|
16
|
+
}
|
|
17
|
+
function Toast({ className, ...props }) {
|
|
18
|
+
return (_jsx(ToastPrimitive.Root, { "data-slot": "toast", className: cn("group/toast pointer-events-auto absolute right-0 bottom-0 z-[calc(1000-var(--toast-index))] w-full origin-bottom rounded-2xl border bg-popover text-popover-foreground shadow-lg will-change-transform outline-none select-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50", "[--gap:0.75rem] [--height:var(--toast-frontmost-height,var(--toast-height))] [--offset-y:calc(var(--toast-offset-y)*-1+calc(var(--toast-index)*var(--gap)*-1)+var(--toast-swipe-movement-y))] [--peek:0.75rem] [--scale:calc(max(0,1-(var(--toast-index)*0.1)))] [--shrink:calc(1-var(--scale))]", "h-(--height) [transform:translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-swipe-movement-y)-(var(--toast-index)*var(--peek))-(var(--shrink)*var(--height))))_scale(var(--scale))] [transition:transform_500ms_cubic-bezier(0.22,1,0.36,1),opacity_500ms,height_150ms]", "after:absolute after:top-full after:left-0 after:h-[calc(var(--gap)+1px)] after:w-full after:content-['']", "data-expanded:h-(--toast-height) data-expanded:[transform:translateX(var(--toast-swipe-movement-x))_translateY(var(--offset-y))]", "data-limited:opacity-0 data-starting-style:[transform:translateY(150%)]", "[&[data-ending-style]:not([data-limited]):not([data-swipe-direction])]:[transform:translateY(150%)]", "data-ending-style:data-[swipe-direction=down]:[transform:translateY(calc(var(--toast-swipe-movement-y)+150%))]", "data-ending-style:data-[swipe-direction=left]:[transform:translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))]", "data-ending-style:data-[swipe-direction=right]:[transform:translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))]", "data-ending-style:data-[swipe-direction=up]:[transform:translateY(calc(var(--toast-swipe-movement-y)-150%))]", "data-expanded:data-ending-style:data-[swipe-direction=down]:[transform:translateY(calc(var(--toast-swipe-movement-y)+150%))]", "data-expanded:data-ending-style:data-[swipe-direction=left]:[transform:translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))]", "data-expanded:data-ending-style:data-[swipe-direction=right]:[transform:translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))]", "data-expanded:data-ending-style:data-[swipe-direction=up]:[transform:translateY(calc(var(--toast-swipe-movement-y)-150%))]", className), ...props }));
|
|
19
|
+
}
|
|
20
|
+
function ToastContent({ className, ...props }) {
|
|
21
|
+
return (_jsx(ToastPrimitive.Content, { "data-slot": "toast-content", className: cn("flex h-full items-center gap-3 overflow-hidden p-4 transition-opacity duration-250 ease-[cubic-bezier(0.22,1,0.36,1)] data-behind:opacity-0 data-expanded:opacity-100", className), ...props }));
|
|
22
|
+
}
|
|
23
|
+
function ToastTitle({ className, ...props }) {
|
|
24
|
+
return (_jsx(ToastPrimitive.Title, { "data-slot": "toast-title", className: cn("text-sm font-medium", className), ...props }));
|
|
25
|
+
}
|
|
26
|
+
function ToastDescription({ className, ...props }) {
|
|
27
|
+
return (_jsx(ToastPrimitive.Description, { "data-slot": "toast-description", className: cn("text-sm text-muted-foreground", className), ...props }));
|
|
28
|
+
}
|
|
29
|
+
function ToastAction({ className, render = _jsx(Button, { variant: "outline", size: "sm" }), ...props }) {
|
|
30
|
+
return (_jsx(ToastPrimitive.Action, { "data-slot": "toast-action", render: render, className: cn("shrink-0", className), ...props }));
|
|
31
|
+
}
|
|
32
|
+
function ToastClose({ className, children, render = _jsx(Button, { variant: "ghost", size: "icon-sm" }), ...props }) {
|
|
33
|
+
return (_jsx(ToastPrimitive.Close, { "data-slot": "toast-close", "aria-label": "\u0417\u0430\u043A\u0440\u044B\u0442\u044C \u0443\u0432\u0435\u0434\u043E\u043C\u043B\u0435\u043D\u0438\u0435", render: render, className: cn("relative shrink-0 text-muted-foreground after:absolute after:-inset-2 after:content-[''] hover:text-foreground", className), ...props, children: children ?? (_jsx(XIcon, { "aria-hidden": "true" })) }));
|
|
34
|
+
}
|
|
35
|
+
function ToastIcon({ type }) {
|
|
36
|
+
let icon = null;
|
|
37
|
+
if (type === "success") {
|
|
38
|
+
icon = (_jsx(CircleCheckIcon, { "aria-hidden": "true" }));
|
|
39
|
+
}
|
|
40
|
+
if (type === "info") {
|
|
41
|
+
icon = (_jsx(InfoIcon, { "aria-hidden": "true" }));
|
|
42
|
+
}
|
|
43
|
+
if (type === "warning") {
|
|
44
|
+
icon = (_jsx(TriangleAlertIcon, { "aria-hidden": "true" }));
|
|
45
|
+
}
|
|
46
|
+
if (type === "error") {
|
|
47
|
+
icon = (_jsx(OctagonXIcon, { className: "text-destructive", "aria-hidden": "true" }));
|
|
48
|
+
}
|
|
49
|
+
if (type === "loading") {
|
|
50
|
+
icon = (_jsx(Loader2Icon, { className: "animate-spin", "aria-hidden": "true" }));
|
|
51
|
+
}
|
|
52
|
+
if (!icon) {
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
return (_jsx("span", { "data-slot": "toast-icon", className: "shrink-0 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4", children: icon }));
|
|
56
|
+
}
|
|
57
|
+
function ToastList() {
|
|
58
|
+
const { toasts } = ToastPrimitive.useToastManager();
|
|
59
|
+
return toasts.map((toastItem) => (_jsx(Toast, { toast: toastItem, children: _jsxs(ToastContent, { children: [_jsx(ToastIcon, { type: toastItem.type }), _jsxs("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [_jsx(ToastTitle, {}), _jsx(ToastDescription, {})] }), _jsx(ToastAction, {}), _jsx(ToastClose, {})] }) }, toastItem.id)));
|
|
60
|
+
}
|
|
61
|
+
function Toaster({ children, toastManager = toast, ...props }) {
|
|
62
|
+
return (_jsxs(ToastProvider, { toastManager: toastManager, ...props, children: [children, _jsx(ToastPortal, { children: _jsx(ToastViewport, { children: _jsx(ToastList, {}) }) })] }));
|
|
63
|
+
}
|
|
64
|
+
const createToastManager = ToastPrimitive.createToastManager;
|
|
65
|
+
const useToastManager = ToastPrimitive.useToastManager;
|
|
66
|
+
export { Toaster, Toast, ToastAction, ToastClose, ToastContent, ToastDescription, ToastPortal, ToastProvider, ToastTitle, ToastViewport, createToastManager, toast, useToastManager, };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Toggle as TogglePrimitive } from "@base-ui/react/toggle";
|
|
3
|
+
import { ToggleGroup as ToggleGroupPrimitive } from "@base-ui/react/toggle-group";
|
|
4
|
+
import { type VariantProps } from "class-variance-authority";
|
|
5
|
+
import { toggleVariants } from "#components/toggle";
|
|
6
|
+
declare function ToggleGroup({ className, variant, size, spacing, orientation, children, ...props }: ToggleGroupPrimitive.Props & VariantProps<typeof toggleVariants> & {
|
|
7
|
+
spacing?: number;
|
|
8
|
+
orientation?: "horizontal" | "vertical";
|
|
9
|
+
}): React.JSX.Element;
|
|
10
|
+
declare function ToggleGroupItem({ className, children, variant, size, ...props }: TogglePrimitive.Props & VariantProps<typeof toggleVariants>): React.JSX.Element;
|
|
11
|
+
export { ToggleGroup, ToggleGroupItem };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Toggle as TogglePrimitive } from "@base-ui/react/toggle";
|
|
5
|
+
import { ToggleGroup as ToggleGroupPrimitive } from "@base-ui/react/toggle-group";
|
|
6
|
+
import { cn } from "#lib/utils";
|
|
7
|
+
import { toggleVariants } from "#components/toggle";
|
|
8
|
+
const ToggleGroupContext = React.createContext({
|
|
9
|
+
size: "default",
|
|
10
|
+
variant: "default",
|
|
11
|
+
spacing: 2,
|
|
12
|
+
orientation: "horizontal",
|
|
13
|
+
});
|
|
14
|
+
function ToggleGroup({ className, variant, size, spacing = 2, orientation = "horizontal", children, ...props }) {
|
|
15
|
+
return (_jsx(ToggleGroupPrimitive, { "data-slot": "toggle-group", "data-variant": variant, "data-size": size, "data-spacing": spacing, "data-orientation": orientation, style: { "--gap": spacing }, className: cn("group/toggle-group flex w-fit flex-row items-center gap-[--spacing(var(--gap))] data-[spacing=0]:data-[variant=outline]:rounded-4xl data-vertical:flex-col data-vertical:items-stretch", className), ...props, children: _jsx(ToggleGroupContext.Provider, { value: { variant, size, spacing, orientation }, children: children }) }));
|
|
16
|
+
}
|
|
17
|
+
function ToggleGroupItem({ className, children, variant = "default", size = "default", ...props }) {
|
|
18
|
+
const context = React.useContext(ToggleGroupContext);
|
|
19
|
+
return (_jsx(TogglePrimitive, { "data-slot": "toggle-group-item", "data-variant": context.variant || variant, "data-size": context.size || size, "data-spacing": context.spacing, className: cn("shrink-0 group-data-[spacing=0]/toggle-group:rounded-none group-data-[spacing=0]/toggle-group:px-3 group-data-[spacing=0]/toggle-group:shadow-none focus:z-10 focus-visible:z-10 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-end]:pr-2.5 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-start]:pl-2.5 group-data-horizontal/toggle-group:data-[spacing=0]:first:rounded-l-3xl group-data-vertical/toggle-group:data-[spacing=0]:first:rounded-t-3xl group-data-horizontal/toggle-group:data-[spacing=0]:last:rounded-r-3xl group-data-vertical/toggle-group:data-[spacing=0]:last:rounded-b-3xl data-[state=on]:bg-muted group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:border-l-0 group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:border-t-0 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-l group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-t", toggleVariants({
|
|
20
|
+
variant: context.variant || variant,
|
|
21
|
+
size: context.size || size,
|
|
22
|
+
}), className), ...props, children: children }));
|
|
23
|
+
}
|
|
24
|
+
export { ToggleGroup, ToggleGroupItem };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Toggle as TogglePrimitive } from "@base-ui/react/toggle";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
declare const toggleVariants: (props?: ({
|
|
4
|
+
variant?: "default" | "outline" | null | undefined;
|
|
5
|
+
size?: "default" | "sm" | "lg" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
declare function Toggle({ className, variant, size, ...props }: TogglePrimitive.Props & VariantProps<typeof toggleVariants>): import("react").JSX.Element;
|
|
8
|
+
export { Toggle, toggleVariants };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Toggle as TogglePrimitive } from "@base-ui/react/toggle";
|
|
4
|
+
import { cva } from "class-variance-authority";
|
|
5
|
+
import { cn } from "#lib/utils";
|
|
6
|
+
const toggleVariants = cva("group/toggle inline-flex items-center justify-center gap-1 rounded-4xl text-sm font-medium whitespace-nowrap transition-colors outline-none hover:bg-muted hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-pressed:bg-muted dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
|
|
7
|
+
variants: {
|
|
8
|
+
variant: {
|
|
9
|
+
default: "bg-transparent",
|
|
10
|
+
outline: "border border-input bg-transparent hover:bg-muted",
|
|
11
|
+
},
|
|
12
|
+
size: {
|
|
13
|
+
default: "h-9 min-w-9 px-3 has-data-[icon=inline-end]:pr-2.5 has-data-[icon=inline-start]:pl-2.5",
|
|
14
|
+
sm: "h-8 min-w-8 px-3 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
15
|
+
lg: "h-10 min-w-10 px-4 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3",
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
defaultVariants: {
|
|
19
|
+
variant: "default",
|
|
20
|
+
size: "default",
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
function Toggle({ className, variant = "default", size = "default", ...props }) {
|
|
24
|
+
return (_jsx(TogglePrimitive, { "data-slot": "toggle", className: cn(toggleVariants({ variant, size, className })), ...props }));
|
|
25
|
+
}
|
|
26
|
+
export { Toggle, toggleVariants };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Tooltip as TooltipPrimitive } from "@base-ui/react/tooltip";
|
|
2
|
+
declare function TooltipProvider({ delay, ...props }: TooltipPrimitive.Provider.Props): import("react").JSX.Element;
|
|
3
|
+
declare function Tooltip({ ...props }: TooltipPrimitive.Root.Props): import("react").JSX.Element;
|
|
4
|
+
declare function TooltipTrigger({ ...props }: TooltipPrimitive.Trigger.Props): import("react").JSX.Element;
|
|
5
|
+
declare function TooltipContent({ className, side, sideOffset, align, alignOffset, children, ...props }: TooltipPrimitive.Popup.Props & Pick<TooltipPrimitive.Positioner.Props, "align" | "alignOffset" | "side" | "sideOffset">): import("react").JSX.Element;
|
|
6
|
+
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Tooltip as TooltipPrimitive } from "@base-ui/react/tooltip";
|
|
4
|
+
import { cn } from "#lib/utils";
|
|
5
|
+
function TooltipProvider({ delay = 0, ...props }) {
|
|
6
|
+
return (_jsx(TooltipPrimitive.Provider, { "data-slot": "tooltip-provider", delay: delay, ...props }));
|
|
7
|
+
}
|
|
8
|
+
function Tooltip({ ...props }) {
|
|
9
|
+
return _jsx(TooltipPrimitive.Root, { "data-slot": "tooltip", ...props });
|
|
10
|
+
}
|
|
11
|
+
function TooltipTrigger({ ...props }) {
|
|
12
|
+
return _jsx(TooltipPrimitive.Trigger, { "data-slot": "tooltip-trigger", ...props });
|
|
13
|
+
}
|
|
14
|
+
function TooltipContent({ className, side = "top", sideOffset = 4, align = "center", alignOffset = 0, children, ...props }) {
|
|
15
|
+
return (_jsx(TooltipPrimitive.Portal, { children: _jsx(TooltipPrimitive.Positioner, { align: align, alignOffset: alignOffset, side: side, sideOffset: sideOffset, className: "isolate z-50", children: _jsxs(TooltipPrimitive.Popup, { "data-slot": "tooltip-content", className: cn("z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-2xl bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-4xl data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className), ...props, children: [children, _jsx(TooltipPrimitive.Arrow, { className: "z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:translate-x-[1.5px] data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:translate-x-[-1.5px] data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:translate-x-[-1.5px] data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:translate-x-[1.5px] data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5" })] }) }) }));
|
|
16
|
+
}
|
|
17
|
+
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useIsMobile(): boolean;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const MOBILE_BREAKPOINT = 768;
|
|
3
|
+
export function useIsMobile() {
|
|
4
|
+
const [isMobile, setIsMobile] = React.useState(undefined);
|
|
5
|
+
React.useEffect(() => {
|
|
6
|
+
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
|
|
7
|
+
const onChange = () => {
|
|
8
|
+
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
9
|
+
};
|
|
10
|
+
mql.addEventListener("change", onChange);
|
|
11
|
+
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
12
|
+
return () => mql.removeEventListener("change", onChange);
|
|
13
|
+
}, []);
|
|
14
|
+
return !!isMobile;
|
|
15
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
export * from './components/accordion.js';
|
|
2
|
+
export * from './components/alert-dialog.js';
|
|
3
|
+
export * from './components/alert.js';
|
|
4
|
+
export * from './components/aspect-ratio.js';
|
|
5
|
+
export * from './components/attachment.js';
|
|
6
|
+
export * from './components/avatar.js';
|
|
7
|
+
export * from './components/badge.js';
|
|
8
|
+
export * from './components/breadcrumb.js';
|
|
9
|
+
export * from './components/bubble.js';
|
|
10
|
+
export * from './components/button-group.js';
|
|
11
|
+
export * from './components/button.js';
|
|
12
|
+
export * from './components/calendar.js';
|
|
13
|
+
export * from './components/card.js';
|
|
14
|
+
export * from './components/carousel.js';
|
|
15
|
+
export * from './components/chart.js';
|
|
16
|
+
export * from './components/checkbox.js';
|
|
17
|
+
export * from './components/collapsible.js';
|
|
18
|
+
export * from './components/combobox.js';
|
|
19
|
+
export * from './components/command.js';
|
|
20
|
+
export * from './components/context-menu.js';
|
|
21
|
+
export * from './components/dialog.js';
|
|
22
|
+
export * from './components/direction.js';
|
|
23
|
+
export * from './components/drawer.js';
|
|
24
|
+
export * from './components/dropdown-menu.js';
|
|
25
|
+
export * from './components/empty.js';
|
|
26
|
+
export * from './components/field.js';
|
|
27
|
+
export * from './components/hover-card.js';
|
|
28
|
+
export * from './components/input-group.js';
|
|
29
|
+
export * from './components/input-otp.js';
|
|
30
|
+
export * from './components/input.js';
|
|
31
|
+
export * from './components/item.js';
|
|
32
|
+
export * from './components/kbd.js';
|
|
33
|
+
export * from './components/label.js';
|
|
34
|
+
export * from './components/marker.js';
|
|
35
|
+
export * from './components/menubar.js';
|
|
36
|
+
export * from './components/message-scroller.js';
|
|
37
|
+
export * from './components/message.js';
|
|
38
|
+
export * from './components/native-select.js';
|
|
39
|
+
export * from './components/navigation-menu.js';
|
|
40
|
+
export * from './components/pagination.js';
|
|
41
|
+
export * from './components/popover.js';
|
|
42
|
+
export * from './components/progress.js';
|
|
43
|
+
export * from './components/questionnaire.js';
|
|
44
|
+
export * from './components/radio-group.js';
|
|
45
|
+
export * from './components/resizable.js';
|
|
46
|
+
export * from './components/scroll-area.js';
|
|
47
|
+
export * from './components/select.js';
|
|
48
|
+
export * from './components/separator.js';
|
|
49
|
+
export * from './components/sheet.js';
|
|
50
|
+
export * from './components/sidebar.js';
|
|
51
|
+
export * from './components/skeleton.js';
|
|
52
|
+
export * from './components/slider.js';
|
|
53
|
+
export * from './components/spinner.js';
|
|
54
|
+
export * from './components/switch.js';
|
|
55
|
+
export * from './components/table.js';
|
|
56
|
+
export * from './components/tabs.js';
|
|
57
|
+
export * from './components/textarea.js';
|
|
58
|
+
export * from './components/toast.js';
|
|
59
|
+
export * from './components/toggle-group.js';
|
|
60
|
+
export * from './components/toggle.js';
|
|
61
|
+
export * from './components/tooltip.js';
|
|
62
|
+
export * from './brand/logo.js';
|
|
63
|
+
export * from './brand/site-footer.js';
|
|
64
|
+
export * from './brand/site-header.js';
|
|
65
|
+
export * from './layouts/app-shell.js';
|
|
66
|
+
export * from './layouts/public-layout.js';
|
|
67
|
+
export * from './lib/utils.js';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
// Сгенерировано scripts/gen-index.mjs, не редактировать.
|
|
2
|
+
// Рекомендуемый импорт — по подпутям (@mednet/ui/button): корневой индекс тянет все модули.
|
|
3
|
+
export * from './components/accordion.js';
|
|
4
|
+
export * from './components/alert-dialog.js';
|
|
5
|
+
export * from './components/alert.js';
|
|
6
|
+
export * from './components/aspect-ratio.js';
|
|
7
|
+
export * from './components/attachment.js';
|
|
8
|
+
export * from './components/avatar.js';
|
|
9
|
+
export * from './components/badge.js';
|
|
10
|
+
export * from './components/breadcrumb.js';
|
|
11
|
+
export * from './components/bubble.js';
|
|
12
|
+
export * from './components/button-group.js';
|
|
13
|
+
export * from './components/button.js';
|
|
14
|
+
export * from './components/calendar.js';
|
|
15
|
+
export * from './components/card.js';
|
|
16
|
+
export * from './components/carousel.js';
|
|
17
|
+
export * from './components/chart.js';
|
|
18
|
+
export * from './components/checkbox.js';
|
|
19
|
+
export * from './components/collapsible.js';
|
|
20
|
+
export * from './components/combobox.js';
|
|
21
|
+
export * from './components/command.js';
|
|
22
|
+
export * from './components/context-menu.js';
|
|
23
|
+
export * from './components/dialog.js';
|
|
24
|
+
export * from './components/direction.js';
|
|
25
|
+
export * from './components/drawer.js';
|
|
26
|
+
export * from './components/dropdown-menu.js';
|
|
27
|
+
export * from './components/empty.js';
|
|
28
|
+
export * from './components/field.js';
|
|
29
|
+
export * from './components/hover-card.js';
|
|
30
|
+
export * from './components/input-group.js';
|
|
31
|
+
export * from './components/input-otp.js';
|
|
32
|
+
export * from './components/input.js';
|
|
33
|
+
export * from './components/item.js';
|
|
34
|
+
export * from './components/kbd.js';
|
|
35
|
+
export * from './components/label.js';
|
|
36
|
+
export * from './components/marker.js';
|
|
37
|
+
export * from './components/menubar.js';
|
|
38
|
+
export * from './components/message-scroller.js';
|
|
39
|
+
export * from './components/message.js';
|
|
40
|
+
export * from './components/native-select.js';
|
|
41
|
+
export * from './components/navigation-menu.js';
|
|
42
|
+
export * from './components/pagination.js';
|
|
43
|
+
export * from './components/popover.js';
|
|
44
|
+
export * from './components/progress.js';
|
|
45
|
+
export * from './components/questionnaire.js';
|
|
46
|
+
export * from './components/radio-group.js';
|
|
47
|
+
export * from './components/resizable.js';
|
|
48
|
+
export * from './components/scroll-area.js';
|
|
49
|
+
export * from './components/select.js';
|
|
50
|
+
export * from './components/separator.js';
|
|
51
|
+
export * from './components/sheet.js';
|
|
52
|
+
export * from './components/sidebar.js';
|
|
53
|
+
export * from './components/skeleton.js';
|
|
54
|
+
export * from './components/slider.js';
|
|
55
|
+
export * from './components/spinner.js';
|
|
56
|
+
export * from './components/switch.js';
|
|
57
|
+
export * from './components/table.js';
|
|
58
|
+
export * from './components/tabs.js';
|
|
59
|
+
export * from './components/textarea.js';
|
|
60
|
+
export * from './components/toast.js';
|
|
61
|
+
export * from './components/toggle-group.js';
|
|
62
|
+
export * from './components/toggle.js';
|
|
63
|
+
export * from './components/tooltip.js';
|
|
64
|
+
export * from './brand/logo.js';
|
|
65
|
+
export * from './brand/site-footer.js';
|
|
66
|
+
export * from './brand/site-header.js';
|
|
67
|
+
export * from './layouts/app-shell.js';
|
|
68
|
+
export * from './layouts/public-layout.js';
|
|
69
|
+
export * from './lib/utils.js';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface AppShellProps {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
/** Содержимое боковой панели: SidebarGroup, SidebarMenu… из `@mednet/ui/sidebar`. */
|
|
5
|
+
nav: ReactNode;
|
|
6
|
+
/** Заголовок раздела в верхней панели. */
|
|
7
|
+
title?: ReactNode;
|
|
8
|
+
/** Правая часть верхней панели: поиск, уведомления, профиль. */
|
|
9
|
+
actions?: ReactNode;
|
|
10
|
+
/** Адрес главной — ссылка на логотипе. */
|
|
11
|
+
homeHref?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Открыта ли панель при первой отрисовке. В Next — из cookie `sidebar_state`
|
|
14
|
+
* (`(await cookies()).get('sidebar_state')?.value !== 'false'`); при `output: 'export'` не передавать.
|
|
15
|
+
*/
|
|
16
|
+
defaultOpen?: boolean;
|
|
17
|
+
}
|
|
18
|
+
/** Каркас приложений (инструменты, кабинеты, дашборды): боковая панель + верхняя панель. */
|
|
19
|
+
export declare function AppShell({ children, nav, title, actions, homeHref, defaultOpen, }: AppShellProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Sidebar, SidebarContent, SidebarHeader, SidebarInset, SidebarProvider, SidebarRail, SidebarTrigger, } from '#components/sidebar';
|
|
3
|
+
import { TooltipProvider } from '#components/tooltip';
|
|
4
|
+
import { Logo } from '../brand/logo.js';
|
|
5
|
+
import { SkipLink } from './skip-link.js';
|
|
6
|
+
/** Каркас приложений (инструменты, кабинеты, дашборды): боковая панель + верхняя панель. */
|
|
7
|
+
export function AppShell({ children, nav, title, actions, homeHref = '/', defaultOpen, }) {
|
|
8
|
+
return (_jsxs(TooltipProvider, { children: [_jsx(SkipLink, {}), _jsxs(SidebarProvider, { defaultOpen: defaultOpen, children: [_jsxs(Sidebar, { collapsible: "icon", children: [_jsx(SidebarHeader, { children: _jsxs("a", { href: homeHref, "aria-label": "\u0426\u041D\u0418\u0418\u041E\u0418\u0417 \u2014 \u043D\u0430 \u0433\u043B\u0430\u0432\u043D\u0443\u044E", className: "flex h-12 items-center rounded-md px-2 outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50", children: [_jsx(Logo, { variant: "horizontal", className: "h-9 w-auto group-data-[collapsible=icon]:hidden" }), _jsx(Logo, { variant: "mark", className: "hidden h-7 w-auto group-data-[collapsible=icon]:block" })] }) }), _jsx(SidebarContent, { children: nav }), _jsx(SidebarRail, {})] }), _jsxs(SidebarInset, { id: "main", children: [_jsxs("header", { className: "flex h-14 shrink-0 items-center gap-2 border-b border-border px-4", children: [_jsx(SidebarTrigger, {}), title ? _jsx("div", { className: "text-sm font-semibold", children: title }) : null, actions ? _jsx("div", { className: "ml-auto flex items-center gap-2", children: actions }) : null] }), _jsx("div", { className: "flex-1 p-4 md:p-6", children: children })] })] })] }));
|
|
9
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface PublicLayoutProps {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
/** Пункты основной навигации в шапке. */
|
|
5
|
+
nav?: ReactNode;
|
|
6
|
+
/** Действия справа в шапке. */
|
|
7
|
+
actions?: ReactNode;
|
|
8
|
+
/** Адрес главной — ссылка на логотипе. */
|
|
9
|
+
homeHref?: string;
|
|
10
|
+
/** Подвал целиком; по умолчанию — `<SiteFooter />` с реквизитами ЦНИИОИЗ. */
|
|
11
|
+
footer?: ReactNode;
|
|
12
|
+
}
|
|
13
|
+
/** Каркас публичных страниц (лендинги, отчёты): шапка, содержимое, подвал. */
|
|
14
|
+
export declare function PublicLayout({ children, nav, actions, homeHref, footer }: PublicLayoutProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { SiteFooter } from '../brand/site-footer.js';
|
|
3
|
+
import { SiteHeader } from '../brand/site-header.js';
|
|
4
|
+
import { SkipLink } from './skip-link.js';
|
|
5
|
+
/** Каркас публичных страниц (лендинги, отчёты): шапка, содержимое, подвал. */
|
|
6
|
+
export function PublicLayout({ children, nav, actions, homeHref, footer }) {
|
|
7
|
+
return (_jsxs("div", { "data-slot": "public-layout", className: "flex min-h-svh flex-col", children: [_jsx(SkipLink, {}), _jsx(SiteHeader, { nav: nav, actions: actions, homeHref: homeHref }), _jsx("main", { id: "main", className: "flex-1", children: children }), footer ?? _jsx(SiteFooter, {})] }));
|
|
8
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/** Ссылка «Перейти к содержанию»: первая по Tab, видна только в фокусе. */
|
|
3
|
+
export function SkipLink() {
|
|
4
|
+
return (_jsx("a", { href: "#main", className: "sr-only focus:not-sr-only focus:fixed focus:top-2 focus:left-2 focus:z-50 focus:rounded-md focus:bg-background focus:px-4 focus:py-2 focus:shadow-md", children: "\u041F\u0435\u0440\u0435\u0439\u0442\u0438 \u043A \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u043D\u0438\u044E" }));
|
|
5
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createCn } from 'cn/config';
|
|
2
|
+
// cn (замена clsx + tailwind-merge от shadcn) не знает размеры шрифта бренда из @mednet/tokens:
|
|
3
|
+
// без расширения cn('text-foreground', 'text-h3') считает text-h3 цветом и выбрасывает text-foreground.
|
|
4
|
+
// Тип указан явно: без него tsc падает с TS2883 (тип cn нельзя назвать без ссылки на CnFunction).
|
|
5
|
+
export const cn = createCn({
|
|
6
|
+
extend: { classGroups: { 'font-size': [{ text: ['lead', 'h1', 'h2', 'h3', 'h4'] }] } },
|
|
7
|
+
});
|