@leitware/composables 3.3.0 → 3.4.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leitware/composables",
3
- "version": "3.3.0",
3
+ "version": "3.4.1",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -187,7 +187,7 @@ Use this catalog to choose public exports. The `Source module` column is for mai
187
187
  | `direction` | `./opinionated/direction` | `@leitware/composables` | `DirectionProvider`, `useDirection` | `DirectionProviderProps`, `TextDirection` | Public export not listed in the README component catalog. |
188
188
  | `field` | `./opinionated/field` | `@leitware/composables` | `Field`, `FieldContent`, `FieldDescription`, `FieldError`, `FieldGroup`, `FieldLabel`, `FieldLegend`, `FieldSeparator`, `FieldSet`, `FieldTitle` | - | Public export not listed in the README component catalog. |
189
189
  | `grid-overlay` | `./opinionated/grid-overlay` | `@leitware/composables` | `GridOverlay` | `GridOverlayProps` | Public export not listed in the README component catalog. |
190
- | `image` | `./opinionated/image` | `@leitware/composables` | `Image` | `ImageProps` | Public export not listed in the README component catalog. |
190
+ | `image` | `./opinionated/image` | `@leitware/composables` | `Image`, `imageVariants` | `ImageProps` | Public export not listed in the README component catalog. |
191
191
  | `input-group` | `./opinionated/input-group` | `@leitware/composables` | `InputGroup`, `InputGroupAddon`, `InputGroupButton`, `InputGroupInput`, `InputGroupTextarea` | - | Public export not listed in the README component catalog. |
192
192
  | `input` | `./opinionated/input` | `@leitware/composables` | `Input` | - | Public export not listed in the README component catalog. |
193
193
  | `label` | `./opinionated/label` | `@leitware/composables` | `Label` | - | Public export not listed in the README component catalog. |
@@ -6,7 +6,7 @@ This is the exact installed-package entrypoint and export-name contract. Import
6
6
 
7
7
  ## `@leitware/composables`
8
8
 
