@the12company/ui 0.1.2 → 0.1.3

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/README.md CHANGED
@@ -96,15 +96,26 @@ Floating glass header and sidebar shells — pass product UI as slots:
96
96
 
97
97
  ```tsx
98
98
  import {
99
+ AppChromeBrand,
99
100
  AppChromeHeader,
100
101
  AppChromeSidebar,
102
+ PageHeader,
103
+ ChartCard,
104
+ ListingPagination,
105
+ SearchableSelect,
101
106
  SidebarProvider,
102
107
  SidebarTrigger,
103
108
  } from "@the12company/ui";
104
109
 
105
110
  <SidebarProvider>
106
111
  <AppChromeSidebar
107
- header={<YourBrand />}
112
+ header={
113
+ <AppChromeBrand
114
+ logo={<img src="/logo.svg" alt="" className="h-4.5 w-4.5" />}
115
+ title="Your Product"
116
+ subtitle="Tagline"
117
+ />
118
+ }
108
119
  footer={<YourAccountMenu />}
109
120
  >
110
121
  <YourNavLinks />
@@ -119,6 +130,15 @@ import {
119
130
  </SidebarProvider>
120
131
  ```
121
132
 
133
+ Also available:
134
+
135
+ | Component | Role |
136
+ | --------- | ---- |
137
+ | `PageHeader` | Title block (label, badge, meta, back, actions) |
138
+ | `ChartCard` | Section / chart surface |
139
+ | `ListingPagination` | List paging (default + minimal) |
140
+ | `SearchableSelect` | Async combobox — inject `loadItems` |
141
+
122
142
  Primitives (`Sidebar`, `SidebarMenu`, `SidebarTrigger`, …) are also exported for custom layouts.
123
143
 
124
144
  No routing or business logic inside the kit — only structure and look.
