@loykin/designkit 0.0.3 → 0.0.5

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/dist/index.js CHANGED
@@ -7,7 +7,7 @@ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
7
7
  import { Avatar as Avatar$1 } from '@base-ui/react/avatar';
8
8
  import { mergeProps } from '@base-ui/react/merge-props';
9
9
  import { useRender } from '@base-ui/react/use-render';
10
- import { GripHorizontal, ChevronRightIcon, MoreHorizontalIcon, CheckIcon, ChevronDownIcon, ChevronUpIcon, XIcon, PanelLeftIcon, SlidersHorizontal, ChevronLeft, Check } from 'lucide-react';
10
+ import { GripHorizontal, XIcon, ChevronRightIcon, MoreHorizontalIcon, CheckIcon, ChevronDownIcon, ChevronUpIcon, PanelLeftIcon, SlidersHorizontal, ChevronLeft, Check, Clock } from 'lucide-react';
11
11
  import { Checkbox as Checkbox$1 } from '@base-ui/react/checkbox';
12
12
  import { Menu } from '@base-ui/react/menu';
13
13
  import { Input as Input$1 } from '@base-ui/react/input';
@@ -18,7 +18,7 @@ import { Select as Select$1 } from '@base-ui/react/select';
18
18
  import { Separator as Separator$1 } from '@base-ui/react/separator';
19
19
  import { Dialog } from '@base-ui/react/dialog';
20
20
  import * as React2 from 'react';
21
- import React2__default, { createContext, forwardRef, useContext, useEffect, useMemo, Children, useState, Fragment as Fragment$1, useCallback } from 'react';
21
+ import React2__default, { createContext, forwardRef, useContext, useEffect, useState, useCallback, useMemo, Children, Fragment as Fragment$1 } from 'react';
22
22
  import { Tooltip as Tooltip$1 } from '@base-ui/react/tooltip';
23
23
  import { Slider as Slider$1 } from '@base-ui/react/slider';
24
24
  import { Switch as Switch$1 } from '@base-ui/react/switch';
@@ -2474,7 +2474,7 @@ function ResizeHandle({
2474
2474
  }
2475
2475
  );
2476
2476
  }
2477
- function WorkbenchBodyTemplate({
2477
+ function WorkbenchBodyTemplateRoot({
2478
2478
  theme,
2479
2479
  className,
2480
2480
  contentClassName,
@@ -2765,6 +2765,21 @@ function WorkbenchBodyTemplate({
2765
2765
  ] })
2766
2766
  ] });
2767
2767
  }
2768
+ function WorkbenchSection({ title, description, actions, className, children }) {
2769
+ return /* @__PURE__ */ jsxs("section", { className: cn("space-y-2.5 p-3", className), children: [
2770
+ (title || description || actions) && /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-2", children: [
2771
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
2772
+ title && /* @__PURE__ */ jsx("h3", { className: "text-xs font-semibold uppercase tracking-wider text-muted-foreground", children: title }),
2773
+ description && /* @__PURE__ */ jsx("p", { className: "mt-0.5 text-xs text-muted-foreground", children: description })
2774
+ ] }),
2775
+ actions && /* @__PURE__ */ jsx("div", { className: "shrink-0", children: actions })
2776
+ ] }),
2777
+ children
2778
+ ] });
2779
+ }
2780
+ var WorkbenchBodyTemplate = Object.assign(WorkbenchBodyTemplateRoot, {
2781
+ Section: WorkbenchSection
2782
+ });
2768
2783
  var DataBodyTemplateContext = React2__default.createContext(false);