9
- - Values (360): `ACCEPT_PRESETS`, `Accordion`, `AccordionContent`, `AccordionItem`, `AccordionTrigger`, `Alert`, `AlertAction`, `AlertDescription`, `AlertDialog`, `AlertDialogAction`, `AlertDialogCancel`, `AlertDialogContent`, `AlertDialogDescription`, `AlertDialogFooter`, `AlertDialogHeader`, `AlertDialogMedia`, `AlertDialogOverlay`, `AlertDialogPortal`, `AlertDialogTitle`, `AlertDialogTrigger`, `AlertTitle`, `AspectRatio`, `Avatar`, `AvatarFallback`, `AvatarImage`, `avatarVariants`, `Badge`, `BentoCell`, `BentoGrid`, `BentoLeader`, `BentoQuad`, `BentoSplit`, `BentoTriple`, `Breadcrumb`, `BreadcrumbEllipsis`, `BreadcrumbItem`, `BreadcrumbLink`, `BreadcrumbList`, `BreadcrumbPage`, `BreadcrumbSeparator`, `Bubble`, `BubbleContent`, `BubbleGroup`, `BubbleReactions`, `bubbleReactionsVariants`, `bubbleVariants`, `Button`, `Calendar`, `CalendarDayButton`, `Card`, `CardAction`, `CardContent`, `CardDescription`, `CardFooter`, `CardHeader`, `CardTitle`, `Carousel`, `CarouselContent`, `CarouselItem`, `CarouselNext`, `CarouselPrevious`, `CellGrid`, `CellRow`, `Checkbox`, `ClipboardText`, `cn`, `CodeBlock`, `Collapsible`, `CollapsibleContent`, `CollapsibleTrigger`, `Combobox`, `ComboboxChip`, `ComboboxChips`, `ComboboxChipsInput`, `ComboboxCollection`, `ComboboxContent`, `ComboboxEmpty`, `ComboboxGroup`, `ComboboxInput`, `ComboboxItem`, `ComboboxLabel`, `ComboboxList`, `ComboboxSeparator`, `ComboboxTrigger`, `ComboboxValue`, `Command`, `CommandDialog`, `CommandEmpty`, `CommandGroup`, `CommandInput`, `CommandItem`, `CommandList`, `CommandSeparator`, `CommandShortcut`, `Container`, `containerVariants`, `DataGrid`, `DataLabel`, `DataRow`, `DataValue`, `DEFAULT_ACCEPT`, `DEFAULT_MAX_SIZE`, `Dialog`, `DialogClose`, `DialogContent`, `DialogDescription`, `DialogFooter`, `DialogHeader`, `DialogOverlay`, `DialogPortal`, `DialogTitle`, `DialogTrigger`, `DirectionProvider`, `DISABLED_OPACITY`, `Divider`, `dividerVariants`, `DropdownMenu`, `DropdownMenuCheckboxItem`, `DropdownMenuContent`, `DropdownMenuGroup`, `DropdownMenuItem`, `DropdownMenuLabel`, `DropdownMenuPortal`, `DropdownMenuRadioGroup`, `DropdownMenuRadioItem`, `DropdownMenuSeparator`, `DropdownMenuShortcut`, `DropdownMenuSub`, `DropdownMenuSubContent`, `DropdownMenuSubTrigger`, `DropdownMenuTrigger`, `Dropzone`, `DropZone`, `DropZoneArea`, `DropzoneContent`, `DropZoneContent`, `DropZoneFile`, `DropZoneFileList`, `DropzoneInput`, `DropZoneInput`, `DropzoneLabel`, `Empty`, `EmptyContent`, `EmptyDescription`, `EmptyHeader`, `EmptyMedia`, `EmptyTableState`, `EmptyTitle`, `Field`, `FieldContent`, `FieldDescription`, `FieldError`, `FieldGroup`, `FieldLabel`, `FieldLegend`, `FieldSeparator`, `FieldSet`, `FieldTitle`, `FlexSpacer`, `Flow`, `FlowAnchor`, `FlowList`, `FlowNode`, `FlowParallel`, `FlowRoot`, `FOCUS_RING`, `FOCUS_RING_DESTRUCTIVE`, `formatFileSize`, `formatNumericValue`, `FormCalendarPopover`, `FormCheckbox`, `FormCombobox`, `FormDateOfBirth`, `FormDropZone`, `FormInput`, `FormInputGroup`, `FormMultiCombobox`, `FormMultiDropZone`, `FormRadioGroup`, `FormSelect`, `FormSlider`, `FormSwitch`, `FormTextarea`, `getAcceptDescription`, `getRejectionMessage`, `Grid`, `GridOverlay`, `gridVariants`, `HoverCard`, `HoverCardContent`, `HoverCardTrigger`, `Icon`, `iconVariants`, `Image`, `Input`, `InputGroup`, `InputGroupAddon`, `InputGroupButton`, `InputGroupInput`, `InputGroupTextarea`, `Item`, `ItemActions`, `ItemContent`, `ItemDescription`, `ItemFooter`, `ItemGroup`, `ItemHeader`, `ItemMedia`, `ItemSeparator`, `ItemTitle`, `Kbd`, `KbdGroup`, `Label`, `LayerCard`, `LayerCardPrimary`, `LayerCardRoot`, `LayerCardSecondary`, `leftPad`, `List`, `ListArrowItem`, `ListBulletItem`, `Marker`, `MarkerContent`, `MarkerIcon`, `markerVariants`, `Message`, `MessageAvatar`, `MessageContent`, `MessageFooter`, `MessageGroup`, `MessageHeader`, `NativeSelect`, `NativeSelectOptGroup`, `NativeSelectOption`, `NewspaperCell`, `NewspaperGrid`, `newspaperGridVariants`, `Pagination`, `PaginationContent`, `PaginationEllipsis`, `PaginationItem`, `PaginationLink`, `PaginationNext`, `PaginationPrevious`, `parseNumericValue`, `Popover`, `PopoverContent`, `PopoverDescription`, `PopoverHeader`, `PopoverTitle`, `PopoverTrigger`, `Progress`, `ProgressIndicator`, `ProgressLabel`, `ProgressTrack`, `ProgressValue`, `RadioGroup`, `RadioGroupItem`, `ResizableHandle`, `ResizablePanel`, `ResizablePanelGroup`, `sanitizeNumericInput`, `ScrollArea`, `ScrollBar`, `Section`, `sectionVariants`, `Select`, `SelectContent`, `SelectGroup`, `SelectItem`, `SelectLabel`, `SelectRoot`, `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`, `SidebarMenuSub`, `SidebarMenuSubButton`, `SidebarMenuSubItem`, `SidebarProvider`, `SidebarRail`, `SidebarSeparator`, `SidebarTrigger`, `Skeleton`, `SkeletonAvatar`, `SkeletonButton`, `SkeletonCard`, `SkeletonInput`, `SkeletonTableRow`, `SkeletonText`, `Slider`, `Spacer`, `spacerVariants`, `Spinner`, `spinnerVariants`, `Stack`, `stackVariants`, `StatCell`, `Switch`, `Table`, `TableBody`, `TableCaption`, `TableCell`, `TableFooter`, `TableHead`, `TableHeader`, `TableOfContents`, `TableOfContentsGroup`, `TableOfContentsItem`, `TableOfContentsList`, `TableOfContentsRoot`, `TableOfContentsTitle`, `TableRow`, `Tabs`, `TabsContent`, `Textarea`, `ThemeInjector`, `Toaster`, `Toggle`, `ToggleGroup`, `ToggleGroupItem`, `TokenConfigPanel`, `Tooltip`, `TooltipContent`, `TooltipTrigger`, `Typography`, `typographyVariants`, `useComboboxAnchor`, `useDirection`, `useDropZoneContext`, `useIsMobile`, `useNumericInput`, `useSidebar`, `useTableOfContentsActiveId`, `WindowFrame`
9
+ - Values (361): `ACCEPT_PRESETS`, `Accordion`, `AccordionContent`, `AccordionItem`, `AccordionTrigger`, `Alert`, `AlertAction`, `AlertDescription`, `AlertDialog`, `AlertDialogAction`, `AlertDialogCancel`, `AlertDialogContent`, `AlertDialogDescription`, `AlertDialogFooter`, `AlertDialogHeader`, `AlertDialogMedia`, `AlertDialogOverlay`, `AlertDialogPortal`, `AlertDialogTitle`, `AlertDialogTrigger`, `AlertTitle`, `AspectRatio`, `Avatar`, `AvatarFallback`, `AvatarImage`, `avatarVariants`, `Badge`, `BentoCell`, `BentoGrid`, `BentoLeader`, `BentoQuad`, `BentoSplit`, `BentoTriple`, `Breadcrumb`, `BreadcrumbEllipsis`, `BreadcrumbItem`, `BreadcrumbLink`, `BreadcrumbList`, `BreadcrumbPage`, `BreadcrumbSeparator`, `Bubble`, `BubbleContent`, `BubbleGroup`, `BubbleReactions`, `bubbleReactionsVariants`, `bubbleVariants`, `Button`, `Calendar`, `CalendarDayButton`, `Card`, `CardAction`, `CardContent`, `CardDescription`, `CardFooter`, `CardHeader`, `CardTitle`, `Carousel`, `CarouselContent`, `CarouselItem`, `CarouselNext`, `CarouselPrevious`, `CellGrid`, `CellRow`, `Checkbox`, `ClipboardText`, `cn`, `CodeBlock`, `Collapsible`, `CollapsibleContent`, `CollapsibleTrigger`, `Combobox`, `ComboboxChip`, `ComboboxChips`, `ComboboxChipsInput`, `ComboboxCollection`, `ComboboxContent`, `ComboboxEmpty`, `ComboboxGroup`, `ComboboxInput`, `ComboboxItem`, `ComboboxLabel`, `ComboboxList`, `ComboboxSeparator`, `ComboboxTrigger`, `ComboboxValue`, `Command`, `CommandDialog`, `CommandEmpty`, `CommandGroup`, `CommandInput`, `CommandItem`, `CommandList`, `CommandSeparator`, `CommandShortcut`, `Container`, `containerVariants`, `DataGrid`, `DataLabel`, `DataRow`, `DataValue`, `DEFAULT_ACCEPT`, `DEFAULT_MAX_SIZE`, `Dialog`, `DialogClose`, `DialogContent`, `DialogDescription`, `DialogFooter`, `DialogHeader`, `DialogOverlay`, `DialogPortal`, `DialogTitle`, `DialogTrigger`, `DirectionProvider`, `DISABLED_OPACITY`, `Divider`, `dividerVariants`, `DropdownMenu`, `DropdownMenuCheckboxItem`, `DropdownMenuContent`, `DropdownMenuGroup`, `DropdownMenuItem`, `DropdownMenuLabel`, `DropdownMenuPortal`, `DropdownMenuRadioGroup`, `DropdownMenuRadioItem`, `DropdownMenuSeparator`, `DropdownMenuShortcut`, `DropdownMenuSub`, `DropdownMenuSubContent`, `DropdownMenuSubTrigger`, `DropdownMenuTrigger`, `Dropzone`, `DropZone`, `DropZoneArea`, `DropzoneContent`, `DropZoneContent`, `DropZoneFile`, `DropZoneFileList`, `DropzoneInput`, `DropZoneInput`, `DropzoneLabel`, `Empty`, `EmptyContent`, `EmptyDescription`, `EmptyHeader`, `EmptyMedia`, `EmptyTableState`, `EmptyTitle`, `Field`, `FieldContent`, `FieldDescription`, `FieldError`, `FieldGroup`, `FieldLabel`, `FieldLegend`, `FieldSeparator`, `FieldSet`, `FieldTitle`, `FlexSpacer`, `Flow`, `FlowAnchor`, `FlowList`, `FlowNode`, `FlowParallel`, `FlowRoot`, `FOCUS_RING`, `FOCUS_RING_DESTRUCTIVE`, `formatFileSize`, `formatNumericValue`, `FormCalendarPopover`, `FormCheckbox`, `FormCombobox`, `FormDateOfBirth`, `FormDropZone`, `FormInput`, `FormInputGroup`, `FormMultiCombobox`, `FormMultiDropZone`, `FormRadioGroup`, `FormSelect`, `FormSlider`, `FormSwitch`, `FormTextarea`, `getAcceptDescription`, `getRejectionMessage`, `Grid`, `GridOverlay`, `gridVariants`, `HoverCard`, `HoverCardContent`, `HoverCardTrigger`, `Icon`, `iconVariants`, `Image`, `imageVariants`, `Input`, `InputGroup`, `InputGroupAddon`, `InputGroupButton`, `InputGroupInput`, `InputGroupTextarea`, `Item`, `ItemActions`, `ItemContent`, `ItemDescription`, `ItemFooter`, `ItemGroup`, `ItemHeader`, `ItemMedia`, `ItemSeparator`, `ItemTitle`, `Kbd`, `KbdGroup`, `Label`, `LayerCard`, `LayerCardPrimary`, `LayerCardRoot`, `LayerCardSecondary`, `leftPad`, `List`, `ListArrowItem`, `ListBulletItem`, `Marker`, `MarkerContent`, `MarkerIcon`, `markerVariants`, `Message`, `MessageAvatar`, `MessageContent`, `MessageFooter`, `MessageGroup`, `MessageHeader`, `NativeSelect`, `NativeSelectOptGroup`, `NativeSelectOption`, `NewspaperCell`, `NewspaperGrid`, `newspaperGridVariants`, `Pagination`, `PaginationContent`, `PaginationEllipsis`, `PaginationItem`, `PaginationLink`, `PaginationNext`, `PaginationPrevious`, `parseNumericValue`, `Popover`, `PopoverContent`, `PopoverDescription`, `PopoverHeader`, `PopoverTitle`, `PopoverTrigger`, `Progress`, `ProgressIndicator`, `ProgressLabel`, `ProgressTrack`, `ProgressValue`, `RadioGroup`, `RadioGroupItem`, `ResizableHandle`, `ResizablePanel`, `ResizablePanelGroup`, `sanitizeNumericInput`, `ScrollArea`, `ScrollBar`, `Section`, `sectionVariants`, `Select`, `SelectContent`, `SelectGroup`, `SelectItem`, `SelectLabel`, `SelectRoot`, `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`, `SidebarMenuSub`, `SidebarMenuSubButton`, `SidebarMenuSubItem`, `SidebarProvider`, `SidebarRail`, `SidebarSeparator`, `SidebarTrigger`, `Skeleton`, `SkeletonAvatar`, `SkeletonButton`, `SkeletonCard`, `SkeletonInput`, `SkeletonTableRow`, `SkeletonText`, `Slider`, `Spacer`, `spacerVariants`, `Spinner`, `spinnerVariants`, `Stack`, `stackVariants`, `StatCell`, `Switch`, `Table`, `TableBody`, `TableCaption`, `TableCell`, `TableFooter`, `TableHead`, `TableHeader`, `TableOfContents`, `TableOfContentsGroup`, `TableOfContentsItem`, `TableOfContentsList`, `TableOfContentsRoot`, `TableOfContentsTitle`, `TableRow`, `Tabs`, `TabsContent`, `Textarea`, `ThemeInjector`, `Toaster`, `Toggle`, `ToggleGroup`, `ToggleGroupItem`, `TokenConfigPanel`, `Tooltip`, `TooltipContent`, `TooltipTrigger`, `Typography`, `typographyVariants`, `useComboboxAnchor`, `useDirection`, `useDropZoneContext`, `useIsMobile`, `useNumericInput`, `useSidebar`, `useTableOfContentsActiveId`, `WindowFrame`
10
10
  - Types (117): `Accept`, `AccordionItemData`, `AccordionProps`, `AccordionVariant`, `AlertDialogProps`, `AlertProps`, `AlertType`, `AlertVariant`, `AvatarProps`, `BadgeProps`, `BreadcrumbItemData`, `BreadcrumbProps`, `BubbleProps`, `ButtonProps`, `CardProps`, `CarouselProps`, `ClipboardTextProps`, `ClipboardTextSize`, `ClipboardTextStatus`, `CodeBlockProps`, `CollapsibleProps`, `ComboboxOption`, `ComboboxProps`, `ContainerProps`, `DataGridProps`, `DataLabelProps`, `DataRowProps`, `DataValueProps`, `DateOfBirthValue`, `DialogProps`, `DirectionProviderProps`, `DividerProps`, `DropdownMenuItemData`, `DropdownMenuProps`, `DropZoneFileProps`, `DropZoneProps`, `EmptyProps`, `EmptyTableStateProps`, `FileRejection`, `FlowAlign`, `FlowAnchorProps`, `FlowBranch`, `FlowItem`, `FlowNodeProps`, `FlowOrientation`, `FlowProps`, `FlowRootProps`, `FlowStep`, `FormCalendarPopoverProps`, `FormCheckboxProps`, `FormComboboxOption`, `FormComboboxProps`, `FormDateOfBirthProps`, `FormDropZoneProps`, `FormInputGroupInputProps`, `FormInputGroupProps`, `FormInputProps`, `FormMultiComboboxOption`, `FormMultiComboboxProps`, `FormMultiDropZoneProps`, `FormRadioGroupOption`, `FormRadioGroupProps`, `FormSelectOption`, `FormSelectProps`, `FormSliderProps`, `FormSwitchProps`, `FormTextareaProps`, `GridOverlayProps`, `GridProps`, `HoverCardProps`, `ImageProps`, `ItemProps`, `ItemVariants`, `KbdGroupProps`, `KbdProps`, `LayerCardProps`, `LayerCardRootProps`, `LayerCardSectionProps`, `ListItemData`, `ListProps`, `ListVariant`, `MarkerProps`, `NativeSelectOptionData`, `NativeSelectProps`, `NewspaperCellProps`, `NewspaperGridProps`, `NumericInputOptions`, `NumericMode`, `PaginationProps`, `PopoverProps`, `ProgressProps`, `ScrollAreaProps`, `SectionProps`, `SelectOption`, `SelectProps`, `SheetProps`, `SkeletonProps`, `SpacerProps`, `StackProps`, `TabItem`, `TableOfContentsGroupProps`, `TableOfContentsItemData`, `TableOfContentsItemProps`, `TableOfContentsProps`, `TableOfContentsTrackingOptions`, `TabsProps`, `TabsVariant`, `TextDirection`, `ToggleGroupOption`, `ToggleGroupProps`, `ToggleProps`, `TooltipProps`, `TypographyProps`, `TypographyVariant`, `UseNumericInputOptions`, `UseNumericInputReturn`, `WindowFrameProps`
