@devalok/shilp-sutra 0.45.0 → 0.46.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/MIGRATION.md +836 -808
- package/dist/_chunks/chat.js +157 -156
- package/dist/_chunks/chat.js.map +1 -1
- package/dist/_chunks/document-preview.js +5 -5
- package/dist/_chunks/image-preview.js +7 -7
- package/dist/_chunks/mention.js +5 -0
- package/dist/_chunks/mention.js.map +1 -0
- package/dist/_chunks/success.js +16 -16
- package/dist/composed/activity-feed.js +19 -19
- package/dist/composed/deadline-indicator.d.ts.map +1 -1
- package/dist/composed/deadline-indicator.js +31 -31
- package/dist/composed/deadline-indicator.js.map +1 -1
- package/dist/composed/emoji-picker.js +15 -15
- package/dist/composed/file-preview/video-preview.d.ts.map +1 -1
- package/dist/composed/file-preview.js +36 -34
- package/dist/composed/file-preview.js.map +1 -1
- package/dist/composed/filter-bar.js +1 -1
- package/dist/composed/filter-bar.js.map +1 -1
- package/dist/composed/multi-select-popover.js +1 -1
- package/dist/composed/multi-select-popover.js.map +1 -1
- package/dist/composed/rich-chat-input.d.ts.map +1 -1
- package/dist/composed/rich-chat-input.js +514 -503
- package/dist/composed/rich-chat-input.js.map +1 -1
- package/dist/composed/rich-text-editor.d.ts.map +1 -1
- package/dist/composed/rich-text-editor.js +144 -143
- package/dist/composed/rich-text-editor.js.map +1 -1
- package/dist/tokens/base.css +6 -0
- package/dist/tokens/index.css +1 -1
- package/dist/tokens/semantic.css +1 -1
- package/dist/tokens/typography.css +10 -0
- package/dist/tokens/utilities.css +6 -0
- package/dist/ui/avatar.d.ts.map +1 -1
- package/dist/ui/avatar.js +57 -56
- package/dist/ui/avatar.js.map +1 -1
- package/dist/ui/badge-indicator.js +1 -1
- package/dist/ui/badge-indicator.js.map +1 -1
- package/dist/ui/chat/message.d.ts.map +1 -1
- package/dist/ui/data-table-body.js +27 -27
- package/dist/ui/data-table-card.js +20 -20
- package/dist/ui/data-table-toolbar.d.ts.map +1 -1
- package/dist/ui/data-table-toolbar.js +40 -36
- package/dist/ui/data-table-toolbar.js.map +1 -1
- package/dist/ui/index.d.ts +1 -0
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/index.js +37 -36
- package/dist/ui/index.js.map +1 -1
- package/dist/ui/lib/mention.d.ts +11 -0
- package/dist/ui/lib/mention.d.ts.map +1 -0
- package/dist/ui/radio.js +1 -1
- package/dist/ui/radio.js.map +1 -1
- package/dist/ui/sidebar.js +7 -7
- package/dist/ui/stat-card.d.ts.map +1 -1
- package/dist/ui/stat-card.js +48 -47
- package/dist/ui/stat-card.js.map +1 -1
- package/dist/ui/surface.d.ts +46 -0
- package/dist/ui/surface.d.ts.map +1 -0
- package/dist/ui/surface.js +51 -0
- package/dist/ui/surface.js.map +1 -0
- package/dist/ui/text.js +6 -6
- package/dist/ui/text.js.map +1 -1
- package/docs/components/ui/chat.md +1 -1
- package/docs/components/ui/surface.md +55 -0
- package/fonts/Manrope-Variable.woff2 +0 -0
- package/llms.txt +2 -1
- package/make-kit/components/overview.md +7 -3
- package/make-kit/components/surface.md +60 -0
- package/mcp-manifest.json +91 -2
- package/package.json +11 -1
- package/skill/SKILL.md +1 -1
- package/skill/references/components.md +2 -1
package/dist/ui/index.js
CHANGED
|
@@ -10,24 +10,24 @@ import { Alert as S, alertVariants as C } from "./alert.js";
|
|
|
10
10
|
import { AspectRatio as w } from "./aspect-ratio.js";
|
|
11
11
|
import { FormField as T, FormHelperText as E, useFormField as D } from "./form.js";
|
|
12
12
|
import { Autocomplete as O } from "./autocomplete.js";
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
13
|
+
import { Skeleton as k, SkeletonAvatar as A, SkeletonButton as j, SkeletonChart as M, SkeletonGroup as N, SkeletonImage as P, SkeletonInput as F, SkeletonText as I, skeletonVariants as L } from "./skeleton.js";
|
|
14
|
+
import { Avatar as R, AvatarFallback as z, AvatarImage as B, avatarVariants as V } from "./avatar.js";
|
|
15
|
+
import { BadgeIndicator as H } from "./badge-indicator.js";
|
|
16
|
+
import { n as U, r as W, t as G } from "../_chunks/badge-group.js";
|
|
17
|
+
import { Banner as K, bannerVariants as q } from "./banner.js";
|
|
18
|
+
import { Breadcrumb as J, BreadcrumbEllipsis as Y, BreadcrumbItem as X, BreadcrumbLink as Z, BreadcrumbList as re, BreadcrumbPage as ie, BreadcrumbSeparator as ae } from "./breadcrumb.js";
|
|
19
|
+
import { ButtonGroup as oe, useButtonGroup as se } from "./button-group.js";
|
|
20
|
+
import { Button as ce, buttonVariants as le } from "./button.js";
|
|
21
|
+
import { Card as ue, CardAction as de, CardBleed as fe, CardContent as pe, CardDescription as me, CardFooter as he, CardHeader as ge, CardSection as _e, CardTitle as ve, cardVariants as ye } from "./card.js";
|
|
22
|
+
import { Checkbox as be } from "./checkbox.js";
|
|
23
|
+
import { Code as xe } from "./code.js";
|
|
24
|
+
import { Collapsible as Se, CollapsibleContent as Ce, CollapsibleTrigger as we } from "./collapsible.js";
|
|
25
|
+
import { i as Te, n as Ee, r as De, t as Oe } from "../_chunks/popover.js";
|
|
26
|
+
import { ColorInput as ke } from "./color-input.js";
|
|
27
|
+
import { ColorSwatch as Ae } from "./color-swatch.js";
|
|
28
|
+
import { Combobox as je, comboboxTriggerVariants as Me } from "./combobox.js";
|
|
29
|
+
import { Container as Ne } from "./container.js";
|
|
30
|
+
import { ContextMenu as Pe, ContextMenuCheckboxItem as Fe, ContextMenuContent as Ie, ContextMenuGroup as Le, ContextMenuItem as Re, ContextMenuLabel as ze, ContextMenuPortal as Be, ContextMenuRadioGroup as Ve, ContextMenuRadioItem as He, ContextMenuSeparator as Ue, ContextMenuShortcut as We, ContextMenuSub as Ge, ContextMenuSubContent as Ke, ContextMenuSubTrigger as qe, ContextMenuTrigger as Je } from "./context-menu.js";
|
|
31
31
|
import { Table as Ye, TableBody as Xe, TableCaption as Ze, TableCell as Qe, TableFooter as $e, TableHead as et, TableHeader as tt, TableRow as nt, TableRowActions as rt } from "./table.js";
|
|
32
32
|
import { DropdownMenu as it, DropdownMenuCheckboxItem as at, DropdownMenuContent as ot, DropdownMenuGroup as st, DropdownMenuItem as ct, DropdownMenuLabel as lt, DropdownMenuPortal as ut, DropdownMenuRadioGroup as dt, DropdownMenuRadioItem as ft, DropdownMenuSeparator as pt, DropdownMenuShortcut as mt, DropdownMenuSub as ht, DropdownMenuSubContent as gt, DropdownMenuSubTrigger as _t, DropdownMenuTrigger as vt } from "./dropdown-menu.js";
|
|
33
33
|
import { DevalokGrain as yt } from "./devalok-grain.js";
|
|
@@ -58,24 +58,25 @@ import { MultiProgressRing as Nn, ProgressRing as Pn } from "./progress-ring.js"
|
|
|
58
58
|
import { StatFlash as Fn } from "./stat-flash.js";
|
|
59
59
|
import { StatCard as In } from "./stat-card.js";
|
|
60
60
|
import { StatusDot as Ln } from "./status-dot.js";
|
|
61
|
-
import {
|
|
62
|
-
import {
|
|
63
|
-
import {
|
|
64
|
-
import {
|
|
65
|
-
import {
|
|
66
|
-
import {
|
|
67
|
-
import {
|
|
68
|
-
import {
|
|
69
|
-
import {
|
|
70
|
-
import {
|
|
71
|
-
import {
|
|
72
|
-
import {
|
|
73
|
-
import {
|
|
74
|
-
import {
|
|
75
|
-
import {
|
|
61
|
+
import { Surface as Rn, surfaceVariants as zn } from "./surface.js";
|
|
62
|
+
import { TableRowLink as Bn } from "./table-row-link.js";
|
|
63
|
+
import { Menubar as Vn, MenubarCheckboxItem as Hn, MenubarContent as Un, MenubarGroup as Wn, MenubarItem as Gn, MenubarLabel as Kn, MenubarMenu as qn, MenubarPortal as Jn, MenubarRadioGroup as Yn, MenubarRadioItem as Xn, MenubarSeparator as Zn, MenubarShortcut as Qn, MenubarSub as $n, MenubarSubContent as er, MenubarSubTrigger as tr, MenubarTrigger as nr } from "./menubar.js";
|
|
64
|
+
import { NavigationMenu as rr, NavigationMenuContent as ir, NavigationMenuIndicator as ar, NavigationMenuItem as or, NavigationMenuLink as sr, NavigationMenuList as cr, NavigationMenuTrigger as lr, NavigationMenuViewport as ur } from "./navigation-menu.js";
|
|
65
|
+
import { PaginationContent as dr, PaginationEllipsis as fr, PaginationItem as pr, PaginationLink as mr, PaginationNav as hr, PaginationNext as gr, PaginationPrevious as _r, PaginationRoot as vr, generatePagination as yr } from "./pagination.js";
|
|
66
|
+
import { Sidebar as br, SidebarContent as xr, SidebarFooter as Sr, SidebarGroup as Cr, SidebarGroupAction as wr, SidebarGroupContent as Tr, SidebarGroupLabel as Er, SidebarHeader as Dr, SidebarInput as Or, SidebarInset as kr, SidebarMenu as Ar, SidebarMenuAction as jr, SidebarMenuBadge as Mr, SidebarMenuButton as Nr, SidebarMenuItem as Pr, SidebarMenuSkeleton as Fr, SidebarMenuSub as Ir, SidebarMenuSubButton as Lr, SidebarMenuSubItem as Rr, SidebarProvider as zr, SidebarRail as Br, SidebarSeparator as Vr, SidebarTrigger as Hr, useSidebar as Ur } from "./sidebar.js";
|
|
67
|
+
import { Tabs as Wr, TabsContent as Gr, TabsList as Kr, TabsTrigger as qr } from "./tabs.js";
|
|
68
|
+
import { Step as Jr, Stepper as Yr } from "./stepper.js";
|
|
69
|
+
import { Text as Xr, textVariants as Zr } from "./text.js";
|
|
70
|
+
import { Stack as Qr } from "./stack.js";
|
|
71
|
+
import { n as $r, r as ei, t as ti } from "../_chunks/tree-view.js";
|
|
72
|
+
import { SegmentedControl as ni } from "./segmented-control.js";
|
|
73
|
+
import { a as ri, c as ii, i as ai, n as oi, o as si, r as ci, s as li, t as ui } from "../_chunks/chat.js";
|
|
74
|
+
import { Link as di } from "./link.js";
|
|
75
|
+
import { a as fi, c as pi, i as mi, n as hi, o as gi, r as _i, s as vi, t as yi } from "../_chunks/oauth-button.js";
|
|
76
|
+
import { formatRelativeTime as bi } from "./lib/date-utils.js";
|
|
76
77
|
//#region src/ui/lib/check-tokens.ts
|
|
77
78
|
var $ = !1;
|
|
78
|
-
function
|
|
79
|
+
function xi() {
|
|
79
80
|
if (!$ && !(typeof window > "u")) {
|
|
80
81
|
try {
|
|
81
82
|
return;
|
|
@@ -87,6 +88,6 @@ function yi() {
|
|
|
87
88
|
}
|
|
88
89
|
//#endregion
|
|
89
90
|
//#region src/ui/index.ts
|
|
90
|
-
|
|
91
|
+
xi();
|
|
91
92
|
//#endregion
|
|
92
|
-
export { s as Accordion, c as AccordionContent, l as AccordionItem, u as AccordionTrigger, S as Alert, d as AlertDialog, f as AlertDialogAction, p as AlertDialogCancel, m as AlertDialogContent, h as AlertDialogDescription, g as AlertDialogFooter, _ as AlertDialogHeader, v as AlertDialogOverlay, y as AlertDialogPortal, b as AlertDialogTitle, x as AlertDialogTrigger, w as AspectRatio, O as Autocomplete,
|
|
93
|
+
export { s as Accordion, c as AccordionContent, l as AccordionItem, u as AccordionTrigger, S as Alert, d as AlertDialog, f as AlertDialogAction, p as AlertDialogCancel, m as AlertDialogContent, h as AlertDialogDescription, g as AlertDialogFooter, _ as AlertDialogHeader, v as AlertDialogOverlay, y as AlertDialogPortal, b as AlertDialogTitle, x as AlertDialogTrigger, w as AspectRatio, O as Autocomplete, R as Avatar, z as AvatarFallback, B as AvatarImage, U as Badge, G as BadgeGroup, H as BadgeIndicator, K as Banner, J as Breadcrumb, Y as BreadcrumbEllipsis, X as BreadcrumbItem, Z as BreadcrumbLink, re as BreadcrumbList, ie as BreadcrumbPage, ae as BreadcrumbSeparator, ce as Button, oe as ButtonGroup, ue as Card, de as CardAction, fe as CardBleed, pe as CardContent, me as CardDescription, he as CardFooter, ge as CardHeader, _e as CardSection, ve as CardTitle, be as Checkbox, xe as Code, Se as Collapsible, Ce as CollapsibleContent, we as CollapsibleTrigger, ke as ColorInput, Ae as ColorSwatch, je as Combobox, Ne as Container, Pe as ContextMenu, Fe as ContextMenuCheckboxItem, Ie as ContextMenuContent, Le as ContextMenuGroup, Re as ContextMenuItem, ze as ContextMenuLabel, Be as ContextMenuPortal, Ve as ContextMenuRadioGroup, He as ContextMenuRadioItem, Ue as ContextMenuSeparator, We as ContextMenuShortcut, Ge as ContextMenuSub, Ke as ContextMenuSubContent, qe as ContextMenuSubTrigger, Je as ContextMenuTrigger, ii as DateSeparator, yt as DevalokGrain, bt as Dialog, xt as DialogClose, St as DialogContent, Ct as DialogContentRaw, wt as DialogDescription, Tt as DialogFooter, Et as DialogHeader, Dt as DialogOverlay, Ot as DialogPortal, kt as DialogTitle, At as DialogTrigger, it as DropdownMenu, at as DropdownMenuCheckboxItem, ot as DropdownMenuContent, st as DropdownMenuGroup, ct as DropdownMenuItem, lt as DropdownMenuLabel, ut as DropdownMenuPortal, dt as DropdownMenuRadioGroup, ft as DropdownMenuRadioItem, pt as DropdownMenuSeparator, mt as DropdownMenuShortcut, ht as DropdownMenuSub, gt as DropdownMenuSubContent, _t as DropdownMenuSubTrigger, vt as DropdownMenuTrigger, jt as FileUpload, T as FormField, E as FormHelperText, Mt as HoverCard, Nt as HoverCardContent, Pt as HoverCardTrigger, o as Icon, Ft as IconButton, ee as IconContext, It as IconGroup, te as IconProvider, Lt as Input, zt as Label, di as Link, Vn as Menubar, Hn as MenubarCheckboxItem, Un as MenubarContent, Wn as MenubarGroup, Gn as MenubarItem, Kn as MenubarLabel, qn as MenubarMenu, Jn as MenubarPortal, Yn as MenubarRadioGroup, Xn as MenubarRadioItem, Zn as MenubarSeparator, Qn as MenubarShortcut, $n as MenubarSub, er as MenubarSubContent, tr as MenubarSubTrigger, nr as MenubarTrigger, si as Message, ri as MessageInput, ai as MessageList, Nn as MultiProgressRing, rr as NavigationMenu, ir as NavigationMenuContent, ar as NavigationMenuIndicator, or as NavigationMenuItem, sr as NavigationMenuLink, cr as NavigationMenuList, lr as NavigationMenuTrigger, ur as NavigationMenuViewport, Ut as NumberInput, yi as OAuth, hi as OAuthButton, _i as OAuthConnectionRow, mi as OAuthDivider, fi as OAuthGlyph, gi as OAuthGroup, dr as PaginationContent, fr as PaginationEllipsis, pr as PaginationItem, mr as PaginationLink, hr as PaginationNav, gr as PaginationNext, _r as PaginationPrevious, vr as PaginationRoot, Oe as Popover, Ee as PopoverAnchor, De as PopoverContent, Te as PopoverTrigger, An as Progress, Pn as ProgressRing, Gt as RadioGroup, Kt as RadioGroupItem, qt as SearchInput, ni as SegmentedControl, Jt as Select, Yt as SelectContent, Xt as SelectGroup, Zt as SelectItem, Qt as SelectLabel, $t as SelectScrollDownButton, Q as SelectScrollUpButton, en as SelectSeparator, tn as SelectTrigger, nn as SelectValue, Bt as Separator, bn as Sheet, xn as SheetClose, Sn as SheetContent, Cn as SheetDescription, wn as SheetFooter, Tn as SheetHeader, En as SheetOverlay, Dn as SheetPortal, On as SheetTitle, kn as SheetTrigger, br as Sidebar, xr as SidebarContent, Sr as SidebarFooter, Cr as SidebarGroup, wr as SidebarGroupAction, Tr as SidebarGroupContent, Er as SidebarGroupLabel, Dr as SidebarHeader, Or as SidebarInput, kr as SidebarInset, Ar as SidebarMenu, jr as SidebarMenuAction, Mr as SidebarMenuBadge, Nr as SidebarMenuButton, Pr as SidebarMenuItem, Fr as SidebarMenuSkeleton, Ir as SidebarMenuSub, Lr as SidebarMenuSubButton, Rr as SidebarMenuSubItem, zr as SidebarProvider, Br as SidebarRail, Vr as SidebarSeparator, Hr as SidebarTrigger, k as Skeleton, A as SkeletonAvatar, j as SkeletonButton, M as SkeletonChart, N as SkeletonGroup, P as SkeletonImage, F as SkeletonInput, I as SkeletonText, an as Slider, a as Spinner, Vt as SplitButton, Qr as Stack, In as StatCard, Fn as StatFlash, Ln as StatusDot, Jr as Step, Yr as Stepper, Rn as Surface, cn as Switch, ci as SystemMessage, Ye as Table, Xe as TableBody, Ze as TableCaption, Qe as TableCell, $e as TableFooter, et as TableHead, tt as TableHeader, nt as TableRow, rt as TableRowActions, Bn as TableRowLink, Wr as Tabs, Gr as TabsContent, Kr as TabsList, qr as TabsTrigger, Xr as Text, ln as Textarea, dn as Toggle, pn as ToggleGroup, mn as ToggleGroupItem, hn as Tooltip, gn as TooltipContent, _n as TooltipProvider, vn as TooltipTrigger, ti as TreeItem, $r as TreeView, yn as TruncatedText, oi as TypingIndicator, ui as UnreadSeparator, Ht as VisuallyHidden, C as alertVariants, V as avatarVariants, W as badgeVariants, q as bannerVariants, le as buttonVariants, ye as cardVariants, i as cn, Me as comboboxTriggerVariants, bi as formatRelativeTime, yr as generatePagination, vi as getOAuthLabel, pi as getOAuthName, Rt as inputWrapperVariants, Wt as numberInputWrapperVariants, jn as progressIndicatorVariants, Mn as progressTrackVariants, rn as selectTriggerVariants, L as skeletonVariants, on as sliderThumbVariants, sn as sliderTrackVariants, e as springs, t as stagger, zn as surfaceVariants, Zr as textVariants, un as textareaVariants, fn as toggleVariants, n as tweens, se as useButtonGroup, D as useFormField, ne as useIconContext, li as useMessageContext, Ur as useSidebar, ei as useTree, r as withReducedMotion };
|
package/dist/ui/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../src/ui/lib/check-tokens.ts","../../src/ui/index.ts"],"sourcesContent":["/**\n * Dev-mode check for missing token CSS.\n *\n * If the consumer forgets `import '@devalok/shilp-sutra/tokens'`, all CSS\n * custom properties resolve to empty strings and components render with\n * transparent/broken backgrounds. This check detects that condition and\n * warns in the console.\n *\n * Only runs once, only in development, only in the browser.\n */\nlet checked = false\n\nexport function checkTokensLoaded(): void {\n if (checked) return\n if (typeof window === 'undefined') return\n\n // Skip in production — bundlers (Vite, Next.js, webpack) define import.meta.env or process.env\n try {\n // @ts-expect-error -- import.meta.env is Vite-specific, not in base TS lib\n if (import.meta.env?.PROD) return\n } catch { /* not in Vite */ }\n\n checked = true\n\n // Wait for stylesheets to load\n requestAnimationFrame(() => {\n const value = getComputedStyle(document.documentElement).getPropertyValue('--color-accent-9').trim()\n if (!value) {\n console.warn(\n '[shilp-sutra] Design system tokens CSS not loaded. ' +\n 'Add `import \\'@devalok/shilp-sutra/tokens\\'` to your root layout. ' +\n 'Without it, components will render with missing colors, spacing, and typography.'\n )\n }\n })\n}\n","/**\n * @module @devalok/shilp-sutra/ui\n *\n * Core UI primitives: buttons, inputs, dialogs, cards, tables, badges, navigation, and more.\n * Most components require client-side React (\"use client\").\n *\n * **Server-safe components** (import individually for Server Components):\n * `Text`, `Skeleton`, `Stack`, `Container`, `Table`, `Code`, `VisuallyHidden`\n *\n * @example\n * // Server Component — import individually:\n * import { Text } from '@devalok/shilp-sutra/ui/text'\n * import { Stack } from '@devalok/shilp-sutra/ui/stack'\n *\n * // Client Component — barrel import:\n * import { Button, Dialog } from '@devalok/shilp-sutra/ui'\n */\n\n// Dev-mode token presence check — runs once on first import\nimport { checkTokensLoaded } from './lib/check-tokens'\ncheckTokensLoaded()\n\n// Core\nexport { Button, type ButtonProps,buttonVariants } from './button'\nexport { ButtonGroup, type ButtonGroupProps,useButtonGroup } from './button-group'\nexport { ColorInput, type ColorInputProps } from './color-input'\nexport { Icon, type IconProps } from './icon'\nexport { IconButton, type IconButtonProps } from './icon-button'\nexport { IconContext, type IconContextValue, IconProvider, type IconSize, type IconStroke,useIconContext } from './icon-context'\nexport { IconGroup, type IconGroupProps } from './icon-group'\nexport { Input, type InputProps, type InputState, inputWrapperVariants } from './input'\nexport { Label, type LabelProps } from './label'\nexport { Separator, type SeparatorProps } from './separator'\nexport { SplitButton, type SplitButtonProps } from './split-button'\nexport { VisuallyHidden, type VisuallyHiddenProps } from './visually-hidden'\n\n// Autocomplete\nexport { Autocomplete, type AutocompleteOption,type AutocompleteProps } from './autocomplete'\n\n// Combobox\nexport { Combobox, type ComboboxOption, type ComboboxProps, type ComboboxSize,comboboxTriggerVariants } from './combobox'\n\n// FileUpload\nexport { FileUpload, type FileUploadProps } from './file-upload'\n\n// Form Controls\nexport { Checkbox, type CheckboxProps } from './checkbox'\nexport { FormField, type FormFieldProps, type FormHelperState, FormHelperText, type FormHelperTextProps,useFormField } from './form'\n// InputOTP removed from barrel in 0.40.0 — hard peer `input-otp` was breaking\n// fresh-consumer builds. Import per-component instead:\n// import { InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot } from '@devalok/shilp-sutra/ui/input-otp'\nexport { NumberInput, type NumberInputProps, type NumberInputSize, type NumberInputState,numberInputWrapperVariants } from './number-input'\nexport { RadioGroup, RadioGroupItem, type RadioGroupItemProps,type RadioGroupProps } from './radio'\nexport { SearchInput, type SearchInputProps } from './search-input'\nexport {\n Select,\n SelectContent,\n SelectGroup,\n SelectItem,\n SelectLabel,\n SelectScrollDownButton,\n SelectScrollUpButton,\n SelectSeparator,\n SelectTrigger,\n type SelectTriggerProps,\n selectTriggerVariants,\n SelectValue,\n} from './select'\nexport { Slider, type SliderColor,type SliderProps, type SliderSize, sliderThumbVariants, sliderTrackVariants } from './slider'\nexport { Switch, type SwitchProps } from './switch'\nexport { Textarea, type TextareaProps,textareaVariants } from './textarea'\nexport { Toggle, type ToggleProps,toggleVariants } from './toggle'\nexport { ToggleGroup, ToggleGroupItem, type ToggleGroupItemProps,type ToggleGroupProps } from './toggle-group'\nexport { TruncatedText, type TruncatedTextProps } from './truncated-text'\n\n// Feedback & Overlays\nexport {\n AlertDialog,\n AlertDialogAction,\n type AlertDialogActionProps,\n AlertDialogCancel,\n type AlertDialogCancelProps,\n AlertDialogContent,\n type AlertDialogContentProps,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogOverlay,\n AlertDialogPortal,\n AlertDialogTitle,\n AlertDialogTrigger,\n} from './alert-dialog'\nexport { Collapsible, CollapsibleContent, type CollapsibleProps,CollapsibleTrigger } from './collapsible'\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n type DialogContentProps,\n DialogContentRaw,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n type DialogTitleProps,\n DialogTrigger,\n} from './dialog'\nexport { HoverCard, HoverCardContent, type HoverCardContentProps,HoverCardTrigger } from './hover-card'\nexport { Popover, PopoverAnchor, PopoverContent, type PopoverContentProps,PopoverTrigger } from './popover'\nexport {\n Sheet,\n SheetClose,\n SheetContent,\n type SheetContentProps,\n SheetDescription,\n SheetFooter,\n SheetHeader,\n SheetOverlay,\n SheetPortal,\n SheetTitle,\n SheetTrigger,\n} from './sheet'\n// toast + Toaster removed from barrel in 0.40.0 — hard peer `sonner` was\n// breaking fresh-consumer builds when consumers imported other UI symbols\n// from the barrel without sonner installed. Import per-component instead:\n// import { toast, formatFileSize, type ToastOptions } from '@devalok/shilp-sutra/ui/toast'\n// import { Toaster } from '@devalok/shilp-sutra/ui/toaster'\nexport { Tooltip, TooltipContent, type TooltipContentProps,TooltipProvider, TooltipTrigger } from './tooltip'\n// ---------------------------------------------------------------------------\n// Notifications — pick the right one:\n// Alert — inline, static feedback within a form or page section (no user action needed to show)\n// Banner — persistent, page-level notice shown above main content (survives navigation)\n// Toast — imperative, transient, action-triggered (fires on user action, auto-dismisses)\n// Requires <Toaster /> mounted once at layout root. Use toast.success() etc. from anywhere.\n// ---------------------------------------------------------------------------\nexport { Alert, type AlertProps,alertVariants } from './alert'\nexport { Banner, type BannerProps,bannerVariants } from './banner'\nexport { Spinner, type SpinnerProps } from './spinner'\n\n// Data Display\nexport { AspectRatio } from './aspect-ratio'\nexport { Avatar, AvatarFallback, type AvatarFallbackProps, AvatarImage, type AvatarProps, type AvatarRing,type AvatarStatus, avatarVariants } from './avatar'\nexport { Badge, type BadgeProps,badgeVariants } from './badge'\nexport { BadgeGroup, type BadgeGroupProps } from './badge-group'\nexport { BadgeIndicator, type BadgeIndicatorProps } from './badge-indicator'\nexport { Card, CardAction, type CardActionPlacement, type CardActionProps, CardBleed, type CardBleedProps, type CardBleedSide, CardContent, CardDescription, CardFooter, CardHeader, type CardProps,CardSection, CardTitle, cardVariants } from './card'\nexport { Code, type CodeProps } from './code'\nexport { ColorSwatch, type ColorSwatchProps } from './color-swatch'\nexport { Progress, progressIndicatorVariants, type ProgressProps,progressTrackVariants } from './progress'\nexport { MultiProgressRing, type MultiProgressRingProps,ProgressRing, type ProgressRingProps } from './progress-ring'\nexport {\n Skeleton,\n SkeletonAvatar,\n type SkeletonAvatarProps,\n SkeletonButton,\n type SkeletonButtonProps,\n SkeletonChart,\n type SkeletonChartProps,\n SkeletonGroup,\n type SkeletonGroupProps,\n SkeletonImage,\n type SkeletonImageProps,\n SkeletonInput,\n type SkeletonInputProps,\n type SkeletonProps,\n SkeletonText,\n type SkeletonTextProps,\n skeletonVariants,\n} from './skeleton'\nexport { StatCard, type StatCardProps } from './stat-card'\nexport {\n type FlashPreset,\n type FlashSpec,\n type FlashSpeed,\n type FlashTone,\n StatFlash,\n type StatFlashProps,\n} from './stat-flash'\nexport { StatusDot, type StatusDotProps, type StatusDotStatus } from './status-dot'\nexport { Table, TableBody, TableCaption, TableCell, type TableCellBaseProps,type TableCellProps,type TableDensity, TableFooter, TableHead, TableHeader, type TableProps, TableRow, TableRowActions, type TableRowActionsProps,type TableRowProps } from './table'\nexport { TableRowLink, type TableRowLinkProps } from './table-row-link'\n\n// Navigation\nexport { Accordion, AccordionContent, type AccordionContentProps,AccordionItem, type AccordionItemProps, AccordionTrigger, type AccordionTriggerProps } from './accordion'\nexport {\n Breadcrumb,\n BreadcrumbEllipsis,\n BreadcrumbItem,\n BreadcrumbLink,\n type BreadcrumbLinkProps,\n BreadcrumbList,\n BreadcrumbPage,\n type BreadcrumbProps,\n BreadcrumbSeparator,\n} from './breadcrumb'\nexport {\n ContextMenu,\n ContextMenuCheckboxItem,\n ContextMenuContent,\n type ContextMenuContentProps,\n ContextMenuGroup,\n ContextMenuItem,\n type ContextMenuItemProps,\n ContextMenuLabel,\n ContextMenuPortal,\n ContextMenuRadioGroup,\n ContextMenuRadioItem,\n ContextMenuSeparator,\n ContextMenuShortcut,\n ContextMenuSub,\n ContextMenuSubContent,\n ContextMenuSubTrigger,\n ContextMenuTrigger,\n} from './context-menu'\nexport {\n DropdownMenu,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n type DropdownMenuContentProps,\n DropdownMenuGroup,\n DropdownMenuItem,\n type DropdownMenuItemProps,\n DropdownMenuLabel,\n DropdownMenuPortal,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuTrigger,\n} from './dropdown-menu'\nexport {\n Menubar,\n MenubarCheckboxItem,\n MenubarContent,\n type MenubarContentProps,\n MenubarGroup,\n MenubarItem,\n type MenubarItemProps,\n MenubarLabel,\n MenubarMenu,\n MenubarPortal,\n MenubarRadioGroup,\n MenubarRadioItem,\n MenubarSeparator,\n MenubarShortcut,\n MenubarSub,\n MenubarSubContent,\n MenubarSubTrigger,\n MenubarTrigger,\n} from './menubar'\nexport {\n NavigationMenu,\n NavigationMenuContent,\n type NavigationMenuContentProps,\n NavigationMenuIndicator,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n type NavigationMenuProps,\n NavigationMenuTrigger,\n NavigationMenuViewport,\n} from './navigation-menu'\nexport {\n generatePagination,\n PaginationContent,\n PaginationEllipsis,\n PaginationItem,\n PaginationLink,\n type PaginationLinkProps,\n PaginationNav,\n type PaginationNavProps,\n PaginationNext,\n PaginationPrevious,\n PaginationRoot,\n} from './pagination'\nexport {\n Sidebar,\n SidebarContent,\n SidebarFooter,\n SidebarGroup,\n SidebarGroupAction,\n SidebarGroupContent,\n SidebarGroupLabel,\n SidebarHeader,\n SidebarInput,\n SidebarInset,\n SidebarMenu,\n SidebarMenuAction,\n SidebarMenuBadge,\n SidebarMenuButton,\n SidebarMenuItem,\n SidebarMenuSkeleton,\n SidebarMenuSub,\n SidebarMenuSubButton,\n SidebarMenuSubItem,\n type SidebarProps,\n SidebarProvider,\n SidebarRail,\n SidebarSeparator,\n SidebarTrigger,\n useSidebar,\n} from './sidebar'\nexport { Tabs, type TabsColor, TabsContent, type TabsContentProps, TabsList, type TabsListProps, type TabsOrientation,type TabsProps, type TabsSize, TabsTrigger, type TabsTriggerProps } from './tabs'\n\n// Workflow\nexport { Step, Stepper, type StepperProps, type StepProps } from './stepper'\n\n\n// Typography\nexport { Text, type TextProps, type TextVariant,textVariants } from './text'\n\n// Layout\nexport { Container, type ContainerProps } from './container'\nexport { type SpacingToken,Stack, type StackProps } from './stack'\n\n// Tree View\nexport { TreeItem, type TreeItemProps, type TreeNode,TreeView, type TreeViewProps, useTree } from './tree-view'\n\n// Segmented Control\nexport {\n SegmentedControl,\n type SegmentedControlOption,\n type SegmentedControlProps,\n type SegmentedControlSize,\n type SegmentedControlVariant,\n} from './segmented-control'\n\n// Brand Texture\nexport { DevalokGrain, type DevalokGrainProps, type GrainIntensity } from './devalok-grain'\n\n// Chat primitives\nexport {\n DateSeparator,\n type DateSeparatorProps,\n Message,\n type MessageActionProps,\n type MessageActionsProps,\n type MessageAuthorProps,\n type MessageAvatarProps,\n type MessageBodyProps,\n type MessageContentProps,\n type MessageContextValue,\n type MessageEditableBodyProps,\n MessageInput,\n type MessageInputProps,\n MessageList,\n type MessageListProps,\n type MessageProps,\n type MessageReactionsProps,\n SystemMessage,\n type SystemMessageProps,\n TypingIndicator,\n type TypingIndicatorProps,\n UnreadSeparator,\n type UnreadSeparatorProps,\n useMessageContext,\n} from './chat'\n\n// Other\nexport { Link, type LinkProps } from './link'\n\n// OAuth / Social sign-in\nexport {\n getOAuthLabel,\n getOAuthName,\n OAuth,\n type OAuthAppearance,\n OAuthButton,\n type OAuthButtonProps,\n OAuthConnectionRow,\n type OAuthConnectionRowProps,\n OAuthDivider,\n type OAuthDividerProps,\n OAuthGlyph,\n type OAuthGlyphProps,\n OAuthGroup,\n type OAuthGroupProps,\n type OAuthIntent,\n type OAuthProvider,\n type OAuthVariant,\n} from './oauth-button'\n\n// Utilities\nexport { formatRelativeTime } from './lib/date-utils'\nexport type { SpringPreset, TweenPreset } from './lib/motion'\nexport { springs, stagger, tweens, withReducedMotion } from './lib/motion'\nexport { cn } from './lib/utils'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUA,IAAI,IAAU;AAEd,SAAgB,KAA0B;AACpC,WACA,SAAO,SAAW,MAGtB;MAAI;AAEyB;UACrB;AAKR,EAHA,IAAU,IAGV,4BAA4B;AAE1B,GADc,iBAAiB,SAAS,gBAAgB,CAAC,iBAAiB,mBAAmB,CAAC,MAAM,IAElG,QAAQ,KACN,sMAGD;IAEH;;;;;ACdJ,IAAmB"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/ui/lib/check-tokens.ts","../../src/ui/index.ts"],"sourcesContent":["/**\n * Dev-mode check for missing token CSS.\n *\n * If the consumer forgets `import '@devalok/shilp-sutra/tokens'`, all CSS\n * custom properties resolve to empty strings and components render with\n * transparent/broken backgrounds. This check detects that condition and\n * warns in the console.\n *\n * Only runs once, only in development, only in the browser.\n */\nlet checked = false\n\nexport function checkTokensLoaded(): void {\n if (checked) return\n if (typeof window === 'undefined') return\n\n // Skip in production — bundlers (Vite, Next.js, webpack) define import.meta.env or process.env\n try {\n // @ts-expect-error -- import.meta.env is Vite-specific, not in base TS lib\n if (import.meta.env?.PROD) return\n } catch { /* not in Vite */ }\n\n checked = true\n\n // Wait for stylesheets to load\n requestAnimationFrame(() => {\n const value = getComputedStyle(document.documentElement).getPropertyValue('--color-accent-9').trim()\n if (!value) {\n console.warn(\n '[shilp-sutra] Design system tokens CSS not loaded. ' +\n 'Add `import \\'@devalok/shilp-sutra/tokens\\'` to your root layout. ' +\n 'Without it, components will render with missing colors, spacing, and typography.'\n )\n }\n })\n}\n","/**\n * @module @devalok/shilp-sutra/ui\n *\n * Core UI primitives: buttons, inputs, dialogs, cards, tables, badges, navigation, and more.\n * Most components require client-side React (\"use client\").\n *\n * **Server-safe components** (import individually for Server Components):\n * `Text`, `Skeleton`, `Stack`, `Container`, `Table`, `Code`, `VisuallyHidden`\n *\n * @example\n * // Server Component — import individually:\n * import { Text } from '@devalok/shilp-sutra/ui/text'\n * import { Stack } from '@devalok/shilp-sutra/ui/stack'\n *\n * // Client Component — barrel import:\n * import { Button, Dialog } from '@devalok/shilp-sutra/ui'\n */\n\n// Dev-mode token presence check — runs once on first import\nimport { checkTokensLoaded } from './lib/check-tokens'\ncheckTokensLoaded()\n\n// Core\nexport { Button, type ButtonProps,buttonVariants } from './button'\nexport { ButtonGroup, type ButtonGroupProps,useButtonGroup } from './button-group'\nexport { ColorInput, type ColorInputProps } from './color-input'\nexport { Icon, type IconProps } from './icon'\nexport { IconButton, type IconButtonProps } from './icon-button'\nexport { IconContext, type IconContextValue, IconProvider, type IconSize, type IconStroke,useIconContext } from './icon-context'\nexport { IconGroup, type IconGroupProps } from './icon-group'\nexport { Input, type InputProps, type InputState, inputWrapperVariants } from './input'\nexport { Label, type LabelProps } from './label'\nexport { Separator, type SeparatorProps } from './separator'\nexport { SplitButton, type SplitButtonProps } from './split-button'\nexport { VisuallyHidden, type VisuallyHiddenProps } from './visually-hidden'\n\n// Autocomplete\nexport { Autocomplete, type AutocompleteOption,type AutocompleteProps } from './autocomplete'\n\n// Combobox\nexport { Combobox, type ComboboxOption, type ComboboxProps, type ComboboxSize,comboboxTriggerVariants } from './combobox'\n\n// FileUpload\nexport { FileUpload, type FileUploadProps } from './file-upload'\n\n// Form Controls\nexport { Checkbox, type CheckboxProps } from './checkbox'\nexport { FormField, type FormFieldProps, type FormHelperState, FormHelperText, type FormHelperTextProps,useFormField } from './form'\n// InputOTP removed from barrel in 0.40.0 — hard peer `input-otp` was breaking\n// fresh-consumer builds. Import per-component instead:\n// import { InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot } from '@devalok/shilp-sutra/ui/input-otp'\nexport { NumberInput, type NumberInputProps, type NumberInputSize, type NumberInputState,numberInputWrapperVariants } from './number-input'\nexport { RadioGroup, RadioGroupItem, type RadioGroupItemProps,type RadioGroupProps } from './radio'\nexport { SearchInput, type SearchInputProps } from './search-input'\nexport {\n Select,\n SelectContent,\n SelectGroup,\n SelectItem,\n SelectLabel,\n SelectScrollDownButton,\n SelectScrollUpButton,\n SelectSeparator,\n SelectTrigger,\n type SelectTriggerProps,\n selectTriggerVariants,\n SelectValue,\n} from './select'\nexport { Slider, type SliderColor,type SliderProps, type SliderSize, sliderThumbVariants, sliderTrackVariants } from './slider'\nexport { Switch, type SwitchProps } from './switch'\nexport { Textarea, type TextareaProps,textareaVariants } from './textarea'\nexport { Toggle, type ToggleProps,toggleVariants } from './toggle'\nexport { ToggleGroup, ToggleGroupItem, type ToggleGroupItemProps,type ToggleGroupProps } from './toggle-group'\nexport { TruncatedText, type TruncatedTextProps } from './truncated-text'\n\n// Feedback & Overlays\nexport {\n AlertDialog,\n AlertDialogAction,\n type AlertDialogActionProps,\n AlertDialogCancel,\n type AlertDialogCancelProps,\n AlertDialogContent,\n type AlertDialogContentProps,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogOverlay,\n AlertDialogPortal,\n AlertDialogTitle,\n AlertDialogTrigger,\n} from './alert-dialog'\nexport { Collapsible, CollapsibleContent, type CollapsibleProps,CollapsibleTrigger } from './collapsible'\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n type DialogContentProps,\n DialogContentRaw,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n type DialogTitleProps,\n DialogTrigger,\n} from './dialog'\nexport { HoverCard, HoverCardContent, type HoverCardContentProps,HoverCardTrigger } from './hover-card'\nexport { Popover, PopoverAnchor, PopoverContent, type PopoverContentProps,PopoverTrigger } from './popover'\nexport {\n Sheet,\n SheetClose,\n SheetContent,\n type SheetContentProps,\n SheetDescription,\n SheetFooter,\n SheetHeader,\n SheetOverlay,\n SheetPortal,\n SheetTitle,\n SheetTrigger,\n} from './sheet'\n// toast + Toaster removed from barrel in 0.40.0 — hard peer `sonner` was\n// breaking fresh-consumer builds when consumers imported other UI symbols\n// from the barrel without sonner installed. Import per-component instead:\n// import { toast, formatFileSize, type ToastOptions } from '@devalok/shilp-sutra/ui/toast'\n// import { Toaster } from '@devalok/shilp-sutra/ui/toaster'\nexport { Tooltip, TooltipContent, type TooltipContentProps,TooltipProvider, TooltipTrigger } from './tooltip'\n// ---------------------------------------------------------------------------\n// Notifications — pick the right one:\n// Alert — inline, static feedback within a form or page section (no user action needed to show)\n// Banner — persistent, page-level notice shown above main content (survives navigation)\n// Toast — imperative, transient, action-triggered (fires on user action, auto-dismisses)\n// Requires <Toaster /> mounted once at layout root. Use toast.success() etc. from anywhere.\n// ---------------------------------------------------------------------------\nexport { Alert, type AlertProps,alertVariants } from './alert'\nexport { Banner, type BannerProps,bannerVariants } from './banner'\nexport { Spinner, type SpinnerProps } from './spinner'\n\n// Data Display\nexport { AspectRatio } from './aspect-ratio'\nexport { Avatar, AvatarFallback, type AvatarFallbackProps, AvatarImage, type AvatarProps, type AvatarRing,type AvatarStatus, avatarVariants } from './avatar'\nexport { Badge, type BadgeProps,badgeVariants } from './badge'\nexport { BadgeGroup, type BadgeGroupProps } from './badge-group'\nexport { BadgeIndicator, type BadgeIndicatorProps } from './badge-indicator'\nexport { Card, CardAction, type CardActionPlacement, type CardActionProps, CardBleed, type CardBleedProps, type CardBleedSide, CardContent, CardDescription, CardFooter, CardHeader, type CardProps,CardSection, CardTitle, cardVariants } from './card'\nexport { Code, type CodeProps } from './code'\nexport { ColorSwatch, type ColorSwatchProps } from './color-swatch'\nexport { Progress, progressIndicatorVariants, type ProgressProps,progressTrackVariants } from './progress'\nexport { MultiProgressRing, type MultiProgressRingProps,ProgressRing, type ProgressRingProps } from './progress-ring'\nexport {\n Skeleton,\n SkeletonAvatar,\n type SkeletonAvatarProps,\n SkeletonButton,\n type SkeletonButtonProps,\n SkeletonChart,\n type SkeletonChartProps,\n SkeletonGroup,\n type SkeletonGroupProps,\n SkeletonImage,\n type SkeletonImageProps,\n SkeletonInput,\n type SkeletonInputProps,\n type SkeletonProps,\n SkeletonText,\n type SkeletonTextProps,\n skeletonVariants,\n} from './skeleton'\nexport { StatCard, type StatCardProps } from './stat-card'\nexport {\n type FlashPreset,\n type FlashSpec,\n type FlashSpeed,\n type FlashTone,\n StatFlash,\n type StatFlashProps,\n} from './stat-flash'\nexport { StatusDot, type StatusDotProps, type StatusDotStatus } from './status-dot'\nexport { Surface, type SurfaceProps, surfaceVariants } from './surface'\nexport { Table, TableBody, TableCaption, TableCell, type TableCellBaseProps,type TableCellProps,type TableDensity, TableFooter, TableHead, TableHeader, type TableProps, TableRow, TableRowActions, type TableRowActionsProps,type TableRowProps } from './table'\nexport { TableRowLink, type TableRowLinkProps } from './table-row-link'\n\n// Navigation\nexport { Accordion, AccordionContent, type AccordionContentProps,AccordionItem, type AccordionItemProps, AccordionTrigger, type AccordionTriggerProps } from './accordion'\nexport {\n Breadcrumb,\n BreadcrumbEllipsis,\n BreadcrumbItem,\n BreadcrumbLink,\n type BreadcrumbLinkProps,\n BreadcrumbList,\n BreadcrumbPage,\n type BreadcrumbProps,\n BreadcrumbSeparator,\n} from './breadcrumb'\nexport {\n ContextMenu,\n ContextMenuCheckboxItem,\n ContextMenuContent,\n type ContextMenuContentProps,\n ContextMenuGroup,\n ContextMenuItem,\n type ContextMenuItemProps,\n ContextMenuLabel,\n ContextMenuPortal,\n ContextMenuRadioGroup,\n ContextMenuRadioItem,\n ContextMenuSeparator,\n ContextMenuShortcut,\n ContextMenuSub,\n ContextMenuSubContent,\n ContextMenuSubTrigger,\n ContextMenuTrigger,\n} from './context-menu'\nexport {\n DropdownMenu,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n type DropdownMenuContentProps,\n DropdownMenuGroup,\n DropdownMenuItem,\n type DropdownMenuItemProps,\n DropdownMenuLabel,\n DropdownMenuPortal,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuTrigger,\n} from './dropdown-menu'\nexport {\n Menubar,\n MenubarCheckboxItem,\n MenubarContent,\n type MenubarContentProps,\n MenubarGroup,\n MenubarItem,\n type MenubarItemProps,\n MenubarLabel,\n MenubarMenu,\n MenubarPortal,\n MenubarRadioGroup,\n MenubarRadioItem,\n MenubarSeparator,\n MenubarShortcut,\n MenubarSub,\n MenubarSubContent,\n MenubarSubTrigger,\n MenubarTrigger,\n} from './menubar'\nexport {\n NavigationMenu,\n NavigationMenuContent,\n type NavigationMenuContentProps,\n NavigationMenuIndicator,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n type NavigationMenuProps,\n NavigationMenuTrigger,\n NavigationMenuViewport,\n} from './navigation-menu'\nexport {\n generatePagination,\n PaginationContent,\n PaginationEllipsis,\n PaginationItem,\n PaginationLink,\n type PaginationLinkProps,\n PaginationNav,\n type PaginationNavProps,\n PaginationNext,\n PaginationPrevious,\n PaginationRoot,\n} from './pagination'\nexport {\n Sidebar,\n SidebarContent,\n SidebarFooter,\n SidebarGroup,\n SidebarGroupAction,\n SidebarGroupContent,\n SidebarGroupLabel,\n SidebarHeader,\n SidebarInput,\n SidebarInset,\n SidebarMenu,\n SidebarMenuAction,\n SidebarMenuBadge,\n SidebarMenuButton,\n SidebarMenuItem,\n SidebarMenuSkeleton,\n SidebarMenuSub,\n SidebarMenuSubButton,\n SidebarMenuSubItem,\n type SidebarProps,\n SidebarProvider,\n SidebarRail,\n SidebarSeparator,\n SidebarTrigger,\n useSidebar,\n} from './sidebar'\nexport { Tabs, type TabsColor, TabsContent, type TabsContentProps, TabsList, type TabsListProps, type TabsOrientation,type TabsProps, type TabsSize, TabsTrigger, type TabsTriggerProps } from './tabs'\n\n// Workflow\nexport { Step, Stepper, type StepperProps, type StepProps } from './stepper'\n\n\n// Typography\nexport { Text, type TextProps, type TextVariant,textVariants } from './text'\n\n// Layout\nexport { Container, type ContainerProps } from './container'\nexport { type SpacingToken,Stack, type StackProps } from './stack'\n\n// Tree View\nexport { TreeItem, type TreeItemProps, type TreeNode,TreeView, type TreeViewProps, useTree } from './tree-view'\n\n// Segmented Control\nexport {\n SegmentedControl,\n type SegmentedControlOption,\n type SegmentedControlProps,\n type SegmentedControlSize,\n type SegmentedControlVariant,\n} from './segmented-control'\n\n// Brand Texture\nexport { DevalokGrain, type DevalokGrainProps, type GrainIntensity } from './devalok-grain'\n\n// Chat primitives\nexport {\n DateSeparator,\n type DateSeparatorProps,\n Message,\n type MessageActionProps,\n type MessageActionsProps,\n type MessageAuthorProps,\n type MessageAvatarProps,\n type MessageBodyProps,\n type MessageContentProps,\n type MessageContextValue,\n type MessageEditableBodyProps,\n MessageInput,\n type MessageInputProps,\n MessageList,\n type MessageListProps,\n type MessageProps,\n type MessageReactionsProps,\n SystemMessage,\n type SystemMessageProps,\n TypingIndicator,\n type TypingIndicatorProps,\n UnreadSeparator,\n type UnreadSeparatorProps,\n useMessageContext,\n} from './chat'\n\n// Other\nexport { Link, type LinkProps } from './link'\n\n// OAuth / Social sign-in\nexport {\n getOAuthLabel,\n getOAuthName,\n OAuth,\n type OAuthAppearance,\n OAuthButton,\n type OAuthButtonProps,\n OAuthConnectionRow,\n type OAuthConnectionRowProps,\n OAuthDivider,\n type OAuthDividerProps,\n OAuthGlyph,\n type OAuthGlyphProps,\n OAuthGroup,\n type OAuthGroupProps,\n type OAuthIntent,\n type OAuthProvider,\n type OAuthVariant,\n} from './oauth-button'\n\n// Utilities\nexport { formatRelativeTime } from './lib/date-utils'\nexport type { SpringPreset, TweenPreset } from './lib/motion'\nexport { springs, stagger, tweens, withReducedMotion } from './lib/motion'\nexport { cn } from './lib/utils'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUA,IAAI,IAAU;AAEd,SAAgB,KAA0B;AACpC,WACA,SAAO,SAAW,MAGtB;MAAI;AAEyB;UACrB;AAKR,EAHA,IAAU,IAGV,4BAA4B;AAE1B,GADc,iBAAiB,SAAS,gBAAgB,CAAC,iBAAiB,mBAAmB,CAAC,MAAM,IAElG,QAAQ,KACN,sMAGD;IAEH;;;;;ACdJ,IAAmB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
/**
|
|
3
|
+
* Tailwind classes that style an in-content `@mention` token (`<span class="mention">`).
|
|
4
|
+
*
|
|
5
|
+
* Shared by the rich-text editor, the chat input, AND the read-only Message
|
|
6
|
+
* display so a mention looks identical whether it's being typed or rendered in a
|
|
7
|
+
* timeline. Keep this the single source — three copies drifted before (see #99,
|
|
8
|
+
* where Message never styled the token and `highlight="mention"` went invisible).
|
|
9
|
+
*/
|
|
10
|
+
export declare const MENTION_TOKEN_CLASS = "[&_.mention]:rounded-control-inner [&_.mention]:bg-accent-2 [&_.mention]:px-ds-02 [&_.mention]:py-[1px] [&_.mention]:font-medium [&_.mention]:text-accent-11";
|
|
11
|
+
//# sourceMappingURL=mention.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mention.d.ts","sourceRoot":"","sources":["../../../src/ui/lib/mention.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,iKACgI,CAAA"}
|
package/dist/ui/radio.js
CHANGED
|
@@ -39,7 +39,7 @@ var d = {
|
|
|
39
39
|
className: "flex items-center justify-center",
|
|
40
40
|
initial: { scale: 0 },
|
|
41
41
|
animate: { scale: 1 },
|
|
42
|
-
transition: r.
|
|
42
|
+
transition: r.snappy,
|
|
43
43
|
children: /* @__PURE__ */ s(c, { className: i(f[a], "fill-accent-9 text-accent-11") })
|
|
44
44
|
})
|
|
45
45
|
})
|
package/dist/ui/radio.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio.js","names":[],"sources":["../../src/ui/radio.tsx"],"sourcesContent":["'use client'\n\nimport * as RadioGroupPrimitive from '@primitives/react-radio-group'\nimport { IconCircle } from '@tabler/icons-react'\nimport { AnimatePresence, motion } from 'framer-motion'\nimport * as React from 'react'\n\nimport { useFormField } from './form'\nimport { springs } from './lib/motion'\nimport { cn } from './lib/utils'\n\nconst RadioGroup = React.forwardRef<\n React.ElementRef<typeof RadioGroupPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>\n>(({ className, ...props }, ref) => {\n const fieldCtx = useFormField()\n const isError = fieldCtx.state === 'error'\n const ariaDescribedBy = props['aria-describedby'] ?? fieldCtx.helperTextId\n const ariaRequired = props['aria-required'] ?? fieldCtx.required\n\n return (\n <RadioGroupPrimitive.Root\n className={cn('grid gap-ds-03', className)}\n aria-invalid={isError || undefined}\n aria-describedby={ariaDescribedBy}\n aria-required={ariaRequired || undefined}\n {...props}\n ref={ref}\n />\n )\n})\nRadioGroup.displayName = RadioGroupPrimitive.Root.displayName\n\nexport interface RadioGroupItemProps extends React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item> {\n /** Control size — `sm` (20px), `md` (24px, default, WCAG compliant), `lg` (28px). */\n size?: 'sm' | 'md' | 'lg'\n}\n\nconst radioSizeClasses = {\n sm: 'h-5 w-5',\n md: 'h-6 w-6',\n lg: 'h-7 w-7',\n} as const\n\nconst radioIndicatorClasses = {\n sm: 'h-1.5 w-1.5',\n md: 'h-ds-03 w-ds-03',\n lg: 'h-2.5 w-2.5',\n} as const\n\nconst RadioGroupItem = React.forwardRef<\n React.ElementRef<typeof RadioGroupPrimitive.Item>,\n RadioGroupItemProps\n>(({ className, size = 'md', ...props }, ref) => {\n return (\n <RadioGroupPrimitive.Item\n ref={ref}\n className={cn(\n 'touch-target aspect-square rounded-pill',\n radioSizeClasses[size],\n 'border border-surface-border-strong bg-surface-raised-hover',\n 'transition-colors duration-fast-01',\n 'focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-accent-9 focus-visible:ring-offset-2',\n 'disabled:cursor-not-allowed disabled:opacity-action-disabled',\n 'hover:border-accent-7 hover:bg-surface-raised-active',\n 'data-[state=checked]:border-accent-7',\n className,\n )}\n {...props}\n >\n <RadioGroupPrimitive.Indicator asChild className=\"flex items-center justify-center\">\n <motion.span\n className=\"flex items-center justify-center\"\n initial={{ scale: 0 }}\n animate={{ scale: 1 }}\n transition={springs.
|
|
1
|
+
{"version":3,"file":"radio.js","names":[],"sources":["../../src/ui/radio.tsx"],"sourcesContent":["'use client'\n\nimport * as RadioGroupPrimitive from '@primitives/react-radio-group'\nimport { IconCircle } from '@tabler/icons-react'\nimport { AnimatePresence, motion } from 'framer-motion'\nimport * as React from 'react'\n\nimport { useFormField } from './form'\nimport { springs } from './lib/motion'\nimport { cn } from './lib/utils'\n\nconst RadioGroup = React.forwardRef<\n React.ElementRef<typeof RadioGroupPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>\n>(({ className, ...props }, ref) => {\n const fieldCtx = useFormField()\n const isError = fieldCtx.state === 'error'\n const ariaDescribedBy = props['aria-describedby'] ?? fieldCtx.helperTextId\n const ariaRequired = props['aria-required'] ?? fieldCtx.required\n\n return (\n <RadioGroupPrimitive.Root\n className={cn('grid gap-ds-03', className)}\n aria-invalid={isError || undefined}\n aria-describedby={ariaDescribedBy}\n aria-required={ariaRequired || undefined}\n {...props}\n ref={ref}\n />\n )\n})\nRadioGroup.displayName = RadioGroupPrimitive.Root.displayName\n\nexport interface RadioGroupItemProps extends React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item> {\n /** Control size — `sm` (20px), `md` (24px, default, WCAG compliant), `lg` (28px). */\n size?: 'sm' | 'md' | 'lg'\n}\n\nconst radioSizeClasses = {\n sm: 'h-5 w-5',\n md: 'h-6 w-6',\n lg: 'h-7 w-7',\n} as const\n\nconst radioIndicatorClasses = {\n sm: 'h-1.5 w-1.5',\n md: 'h-ds-03 w-ds-03',\n lg: 'h-2.5 w-2.5',\n} as const\n\nconst RadioGroupItem = React.forwardRef<\n React.ElementRef<typeof RadioGroupPrimitive.Item>,\n RadioGroupItemProps\n>(({ className, size = 'md', ...props }, ref) => {\n return (\n <RadioGroupPrimitive.Item\n ref={ref}\n className={cn(\n 'touch-target aspect-square rounded-pill',\n radioSizeClasses[size],\n 'border border-surface-border-strong bg-surface-raised-hover',\n 'transition-colors duration-fast-01',\n 'focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-accent-9 focus-visible:ring-offset-2',\n 'disabled:cursor-not-allowed disabled:opacity-action-disabled',\n 'hover:border-accent-7 hover:bg-surface-raised-active',\n 'data-[state=checked]:border-accent-7',\n className,\n )}\n {...props}\n >\n <RadioGroupPrimitive.Indicator asChild className=\"flex items-center justify-center\">\n <motion.span\n className=\"flex items-center justify-center\"\n initial={{ scale: 0 }}\n animate={{ scale: 1 }}\n transition={springs.snappy}\n >\n <IconCircle className={cn(radioIndicatorClasses[size], 'fill-accent-9 text-accent-11')} />\n </motion.span>\n </RadioGroupPrimitive.Indicator>\n </RadioGroupPrimitive.Item>\n )\n})\nRadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName\n\nexport type RadioGroupProps = React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>\n\nexport { RadioGroup, RadioGroupItem }\n"],"mappings":";;;;;;;;;;AAWA,IAAM,IAAa,EAAM,YAGtB,EAAE,cAAW,GAAG,KAAS,MAAQ;CAClC,IAAM,IAAW,GAAc,EACzB,IAAU,EAAS,UAAU,SAC7B,IAAkB,EAAM,uBAAuB,EAAS,cACxD,IAAe,EAAM,oBAAoB,EAAS;AAExD,QACE,kBAAC,GAAD;EACE,WAAW,EAAG,kBAAkB,EAAU;EAC1C,gBAAc,KAAW,KAAA;EACzB,oBAAkB;EAClB,iBAAe,KAAgB,KAAA;EAC/B,GAAI;EACC;EACL,CAAA;EAEJ;AACF,EAAW,cAAA,EAAuC;AAOlD,IAAM,IAAmB;CACvB,IAAI;CACJ,IAAI;CACJ,IAAI;CACL,EAEK,IAAwB;CAC5B,IAAI;CACJ,IAAI;CACJ,IAAI;CACL,EAEK,IAAiB,EAAM,YAG1B,EAAE,cAAW,UAAO,MAAM,GAAG,KAAS,MAErC,kBAAC,GAAD;CACO;CACL,WAAW,EACT,2CACA,EAAiB,IACjB,+DACA,sCACA,6GACA,gEACA,wDACA,wCACA,EACD;CACD,GAAI;WAEJ,kBAAC,GAAD;EAA+B,SAAA;EAAQ,WAAU;YAC/C,kBAAC,EAAO,MAAR;GACE,WAAU;GACV,SAAS,EAAE,OAAO,GAAG;GACrB,SAAS,EAAE,OAAO,GAAG;GACrB,YAAY,EAAQ;aAEpB,kBAAC,GAAD,EAAY,WAAW,EAAG,EAAsB,IAAO,+BAA+B,EAAI,CAAA;GAC9E,CAAA;EACgB,CAAA;CACP,CAAA,CAE7B;AACF,EAAe,cAAA,EAAuC"}
|
package/dist/ui/sidebar.js
CHANGED
|
@@ -5,8 +5,8 @@ import { t as n } from "../_chunks/vendor-utils.js";
|
|
|
5
5
|
import { cn as r } from "./lib/utils.js";
|
|
6
6
|
import { Icon as i } from "./icon.js";
|
|
7
7
|
import { useIsMobile as a } from "../hooks/use-mobile.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { Skeleton as o } from "./skeleton.js";
|
|
9
|
+
import { Button as s } from "./button.js";
|
|
10
10
|
import { Input as c } from "./input.js";
|
|
11
11
|
import { Separator as l } from "./separator.js";
|
|
12
12
|
import { Tooltip as u, TooltipContent as d, TooltipProvider as f, TooltipTrigger as p } from "./tooltip.js";
|
|
@@ -138,15 +138,15 @@ var M = _(({ side: e = "left", variant: t = "sidebar", collapsible: n = "offcanv
|
|
|
138
138
|
});
|
|
139
139
|
M.displayName = "Sidebar";
|
|
140
140
|
var N = _(({ className: e, onClick: t, ...n }, a) => {
|
|
141
|
-
let { toggleSidebar:
|
|
142
|
-
return /* @__PURE__ */ E(
|
|
141
|
+
let { toggleSidebar: o } = A();
|
|
142
|
+
return /* @__PURE__ */ E(s, {
|
|
143
143
|
ref: a,
|
|
144
144
|
"data-sidebar": "trigger",
|
|
145
145
|
variant: "ghost",
|
|
146
146
|
size: "icon-md",
|
|
147
147
|
className: r("h-ds-xs-plus w-ds-xs-plus", e),
|
|
148
148
|
onClick: (e) => {
|
|
149
|
-
t?.(e),
|
|
149
|
+
t?.(e), o();
|
|
150
150
|
},
|
|
151
151
|
...n,
|
|
152
152
|
children: [/* @__PURE__ */ T(i, {
|
|
@@ -326,10 +326,10 @@ var X = _(({ className: e, showIcon: t = !1, ...n }, i) => {
|
|
|
326
326
|
"data-sidebar": "menu-skeleton",
|
|
327
327
|
className: r("flex h-ds-sm items-center gap-ds-03 rounded-control px-ds-03", e),
|
|
328
328
|
...n,
|
|
329
|
-
children: [t && /* @__PURE__ */ T(
|
|
329
|
+
children: [t && /* @__PURE__ */ T(o, {
|
|
330
330
|
className: "h-ico-sm w-ico-sm rounded-control",
|
|
331
331
|
"data-sidebar": "menu-skeleton-icon"
|
|
332
|
-
}), /* @__PURE__ */ T(
|
|
332
|
+
}), /* @__PURE__ */ T(o, {
|
|
333
333
|
className: "h-4 max-w-(--skeleton-width) flex-1",
|
|
334
334
|
"data-sidebar": "menu-skeleton-text",
|
|
335
335
|
style: { "--skeleton-width": a }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stat-card.d.ts","sourceRoot":"","sources":["../../src/ui/stat-card.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAiC,KAAK,QAAQ,EAAE,MAAM,QAAQ,CAAA;AAGrE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"stat-card.d.ts","sourceRoot":"","sources":["../../src/ui/stat-card.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAiC,KAAK,QAAQ,EAAE,MAAM,QAAQ,CAAA;AAGrE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAMjD,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,SAAS,EAAE,KAAK,UAAU,EAAY,MAAM,cAAc,CAAA;AAE1F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,MAAM,WAAW,aAAc,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IACxF,oEAAoE;IACpE,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,uDAAuD;IACvD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;IACtB,oCAAoC;IACpC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,uCAAuC;IACvC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE;QACN,KAAK,EAAE,MAAM,CAAA;QACb,SAAS,EAAE,IAAI,GAAG,MAAM,GAAG,SAAS,CAAA;KACrC,CAAA;IACD,kJAAkJ;IAClJ,cAAc,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAA;IACnC,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,sEAAsE;IACtE,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,kEAAkE;IAClE,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,qFAAqF;IACrF,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,+IAA+I;IAC/I,OAAO,CAAC,EAAE,SAAS,GAAG,UAAU,GAAG,SAAS,GAAG,MAAM,CAAA;IACrD;;;;OAIG;IACH,IAAI,CAAC,EAAE,QAAQ,CAAA;IACf,yJAAyJ;IACzJ,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAA;IACtC,uGAAuG;IACvG,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;IAC3B;;;;OAIG;IACH,KAAK,CAAC,EAAE,WAAW,GAAG,SAAS,CAAA;IAC/B,iFAAiF;IACjF,UAAU,CAAC,EAAE,UAAU,CAAA;IACvB,wEAAwE;IACxE,SAAS,CAAC,EAAE,MAAM,EAAE,CAAA;IACpB,+CAA+C;IAC/C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,yEAAyE;IACzE,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,yEAAyE;IACzE,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CACzB;AA+FD,QAAA,MAAM,QAAQ,sFA0Qb,CAAA;AAID,OAAO,EAAE,QAAQ,EAAE,CAAA"}
|
package/dist/ui/stat-card.js
CHANGED
|
@@ -3,16 +3,17 @@ import { IconProvider as e } from "./icon-context.js";
|
|
|
3
3
|
import { springs as t, tweens as n } from "./lib/motion.js";
|
|
4
4
|
import { cn as r } from "./lib/utils.js";
|
|
5
5
|
import { Icon as i } from "./icon.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { Skeleton as a } from "./skeleton.js";
|
|
7
|
+
import { t as o } from "../_chunks/normalize-icon.js";
|
|
8
|
+
import { Card as s, CardContent as c, CardFooter as ee } from "./card.js";
|
|
8
9
|
import { n as l } from "../_chunks/link-context.js";
|
|
9
10
|
import { StatFlash as u } from "./stat-flash.js";
|
|
10
11
|
import * as d from "react";
|
|
11
12
|
import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
12
|
-
import { IconMinus as h, IconTrendingDown as
|
|
13
|
-
import { motion as
|
|
13
|
+
import { IconMinus as h, IconTrendingDown as g, IconTrendingUp as _ } from "@tabler/icons-react";
|
|
14
|
+
import { motion as v } from "framer-motion";
|
|
14
15
|
//#region src/ui/stat-card.tsx
|
|
15
|
-
function
|
|
16
|
+
function y(e, t, n) {
|
|
16
17
|
let r = e.filter((e) => Number.isFinite(e));
|
|
17
18
|
if (r.length < 2) return "";
|
|
18
19
|
let i = Math.min(...r), a = Math.max(...r) - i || 1, o = t / (r.length - 1);
|
|
@@ -21,8 +22,8 @@ function v(e, t, n) {
|
|
|
21
22
|
return `${t === 0 ? "M" : "L"}${r.toFixed(1)},${s.toFixed(1)}`;
|
|
22
23
|
}).join(" ");
|
|
23
24
|
}
|
|
24
|
-
function
|
|
25
|
-
let n = d.useId(), i = d.useRef(null), [a, o] = d.useState(0), s =
|
|
25
|
+
function b({ data: e, colorClass: t }) {
|
|
26
|
+
let n = d.useId(), i = d.useRef(null), [a, o] = d.useState(0), s = y(e, 80, 32);
|
|
26
27
|
if (d.useEffect(() => {
|
|
27
28
|
i.current && o(i.current.getTotalLength());
|
|
28
29
|
}, [s]), !s) return null;
|
|
@@ -74,7 +75,7 @@ function y({ data: e, colorClass: t }) {
|
|
|
74
75
|
}), a > 0 && /* @__PURE__ */ p("style", { children: `@keyframes sparkline-draw-${n.replace(/:/g, "")} { to { stroke-dashoffset: 0; } }` })]
|
|
75
76
|
});
|
|
76
77
|
}
|
|
77
|
-
function
|
|
78
|
+
function x({ progress: e, label: t }) {
|
|
78
79
|
let n = Math.max(0, Math.min(100, e)), i = n >= 90 ? "bg-success-9" : n >= 70 ? "bg-warning-9" : "bg-accent-9";
|
|
79
80
|
return /* @__PURE__ */ p("div", {
|
|
80
81
|
className: "h-1 w-full rounded-pill bg-surface-raised",
|
|
@@ -89,25 +90,25 @@ function b({ progress: e, label: t }) {
|
|
|
89
90
|
})
|
|
90
91
|
});
|
|
91
92
|
}
|
|
92
|
-
var
|
|
93
|
-
let W = l(), G =
|
|
94
|
-
if (
|
|
93
|
+
var S = d.forwardRef(({ className: d, label: y, title: S, value: C, prefix: w, suffix: T, delta: E, deltaPlacement: D = "block", icon: O, loading: te, comparisonLabel: k, secondaryLabel: A, progress: j, variant: M = "default", size: N = "md", accentStyle: P = "none", iconFill: F = "soft", flash: I, flashSpeed: L, sparkline: R, onClick: z, href: B, footer: V, ...H }, U) => {
|
|
94
|
+
let W = l(), G = S ?? y ?? "", K = (z || B) && !H["aria-label"] ? `View ${G}` : H["aria-label"];
|
|
95
|
+
if (te) return /* @__PURE__ */ p(s, {
|
|
95
96
|
ref: U,
|
|
96
97
|
variant: M,
|
|
97
98
|
size: N,
|
|
98
99
|
className: d,
|
|
99
100
|
"aria-busy": "true",
|
|
100
101
|
...H,
|
|
101
|
-
children: /* @__PURE__ */ m(
|
|
102
|
+
children: /* @__PURE__ */ m(c, {
|
|
102
103
|
className: "flex flex-col gap-ds-03",
|
|
103
104
|
children: [
|
|
104
|
-
/* @__PURE__ */ p(
|
|
105
|
-
/* @__PURE__ */ p(
|
|
106
|
-
/* @__PURE__ */ p(
|
|
105
|
+
/* @__PURE__ */ p(a, { className: "h-ds-04 w-24 rounded-control-inner" }),
|
|
106
|
+
/* @__PURE__ */ p(a, { className: "h-ds-sm w-32" }),
|
|
107
|
+
/* @__PURE__ */ p(a, { className: "h-3 w-16 rounded-control-inner" })
|
|
107
108
|
]
|
|
108
109
|
})
|
|
109
110
|
});
|
|
110
|
-
let q =
|
|
111
|
+
let q = E?.direction === "up" ? _ : E?.direction === "down" ? g : h, J = E?.direction === "up" ? "text-success-11" : E?.direction === "down" ? "text-error-11" : "text-surface-fg-muted", Y = E?.direction === "up" ? "text-success-11" : E?.direction === "down" ? "text-error-11" : "text-accent-11", X = E ? /* @__PURE__ */ m(v.div, {
|
|
111
112
|
className: r("flex items-center gap-ds-02 text-ds-sm font-medium", J),
|
|
112
113
|
initial: {
|
|
113
114
|
opacity: 0,
|
|
@@ -122,7 +123,7 @@ var x = d.forwardRef(({ className: d, label: v, title: x, value: S, prefix: C, s
|
|
|
122
123
|
delay: .2
|
|
123
124
|
},
|
|
124
125
|
children: [
|
|
125
|
-
/* @__PURE__ */ p(
|
|
126
|
+
/* @__PURE__ */ p(v.span, {
|
|
126
127
|
className: "inline-flex",
|
|
127
128
|
initial: {
|
|
128
129
|
opacity: .5,
|
|
@@ -132,13 +133,13 @@ var x = d.forwardRef(({ className: d, label: v, title: x, value: S, prefix: C, s
|
|
|
132
133
|
opacity: 1,
|
|
133
134
|
scale: 1
|
|
134
135
|
},
|
|
135
|
-
transition: t.
|
|
136
|
+
transition: t.smooth,
|
|
136
137
|
children: /* @__PURE__ */ p(i, {
|
|
137
138
|
icon: q,
|
|
138
139
|
size: "sm"
|
|
139
140
|
})
|
|
140
141
|
}),
|
|
141
|
-
/* @__PURE__ */ p("span", { children:
|
|
142
|
+
/* @__PURE__ */ p("span", { children: E.value }),
|
|
142
143
|
k && /* @__PURE__ */ p("span", {
|
|
143
144
|
className: "text-surface-fg-subtle font-normal",
|
|
144
145
|
children: k
|
|
@@ -147,7 +148,7 @@ var x = d.forwardRef(({ className: d, label: v, title: x, value: S, prefix: C, s
|
|
|
147
148
|
}) : null, Z = /* @__PURE__ */ m(f, { children: [
|
|
148
149
|
/* @__PURE__ */ m("div", {
|
|
149
150
|
className: "flex items-center justify-between",
|
|
150
|
-
children: [/* @__PURE__ */ p(
|
|
151
|
+
children: [/* @__PURE__ */ p(v.p, {
|
|
151
152
|
className: "text-ds-md font-medium text-surface-fg-muted",
|
|
152
153
|
initial: { opacity: 0 },
|
|
153
154
|
animate: { opacity: 1 },
|
|
@@ -155,15 +156,15 @@ var x = d.forwardRef(({ className: d, label: v, title: x, value: S, prefix: C, s
|
|
|
155
156
|
children: G
|
|
156
157
|
}), /* @__PURE__ */ m("div", {
|
|
157
158
|
className: "flex items-center gap-ds-03",
|
|
158
|
-
children: [R && R.length >= 2 && /* @__PURE__ */ p(
|
|
159
|
+
children: [R && R.length >= 2 && /* @__PURE__ */ p(b, {
|
|
159
160
|
data: R,
|
|
160
161
|
colorClass: Y
|
|
161
|
-
}),
|
|
162
|
-
icon:
|
|
162
|
+
}), O && I ? /* @__PURE__ */ p(u, {
|
|
163
|
+
icon: O,
|
|
163
164
|
flash: I,
|
|
164
165
|
fill: F,
|
|
165
166
|
speed: L
|
|
166
|
-
}) :
|
|
167
|
+
}) : O ? P === "icon" ? /* @__PURE__ */ p(v.span, {
|
|
167
168
|
className: r("inline-flex items-center justify-center rounded-control p-ds-02", F === "solid" ? "bg-accent-9 text-accent-fg" : "bg-accent-3 text-accent-11"),
|
|
168
169
|
initial: {
|
|
169
170
|
opacity: 0,
|
|
@@ -177,9 +178,9 @@ var x = d.forwardRef(({ className: d, label: v, title: x, value: S, prefix: C, s
|
|
|
177
178
|
"aria-hidden": "true",
|
|
178
179
|
children: /* @__PURE__ */ p(e, {
|
|
179
180
|
size: "md",
|
|
180
|
-
children:
|
|
181
|
+
children: o(O, "md")
|
|
181
182
|
})
|
|
182
|
-
}) : /* @__PURE__ */ p(
|
|
183
|
+
}) : /* @__PURE__ */ p(v.span, {
|
|
183
184
|
className: "text-surface-fg-muted",
|
|
184
185
|
initial: {
|
|
185
186
|
opacity: 0,
|
|
@@ -193,7 +194,7 @@ var x = d.forwardRef(({ className: d, label: v, title: x, value: S, prefix: C, s
|
|
|
193
194
|
"aria-hidden": "true",
|
|
194
195
|
children: /* @__PURE__ */ p(e, {
|
|
195
196
|
size: "lg",
|
|
196
|
-
children:
|
|
197
|
+
children: o(O, "lg")
|
|
197
198
|
})
|
|
198
199
|
}) : null]
|
|
199
200
|
})]
|
|
@@ -201,10 +202,10 @@ var x = d.forwardRef(({ className: d, label: v, title: x, value: S, prefix: C, s
|
|
|
201
202
|
/* @__PURE__ */ m("div", {
|
|
202
203
|
className: "flex flex-col gap-ds-01",
|
|
203
204
|
children: [/* @__PURE__ */ m("div", {
|
|
204
|
-
className: r(
|
|
205
|
+
className: r(D === "inline" && E && "flex items-baseline gap-ds-03"),
|
|
205
206
|
children: [/* @__PURE__ */ p("div", {
|
|
206
207
|
className: "overflow-hidden",
|
|
207
|
-
children: /* @__PURE__ */ m(
|
|
208
|
+
children: /* @__PURE__ */ m(v.p, {
|
|
208
209
|
className: r("inline-block font-semibold", N === "sm" ? "text-ds-2xl" : "text-ds-3xl", P === "tint" ? "text-accent-11" : "text-surface-fg"),
|
|
209
210
|
initial: {
|
|
210
211
|
opacity: 0,
|
|
@@ -216,22 +217,22 @@ var x = d.forwardRef(({ className: d, label: v, title: x, value: S, prefix: C, s
|
|
|
216
217
|
},
|
|
217
218
|
transition: t.smooth,
|
|
218
219
|
children: [
|
|
219
|
-
|
|
220
|
+
w && /* @__PURE__ */ p("span", {
|
|
220
221
|
className: r("text-surface-fg-muted", N === "sm" ? "text-ds-md" : "text-ds-lg"),
|
|
221
|
-
children:
|
|
222
|
+
children: w
|
|
222
223
|
}),
|
|
223
224
|
/* @__PURE__ */ p("span", {
|
|
224
225
|
className: "tabular-nums",
|
|
225
|
-
children:
|
|
226
|
+
children: C
|
|
226
227
|
}),
|
|
227
|
-
|
|
228
|
+
T && /* @__PURE__ */ p("span", {
|
|
228
229
|
className: r("text-surface-fg-muted", N === "sm" ? "text-ds-md" : "text-ds-lg"),
|
|
229
|
-
children:
|
|
230
|
+
children: T
|
|
230
231
|
})
|
|
231
232
|
]
|
|
232
233
|
})
|
|
233
|
-
}),
|
|
234
|
-
}), A && /* @__PURE__ */ p(
|
|
234
|
+
}), D === "inline" && X]
|
|
235
|
+
}), A && /* @__PURE__ */ p(v.p, {
|
|
235
236
|
className: "text-ds-sm text-surface-fg-subtle",
|
|
236
237
|
initial: { opacity: 0 },
|
|
237
238
|
animate: { opacity: 1 },
|
|
@@ -242,28 +243,28 @@ var x = d.forwardRef(({ className: d, label: v, title: x, value: S, prefix: C, s
|
|
|
242
243
|
children: A
|
|
243
244
|
})]
|
|
244
245
|
}),
|
|
245
|
-
j != null && /* @__PURE__ */ p(
|
|
246
|
+
j != null && /* @__PURE__ */ p(v.div, {
|
|
246
247
|
initial: { opacity: 0 },
|
|
247
248
|
animate: { opacity: 1 },
|
|
248
249
|
transition: {
|
|
249
250
|
...n.fade,
|
|
250
251
|
delay: .15
|
|
251
252
|
},
|
|
252
|
-
children: /* @__PURE__ */ p(
|
|
253
|
+
children: /* @__PURE__ */ p(x, {
|
|
253
254
|
progress: j,
|
|
254
255
|
label: G
|
|
255
256
|
})
|
|
256
257
|
}),
|
|
257
|
-
|
|
258
|
-
] }), Q = P === "tint" ? "bg-linear-to-t from-accent-2 to-surface-raised" : void 0, $ = /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(
|
|
258
|
+
D === "block" && X
|
|
259
|
+
] }), Q = P === "tint" ? "bg-linear-to-t from-accent-2 to-surface-raised" : void 0, $ = /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(c, {
|
|
259
260
|
className: "flex flex-col gap-ds-03",
|
|
260
261
|
children: Z
|
|
261
262
|
}), V && /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("div", {
|
|
262
263
|
"aria-hidden": "true",
|
|
263
264
|
className: "h-px w-full bg-surface-border-subtle"
|
|
264
|
-
}), /* @__PURE__ */ p(
|
|
265
|
+
}), /* @__PURE__ */ p(ee, {
|
|
265
266
|
className: "text-ds-sm",
|
|
266
|
-
children: /* @__PURE__ */ p(
|
|
267
|
+
children: /* @__PURE__ */ p(v.div, {
|
|
267
268
|
className: "w-full",
|
|
268
269
|
initial: { opacity: 0 },
|
|
269
270
|
animate: { opacity: 1 },
|
|
@@ -281,14 +282,14 @@ var x = d.forwardRef(({ className: d, label: v, title: x, value: S, prefix: C, s
|
|
|
281
282
|
className: "block no-underline",
|
|
282
283
|
"aria-label": K,
|
|
283
284
|
...H,
|
|
284
|
-
children: /* @__PURE__ */ p(
|
|
285
|
+
children: /* @__PURE__ */ p(s, {
|
|
285
286
|
variant: M,
|
|
286
287
|
size: N,
|
|
287
288
|
interactive: !0,
|
|
288
289
|
className: Q,
|
|
289
290
|
children: $
|
|
290
291
|
})
|
|
291
|
-
}) : z ? /* @__PURE__ */ p(
|
|
292
|
+
}) : z ? /* @__PURE__ */ p(s, {
|
|
292
293
|
ref: U,
|
|
293
294
|
variant: M,
|
|
294
295
|
size: N,
|
|
@@ -303,7 +304,7 @@ var x = d.forwardRef(({ className: d, label: v, title: x, value: S, prefix: C, s
|
|
|
303
304
|
},
|
|
304
305
|
...H,
|
|
305
306
|
children: $
|
|
306
|
-
}) : /* @__PURE__ */ p(
|
|
307
|
+
}) : /* @__PURE__ */ p(s, {
|
|
307
308
|
ref: U,
|
|
308
309
|
variant: M,
|
|
309
310
|
size: N,
|
|
@@ -312,6 +313,6 @@ var x = d.forwardRef(({ className: d, label: v, title: x, value: S, prefix: C, s
|
|
|
312
313
|
children: $
|
|
313
314
|
});
|
|
314
315
|
});
|
|
315
|
-
|
|
316
|
+
S.displayName = "StatCard";
|
|
316
317
|
//#endregion
|
|
317
|
-
export {
|
|
318
|
+
export { S as StatCard };
|