2769
2784
  function useDataBodyTemplateParent(component) {
2770
2785
  if (!React2__default.useContext(DataBodyTemplateContext)) {
@@ -3503,52 +3518,6 @@ function ListDetailBodyTemplate({
3503
3518
  }
3504
3519
  );
3505
3520
  }
3506
- function PanelTemplateSection({
3507
- title,
3508
- description,
3509
- actions,
3510
- className,
3511
- children
3512
- }) {
3513
- return /* @__PURE__ */ jsxs("section", { className: cn("space-y-2.5", className), children: [
3514
- (title || description || actions) && /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-2", children: [
3515
- /* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
3516
- title && /* @__PURE__ */ jsx("p", { className: "text-[10px] font-semibold uppercase tracking-wider text-muted-foreground", children: title }),
3517
- description && /* @__PURE__ */ jsx("p", { className: "mt-0.5 text-xs text-muted-foreground", children: description })
3518
- ] }),
3519
- actions && /* @__PURE__ */ jsx("div", { className: "shrink-0", children: actions })
3520
- ] }),
3521
- children
3522
- ] });
3523
- }
3524
- function PanelTemplateRoot({
3525
- title,
3526
- eyebrow,
3527
- status,
3528
- actions,
3529
- footer,
3530
- children,
3531
- className,
3532
- bodyClassName
3533
- }) {
3534
- return /* @__PURE__ */ jsxs("div", { className: cn("flex h-full flex-col overflow-hidden", className), children: [
3535
- (title || eyebrow || actions) && /* @__PURE__ */ jsxs("div", { className: "shrink-0 px-4 py-3", children: [
3536
- eyebrow && /* @__PURE__ */ jsx("p", { className: "mb-0.5 text-[10px] font-medium uppercase tracking-wider text-muted-foreground", children: eyebrow }),
3537
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
3538
- /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: [
3539
- title && /* @__PURE__ */ jsx("h2", { className: "min-w-0 truncate text-sm font-semibold", children: title }),
3540
- status && /* @__PURE__ */ jsx("span", { className: "shrink-0", children: status })
3541
- ] }),
3542
- actions && /* @__PURE__ */ jsx("div", { className: "flex shrink-0 items-center gap-1", children: actions })
3543
- ] })
3544
- ] }),
3545
- /* @__PURE__ */ jsx("div", { className: cn("min-h-0 flex-1 overflow-y-auto px-4 py-4", bodyClassName), children: /* @__PURE__ */ jsx("div", { className: "space-y-5", children }) }),
3546
- footer && /* @__PURE__ */ jsx("div", { className: "shrink-0 border-t border-border px-4 py-3", children: footer })
3547
- ] });
3548
- }
3549
- var PanelTemplate = Object.assign(PanelTemplateRoot, {
3550
- Section: PanelTemplateSection
3551
- });
3552
3521
  function FormWizardBodyTemplate({
3553
3522
  theme,
3554
3523
  title,
@@ -4099,6 +4068,196 @@ function PageTopBar({
4099
4068
  }
4100
4069
  );
4101
4070
  }
4071
+ function PanelTemplateSection({
4072
+ title,
4073
+ description,
4074
+ actions,
4075
+ className,
4076
+ children
4077
+ }) {
4078
+ return /* @__PURE__ */ jsxs("section", { className: cn("space-y-2.5", className), children: [
4079
+ (title || description || actions) && /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-2", children: [
4080
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
4081
+ title && /* @__PURE__ */ jsx("p", { className: "text-[10px] font-semibold uppercase tracking-wider text-muted-foreground", children: title }),
4082
+ description && /* @__PURE__ */ jsx("p", { className: "mt-0.5 text-xs text-muted-foreground", children: description })
4083
+ ] }),
4084
+ actions && /* @__PURE__ */ jsx("div", { className: "shrink-0", children: actions })
4085
+ ] }),
4086
+ children
4087
+ ] });
4088
+ }
4089
+ function PanelTemplateRow({ label, children, className }) {
4090
+ return /* @__PURE__ */ jsxs("div", { className: cn("grid grid-cols-[6rem_minmax(0,1fr)] gap-3", className), children: [
4091
+ /* @__PURE__ */ jsx("dt", { className: "text-xs text-muted-foreground", children: label }),
4092
+ /* @__PURE__ */ jsx("dd", { className: "min-w-0 break-words font-mono text-xs", children })
4093
+ ] });
4094
+ }
4095
+ function PanelTemplateRoot({
4096
+ title,
4097
+ eyebrow,
4098
+ status,
4099
+ actions,
4100
+ footer,
4101
+ children,
4102
+ className,
4103
+ bodyClassName
4104
+ }) {
4105
+ return /* @__PURE__ */ jsxs("div", { className: cn("flex h-full flex-col overflow-hidden", className), children: [
4106
+ (title || eyebrow || actions) && /* @__PURE__ */ jsxs("div", { className: "shrink-0 px-4 py-3", children: [
4107
+ eyebrow && /* @__PURE__ */ jsx("p", { className: "mb-0.5 text-[10px] font-medium uppercase tracking-wider text-muted-foreground", children: eyebrow }),
4108
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
4109
+ /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: [
4110
+ title && /* @__PURE__ */ jsx("h2", { className: "min-w-0 truncate text-sm font-semibold", children: title }),
4111
+ status && /* @__PURE__ */ jsx("span", { className: "shrink-0", children: status })
4112
+ ] }),
4113
+ actions && /* @__PURE__ */ jsx("div", { className: "flex shrink-0 items-center gap-1", children: actions })
4114
+ ] })
4115
+ ] }),
4116
+ /* @__PURE__ */ jsx("div", { className: cn("min-h-0 flex-1 overflow-y-auto px-4 py-4", bodyClassName), children: /* @__PURE__ */ jsx("div", { className: "space-y-5", children }) }),
4117
+ footer && /* @__PURE__ */ jsx("div", { className: "shrink-0 border-t border-border px-4 py-3", children: footer })
4118
+ ] });
4119
+ }
4120
+ var PanelTemplate = Object.assign(PanelTemplateRoot, {
4121
+ Section: PanelTemplateSection,
4122
+ Row: PanelTemplateRow
4123
+ });
4124
+ function InteractiveCard({ className, ...props }) {
4125
+ return /* @__PURE__ */ jsx(
4126
+ Card,
4127
+ {
4128
+ className: cn(
4129
+ "group h-full cursor-pointer gap-0 overflow-hidden py-0 transition-all hover:-translate-y-0.5 hover:shadow-md",
4130
+ className
4131
+ ),
4132
+ ...props
4133
+ }
4134
+ );
4135
+ }
4136
+ var articleToneGradients = {
4137
+ violet: "from-violet-500/80 via-indigo-500/70 to-sky-500/70",
4138
+ emerald: "from-emerald-500/80 via-teal-500/70 to-cyan-500/70",
4139
+ amber: "from-amber-500/80 via-orange-500/70 to-rose-500/70",
4140
+ rose: "from-rose-500/80 via-pink-500/70 to-fuchsia-500/70",
4141
+ sky: "from-sky-500/80 via-blue-500/70 to-indigo-500/70",
4142
+ slate: "from-slate-500/80 via-slate-600/70 to-slate-700/70"
4143
+ };
4144
+ function ArticleCover({ tone, className, children }) {
4145
+ return /* @__PURE__ */ jsx("div", { className: cn("relative bg-gradient-to-br", articleToneGradients[tone], className), children });
4146
+ }
4147
+ function ArticleByline({
4148
+ author,
4149
+ initials,
4150
+ meta,
4151
+ size = "default",
4152
+ className
4153
+ }) {
4154
+ return /* @__PURE__ */ jsxs("div", { className: cn("flex items-center", size === "sm" ? "gap-2" : "gap-3", className), children: [
4155
+ /* @__PURE__ */ jsx(Avatar, { size: size === "sm" ? "sm" : void 0, children: /* @__PURE__ */ jsx(AvatarFallback, { children: initials }) }),
4156
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
4157
+ /* @__PURE__ */ jsx("p", { className: cn("truncate font-medium", size === "sm" ? "text-xs" : "text-sm"), children: author }),
4158
+ meta && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: meta })
4159
+ ] })
4160
+ ] });
4161
+ }
4162
+ function ArticleToc({ title = "On this page", items, className }) {
4163
+ return /* @__PURE__ */ jsxs("div", { className: cn("space-y-3", className), children: [
4164
+ /* @__PURE__ */ jsx("p", { className: "text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: title }),
4165
+ items.map((item) => /* @__PURE__ */ jsx(
4166
+ "a",
4167
+ {
4168
+ href: item.href,
4169
+ className: cn(
4170
+ "block text-sm",
4171
+ item.emphasis ? "font-medium" : "text-muted-foreground"
4172
+ ),
4173
+ children: item.label
4174
+ },
4175
+ item.href
4176
+ ))
4177
+ ] });
4178
+ }
4179
+ function ArticleBody({ className, children }) {
4180
+ return /* @__PURE__ */ jsx("div", { className: cn("mx-auto max-w-3xl space-y-6 text-[15px] leading-7", className), children });
4181
+ }
4182
+ function ArticleBodySkeleton({ className }) {
4183
+ return /* @__PURE__ */ jsxs("div", { className: cn("mx-auto max-w-3xl animate-pulse space-y-4", className), children: [
4184
+ /* @__PURE__ */ jsx("div", { className: "h-8 w-2/3 rounded bg-muted" }),
4185
+ /* @__PURE__ */ jsx("div", { className: "h-56 rounded-xl bg-muted" })
4186
+ ] });
4187
+ }
4188
+ function ArticleCardPreview({
4189
+ tone,
4190
+ category,
4191
+ title,
4192
+ excerpt,
4193
+ author,
4194
+ initials,
4195
+ readTime,
4196
+ coverContent,
4197
+ coverClassName,
4198
+ className
4199
+ }) {
4200
+ return /* @__PURE__ */ jsxs(InteractiveCard, { className, children: [
4201
+ /* @__PURE__ */ jsx(ArticleCover, { tone, className: cn("h-32", coverClassName), children: coverContent }),
4202
+ /* @__PURE__ */ jsxs(CardContent, { className: "flex flex-1 flex-col p-4", children: [
4203
+ /* @__PURE__ */ jsx(Badge, { variant: "outline", className: "mb-3", children: category }),
4204
+ /* @__PURE__ */ jsx("h2", { className: "text-base font-semibold leading-snug", children: title }),
4205
+ /* @__PURE__ */ jsx("p", { className: "mt-2 line-clamp-2 text-sm text-muted-foreground", children: excerpt }),
4206
+ /* @__PURE__ */ jsxs("div", { className: "mt-auto flex items-center justify-between gap-3 pt-5", children: [
4207
+ /* @__PURE__ */ jsx(ArticleByline, { author, initials, size: "sm", className: "min-w-0" }),
4208
+ /* @__PURE__ */ jsxs("span", { className: "inline-flex shrink-0 items-center gap-1 text-xs text-muted-foreground", children: [
4209
+ /* @__PURE__ */ jsx(Clock, { className: "size-3" }),
4210
+ readTime
4211
+ ] })
4212
+ ] })
4213
+ ] })
4214
+ ] });
4215
+ }
4216
+ function FormField({ label, htmlFor, error, helperText, className, children }) {
4217
+ return /* @__PURE__ */ jsxs("div", { className: cn("space-y-1.5", className), children: [
4218
+ /* @__PURE__ */ jsx(Label, { htmlFor, className: "text-xs", children: label }),
4219
+ children,
4220
+ error ? /* @__PURE__ */ jsx("p", { className: "text-xs text-destructive", children: error }) : helperText ? /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: helperText }) : null
4221
+ ] });
4222
+ }
4223
+ function FormActions({
4224
+ status,
4225
+ cancelLabel = "Cancel",
4226
+ onCancel,
4227
+ cancelDisabled,
4228
+ submitLabel,
4229
+ submitDisabled,
4230
+ className
4231
+ }) {
4232
+ return /* @__PURE__ */ jsxs(
4233
+ "div",
4234
+ {
4235
+ className: cn(
4236
+ "flex items-center gap-2 border-t border-border pt-(--designkit-panel-gap)",
4237
+ status ? "justify-between" : "justify-end",
4238
+ className
4239
+ ),
4240
+ children: [
4241
+ status && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", role: "status", children: status }),
4242
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
4243
+ /* @__PURE__ */ jsx(
4244
+ Button,
4245
+ {
4246
+ type: "button",
4247
+ variant: "outline",
4248
+ size: "sm",
4249
+ className: "h-8 text-xs",
4250
+ onClick: onCancel,
4251
+ disabled: cancelDisabled,
4252
+ children: cancelLabel
4253
+ }
4254
+ ),
4255
+ /* @__PURE__ */ jsx(Button, { type: "submit", size: "sm", className: "h-8 text-xs", disabled: submitDisabled, children: submitLabel })
4256
+ ] })
4257
+ ]
4258
+ }
4259
+ );
4260
+ }
4102
4261
  var STYLE_ID = "designkit-vars";
