@hex-core/components 1.0.1 → 1.2.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/dist/index.d.ts CHANGED
@@ -202,6 +202,173 @@ declare const ScrollBar: React$1.ForwardRefExoticComponent<Omit<ScrollAreaPrimit
202
202
  /** A container that maintains a specified width-to-height ratio for its children. */
203
203
  declare const AspectRatio: React$1.ForwardRefExoticComponent<AspectRatioPrimitive.AspectRatioProps & React$1.RefAttributes<HTMLDivElement>>;
204
204
 
205
+ /**
206
+ * CVA variants for Container — max-width wrapper bound to `--container-*` tokens.
207
+ * Variant names match token names (`sm`/`md`/`lg`/`xl`/`full`); `full` removes the clamp.
208
+ * Padding maps to `--space-*` tokens.
209
+ */
210
+ declare const containerVariants: (props?: ({
211
+ size?: "sm" | "lg" | "md" | "xl" | "full" | null | undefined;
212
+ padding?: "sm" | "lg" | "none" | "md" | null | undefined;
213
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
214
+ /** Props for the Container component. */
215
+ interface ContainerProps extends React$1.HTMLAttributes<HTMLDivElement>, VariantProps<typeof containerVariants> {
216
+ /**
217
+ * Render as a different element via Radix `Slot`. Pass `<Container asChild><main>...</main></Container>`
218
+ * to render the layout as a `<main>` (or `<section>`, `<article>`, etc.) and inherit landmark semantics.
219
+ */
220
+ asChild?: boolean;
221
+ }
222
+ /**
223
+ * A centered max-width wrapper for page content. Use to constrain reading-width sections.
224
+ * Pass `asChild` to render as a semantic landmark (`<main>`, `<section>`, etc.) instead of a plain `<div>`.
225
+ *
226
+ * @param props - Container props including `size`, `padding`, and optional `asChild`.
227
+ * @returns A wrapper element with `mx-auto`, max-width clamp, and optional horizontal padding.
228
+ * @example
229
+ * ```tsx
230
+ * <Container size="lg" padding="md" asChild>
231
+ * <main>
232
+ * <h1>Article title</h1>
233
+ * <p>Reading-width content...</p>
234
+ * </main>
235
+ * </Container>
236
+ * ```
237
+ */
238
+ declare function Container({ className, size, padding, asChild, ...props }: ContainerProps): react_jsx_runtime.JSX.Element;
239
+
240
+ /**
241
+ * CVA variants for Stack — vertical flex flow. `gap`, `align`, and `justify`
242
+ * pull from the shared layout-variant maps so any change to the gap scale
243
+ * propagates to Cluster and Grid simultaneously.
244
+ */
245
+ declare const stackVariants: (props?: ({
246
+ gap?: "sm" | "lg" | "md" | "xl" | "xs" | null | undefined;
247
+ align?: "center" | "start" | "end" | "stretch" | null | undefined;
248
+ justify?: "center" | "start" | "end" | "between" | null | undefined;
249
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
250
+ /** Props for the Stack component. */
251
+ interface StackProps extends React$1.HTMLAttributes<HTMLDivElement>, VariantProps<typeof stackVariants> {
252
+ }
253
+ /**
254
+ * Vertical flex flow with token-bound gap. Children stack top-to-bottom.
255
+ * @param props - Stack props including `gap`, `align`, and `justify` variant keys.
256
+ * @returns A flex column with consistent vertical spacing.
257
+ * @example
258
+ * ```tsx
259
+ * <Stack gap="lg">
260
+ * <h2>Section title</h2>
261
+ * <p>Paragraph one.</p>
262
+ * <p>Paragraph two.</p>
263
+ * </Stack>
264
+ * ```
265
+ */
266
+ declare function Stack({ className, gap, align, justify, ...props }: StackProps): react_jsx_runtime.JSX.Element;
267
+
268
+ /**
269
+ * CVA variants for Cluster — horizontal flex flow with wrap.
270
+ * `gap` and `justify` pull from shared layout-variant maps; `align` adds
271
+ * `baseline` (text-baseline alignment for mixed-size siblings).
272
+ */
273
+ declare const clusterVariants: (props?: ({
274
+ gap?: "sm" | "lg" | "md" | "xl" | "xs" | null | undefined;
275
+ align?: "center" | "start" | "end" | "stretch" | "baseline" | null | undefined;
276
+ justify?: "center" | "start" | "end" | "between" | null | undefined;
277
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
278
+ /** Props for the Cluster component. */
279
+ interface ClusterProps extends React$1.HTMLAttributes<HTMLDivElement>, VariantProps<typeof clusterVariants> {
280
+ }
281
+ /**
282
+ * Horizontal flex flow with wrap. Children flow left-to-right and wrap to next line as needed.
283
+ * @param props - Cluster props including `gap`, `align`, and `justify` variant keys.
284
+ * @returns A flex row that wraps with consistent gap.
285
+ * @example
286
+ * ```tsx
287
+ * <Cluster gap="sm">
288
+ * <Badge>react</Badge>
289
+ * <Badge>typescript</Badge>
290
+ * <Badge>tailwind</Badge>
291
+ * </Cluster>
292
+ * ```
293
+ */
294
+ declare function Cluster({ className, gap, align, justify, ...props }: ClusterProps): react_jsx_runtime.JSX.Element;
295
+
296
+ /**
297
+ * CVA variants for Grid — CSS grid with column-count presets and shared `gap`.
298
+ * `cols` accepts 1/2/3/4/6 fixed columns or `"auto-fit"` for responsive auto-sizing
299
+ * (in which case the consumer should pass `minColWidth` for the min track size).
300
+ *
301
+ * `cols` keys are TypeScript numeric literals (`cols={3}`) at the type level;
302
+ * the schema's `enumValues` serializes them as strings for JSON-shape parity.
303
+ */
304
+ declare const gridVariants: (props?: ({
305
+ cols?: 1 | 2 | 3 | 4 | 6 | "auto-fit" | null | undefined;
306
+ gap?: "sm" | "lg" | "md" | "xl" | "xs" | null | undefined;
307
+ align?: "center" | "start" | "end" | "stretch" | null | undefined;
308
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
309
+ /** Props for the Grid component. */
310
+ interface GridProps extends React$1.HTMLAttributes<HTMLDivElement>, VariantProps<typeof gridVariants> {
311
+ /**
312
+ * Minimum column width for `cols="auto-fit"`. Tracks repeat to fill the container,
313
+ * never shrinking below this value. Ignored when `cols` is a fixed integer.
314
+ * @default "16rem"
315
+ */
316
+ minColWidth?: string;
317
+ }
318
+ /**
319
+ * CSS grid with column-count presets and consistent gap. Use for card grids,
320
+ * dashboards, image galleries, and any layout where children should align to
321
+ * shared row/column tracks.
322
+ *
323
+ * Pass `cols="auto-fit"` and `minColWidth` for responsive grids that fit as
324
+ * many columns as the viewport allows without media queries.
325
+ *
326
+ * @param props - Grid props including `cols`, `gap`, `align`, and `minColWidth`.
327
+ * @returns A CSS grid container.
328
+ * @example
329
+ * ```tsx
330
+ * <Grid cols={3} gap="md">
331
+ * {items.map((i) => <Card key={i.id}>{i.title}</Card>)}
332
+ * </Grid>
333
+ * <Grid cols="auto-fit" minColWidth="20rem" gap="lg">
334
+ * {responsiveItems.map(...)}
335
+ * </Grid>
336
+ * ```
337
+ */
338
+ declare function Grid({ className, cols, gap, align, minColWidth, style, ...props }: GridProps): react_jsx_runtime.JSX.Element;
339
+
340
+ /**
341
+ * CVA variants for Spacer — declarative whitespace.
342
+ * `size` sets `--spacer-size` to a `--space-*` token (with inline fallback);
343
+ * `axis` consumes that var via the bracket form used everywhere else in the
344
+ * package, so the height or width can never collapse to zero if the size
345
+ * variant is dropped.
346
+ */
347
+ declare const spacerVariants: (props?: ({
348
+ size?: "sm" | "lg" | "md" | "xl" | "xs" | null | undefined;
349
+ axis?: "both" | "horizontal" | "vertical" | null | undefined;
350
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
351
+ /** Props for the Spacer component. */
352
+ interface SpacerProps extends Omit<React$1.HTMLAttributes<HTMLDivElement>, "children">, VariantProps<typeof spacerVariants> {
353
+ }
354
+ /**
355
+ * A declarative whitespace block. Use when you want to insert space between two
356
+ * siblings without relying on margin or gap (e.g. inside a flex container that
357
+ * doesn't own the spacing decision).
358
+ *
359
+ * Renders an empty `<div>` with `aria-hidden` since it has no semantic content.
360
+ *
361
+ * @param props - Spacer props including `size` and `axis` variant keys.
362
+ * @returns An empty div with the requested dimension.
363
+ * @example
364
+ * ```tsx
365
+ * <h1>Title</h1>
366
+ * <Spacer size="lg" />
367
+ * <p>Body</p>
368
+ * ```
369
+ */
370
+ declare function Spacer({ className, size, axis, ...props }: SpacerProps): react_jsx_runtime.JSX.Element;
371
+
205
372
  /** A container card with subtle shadow and border. */
206
373
  declare const Card: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLDivElement> & React$1.RefAttributes<HTMLDivElement>>;
207
374
  /** The header section of a Card. */
@@ -1026,6 +1193,16 @@ declare const scrollAreaSchema: ComponentSchemaDefinition;
1026
1193
 
1027
1194
  declare const aspectRatioSchema: ComponentSchemaDefinition;
1028
1195
 
1196
+ declare const containerSchema: ComponentSchemaDefinition;
1197
+
1198
+ declare const stackSchema: ComponentSchemaDefinition;
1199
+
1200
+ declare const clusterSchema: ComponentSchemaDefinition;
1201
+
1202
+ declare const gridSchema: ComponentSchemaDefinition;
1203
+
1204
+ declare const spacerSchema: ComponentSchemaDefinition;
1205
+
1029
1206
  declare const collapsibleSchema: ComponentSchemaDefinition;
1030
1207
 
1031
1208
  declare const hoverCardSchema: ComponentSchemaDefinition;
@@ -1073,4 +1250,4 @@ declare const sidebarSchema: ComponentSchemaDefinition;
1073
1250
  */
1074
1251
  declare function cn(...inputs: ClassValue[]): string;
1075
1252
 
1076
- export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AspectRatio, Avatar, AvatarFallback, AvatarImage, Badge, type BadgeProps, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, type ButtonProps, Calendar, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, type CheckboxProps, Collapsible, CollapsibleContent, CollapsibleTrigger, Combobox, type ComboboxOption, type ComboboxProps, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuTrigger, DataTable, type DataTableProps, DatePicker, type DatePickerProps, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuTrigger, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, HoverCard, HoverCardContent, HoverCardTrigger, Input, InputOTP, InputOTPGroup, type InputOTPProps, InputOTPSeparator, InputOTPSlot, type InputProps, Label, type LabelProps, Menubar, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarSeparator, MenubarShortcut, MenubarTrigger, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Progress, RadioGroup, RadioGroupItem, ResizableHandle, ResizablePanel, ResizablePanelGroup, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue, Separator, type SeparatorProps, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarHeader, SidebarItem, SidebarProvider, SidebarTrigger, Skeleton, Slider, Switch, type SwitchProps, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, type TextareaProps, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, accordionSchema, alertDialogSchema, alertSchema, alertVariants, aspectRatioSchema, avatarSchema, badgeSchema, badgeVariants, breadcrumbSchema, buttonSchema, buttonVariants, calendarSchema, cardSchema, checkboxSchema, cn, collapsibleSchema, comboboxSchema, commandSchema, contextMenuSchema, dataTableSchema, datePickerSchema, dialogSchema, drawerSchema, dropdownMenuSchema, formSchema, hoverCardSchema, inputOTPSchema, inputSchema, labelSchema, menubarSchema, navigationMenuSchema, navigationMenuTriggerStyle, paginationSchema, popoverSchema, progressSchema, radioGroupSchema, resizableSchema, scrollAreaSchema, selectSchema, separatorSchema, sheetSchema, sidebarSchema, skeletonSchema, sliderSchema, sonnerSchema, switchSchema, tableSchema, tabsSchema, textareaSchema, toggleGroupSchema, toggleSchema, toggleVariants, tooltipSchema, useFormField, useSidebar };
1253
+ export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AspectRatio, Avatar, AvatarFallback, AvatarImage, Badge, type BadgeProps, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, type ButtonProps, Calendar, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, type CheckboxProps, Cluster, type ClusterProps, Collapsible, CollapsibleContent, CollapsibleTrigger, Combobox, type ComboboxOption, type ComboboxProps, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, Container, type ContainerProps, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuTrigger, DataTable, type DataTableProps, DatePicker, type DatePickerProps, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuTrigger, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, Grid, type GridProps, HoverCard, HoverCardContent, HoverCardTrigger, Input, InputOTP, InputOTPGroup, type InputOTPProps, InputOTPSeparator, InputOTPSlot, type InputProps, Label, type LabelProps, Menubar, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarSeparator, MenubarShortcut, MenubarTrigger, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Progress, RadioGroup, RadioGroupItem, ResizableHandle, ResizablePanel, ResizablePanelGroup, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue, Separator, type SeparatorProps, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarHeader, SidebarItem, SidebarProvider, SidebarTrigger, Skeleton, Slider, Spacer, type SpacerProps, Stack, type StackProps, Switch, type SwitchProps, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, type TextareaProps, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, accordionSchema, alertDialogSchema, alertSchema, alertVariants, aspectRatioSchema, avatarSchema, badgeSchema, badgeVariants, breadcrumbSchema, buttonSchema, buttonVariants, calendarSchema, cardSchema, checkboxSchema, clusterSchema, clusterVariants, cn, collapsibleSchema, comboboxSchema, commandSchema, containerSchema, containerVariants, contextMenuSchema, dataTableSchema, datePickerSchema, dialogSchema, drawerSchema, dropdownMenuSchema, formSchema, gridSchema, gridVariants, hoverCardSchema, inputOTPSchema, inputSchema, labelSchema, menubarSchema, navigationMenuSchema, navigationMenuTriggerStyle, paginationSchema, popoverSchema, progressSchema, radioGroupSchema, resizableSchema, scrollAreaSchema, selectSchema, separatorSchema, sheetSchema, sidebarSchema, skeletonSchema, sliderSchema, sonnerSchema, spacerSchema, spacerVariants, stackSchema, stackVariants, switchSchema, tableSchema, tabsSchema, textareaSchema, toggleGroupSchema, toggleSchema, toggleVariants, tooltipSchema, useFormField, useSidebar };