@@ -162,13 +182,10 @@ Requires `npm login` (or a local auth token). The GitHub `NPM_TOKEN` secret is o
162
182
  ```
163
183
  packages/ui/
164
184
  ├── src/
165
- │ ├── components/ # UI primitives + AppChromeHeader
166
- │ ├── hooks/ # useToast, useIsMobile
167
- │ ├── lib/cn.ts
185
+ │ ├── components/ # primitives + chrome + PageHeader, ChartCard, …
186
+ │ ├── hooks/
187
+ │ ├── lib/ # cn, pagination helpers
168
188
  │ ├── tokens/
169
- │ │ ├── theme.css # Capivara / QA brand
170
- │ │ ├── theme-contract.css # token names + neutrals
171
- │ │ └── utilities.css # bg-content-glass, …
172
189
  │ └── index.ts
173
190
  ├── package.json
174
191
  └── README.md
package/dist/index.d.ts CHANGED
@@ -110,6 +110,23 @@ declare const AlertDialogDescription: React$1.ForwardRefExoticComponent<Omit<Ale
110
110
  declare const AlertDialogAction: React$1.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogActionProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
111
111
  declare const AlertDialogCancel: React$1.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogCancelProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
112
112
 
113
+ type AppChromeBrandProps = {
114
+ /** Brand mark (img, svg, or custom node). */
115
+ logo?: React$1.ReactNode;
116
+ title?: React$1.ReactNode;
117
+ subtitle?: React$1.ReactNode;
118
+ className?: string;
119
+ /**
120
+ * Override collapse detection. When omitted, uses sidebar state
121
+ * (hidden on mobile drawer).
122
+ */
123
+ collapsed?: boolean;
124
+ };
125
+ /**
126
+ * Sidebar brand row: logo + title/subtitle that collapse with the sidebar.
127
+ */
128
+ declare function AppChromeBrand({ logo, title, subtitle, className, collapsed: collapsedProp, }: AppChromeBrandProps): React$1.JSX.Element;
129
+
113
130
  type AppChromeHeaderProps = {
114
131
  /** Ref on the outer `<header>` (e.g. for measuring chrome height). */
115
132
  headerRef?: React$1.Ref<HTMLElement>;
@@ -279,6 +296,22 @@ declare const ChartLegendContent: React$1.ForwardRefExoticComponent<Omit<React$1
279
296
  nameKey?: string;
280
297
  }, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
281
298
 
299
+ type ChartCardProps = {
300
+ title: React$1.ReactNode;
301
+ subtitle?: React$1.ReactNode;
302
+ children: React$1.ReactNode;
303
+ action?: React$1.ReactNode;
304
+ titleInfo?: React$1.ReactNode;
305
+ titleClassName?: string;
306
+ /** Use glass surface (`bg-content-glass`) instead of solid card. */
307
+ glass?: boolean;
308
+ className?: string;
309
+ };
310
+ /**
311
+ * Section / chart surface with title row, optional subtitle, and action slot.
312
+ */
313
+ declare function ChartCard({ title, subtitle, children, action, titleInfo, titleClassName, glass, className, }: ChartCardProps): React$1.JSX.Element;
314
+
282
315
  declare const Checkbox: React$1.ForwardRefExoticComponent<Omit<CheckboxPrimitive.CheckboxProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
283
316
 
284
317
  declare const Collapsible: React$1.ForwardRefExoticComponent<CollapsiblePrimitive.CollapsibleProps & React$1.RefAttributes<HTMLDivElement>>;
@@ -523,6 +556,28 @@ declare const InputOTPSeparator: React$1.ForwardRefExoticComponent<Omit<React$1.
523
556
 
524
557
  declare const Label: React$1.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React$1.RefAttributes<HTMLLabelElement>, "ref"> & VariantProps<(props?: class_variance_authority_types.ClassProp | undefined) => string> & React$1.RefAttributes<HTMLLabelElement>>;
525
558
 
559
+ type ListingPaginationProps = {
560
+ page: number;
561
+ totalPages: number;
562
+ total?: number;
563
+ pageSize?: number;
564
+ itemLabel?: string;
565
+ disabled?: boolean;
566
+ variant?: "default" | "minimal";
567
+ className?: string;
568
+ onPageChange: (page: number) => void;
569
+ /** Override total formatting in the range label (e.g. capped counts). */
570
+ formatTotal?: (n: number) => string;
571
+ labels?: {
572
+ previous?: string;
573
+ next?: string;
574
+ previousAria?: string;
575
+ nextAria?: string;
576
+ pageAria?: (page: number) => string;
577
+ };
578
+ };
579
+ declare function ListingPagination({ page, totalPages, total, pageSize, itemLabel, disabled, variant, className, onPageChange, formatTotal, labels, }: ListingPaginationProps): React$1.JSX.Element | null;
580
+
526
581
  declare const MenubarMenu: (props: MenubarPrimitive.MenubarMenuProps & {
527
582
  __scopeMenubar?: _radix_ui_react_context.Scope;
528
583
  }) => React$1.JSX.Element;
@@ -561,6 +616,33 @@ declare const NavigationMenuLink: React$1.ForwardRefExoticComponent<NavigationMe
561
616
  declare const NavigationMenuViewport: React$1.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuViewportProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
562
617
  declare const NavigationMenuIndicator: React$1.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuIndicatorProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
563
618
 
619
+ type PageHeaderProps = {
620
+ /** Optional eyebrow above the title. */
621
+ label?: React$1.ReactNode;
622
+ title: React$1.ReactNode;
623
+ description?: React$1.ReactNode;
624
+ /** Shown while the title is resolving (e.g. async folder name). */
625
+ titleLoading?: boolean;
626
+ /** Badge or chips next to the title. */
627
+ badge?: React$1.ReactNode;
628
+ /** Right-side meta (e.g. “Updated at …”). */
629
+ meta?: React$1.ReactNode;
630
+ /** Back control (link/button) — fully owned by the consumer. */
631
+ back?: React$1.ReactNode;
632
+ /** Actions aligned to the end (buttons, menus). */
633
+ children?: React$1.ReactNode;
634
+ className?: string;
635
+ titleClassName?: string;
636
+ descriptionClassName?: string;
637
+ /** Skeleton width hint when `titleLoading`. */
638
+ titleSkeletonClassName?: string;
639
+ };
640
+ /**
641
+ * Shared page title block: optional back, label, title (+ badge),
642
+ * description, meta, and trailing actions.
643
+ */
644
+ declare function PageHeader({ label, title, description, titleLoading, badge, meta, back, children, className, titleClassName, descriptionClassName, titleSkeletonClassName, }: PageHeaderProps): React$1.JSX.Element;
645
+
564
646
  declare const Pagination: {
565
647
  ({ className, ...props }: React$1.ComponentProps<"nav">): React$1.JSX.Element;
566
648
  displayName: string;
@@ -623,6 +705,51 @@ declare const ResizableHandle: ({ withHandle, className, ...props }: React.Compo
623
705
  declare const ScrollArea: React$1.ForwardRefExoticComponent<Omit<ScrollAreaPrimitive.ScrollAreaProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
624
706
  declare const ScrollBar: React$1.ForwardRefExoticComponent<Omit<ScrollAreaPrimitive.ScrollAreaScrollbarProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
625
707
 
708
+ type SearchableSelectItem = {
709
+ id: string;
710
+ label: string;
711
+ /** Optional secondary text (e.g. id shown beside the name). */
712
+ secondary?: string;
713
+ };
714
+ type SearchableSelectLoadResult = {
715
+ items: SearchableSelectItem[];
716
+ hasMore: boolean;
717
+ };
718
+ type SearchableSelectProps = {
719
+ value: string;
720
+ onChange: (id: string) => void;
721
+ /** Sentinel value meaning “no filter / all”. @default "all" */
722
+ allValue?: string;
723
+ allLabel: string;
724
+ searchPlaceholder: string;
725
+ loadItems: (args: {
726
+ query: string;
727
+ limit: number;
728
+ offset: number;
729
+ }) => Promise<SearchableSelectLoadResult>;
730
+ /**
731
+ * Resolve a label when the selected id is not yet in the loaded list.
732
+ * Return null to fall back to showing the raw id.
733
+ */
734
+ resolveLabel?: (id: string) => Promise<string | null>;
735
+ pageSize?: number;
736
+ triggerClassName?: string;
737
+ icon?: React$1.ReactNode;
738
+ nestedInPopover?: boolean;
739
+ disabled?: boolean;
740
+ /** When this changes, cached items/labels are cleared. */
741
+ resetKey?: string | number;
742
+ emptyLabel?: string;
743
+ loadingLabel?: string;
744
+ loadingMoreLabel?: string;
745
+ debounceMs?: number;
746
+ };
747
+ /**
748
+ * Async searchable combobox with infinite scroll.
749
+ * Data loading is injected via `loadItems` — no product API coupling.
750
+ */
751
+ declare function SearchableSelect({ value, onChange, allValue, allLabel, searchPlaceholder, loadItems, resolveLabel, pageSize, triggerClassName, icon, nestedInPopover, disabled, resetKey, emptyLabel, loadingLabel, loadingMoreLabel, debounceMs, }: SearchableSelectProps): React$1.JSX.Element;
752
+
626
753
  declare const Select: React$1.FC<SelectPrimitive.SelectProps>;
627
754
  declare const SelectGroup: React$1.ForwardRefExoticComponent<SelectPrimitive.SelectGroupProps & React$1.RefAttributes<HTMLDivElement>>;
628
755
  declare const SelectValue: React$1.ForwardRefExoticComponent<SelectPrimitive.SelectValueProps & React$1.RefAttributes<HTMLSpanElement>>;
@@ -796,4 +923,8 @@ declare const ToggleGroupItem: React$1.ForwardRefExoticComponent<Omit<ToggleGrou
796
923
  size?: "default" | "sm" | "lg" | null | undefined;
797
924
  } & class_variance_authority_types.ClassProp) | undefined) => string> & React$1.RefAttributes<HTMLButtonElement>>;
798
925
 
799
- export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AppChromeHeader, type AppChromeHeaderProps, AppChromeSidebar, type AppChromeSidebarProps, AspectRatio, Avatar, AvatarFallback, AvatarImage, Badge, type BadgeProps, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, type ButtonProps, Calendar, type CalendarProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, type CarouselApi, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, type ChartConfig, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, Dropdown, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, HoverCard, HoverCardContent, HoverCardTrigger, Input, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, type InputProps, Label, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Popover, PopoverContent, PopoverTrigger, Progress, RadioGroup, RadioGroupItem, ResizableHandle, ResizablePanel, ResizablePanelGroup, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, 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, Toaster$1 as SonnerToaster, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, type TableProps, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, type TextareaProps, Toast$1 as Toast, ToastAction, type ToastActionElement, ToastClose, ToastDescription, type ToastProps, ToastProvider, ToastTitle, ToastViewport, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, badgeVariants, buttonVariants, cn, inputVariants, navigationMenuTriggerStyle, toast, toggleVariants, useFormField, useIsMobile, useSidebar, useToast };
926
+ type VisiblePage = number | "ellipsis";
927
+ declare function buildVisiblePages(current: number, totalPages: number): VisiblePage[];
928
+ declare function buildRangeLabel(page: number, pageSize: number, total: number, itemLabel?: string, formatTotal?: (n: number) => string): string;
929
+
930
+ export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AppChromeBrand, type AppChromeBrandProps, AppChromeHeader, type AppChromeHeaderProps, AppChromeSidebar, type AppChromeSidebarProps, AspectRatio, Avatar, AvatarFallback, AvatarImage, Badge, type BadgeProps, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, type ButtonProps, Calendar, type CalendarProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, type CarouselApi, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, ChartCard, type ChartCardProps, type ChartConfig, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, Dropdown, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, HoverCard, HoverCardContent, HoverCardTrigger, Input, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, type InputProps, Label, ListingPagination, type ListingPaginationProps, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, PageHeader, type PageHeaderProps, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Popover, PopoverContent, PopoverTrigger, Progress, RadioGroup, RadioGroupItem, ResizableHandle, ResizablePanel, ResizablePanelGroup, ScrollArea, ScrollBar, SearchableSelect, type SearchableSelectItem, type SearchableSelectLoadResult, type SearchableSelectProps, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, 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, Toaster$1 as SonnerToaster, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, type TableProps, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, type TextareaProps, Toast$1 as Toast, ToastAction, type ToastActionElement, ToastClose, ToastDescription, type ToastProps, ToastProvider, ToastTitle, ToastViewport, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, type VisiblePage, badgeVariants, buildRangeLabel, buildVisiblePages, buttonVariants, cn, inputVariants, navigationMenuTriggerStyle, toast, toggleVariants, useFormField, useIsMobile, useSidebar, useToast };