4103
4262
  function buildTokenMap({
4104
4263
  radius,
@@ -4297,6 +4456,6 @@ function buildTemplateTheme(g, ov = {}) {
4297
4456
  return tokens;
4298
4457
  }
4299
4458
 
4300
- export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, BrowseBodyTemplate, Button, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, ColorsBodyTemplate, DashboardBodyTemplate, DashboardPanel, DataBodyTemplate, DataPage, DetailBodyTemplate, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, FormWizardBodyTemplate, Input, Label, ListDetailBodyTemplate, LoginBodyTemplate, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuPositioner, NavigationMenuTrigger, PageBreadcrumb, PageTopBar, PanelTemplate, Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Slider, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TypographyBodyTemplate, WorkbenchBodyTemplate, badgeVariants, buildTemplateTheme, buildTopBar, buttonVariants, cn, navigationMenuTriggerStyle, tabsListVariants, useIsMobile, useSidebar, useSidebarOptional, useStyleInjector, useThemeStore };
4459
+ export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, ArticleBody, ArticleBodySkeleton, ArticleByline, ArticleCardPreview, ArticleCover, ArticleToc, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, BrowseBodyTemplate, Button, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, ColorsBodyTemplate, DashboardBodyTemplate, DashboardPanel, DataBodyTemplate, DataPage, DetailBodyTemplate, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, FormActions, FormField, FormWizardBodyTemplate, Input, InteractiveCard, Label, ListDetailBodyTemplate, LoginBodyTemplate, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuPositioner, NavigationMenuTrigger, PageBreadcrumb, PageTopBar, PanelTemplate, Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Slider, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TypographyBodyTemplate, WorkbenchBodyTemplate, badgeVariants, buildTemplateTheme, buildTopBar, buttonVariants, cn, navigationMenuTriggerStyle, tabsListVariants, useIsMobile, useSidebar, useSidebarOptional, useStyleInjector, useThemeStore };
4301
4460
  //# sourceMappingURL=index.js.map
4302
4461
  //# sourceMappingURL=index.js.map