11
11
 
12
12
  ## `@leitware/composables/ai`
@@ -7,7 +7,7 @@ import { cn, FOCUS_RING, FOCUS_RING_DESTRUCTIVE, HOVER_RING } from '../lib/utils
7
7
  // border (no bg-clip-padding) so filled and outlined buttons read as the same
8
8
  // size regardless of --border-width-base.
9
9
  const buttonVariants = cva(
10
- `${FOCUS_RING} ${HOVER_RING} rounded-(--button-radius) border border-transparent text-(length:--control-font-size) leading-relaxed font-medium [&_svg:not([class*='size-'])]:size-4 inline-flex items-center justify-center whitespace-nowrap transition-[opacity,box-shadow,transform] duration-(--motion-duration-interaction) ease-(--motion-ease-standard) active:[transform:scale(var(--active-scale,0.98))] disabled:pointer-events-none disabled:opacity-disabled [&_svg]:pointer-events-none shrink-0 [&_svg]:shrink-0 outline-none group/button select-none`,
10
+ `${FOCUS_RING} ${HOVER_RING} rounded-(--button-radius) border border-transparent text-(length:--control-font-size) leading-relaxed font-medium [&_svg:not([class*='size-'])]:size-4 inline-flex items-center justify-center whitespace-nowrap transition-[opacity,transform] duration-(--motion-duration-interaction) ease-(--motion-ease-standard) active:[transform:scale(var(--active-scale,0.98))] disabled:pointer-events-none disabled:opacity-disabled [&_svg]:pointer-events-none shrink-0 [&_svg]:shrink-0 outline-none group/button select-none`,
11
11
  {
12
12
  variants: {
13
13
  variant: {
package/src/index.ts CHANGED
@@ -58,7 +58,7 @@ export {
58
58
 
59
59
  export { AspectRatio } from './opinionated/aspect-ratio'
60
60
 
61
- export { Image, type ImageProps } from './opinionated/image'
61
+ export { Image, imageVariants, type ImageProps } from './opinionated/image'
62
62
 
63
63
  export { Avatar, AvatarFallback, AvatarImage, type AvatarProps } from './opinionated/avatar'
64
64
 
@@ -1,7 +1,31 @@
1
1
  import * as React from 'react'
2
+ import { cva, type VariantProps } from 'class-variance-authority'
2
3
 
3
4
  import { cn } from '../lib/utils'
4
5
 
6
+ const imageVariants = cva('block', {
7
+ variants: {
8
+ variant: {
9
+ default: 'rounded-lg bg-muted',
10
+ outline: 'rounded-lg border border-stroke bg-muted',
11
+ plain: 'rounded-none bg-transparent',
12
+ },
13
+ fit: {
14
+ cover: 'object-cover',
15
+ contain: 'object-contain',
16
+ },
17
+ fill: {
18
+ true: 'absolute inset-0 size-full',
19
+ false: 'h-auto max-w-full',
20
+ },
21
+ },
22
+ defaultVariants: {
23
+ variant: 'default',
24
+ fit: 'cover',
25
+ fill: false,
26
+ },
27
+ })
28
+
5
29
  type ImageLayout =
6
30
  | { fill?: false; width: number; height: number }
7
31
  | { fill: true; width?: never; height?: never }
@@ -16,7 +40,9 @@ export type ImageProps = Omit<
16
40
  /** Describe meaningful images; explicitly use an empty string for decoration. */
17
41
  alt: string
18
42
  /** How the image fits its box. @default 'cover' */
19
- fit?: 'cover' | 'contain'
43
+ fit?: NonNullable<VariantProps<typeof imageVariants>['fit']>
44
+ /** Presentation style. Use plain for backgrounds or edge-to-edge media. @default 'default' */
45
+ variant?: NonNullable<VariantProps<typeof imageVariants>['variant']>
20
46
  /** CSS object-position, e.g. 'center' or '50% 25%'. */
21
47
  position?: React.CSSProperties['objectPosition']
22
48
  }
@@ -35,6 +61,7 @@ const Image = React.forwardRef<HTMLImageElement, ImageProps>(function Image(
35
61
  height,
36
62
  fill = false,
37
63
  fit = 'cover',
64
+ variant = 'default',
38
65
  position,
39
66
  loading = 'lazy',
40
67
  decoding = 'async',
@@ -49,21 +76,17 @@ const Image = React.forwardRef<HTMLImageElement, ImageProps>(function Image(
49
76
  {...props}
50
77
  ref={ref}
51
78
  data-slot="image"
79
+ data-variant={variant}
52
80
  src={src}
53
81
  alt={alt}
54
82
  width={width}
55
83
  height={height}
56
84
  loading={loading}
57
85
  decoding={decoding}
58
- className={cn(
59
- 'block rounded-lg bg-muted',
60
- fill ? 'absolute inset-0 size-full' : 'h-auto max-w-full',
61
- fit === 'cover' ? 'object-cover' : 'object-contain',
62
- className,
63
- )}
86
+ className={cn(imageVariants({ variant, fit, fill }), className)}
64
87
  style={{ objectPosition: position, ...style }}
65
88
  />
66
89
  )
67
90
  })
68
91
 
69
- export { Image }
92
+ export { Image, imageVariants }
@@ -0,0 +1,316 @@
1
+ /* ============================================================================
2
+ @leitware/composables - Gutenberg Preset
3
+ ============================================================================
4
+ Quiet book reading: charcoal, warm gold, and monospaced text.
5
+
6
+ HOW TO USE:
7
+ 1. Copy this file into your project's global CSS (e.g. index.css)
8
+ 2. Or import the preset: @import "@leitware/composables/presets/gutenberg.css";
9
+ 3. Add class="dark" to <html> for dark mode.
10
+ ============================================================================ */
11
+
12
+ :root {
13
+ --bg-default: #f6f3e9;
14
+ --bg-inverse: #21201cff;
15
+ --bg-muted: #ede9dc;
16
+ --bg-surface-default: #fffdf6;
17
+ --bg-surface-popover: #f9f9f8ff;
18
+ --bg-surface-accent: #f1f0efff;
19
+ --bg-surface-field: #fffdf6;
20
+ --bg-surface-input: #dad9d633;
21
+ --bg-surface-info: #f1fafdff;
22
+ --bg-surface-success: #f5fbf5ff;
23
+ --bg-surface-warning: #fff7edff;
24
+ --bg-surface-critical: #fff7f7ff;
25
+ --bg-surface-emphasis: #f4faffff;
26
+ --bg-surface-inverse: #63635eff;
27
+ --bg-surface-transparent: #0000000d;
28
+ --bg-overlay: var(--overlays-black-alpha-800);
29
+ --bg-surface-brand: #fef7fbff;
30
+ --bg-surface-brand-2: #eefaf8ff;
31
+ --bg-surface-brand-3: #fffaf0ff;
32
+ --bg-surface-brand-4: #eef2fbff;
33
+ --bg-surface-brand-5: #f0faf0ff;
34
+ --bg-surface-hover: #e6dfcb;
35
+ --bg-fill-default: #f9f9f8ff;
36
+ --bg-fill-primary: #846000;
37
+ --bg-fill-primary-hover: #21201cff;
38
+ --bg-fill-selected: #21201cff;
39
+ --bg-fill-brand: #846000;
40
+ --bg-fill-brand-2: #12a594ff;
41
+ --bg-fill-brand-3: #ffc53dff;
42
+ --bg-fill-brand-4: #3e63ddff;
43
+ --bg-fill-brand-5: #46a758ff;
44
+ --bg-fill-info: #7ce2feff;
45
+ --bg-fill-success: #46a758ff;
46
+ --bg-fill-warning: #f76b15ff;
47
+ --bg-fill-critical: #e5484dff;
48
+ --bg-fill-emphasis: #0090ffff;
49
+ --bg-fill-transparent: #0000000d;
50
+ --bg-fill-secondary: #f1f0efff;
51
+ --bg-fill-secondary-hover: #f1f0efff;
52
+ --bg-fill-secondary-inverse: #ffffffff;
53
+ --text-default: #323437;
54
+ --text-secondary: #58594e;
55
+ --text-muted: #6b6b60;
56
+ --text-disabled: #cfcecaff;
57
+ --text-inverse: #ffffffff;
58
+ --text-on-fill-primary: #ffffff;
59
+ --text-on-fill-selected: #ffffffff;
60
+ --text-on-fill-brand: #ffffff;
61
+ --text-on-fill-secondary: #21201cff;
62
+ --text-on-surface-accent: #21201cff;
63
+ --text-info: #1d3e56ff;
64
+ --text-success: #203c25ff;
65
+ --text-warning: #582d1dff;
66
+ --text-critical: #641723ff;
67
+ --text-emphasis: #113264ff;
68
+ --text-brand: #846000;
69
+ --text-brand-2: #0d6d5eff;
70
+ --text-brand-3: #6f5b1bff;
71
+ --text-brand-4: #1f3780ff;
72
+ --text-brand-5: #203c25ff;
73
+ --text-link: #113264ff;
74
+ --icon-default: #21201cff;
75
+ --icon-secondary: #63635eff;
76
+ --icon-disabled: #e9e8e6ff;
77
+ --icon-inverse: #f9f9f8ff;
78
+ --icon-info: #00749eff;
79
+ --icon-success: #2a7e3bff;
80
+ --icon-warning: #cc4e00ff;
81
+ --icon-critical: #ce2c31ff;
82
+ --icon-emphasis: #0d74ceff;
83
+ --icon-brand: #c2298aff;
84
+ --icon-brand-2: #12a594ff;
85
+ --icon-brand-3: #e8a317ff;
86
+ --icon-brand-4: #3e63ddff;
87
+ --icon-brand-5: #2a7e3bff;
88
+ --border-default: #d3cebd;
89
+ --border-secondary: #dad9d6ff;
90
+ --border-input: #c3bda9;
91
+ --border-tertiary: #bcbbb5ff;
92
+ --border-disabled: #dad9d6ff;
93
+ --border-inverse: #63635eff;
94
+ --border-focus: #846000;
95
+ --border-brand: #e7acd0ff;
96
+ --border-brand-2: #8ecec6ff;
97
+ --border-brand-3: #edd5a0ff;
98
+ --border-brand-4: #93a9e8ff;
99
+ --border-brand-5: #94ce9aff;
100
+ --border-info: #8dcae3ff;
101
+ --border-success: #94ce9aff;
102
+ --border-warning: #f5ae73ff;
103
+ --border-critical: #f4a9aaff;
104
+ --border-emphasis: #5eb1efff;
105
+ --chart-1: #5eb1efff;
106
+ --chart-2: #0090ffff;
107
+ --chart-3: #aa99ecff;
108
+ --chart-4: #6e56cfff;
109
+ --chart-5: #654dc4ff;
110
+ --sidebar-background: #f9f9f8ff;
111
+ --sidebar-foreground: #21201cff;
112
+ --sidebar-primary: #21201cff;
113
+ --sidebar-primary-foreground: #ffffffff;
114
+ --sidebar-accent: #f1f0efff;
115
+ --sidebar-accent-foreground: #21201cff;
116
+ --sidebar-border: #cfcecaff;
117
+ --sidebar-ring: #0d74ceff;
118
+ --spacing: 0.25rem;
119
+ --border-width-base: 0.0625rem;
120
+ --radius: 0.375rem;
121
+ --font-size-base: 1rem;
122
+ --leading-base: 1.33;
123
+ --letter-spacing-base: 0.025em;
124
+ --opacity-disabled: 0.5;
125
+ --shadow-offset-y: 1px;
126
+ --shadow-blur: 2px;
127
+ --shadow-spread: 1px;
128
+ --shadow-base-color: rgba(0, 0, 0, 0.1);
129
+ --container-sm: 576px;
130
+ --container-md: 768px;
131
+ --container-lg: 1056px;
132
+ --container-xl: 1248px;
133
+ --container-2xl: 1440px;
134
+ --dropdown-offset: 4;
135
+ --overlay-offset: 4;
136
+ --font-sans: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
137
+ --font-heading: ui-sans-serif, system-ui, sans-serif;
138
+ --font-brand: 'Bricolage Grotesque Variable', sans-serif;
139
+ --button-radius: var(--radius);
140
+ --card-radius: var(--radius-lg);
141
+ --card-padding: calc(var(--spacing) * 4);
142
+ --input-radius: var(--radius-md);
143
+ --control-size-md: calc(var(--spacing) * 10);
144
+ --badge-radius: var(--radius-4xl);
145
+ --motion-duration-fast: 100ms;
146
+ --motion-duration-normal: 200ms;
147
+ --motion-duration-slow: 300ms;
148
+ --motion-duration-color: var(--motion-duration-fast);
149
+ --motion-duration-interaction: var(--motion-duration-fast);
150
+ --motion-duration-disclosure: var(--motion-duration-normal);
151
+ --motion-duration-overlay: var(--motion-duration-fast);
152
+ --motion-ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
153
+ --motion-ease-accelerate: cubic-bezier(0.4, 0, 1, 1);
154
+ --motion-ease-decelerate: cubic-bezier(0, 0, 0.2, 1);
155
+ --motion-ease-linear: linear;
156
+ --transition-default: var(--motion-duration-normal) var(--motion-ease-standard);
157
+ --transition-fast: var(--motion-duration-fast) var(--motion-ease-standard);
158
+ --transition-slow: var(--motion-duration-slow) var(--motion-ease-decelerate);
159
+ --hover-transform: none;
160
+ --hover-shadow: var(--shadow-md);
161
+ --active-scale: 0.98;
162
+ --button-height: 2.5rem;
163
+ --button-font-size: 0.8125rem;
164
+ --background: var(--bg-default);
165
+ --foreground: var(--text-default);
166
+ --card: var(--bg-surface-default);
167
+ --card-foreground: var(--text-default);
168
+ --popover: var(--bg-surface-popover);
169
+ --popover-foreground: var(--text-default);
170
+ --primary: var(--bg-fill-primary);
171
+ --primary-foreground: var(--text-on-fill-primary);
172
+ --secondary: var(--bg-fill-secondary);
173
+ --secondary-foreground: var(--text-on-fill-secondary);
174
+ --muted: var(--bg-muted);
175
+ --muted-foreground: var(--text-muted);
176
+ --accent: var(--bg-surface-accent);
177
+ --accent-foreground: var(--text-on-surface-accent);
178
+ --destructive: var(--bg-fill-critical);
179
+ --border: var(--border-default);
180
+ --input: var(--border-input);
181
+ --ring: var(--border-focus);
182
+ }
183
+
184
+ .dark {
185
+ --bg-default: #323437;
186
+ --bg-inverse: #eeeeecff;
187
+ --bg-muted: #292b2e;
188
+ --bg-surface-default: #2c2e31;
189
+ --bg-surface-popover: #191918ff;
190
+ --bg-surface-accent: #222221ff;
191
+ --bg-surface-field: #393b3e;
192
+ --bg-surface-input: #4948444d;
193
+ --bg-surface-info: #111a27ff;
194
+ --bg-surface-success: #141a15ff;
195
+ --bg-surface-warning: #1e160fff;
196
+ --bg-surface-critical: #473638;
197
+ --bg-surface-emphasis: #111927ff;
198
+ --bg-surface-inverse: #b5b3adff;
199
+ --bg-surface-transparent: #0000000d;
200
+ --bg-overlay: var(--overlays-black-alpha-800);
201
+ --bg-surface-brand: #21121dff;
202
+ --bg-surface-brand-2: #0f201eff;
203
+ --bg-surface-brand-3: #231e10ff;
204
+ --bg-surface-brand-4: #111828ff;
205
+ --bg-surface-brand-5: #141a15ff;
206
+ --bg-surface-hover: #3b3d40;
207
+ --bg-fill-default: #191918ff;
208
+ --bg-fill-primary: #e2b714;
209
+ --bg-fill-primary-hover: #eeeeecff;
210
+ --bg-fill-selected: #eeeeecff;
211
+ --bg-fill-brand: #e2b714;
212
+ --bg-fill-brand-2: #12a594ff;
213
+ --bg-fill-brand-3: #ffc53dff;
214
+ --bg-fill-brand-4: #3e63ddff;
215
+ --bg-fill-brand-5: #46a758ff;
216
+ --bg-fill-info: #7ce2feff;
217
+ --bg-fill-success: #46a758ff;
218
+ --bg-fill-warning: #f76b15ff;
219
+ --bg-fill-critical: #e5484dff;
220
+ --bg-fill-emphasis: #0090ffff;
221
+ --bg-fill-transparent: #0000000d;
222
+ --bg-fill-secondary: #222221ff;
223
+ --bg-fill-secondary-hover: #222221ff;
224
+ --bg-fill-secondary-inverse: #000000ff;
225
+ --text-default: #d1d0c5;
226
+ --text-secondary: #b5b5ac;
227
+ --text-muted: #9a9c9e;
228
+ --text-disabled: #494844ff;
229
+ --text-inverse: #000000ff;
230
+ --text-on-fill-primary: #323437;
231
+ --text-on-fill-selected: #000000ff;
232
+ --text-on-fill-brand: #323437;
233
+ --text-on-fill-secondary: #eeeeecff;
234
+ --text-on-surface-accent: #eeeeecff;
235
+ --text-info: #c2f3ffff;
236
+ --text-success: #c2f0c2ff;
237
+ --text-warning: #ffe0c2ff;
238
+ --text-critical: #f17a86;
239
+ --text-emphasis: #c2e6ffff;
240
+ --text-brand: #e2b714;
241
+ --text-brand-2: #a8e5dcff;
242
+ --text-brand-3: #ffe6a0ff;
243
+ --text-brand-4: #aebff0ff;
244
+ --text-brand-5: #c2f0c2ff;
245
+ --text-link: #c2e6ffff;
246
+ --icon-default: #eeeeecff;
247
+ --icon-secondary: #b5b3adff;
248
+ --icon-disabled: #31312eff;
249
+ --icon-inverse: #191918ff;
250
+ --icon-info: #75c7f0ff;
251
+ --icon-success: #71d083ff;
252
+ --icon-warning: #ffa057ff;
253
+ --icon-critical: #ff9592ff;
254
+ --icon-emphasis: #70b8ffff;
255
+ --icon-brand: #ff8dccff;
256
+ --icon-brand-2: #4dc8baff;
257
+ --icon-brand-3: #e8b844ff;
258
+ --icon-brand-4: #6e8defff;
259
+ --icon-brand-5: #71d083ff;
260
+ --border-default: #494b4d;
261
+ --border-secondary: #494844ff;
262
+ --border-input: #55575a;
263
+ --border-tertiary: #62605bff;
264
+ --border-disabled: #494844ff;
265
+ --border-inverse: #b5b3adff;
266
+ --border-focus: #e2b714;
267
+ --border-brand: #833869ff;
268
+ --border-brand-2: #2a6858ff;
269
+ --border-brand-3: #6a5020ff;
270
+ --border-brand-4: #2a4480ff;
271
+ --border-brand-5: #366740ff;
272
+ --border-info: #1f6692ff;
273
+ --border-success: #366740ff;
274
+ --border-warning: #7e451dff;
275
+ --border-critical: #8c333aff;
276
+ --border-emphasis: #2870bdff;
277
+ --chart-1: #2870bdff;
278
+ --chart-2: #0090ffff;
279
+ --chart-3: #6958adff;
280
+ --chart-4: #6e56cfff;
281
+ --chart-5: #7d66d9ff;
282
+ --sidebar-background: #191918ff;
283
+ --sidebar-foreground: #eeeeecff;
284
+ --sidebar-primary: #eeeeecff;
285
+ --sidebar-primary-foreground: #000000ff;
286
+ --sidebar-accent: #222221ff;
287
+ --sidebar-accent-foreground: #eeeeecff;
288
+ --sidebar-border: #494844ff;
289
+ --sidebar-ring: #70b8ffff;
290
+ --font-sans: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
291
+ --font-heading: ui-sans-serif, system-ui, sans-serif;
292
+ --font-brand: 'Bricolage Grotesque Variable', sans-serif;
293
+ --radius: 0.375rem;
294
+ --button-radius: var(--radius);
295
+ --button-height: 2.5rem;
296
+ --button-font-size: 0.8125rem;
297
+ --control-size-md: calc(var(--spacing) * 10);
298
+ --background: var(--bg-default);
299
+ --foreground: var(--text-default);
300
+ --card: var(--bg-surface-default);
301
+ --card-foreground: var(--text-default);
302
+ --popover: var(--bg-surface-popover);
303
+ --popover-foreground: var(--text-default);
304
+ --primary: var(--bg-fill-primary);
305
+ --primary-foreground: var(--text-on-fill-primary);
306
+ --secondary: var(--bg-fill-secondary);
307
+ --secondary-foreground: var(--text-on-fill-secondary);
308
+ --muted: var(--bg-muted);
309
+ --muted-foreground: var(--text-muted);
310
+ --accent: var(--bg-surface-accent);
311
+ --accent-foreground: var(--text-on-surface-accent);
312
+ --destructive: var(--bg-fill-critical);
313
+ --border: var(--border-default);
314
+ --input: var(--border-input);
315
+ --ring: var(--border-focus);
316
+ }
@@ -49,7 +49,7 @@
49
49
  --bg-fill-transparent: #0000000d;
50
50
  --bg-fill-secondary: #ffffff;
51
51
  --bg-fill-secondary-hover: #ffffff;
52
- --bg-fill-secondary-inverse: #171717;
52
+ --bg-fill-secondary-inverse: #ffffff;
53
53
  --text-default: #171717;
54
54
  --text-secondary: #737373;
55
55
  --text-muted: #737373;
@@ -407,7 +407,7 @@
407
407
  --bg-fill-transparent: #ffffff0d;
408
408
  --bg-fill-secondary: #0f0f0f;
409
409
  --bg-fill-secondary-hover: #0f0f0f;
410
- --bg-fill-secondary-inverse: #f5f5f5;
410
+ --bg-fill-secondary-inverse: #0f0f0f;
411
411
  --text-default: #f5f5f5;
412
412
  --text-secondary: #a3a3a3;
413
413
  --text-muted: #a3a3a3;
@@ -0,0 +1,59 @@
1
+ import { defaultPreset, defaultPresetDark } from './default'
2
+
3
+ const shape: Record<string, string> = {
4
+ '--font-sans': 'ui-monospace, SFMono-Regular, Menlo, Consolas, monospace',
5
+ '--font-heading': 'ui-sans-serif, system-ui, sans-serif',
6
+ '--radius': '0.375rem',
7
+ '--button-radius': 'var(--radius)',
8
+ '--button-height': '2.5rem',
9
+ '--button-font-size': '0.8125rem',
10
+ '--control-size-md': 'calc(var(--spacing) * 10)',
11
+ }
12
+
13
+ export const gutenberg: Record<string, string> = {
14
+ ...defaultPreset,
15
+ ...shape,
16
+ ...{
17
+ '--bg-default': '#f6f3e9',
18
+ '--bg-surface-default': '#fffdf6',
19
+ '--bg-muted': '#ede9dc',
20
+ '--bg-surface-hover': '#e6dfcb',
21
+ '--bg-surface-field': '#fffdf6',
22
+ '--bg-fill-brand': '#846000',
23
+ '--bg-fill-primary': '#846000',
24
+ '--text-on-fill-primary': '#ffffff',
25
+ '--text-default': '#323437',
26
+ '--text-secondary': '#58594e',
27
+ '--text-muted': '#6b6b60',
28
+ '--text-brand': '#846000',
29
+ '--text-on-fill-brand': '#ffffff',
30
+ '--border-default': '#d3cebd',
31
+ '--border-input': '#c3bda9',
32
+ '--border-focus': '#846000',
33
+ },
34
+ }
35
+
36
+ export const gutenbergDark: Record<string, string> = {
37
+ ...defaultPresetDark,
38
+ ...shape,
39
+ ...{
40
+ '--bg-default': '#323437',
41
+ '--bg-surface-default': '#2c2e31',
42
+ '--bg-muted': '#292b2e',
43
+ '--bg-surface-hover': '#3b3d40',
44
+ '--bg-surface-field': '#393b3e',
45
+ '--bg-fill-brand': '#e2b714',
46
+ '--bg-fill-primary': '#e2b714',
47
+ '--text-on-fill-primary': '#323437',
48
+ '--text-default': '#d1d0c5',
49
+ '--text-secondary': '#b5b5ac',
50
+ '--text-muted': '#9a9c9e',
51
+ '--text-brand': '#e2b714',
52
+ '--text-on-fill-brand': '#323437',
53
+ '--text-critical': '#f17a86',
54
+ '--bg-surface-critical': '#473638',
55
+ '--border-default': '#494b4d',
56
+ '--border-input': '#55575a',
57
+ '--border-focus': '#e2b714',
58
+ },
59
+ }
@@ -1,3 +1,5 @@
1
+ import { gutenberg, gutenbergDark } from './gutenberg'
2
+ export { gutenberg, gutenbergDark } from './gutenberg'
1
3
  import { defaultPreset, defaultPresetDark } from './default'
2
4
  import { brutalist, brutalistDark } from './brutalist'
3
5
  import { signalPop, signalPopDark } from './signal-pop'
@@ -21,6 +23,13 @@ export interface PresetDefinition {
21
23
  }
22
24
 
23
25
  export const presetDefinitions = [
26
+ {
27
+ name: 'gutenberg',
28
+ label: 'Gutenberg',
29
+ description: 'Quiet book reading: charcoal, warm gold, and monospaced text.',
30
+ light: gutenberg,
31
+ dark: gutenbergDark,
32
+ },
24
33
  {
25
34
  name: 'default',
26
35
  label: 'Default',
@@ -156,7 +156,7 @@ export const kumo: Record<string, string> = {
156
156
  '--bg-fill-selected': '#056DFF',
157
157
  '--bg-fill-secondary': '#FFFFFF',
158
158
  '--bg-fill-secondary-hover': '#FFFFFF',
159
- '--bg-fill-secondary-inverse': '#171717',
159
+ '--bg-fill-secondary-inverse': '#FFFFFF',
160
160
  '--bg-fill-transparent': '#0000000D',
161
161
  '--bg-fill-brand': '#FF6A00',
162
162
  '--bg-fill-brand-2': '#00C2D6',
@@ -271,7 +271,7 @@ export const kumoDark: Record<string, string> = {
271
271
  '--bg-fill-selected': '#045EDE',
272
272
  '--bg-fill-secondary': '#0F0F0F',
273
273
  '--bg-fill-secondary-hover': '#0F0F0F',
274
- '--bg-fill-secondary-inverse': '#F5F5F5',
274
+ '--bg-fill-secondary-inverse': '#0F0F0F',
275
275
  '--bg-fill-transparent': '#FFFFFF0D',
276
276
  '--bg-fill-brand': '#FF6A00',
277
277
  '--bg-fill-brand-2': '#00D9ED',