@leitware/composables 1.0.0 → 1.0.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 +1 -1
- package/rules/composables.md +59 -59
- package/skills/use-composables/references/public-api.md +1 -1
- package/src/_internal/alert.tsx +1 -1
- package/src/index.ts +33 -10
- package/src/opinionated/accordion.tsx +22 -3
- package/src/opinionated/alert.tsx +21 -7
- package/src/opinionated/tabs.tsx +16 -3
package/package.json
CHANGED
package/rules/composables.md
CHANGED
|
@@ -65,49 +65,49 @@ Use this catalog to choose public exports. The `Source module` column is for mai
|
|
|
65
65
|
|
|
66
66
|
### Layout
|
|
67
67
|
|
|
68
|
-
| Module | Source module | Import from | Public values | Public types
|
|
69
|
-
| -------------- | ---------------------------- | ----------------------- | ---------------------------------------------------------- |
|
|
70
|
-
| `stack` | `./opinionated/stack` | `@leitware/composables` | `Stack` |
|
|
71
|
-
| `grid` | `./opinionated/grid` | `@leitware/composables` | `Grid` |
|
|
72
|
-
| `container` | `./opinionated/container` | `@leitware/composables` | `Container` |
|
|
73
|
-
| `spacer` | `./opinionated/spacer` | `@leitware/composables` | `Spacer` |
|
|
74
|
-
| `separator` | `./opinionated/separator` | `@leitware/composables` | `Separator` | -
|
|
75
|
-
| `layout` | `./opinionated/layout` | `@leitware/composables` | `NewspaperCell`, `NewspaperGrid`, `Section` |
|
|
76
|
-
| `layout-bento` | `./opinionated/layout-bento` | `@leitware/composables` | `BentoCell`, `BentoGrid` | -
|
|
77
|
-
| `resizable` | `./opinionated/resizable` | `@leitware/composables` | `ResizableHandle`, `ResizablePanel`, `ResizablePanelGroup` | -
|
|
78
|
-
| `scroll-area` | `./opinionated/scroll-area` | `@leitware/composables` | `ScrollArea`, `ScrollBar` | `ScrollAreaProps`
|
|
68
|
+
| Module | Source module | Import from | Public values | Public types | Description |
|
|
69
|
+
| -------------- | ---------------------------- | ----------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ----------------------------------------------------------- |
|
|
70
|
+
| `stack` | `./opinionated/stack` | `@leitware/composables` | `Stack` | `StackProps` | Flex-based vertical or horizontal stack layout |
|
|
71
|
+
| `grid` | `./opinionated/grid` | `@leitware/composables` | `Grid` | `GridProps` | Responsive CSS grid layout component |
|
|
72
|
+
| `container` | `./opinionated/container` | `@leitware/composables` | `Container` | `ContainerProps` | Centered max-width content wrapper |
|
|
73
|
+
| `spacer` | `./opinionated/spacer` | `@leitware/composables` | `Spacer` | `SpacerProps` | Flexible whitespace component for spacing |
|
|
74
|
+
| `separator` | `./opinionated/separator` | `@leitware/composables` | `Separator` | - | Visual divider line between content sections |
|
|
75
|
+
| `layout` | `./opinionated/layout` | `@leitware/composables` | `NewspaperCell`, `NewspaperGrid`, `Section` | `NewspaperCellProps`, `NewspaperGridProps`, `SectionProps` | Rigid layout primitives: Section, FlexSpacer, NewspaperGrid |
|
|
76
|
+
| `layout-bento` | `./opinionated/layout-bento` | `@leitware/composables` | `BentoCell`, `BentoGrid` | - | Bento grid layout with BentoGrid, BentoCell, and composites |
|
|
77
|
+
| `resizable` | `./opinionated/resizable` | `@leitware/composables` | `ResizableHandle`, `ResizablePanel`, `ResizablePanelGroup` | - | Resizable split pane panels |
|
|
78
|
+
| `scroll-area` | `./opinionated/scroll-area` | `@leitware/composables` | `ScrollArea`, `ScrollBar` | `ScrollAreaProps` | Custom scrollbar container with overflow handling |
|
|
79
79
|
|
|
80
80
|
### Typography & Display
|
|
81
81
|
|
|
82
|
-
| Module | Source module | Import from | Public values | Public types
|
|
83
|
-
| ------------ | -------------------------- | ----------------------- | ---------------------------------------------------------------------------------- |
|
|
84
|
-
| `typography` | `./opinionated/typography` | `@leitware/composables` | `Typography` |
|
|
85
|
-
| `badge` | `./opinionated/badge` | `@leitware/composables` | `Badge` | `BadgeProps`
|
|
86
|
-
| `avatar` | `./opinionated/avatar` | `@leitware/composables` | `Avatar`, `AvatarFallback`, `AvatarImage` | `AvatarProps`
|
|
87
|
-
| `icon` | `./opinionated/icon` | `@leitware/composables` | `Icon` | -
|
|
88
|
-
| `kbd` | `./opinionated/kbd` | `@leitware/composables` | `Kbd`, `KbdGroup` | `KbdGroupProps`, `KbdProps`
|
|
89
|
-
| `skeleton` | `./opinionated/skeleton` | `@leitware/composables` | `Skeleton`, `SkeletonAvatar`, `SkeletonButton`, `SkeletonInput`, `SkeletonText` | `SkeletonProps`
|
|
90
|
-
| `progress` | `./opinionated/progress` | `@leitware/composables` | `Progress`, `ProgressIndicator`, `ProgressLabel`, `ProgressTrack`, `ProgressValue` | `ProgressProps`
|
|
91
|
-
| `divider` | `./opinionated/divider` | `@leitware/composables` | `Divider` |
|
|
82
|
+
| Module | Source module | Import from | Public values | Public types | Description |
|
|
83
|
+
| ------------ | -------------------------- | ----------------------- | ---------------------------------------------------------------------------------- | -------------------------------------- | ------------------------------------------------------------------- |
|
|
84
|
+
| `typography` | `./opinionated/typography` | `@leitware/composables` | `Typography` | `TypographyProps`, `TypographyVariant` | Polymorphic text component with typographic scale variants |
|
|
85
|
+
| `badge` | `./opinionated/badge` | `@leitware/composables` | `Badge` | `BadgeProps` | Small status label with color variants |
|
|
86
|
+
| `avatar` | `./opinionated/avatar` | `@leitware/composables` | `Avatar`, `AvatarFallback`, `AvatarImage` | `AvatarProps` | Circular image element with automatic initials fallback |
|
|
87
|
+
| `icon` | `./opinionated/icon` | `@leitware/composables` | `Icon` | - | Icon wrapper with size and color variants |
|
|
88
|
+
| `kbd` | `./opinionated/kbd` | `@leitware/composables` | `Kbd`, `KbdGroup` | `KbdGroupProps`, `KbdProps` | Keyboard shortcut key and key group display |
|
|
89
|
+
| `skeleton` | `./opinionated/skeleton` | `@leitware/composables` | `Skeleton`, `SkeletonAvatar`, `SkeletonButton`, `SkeletonInput`, `SkeletonText` | `SkeletonProps` | Animated placeholder for loading content |
|
|
90
|
+
| `progress` | `./opinionated/progress` | `@leitware/composables` | `Progress`, `ProgressIndicator`, `ProgressLabel`, `ProgressTrack`, `ProgressValue` | `ProgressProps` | Horizontal progress bar indicator |
|
|
91
|
+
| `divider` | `./opinionated/divider` | `@leitware/composables` | `Divider` | `DividerProps` | Horizontal or vertical divider with solid, dots, and pills variants |
|
|
92
92
|
|
|
93
93
|
### Feedback & Overlay
|
|
94
94
|
|
|
95
|
-
| Module | Source module | Import from | Public values | Public types
|
|
96
|
-
| -------------- | ---------------------------- | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
97
|
-
| `alert` | `./opinionated/alert` | `@leitware/composables` | `Alert`, `AlertAction`, `AlertDescription`, `AlertTitle` | `AlertProps`, `AlertType` | Contextual feedback messages with type-based icon mapping |
|
|
98
|
-
| `dialog` | `./opinionated/dialog` | `@leitware/composables` | `Dialog`, `DialogClose`, `DialogContent`, `DialogDescription`, `DialogFooter`, `DialogHeader`, `DialogTitle`, `DialogTrigger` | `DialogProps`
|
|
99
|
-
| `alert-dialog` | `./opinionated/alert-dialog` | `@leitware/composables` | `AlertDialog`, `AlertDialogAction`, `AlertDialogCancel`, `AlertDialogContent`, `AlertDialogDescription`, `AlertDialogTitle`, `AlertDialogTrigger` | `AlertDialogProps`
|
|
100
|
-
| `sheet` | `./opinionated/sheet` | `@leitware/composables` | `Sheet`, `SheetClose`, `SheetContent`, `SheetDescription`, `SheetFooter`, `SheetHeader`, `SheetTitle`, `SheetTrigger` | `SheetProps`
|
|
101
|
-
| `popover` | `./opinionated/popover` | `@leitware/composables` | `Popover`, `PopoverContent`, `PopoverDescription`, `PopoverHeader`, `PopoverTitle`, `PopoverTrigger` | `PopoverProps`
|
|
102
|
-
| `tooltip` | `./opinionated/tooltip` | `@leitware/composables` | `Tooltip`, `TooltipContent`, `TooltipTrigger` | `TooltipProps`
|
|
103
|
-
| `hover-card` | `./opinionated/hover-card` | `@leitware/composables` | `HoverCard`, `HoverCardContent`, `HoverCardTrigger` | `HoverCardProps`
|
|
104
|
-
| `sonner` | `./opinionated/sonner` | `@leitware/composables` | `Toaster` | -
|
|
95
|
+
| Module | Source module | Import from | Public values | Public types | Description |
|
|
96
|
+
| -------------- | ---------------------------- | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------- | ---------------------------------------------------------- |
|
|
97
|
+
| `alert` | `./opinionated/alert` | `@leitware/composables` | `Alert`, `AlertAction`, `AlertDescription`, `AlertTitle` | `AlertProps`, `AlertType`, `AlertVariant` | Contextual feedback messages with type-based icon mapping |
|
|
98
|
+
| `dialog` | `./opinionated/dialog` | `@leitware/composables` | `Dialog`, `DialogClose`, `DialogContent`, `DialogDescription`, `DialogFooter`, `DialogHeader`, `DialogTitle`, `DialogTrigger` | `DialogProps` | Modal dialog overlay with trigger, title, and footer props |
|
|
99
|
+
| `alert-dialog` | `./opinionated/alert-dialog` | `@leitware/composables` | `AlertDialog`, `AlertDialogAction`, `AlertDialogCancel`, `AlertDialogContent`, `AlertDialogDescription`, `AlertDialogTitle`, `AlertDialogTrigger` | `AlertDialogProps` | Modal dialog for important confirmations |
|
|
100
|
+
| `sheet` | `./opinionated/sheet` | `@leitware/composables` | `Sheet`, `SheetClose`, `SheetContent`, `SheetDescription`, `SheetFooter`, `SheetHeader`, `SheetTitle`, `SheetTrigger` | `SheetProps` | Slide-out panel from screen edge |
|
|
101
|
+
| `popover` | `./opinionated/popover` | `@leitware/composables` | `Popover`, `PopoverContent`, `PopoverDescription`, `PopoverHeader`, `PopoverTitle`, `PopoverTrigger` | `PopoverProps` | Floating content panel anchored to a trigger |
|
|
102
|
+
| `tooltip` | `./opinionated/tooltip` | `@leitware/composables` | `Tooltip`, `TooltipContent`, `TooltipTrigger` | `TooltipProps` | Informational popup on hover or focus |
|
|
103
|
+
| `hover-card` | `./opinionated/hover-card` | `@leitware/composables` | `HoverCard`, `HoverCardContent`, `HoverCardTrigger` | `HoverCardProps` | Preview card shown on hover |
|
|
104
|
+
| `sonner` | `./opinionated/sonner` | `@leitware/composables` | `Toaster` | - | Toast notification system powered by Sonner |
|
|
105
105
|
|
|
106
106
|
### Navigation
|
|
107
107
|
|
|
108
108
|
| Module | Source module | Import from | Public values | Public types | Description |
|
|
109
109
|
| --------------- | ----------------------------- | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------- | ------------------------------------------------------ |
|
|
110
|
-
| `tabs` | `./opinionated/tabs` | `@leitware/composables` | `Tabs`, `TabsContent` | `TabItem`
|
|
110
|
+
| `tabs` | `./opinionated/tabs` | `@leitware/composables` | `Tabs`, `TabsContent` | `TabItem`, `TabsProps`, `TabsVariant` | Tabbed content navigation with items array API |
|
|
111
111
|
| `breadcrumb` | `./opinionated/breadcrumb` | `@leitware/composables` | `Breadcrumb`, `BreadcrumbEllipsis`, `BreadcrumbItem`, `BreadcrumbLink`, `BreadcrumbList`, `BreadcrumbPage`, `BreadcrumbSeparator` | `BreadcrumbItemData`, `BreadcrumbProps` | Navigation trail with items array API |
|
|
112
112
|
| `pagination` | `./opinionated/pagination` | `@leitware/composables` | `Pagination`, `PaginationContent`, `PaginationEllipsis`, `PaginationItem`, `PaginationLink`, `PaginationNext`, `PaginationPrevious` | `PaginationProps` | Page navigation with currentPage and totalPages API |
|
|
113
113
|
| `sidebar` | `./opinionated/sidebar` | `@leitware/composables` | `Sidebar`, `SidebarContent`, `SidebarFooter`, `SidebarGroup`, `SidebarGroupAction`, `SidebarGroupContent`, `SidebarGroupLabel`, `SidebarHeader`, `SidebarInput`, `SidebarInset`, `SidebarMenu`, `SidebarMenuAction`, `SidebarMenuBadge`, `SidebarMenuButton`, `SidebarMenuItem`, `SidebarMenuSkeleton`, `SidebarMenuSub`, `SidebarMenuSubButton`, `SidebarMenuSubItem`, `SidebarProvider`, `SidebarRail`, `SidebarSeparator`, `SidebarTrigger`, `useSidebar` | - | Application sidebar with collapsible navigation groups |
|
|
@@ -115,20 +115,20 @@ Use this catalog to choose public exports. The `Source module` column is for mai
|
|
|
115
115
|
|
|
116
116
|
### Data Display
|
|
117
117
|
|
|
118
|
-
| Module | Source module | Import from | Public values | Public types
|
|
119
|
-
| ------------- | --------------------------- | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
120
|
-
| `table` | `./opinionated/table` | `@leitware/composables` | `Table`, `TableBody`, `TableCaption`, `TableCell`, `TableFooter`, `TableHead`, `TableHeader`, `TableRow` | -
|
|
121
|
-
| `card` | `./opinionated/card` | `@leitware/composables` | `Card`, `CardAction`, `CardContent`, `CardDescription`, `CardFooter`, `CardHeader`, `CardTitle` | `CardProps`
|
|
122
|
-
| `accordion` | `./opinionated/accordion` | `@leitware/composables` | `Accordion`, `AccordionContent`, `AccordionItem`, `AccordionTrigger` | `AccordionItemData`, `AccordionProps`
|
|
123
|
-
| `collapsible` | `./opinionated/collapsible` | `@leitware/composables` | `Collapsible`, `CollapsibleContent`, `CollapsibleTrigger` | `CollapsibleProps`
|
|
124
|
-
| `item` | `./opinionated/item` | `@leitware/composables` | `Item`, `ItemActions`, `ItemContent`, `ItemDescription`, `ItemFooter`, `ItemGroup`, `ItemHeader`, `ItemMedia`, `ItemSeparator`, `ItemTitle` | `ItemProps`
|
|
125
|
-
| `message` | `./opinionated/message` | `@leitware/composables` | `Message`, `MessageAvatar`, `MessageContent`, `MessageFooter`, `MessageGroup`, `MessageHeader` | -
|
|
126
|
-
| `bubble` | `./opinionated/bubble` | `@leitware/composables` | `Bubble`, `BubbleContent`, `BubbleGroup`, `BubbleReactions` | `BubbleProps`
|
|
127
|
-
| `marker` | `./opinionated/marker` | `@leitware/composables` | `Marker`, `MarkerContent`, `MarkerIcon` | `MarkerProps`
|
|
128
|
-
| `empty` | `./opinionated/empty` | `@leitware/composables` | `Empty`, `EmptyContent`, `EmptyDescription`, `EmptyHeader`, `EmptyMedia`, `EmptyTableState`, `EmptyTitle` | `EmptyProps`, `EmptyTableStateProps`
|
|
129
|
-
| `carousel` | `./opinionated/carousel` | `@leitware/composables` | `Carousel`, `CarouselContent`, `CarouselItem`, `CarouselNext`, `CarouselPrevious` | `CarouselProps`
|
|
130
|
-
| `code-block` | `./opinionated/code-block` | `@leitware/composables` | `CodeBlock` |
|
|
131
|
-
| `list` | `./opinionated/list` | `@leitware/composables` | `List`, `ListArrowItem`, `ListBulletItem` | `ListItemData`, `ListProps`, `ListVariant`
|
|
118
|
+
| Module | Source module | Import from | Public values | Public types | Description |
|
|
119
|
+
| ------------- | --------------------------- | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------- | ---------------------------------------------------------------------------- |
|
|
120
|
+
| `table` | `./opinionated/table` | `@leitware/composables` | `Table`, `TableBody`, `TableCaption`, `TableCell`, `TableFooter`, `TableHead`, `TableHeader`, `TableRow` | - | Semantic HTML table with styled rows and cells |
|
|
121
|
+
| `card` | `./opinionated/card` | `@leitware/composables` | `Card`, `CardAction`, `CardContent`, `CardDescription`, `CardFooter`, `CardHeader`, `CardTitle` | `CardProps` | Bordered content container with title, description, action, and footer props |
|
|
122
|
+
| `accordion` | `./opinionated/accordion` | `@leitware/composables` | `Accordion`, `AccordionContent`, `AccordionItem`, `AccordionTrigger` | `AccordionItemData`, `AccordionProps`, `AccordionVariant` | Vertically collapsible content sections with items array API |
|
|
123
|
+
| `collapsible` | `./opinionated/collapsible` | `@leitware/composables` | `Collapsible`, `CollapsibleContent`, `CollapsibleTrigger` | `CollapsibleProps` | Expandable and collapsible content panel with trigger prop |
|
|
124
|
+
| `item` | `./opinionated/item` | `@leitware/composables` | `Item`, `ItemActions`, `ItemContent`, `ItemDescription`, `ItemFooter`, `ItemGroup`, `ItemHeader`, `ItemMedia`, `ItemSeparator`, `ItemTitle` | `ItemProps`, `ItemVariants` | Flexible list item with title, description, icon, and actions |
|
|
125
|
+
| `message` | `./opinionated/message` | `@leitware/composables` | `Message`, `MessageAvatar`, `MessageContent`, `MessageFooter`, `MessageGroup`, `MessageHeader` | - | Message row primitives for chat, activity, and assistant UIs |
|
|
126
|
+
| `bubble` | `./opinionated/bubble` | `@leitware/composables` | `Bubble`, `BubbleContent`, `BubbleGroup`, `BubbleReactions` | `BubbleProps` | Message bubble primitives with semantic variants |
|
|
127
|
+
| `marker` | `./opinionated/marker` | `@leitware/composables` | `Marker`, `MarkerContent`, `MarkerIcon` | `MarkerProps` | Inline metadata marker with icon, separator, and border variants |
|
|
128
|
+
| `empty` | `./opinionated/empty` | `@leitware/composables` | `Empty`, `EmptyContent`, `EmptyDescription`, `EmptyHeader`, `EmptyMedia`, `EmptyTableState`, `EmptyTitle` | `EmptyProps`, `EmptyTableStateProps` | Empty state placeholder with icon, title, and description |
|
|
129
|
+
| `carousel` | `./opinionated/carousel` | `@leitware/composables` | `Carousel`, `CarouselContent`, `CarouselItem`, `CarouselNext`, `CarouselPrevious` | `CarouselProps` | Horizontally scrollable content slider with items array API |
|
|
130
|
+
| `code-block` | `./opinionated/code-block` | `@leitware/composables` | `CodeBlock` | `CodeBlockProps` | Monospace code display with line numbers |
|
|
131
|
+
| `list` | `./opinionated/list` | `@leitware/composables` | `List`, `ListArrowItem`, `ListBulletItem` | `ListItemData`, `ListProps`, `ListVariant` | Variant list renderer: arrow, bullet |
|
|
132
132
|
|
|
133
133
|
### Form Components
|
|
134
134
|
|
|
@@ -152,19 +152,19 @@ Use this catalog to choose public exports. The `Source module` column is for mai
|
|
|
152
152
|
|
|
153
153
|
### Interactive
|
|
154
154
|
|
|
155
|
-
| Module | Source module | Import from | Public values | Public types
|
|
156
|
-
| -------------- | ---------------------------- | ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
157
|
-
| `button` | `./opinionated/button` | `@leitware/composables` | `Button` | `ButtonProps`
|
|
158
|
-
| `toggle` | `./opinionated/toggle` | `@leitware/composables` | `Toggle` | `ToggleProps`
|
|
159
|
-
| `toggle-group` | `./opinionated/toggle-group` | `@leitware/composables` | `ToggleGroup`, `ToggleGroupItem` | `ToggleGroupOption`, `ToggleGroupProps`
|
|
160
|
-
| `switch` | `./opinionated/switch` | `@leitware/composables` | `Switch` | -
|
|
161
|
-
| `slider` | `./opinionated/slider` | `@leitware/composables` | `Slider` | -
|
|
162
|
-
| `checkbox` | `./opinionated/checkbox` | `@leitware/composables` | `Checkbox` | -
|
|
163
|
-
| `radio-group` | `./opinionated/radio-group` | `@leitware/composables` | `RadioGroup`, `RadioGroupItem` | -
|
|
164
|
-
| `combobox` | `./opinionated/combobox` | `@leitware/composables` | `Combobox`, `ComboboxChip`, `ComboboxChips`, `ComboboxChipsInput`, `ComboboxCollection`, `ComboboxContent`, `ComboboxEmpty`, `ComboboxGroup`, `ComboboxInput`, `ComboboxItem`, `ComboboxLabel`, `ComboboxList`, `ComboboxSeparator`, `ComboboxTrigger`, `ComboboxValue` | `ComboboxOption`, `ComboboxProps`
|
|
165
|
-
| `select` | `./opinionated/select` | `@leitware/composables` | `Select`, `SelectContent`, `SelectGroup`, `SelectItem`, `SelectLabel`, `SelectTrigger`, `SelectValue` | `SelectOption`, `SelectProps`
|
|
166
|
-
| `calendar` | `./opinionated/calendar` | `@leitware/composables` | `Calendar`, `CalendarDayButton` | -
|
|
167
|
-
| `dropzone` | `./opinionated/dropzone` | `@leitware/composables` | `ACCEPT_PRESETS`, `DropZone`, `DropZoneFile` |
|
|
155
|
+
| Module | Source module | Import from | Public values | Public types | Description |
|
|
156
|
+
| -------------- | ---------------------------- | ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------- | ------------------------------------------------------- |
|
|
157
|
+
| `button` | `./opinionated/button` | `@leitware/composables` | `Button` | `ButtonProps` | Clickable button with loading spinner support |
|
|
158
|
+
| `toggle` | `./opinionated/toggle` | `@leitware/composables` | `Toggle` | `ToggleProps` | Pressable toggle button with left and right icon slots |
|
|
159
|
+
| `toggle-group` | `./opinionated/toggle-group` | `@leitware/composables` | `ToggleGroup`, `ToggleGroupItem` | `ToggleGroupOption`, `ToggleGroupProps` | Grouped toggle buttons for single or multiple selection |
|
|
160
|
+
| `switch` | `./opinionated/switch` | `@leitware/composables` | `Switch` | - | Toggle switch for on/off states |
|
|
161
|
+
| `slider` | `./opinionated/slider` | `@leitware/composables` | `Slider` | - | Draggable range slider input |
|
|
162
|
+
| `checkbox` | `./opinionated/checkbox` | `@leitware/composables` | `Checkbox` | - | Toggle checkbox input with checked state |
|
|
163
|
+
| `radio-group` | `./opinionated/radio-group` | `@leitware/composables` | `RadioGroup`, `RadioGroupItem` | - | Group of mutually exclusive radio options |
|
|
164
|
+
| `combobox` | `./opinionated/combobox` | `@leitware/composables` | `Combobox`, `ComboboxChip`, `ComboboxChips`, `ComboboxChipsInput`, `ComboboxCollection`, `ComboboxContent`, `ComboboxEmpty`, `ComboboxGroup`, `ComboboxInput`, `ComboboxItem`, `ComboboxLabel`, `ComboboxList`, `ComboboxSeparator`, `ComboboxTrigger`, `ComboboxValue` | `ComboboxOption`, `ComboboxProps` | Searchable select dropdown with autocomplete |
|
|
165
|
+
| `select` | `./opinionated/select` | `@leitware/composables` | `Select`, `SelectContent`, `SelectGroup`, `SelectItem`, `SelectLabel`, `SelectTrigger`, `SelectValue` | `SelectOption`, `SelectProps` | Dropdown select menu with scrollable options |
|
|
166
|
+
| `calendar` | `./opinionated/calendar` | `@leitware/composables` | `Calendar`, `CalendarDayButton` | - | Date picker calendar powered by react-day-picker |
|
|
167
|
+
| `dropzone` | `./opinionated/dropzone` | `@leitware/composables` | `ACCEPT_PRESETS`, `DropZone`, `DropZoneFile` | `Accept`, `DropZoneFileProps`, `DropZoneProps`, `FileRejection` | Drag-and-drop file upload area |
|
|
168
168
|
|
|
169
169
|
### Tooling Components
|
|
170
170
|
|
|
@@ -7,7 +7,7 @@ This is the exact installed-package entrypoint and export-name contract. Import
|
|
|
7
7
|
## `@leitware/composables`
|
|
8
8
|
|
|
9
9
|
- Values (275): `ACCEPT_PRESETS`, `Accordion`, `AccordionContent`, `AccordionItem`, `AccordionTrigger`, `Alert`, `AlertAction`, `AlertDescription`, `AlertDialog`, `AlertDialogAction`, `AlertDialogCancel`, `AlertDialogContent`, `AlertDialogDescription`, `AlertDialogTitle`, `AlertDialogTrigger`, `AlertTitle`, `AspectRatio`, `Avatar`, `AvatarFallback`, `AvatarImage`, `Badge`, `BentoCell`, `BentoGrid`, `Breadcrumb`, `BreadcrumbEllipsis`, `BreadcrumbItem`, `BreadcrumbLink`, `BreadcrumbList`, `BreadcrumbPage`, `BreadcrumbSeparator`, `Bubble`, `BubbleContent`, `BubbleGroup`, `BubbleReactions`, `Button`, `Calendar`, `CalendarDayButton`, `Card`, `CardAction`, `CardContent`, `CardDescription`, `CardFooter`, `CardHeader`, `CardTitle`, `Carousel`, `CarouselContent`, `CarouselItem`, `CarouselNext`, `CarouselPrevious`, `Checkbox`, `cn`, `CodeBlock`, `Collapsible`, `CollapsibleContent`, `CollapsibleTrigger`, `Combobox`, `ComboboxChip`, `ComboboxChips`, `ComboboxChipsInput`, `ComboboxCollection`, `ComboboxContent`, `ComboboxEmpty`, `ComboboxGroup`, `ComboboxInput`, `ComboboxItem`, `ComboboxLabel`, `ComboboxList`, `ComboboxSeparator`, `ComboboxTrigger`, `ComboboxValue`, `Container`, `Dialog`, `DialogClose`, `DialogContent`, `DialogDescription`, `DialogFooter`, `DialogHeader`, `DialogTitle`, `DialogTrigger`, `DirectionProvider`, `DISABLED_OPACITY`, `Divider`, `DropdownMenu`, `DropdownMenuCheckboxItem`, `DropdownMenuContent`, `DropdownMenuGroup`, `DropdownMenuItem`, `DropdownMenuLabel`, `DropdownMenuRadioGroup`, `DropdownMenuRadioItem`, `DropdownMenuSeparator`, `DropdownMenuSub`, `DropdownMenuSubContent`, `DropdownMenuSubTrigger`, `DropdownMenuTrigger`, `DropZone`, `DropZoneFile`, `Empty`, `EmptyContent`, `EmptyDescription`, `EmptyHeader`, `EmptyMedia`, `EmptyTableState`, `EmptyTitle`, `Field`, `FieldContent`, `FieldDescription`, `FieldError`, `FieldGroup`, `FieldLabel`, `FieldLegend`, `FieldSeparator`, `FieldSet`, `FieldTitle`, `FOCUS_RING`, `FOCUS_RING_DESTRUCTIVE`, `formatNumericValue`, `FormCalendarPopover`, `FormCheckbox`, `FormCombobox`, `FormDateOfBirth`, `FormDropZone`, `FormInput`, `FormInputGroup`, `FormMultiCombobox`, `FormMultiDropZone`, `FormRadioGroup`, `FormSelect`, `FormSlider`, `FormSwitch`, `FormTextarea`, `Grid`, `GridOverlay`, `HoverCard`, `HoverCardContent`, `HoverCardTrigger`, `Icon`, `Input`, `InputGroup`, `InputGroupAddon`, `InputGroupButton`, `InputGroupInput`, `InputGroupTextarea`, `Item`, `ItemActions`, `ItemContent`, `ItemDescription`, `ItemFooter`, `ItemGroup`, `ItemHeader`, `ItemMedia`, `ItemSeparator`, `ItemTitle`, `Kbd`, `KbdGroup`, `Label`, `leftPad`, `List`, `ListArrowItem`, `ListBulletItem`, `Marker`, `MarkerContent`, `MarkerIcon`, `Message`, `MessageAvatar`, `MessageContent`, `MessageFooter`, `MessageGroup`, `MessageHeader`, `NativeSelect`, `NativeSelectOptGroup`, `NativeSelectOption`, `NewspaperCell`, `NewspaperGrid`, `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`, `Select`, `SelectContent`, `SelectGroup`, `SelectItem`, `SelectLabel`, `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`, `SkeletonAvatar`, `SkeletonButton`, `SkeletonInput`, `SkeletonText`, `Slider`, `Spacer`, `Stack`, `Switch`, `Table`, `TableBody`, `TableCaption`, `TableCell`, `TableFooter`, `TableHead`, `TableHeader`, `TableRow`, `Tabs`, `TabsContent`, `Textarea`, `ThemeInjector`, `Toaster`, `Toggle`, `ToggleGroup`, `ToggleGroupItem`, `TokenConfigPanel`, `Tooltip`, `TooltipContent`, `TooltipTrigger`, `Typography`, `useDirection`, `useIsMobile`, `useNumericInput`, `useSidebar`
|
|
10
|
-
- Types (
|
|
10
|
+
- Types (91): `Accept`, `AccordionItemData`, `AccordionProps`, `AccordionVariant`, `AlertDialogProps`, `AlertProps`, `AlertType`, `AlertVariant`, `AvatarProps`, `BadgeProps`, `BreadcrumbItemData`, `BreadcrumbProps`, `BubbleProps`, `ButtonProps`, `CardProps`, `CarouselProps`, `CodeBlockProps`, `CollapsibleProps`, `ComboboxOption`, `ComboboxProps`, `ContainerProps`, `DateOfBirthValue`, `DialogProps`, `DirectionProviderProps`, `DividerProps`, `DropdownMenuItemData`, `DropdownMenuProps`, `DropZoneFileProps`, `DropZoneProps`, `EmptyProps`, `EmptyTableStateProps`, `FileRejection`, `FormCalendarPopoverProps`, `FormCheckboxProps`, `FormComboboxOption`, `FormComboboxProps`, `FormDateOfBirthProps`, `FormDropZoneProps`, `FormInputGroupInputProps`, `FormInputGroupProps`, `FormInputProps`, `FormMultiComboboxOption`, `FormMultiComboboxProps`, `FormMultiDropZoneProps`, `FormRadioGroupOption`, `FormRadioGroupProps`, `FormSelectOption`, `FormSelectProps`, `FormSliderProps`, `FormSwitchProps`, `FormTextareaProps`, `GridOverlayProps`, `GridProps`, `HoverCardProps`, `ItemProps`, `ItemVariants`, `KbdGroupProps`, `KbdProps`, `ListItemData`, `ListProps`, `ListVariant`, `MarkerProps`, `NativeSelectOptionData`, `NativeSelectProps`, `NewspaperCellProps`, `NewspaperGridProps`, `NumericInputOptions`, `NumericMode`, `PaginationProps`, `PopoverProps`, `ProgressProps`, `ScrollAreaProps`, `SectionProps`, `SelectOption`, `SelectProps`, `SheetProps`, `SkeletonProps`, `SpacerProps`, `StackProps`, `TabItem`, `TabsProps`, `TabsVariant`, `TextDirection`, `ToggleGroupOption`, `ToggleGroupProps`, `ToggleProps`, `TooltipProps`, `TypographyProps`, `TypographyVariant`, `UseNumericInputOptions`, `UseNumericInputReturn`
|
|
11
11
|
|
|
12
12
|
## `@leitware/composables/ai`
|
|
13
13
|
|
package/src/_internal/alert.tsx
CHANGED
package/src/index.ts
CHANGED
|
@@ -30,6 +30,7 @@ export {
|
|
|
30
30
|
AccordionTrigger,
|
|
31
31
|
type AccordionItemData,
|
|
32
32
|
type AccordionProps,
|
|
33
|
+
type AccordionVariant,
|
|
33
34
|
} from './opinionated/accordion'
|
|
34
35
|
|
|
35
36
|
export {
|
|
@@ -48,6 +49,7 @@ export {
|
|
|
48
49
|
AlertAction,
|
|
49
50
|
AlertDescription,
|
|
50
51
|
AlertTitle,
|
|
52
|
+
type AlertVariant,
|
|
51
53
|
type AlertType,
|
|
52
54
|
type AlertProps,
|
|
53
55
|
} from './opinionated/alert'
|
|
@@ -102,7 +104,7 @@ export {
|
|
|
102
104
|
} from './opinionated/carousel'
|
|
103
105
|
|
|
104
106
|
export { Checkbox } from './opinionated/checkbox'
|
|
105
|
-
export { CodeBlock } from './opinionated/code-block'
|
|
107
|
+
export { CodeBlock, type CodeBlockProps } from './opinionated/code-block'
|
|
106
108
|
|
|
107
109
|
export {
|
|
108
110
|
Collapsible,
|
|
@@ -131,7 +133,7 @@ export {
|
|
|
131
133
|
type ComboboxProps,
|
|
132
134
|
} from './opinionated/combobox'
|
|
133
135
|
|
|
134
|
-
export { Container } from './opinionated/container'
|
|
136
|
+
export { Container, type ContainerProps } from './opinionated/container'
|
|
135
137
|
|
|
136
138
|
export {
|
|
137
139
|
Dialog,
|
|
@@ -145,7 +147,7 @@ export {
|
|
|
145
147
|
type DialogProps,
|
|
146
148
|
} from './opinionated/dialog'
|
|
147
149
|
|
|
148
|
-
export { Divider } from './opinionated/divider'
|
|
150
|
+
export { Divider, type DividerProps } from './opinionated/divider'
|
|
149
151
|
|
|
150
152
|
export {
|
|
151
153
|
DirectionProvider,
|
|
@@ -172,7 +174,14 @@ export {
|
|
|
172
174
|
type DropdownMenuProps,
|
|
173
175
|
} from './opinionated/dropdown-menu'
|
|
174
176
|
|
|
175
|
-
export {
|
|
177
|
+
export {
|
|
178
|
+
DropZone,
|
|
179
|
+
DropZoneFile,
|
|
180
|
+
type Accept,
|
|
181
|
+
type DropZoneFileProps,
|
|
182
|
+
type DropZoneProps,
|
|
183
|
+
type FileRejection,
|
|
184
|
+
} from './opinionated/dropzone'
|
|
176
185
|
|
|
177
186
|
export {
|
|
178
187
|
Empty,
|
|
@@ -237,7 +246,7 @@ export { FormSlider, type FormSliderProps } from './opinionated/form-slider'
|
|
|
237
246
|
export { FormSwitch, type FormSwitchProps } from './opinionated/form-switch'
|
|
238
247
|
export { FormTextarea, type FormTextareaProps } from './opinionated/form-textarea'
|
|
239
248
|
|
|
240
|
-
export { Grid } from './opinionated/grid'
|
|
249
|
+
export { Grid, type GridProps } from './opinionated/grid'
|
|
241
250
|
export { GridOverlay, type GridOverlayProps } from './opinionated/grid-overlay'
|
|
242
251
|
|
|
243
252
|
export {
|
|
@@ -272,11 +281,19 @@ export {
|
|
|
272
281
|
ItemSeparator,
|
|
273
282
|
ItemTitle,
|
|
274
283
|
type ItemProps,
|
|
284
|
+
type ItemVariants,
|
|
275
285
|
} from './opinionated/item'
|
|
276
286
|
|
|
277
287
|
export { Label } from './opinionated/label'
|
|
278
288
|
|
|
279
|
-
export {
|
|
289
|
+
export {
|
|
290
|
+
Section,
|
|
291
|
+
NewspaperGrid,
|
|
292
|
+
NewspaperCell,
|
|
293
|
+
type NewspaperCellProps,
|
|
294
|
+
type NewspaperGridProps,
|
|
295
|
+
type SectionProps,
|
|
296
|
+
} from './opinionated/layout'
|
|
280
297
|
|
|
281
298
|
export { BentoGrid, BentoCell } from './opinionated/layout-bento'
|
|
282
299
|
|
|
@@ -408,8 +425,8 @@ export {
|
|
|
408
425
|
|
|
409
426
|
export { Slider } from './opinionated/slider'
|
|
410
427
|
export { Toaster } from './opinionated/sonner'
|
|
411
|
-
export { Spacer } from './opinionated/spacer'
|
|
412
|
-
export { Stack } from './opinionated/stack'
|
|
428
|
+
export { Spacer, type SpacerProps } from './opinionated/spacer'
|
|
429
|
+
export { Stack, type StackProps } from './opinionated/stack'
|
|
413
430
|
export { Switch } from './opinionated/switch'
|
|
414
431
|
|
|
415
432
|
export {
|
|
@@ -423,7 +440,13 @@ export {
|
|
|
423
440
|
TableRow,
|
|
424
441
|
} from './opinionated/table'
|
|
425
442
|
|
|
426
|
-
export {
|
|
443
|
+
export {
|
|
444
|
+
Tabs,
|
|
445
|
+
TabsContent,
|
|
446
|
+
type TabItem,
|
|
447
|
+
type TabsProps,
|
|
448
|
+
type TabsVariant,
|
|
449
|
+
} from './opinionated/tabs'
|
|
427
450
|
|
|
428
451
|
export { Textarea } from './opinionated/textarea'
|
|
429
452
|
export { ThemeInjector } from './opinionated/theme-injector'
|
|
@@ -437,7 +460,7 @@ export {
|
|
|
437
460
|
|
|
438
461
|
export { Tooltip, TooltipContent, TooltipTrigger, type TooltipProps } from './opinionated/tooltip'
|
|
439
462
|
|
|
440
|
-
export { Typography } from './opinionated/typography'
|
|
463
|
+
export { Typography, type TypographyProps, type TypographyVariant } from './opinionated/typography'
|
|
441
464
|
|
|
442
465
|
// Token config panel (advanced)
|
|
443
466
|
export { TokenConfigPanel } from './opinionated/token-config-panel'
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Accordion as AccordionPrimitiveBase } from '@base-ui/react/accordion'
|
|
2
|
+
import type { VariantProps } from 'class-variance-authority'
|
|
2
3
|
import type * as React from 'react'
|
|
3
4
|
|
|
4
5
|
import {
|
|
@@ -6,8 +7,12 @@ import {
|
|
|
6
7
|
AccordionItem,
|
|
7
8
|
Accordion as AccordionPrimitive,
|
|
8
9
|
AccordionTrigger,
|
|
10
|
+
type accordionVariants,
|
|
9
11
|
} from '../_internal/accordion'
|
|
10
12
|
|
|
13
|
+
/** Visual style variants available for the Accordion. */
|
|
14
|
+
export type AccordionVariant = NonNullable<VariantProps<typeof accordionVariants>['variant']>
|
|
15
|
+
|
|
11
16
|
/** A single panel in an Accordion. */
|
|
12
17
|
export interface AccordionItemData {
|
|
13
18
|
/** Unique identifier for this panel (used for controlled open state). */
|
|
@@ -31,11 +36,13 @@ export interface AccordionItemData {
|
|
|
31
36
|
* <Accordion items={[
|
|
32
37
|
* { value: 'faq-1', trigger: 'What is this?', content: 'A component library.' },
|
|
33
38
|
* { value: 'faq-2', trigger: 'How do I install it?', content: '...', defaultOpen: true },
|
|
34
|
-
* ]} />
|
|
39
|
+
* ]} variant="separated" />
|
|
35
40
|
* ```
|
|
36
41
|
*/
|
|
37
42
|
export interface AccordionProps extends Omit<AccordionPrimitiveBase.Root.Props, 'children'> {
|
|
38
43
|
className?: string
|
|
44
|
+
/** Visual style of the accordion. @default 'default' */
|
|
45
|
+
variant?: AccordionVariant
|
|
39
46
|
/** Panels to render. When provided, `children` is ignored. */
|
|
40
47
|
items?: AccordionItemData[]
|
|
41
48
|
children?: React.ReactNode
|
|
@@ -46,6 +53,7 @@ function Accordion({
|
|
|
46
53
|
items,
|
|
47
54
|
children,
|
|
48
55
|
defaultValue,
|
|
56
|
+
variant = 'default',
|
|
49
57
|
...accordionProps
|
|
50
58
|
}: AccordionProps) {
|
|
51
59
|
// If items prop is provided, use opinionated API
|
|
@@ -59,6 +67,7 @@ function Accordion({
|
|
|
59
67
|
<AccordionPrimitive
|
|
60
68
|
className={className}
|
|
61
69
|
defaultValue={computedDefaultValue}
|
|
70
|
+
variant={variant}
|
|
62
71
|
{...accordionProps}
|
|
63
72
|
>
|
|
64
73
|
{items.map((item) => (
|
|
@@ -74,7 +83,12 @@ function Accordion({
|
|
|
74
83
|
// Fallback to children-based API for advanced use cases
|
|
75
84
|
if (children) {
|
|
76
85
|
return (
|
|
77
|
-
<AccordionPrimitive
|
|
86
|
+
<AccordionPrimitive
|
|
87
|
+
className={className}
|
|
88
|
+
defaultValue={defaultValue}
|
|
89
|
+
variant={variant}
|
|
90
|
+
{...accordionProps}
|
|
91
|
+
>
|
|
78
92
|
{children}
|
|
79
93
|
</AccordionPrimitive>
|
|
80
94
|
)
|
|
@@ -82,7 +96,12 @@ function Accordion({
|
|
|
82
96
|
|
|
83
97
|
// If neither items nor children provided, return empty accordion
|
|
84
98
|
return (
|
|
85
|
-
<AccordionPrimitive
|
|
99
|
+
<AccordionPrimitive
|
|
100
|
+
className={className}
|
|
101
|
+
defaultValue={defaultValue}
|
|
102
|
+
variant={variant}
|
|
103
|
+
{...accordionProps}
|
|
104
|
+
>
|
|
86
105
|
{null}
|
|
87
106
|
</AccordionPrimitive>
|
|
88
107
|
)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AlertTriangleIcon, CircleCheckIcon, InfoIcon, TriangleAlertIcon } from 'lucide-react'
|
|
2
|
+
import type { VariantProps } from 'class-variance-authority'
|
|
2
3
|
import type * as React from 'react'
|
|
3
4
|
|
|
4
5
|
import {
|
|
@@ -6,10 +7,14 @@ import {
|
|
|
6
7
|
AlertDescription,
|
|
7
8
|
Alert as AlertPrimitive,
|
|
8
9
|
AlertTitle,
|
|
10
|
+
type alertVariants,
|
|
9
11
|
} from '../_internal/alert'
|
|
10
12
|
|
|
11
13
|
export type AlertType = 'notice' | 'negative' | 'positive' | 'default' | 'warning'
|
|
12
14
|
|
|
15
|
+
/** Visual style variants available for the Alert. */
|
|
16
|
+
export type AlertVariant = NonNullable<VariantProps<typeof alertVariants>['variant']>
|
|
17
|
+
|
|
13
18
|
/**
|
|
14
19
|
* Props for the opinionated Alert component.
|
|
15
20
|
*
|
|
@@ -21,15 +26,13 @@ export type AlertType = 'notice' | 'negative' | 'positive' | 'default' | 'warnin
|
|
|
21
26
|
* <Alert type="positive" title="Payment successful" message="Your invoice has been sent." />
|
|
22
27
|
* <Alert type="negative" title="Something went wrong" message={error.message} />
|
|
23
28
|
* <Alert type="notice" message="Your session expires in 5 minutes." />
|
|
29
|
+
* <Alert variant="brand" title="New feature" message="Try it today." />
|
|
24
30
|
* <Alert type="warning" title="Storage almost full">
|
|
25
31
|
* <Button size="sm">Upgrade plan</Button>
|
|
26
32
|
* </Alert>
|
|
27
33
|
* ```
|
|
28
34
|
*/
|
|
29
|
-
export interface AlertProps extends Omit<
|
|
30
|
-
React.ComponentProps<typeof AlertPrimitive>,
|
|
31
|
-
'variant' | 'title'
|
|
32
|
-
> {
|
|
35
|
+
export interface AlertProps extends Omit<React.ComponentProps<typeof AlertPrimitive>, 'title'> {
|
|
33
36
|
/**
|
|
34
37
|
* Semantic type that controls the icon and colour variant.
|
|
35
38
|
* - `default` — no icon, neutral styling
|
|
@@ -40,6 +43,10 @@ export interface AlertProps extends Omit<
|
|
|
40
43
|
* @default 'default'
|
|
41
44
|
*/
|
|
42
45
|
type?: AlertType
|
|
46
|
+
/**
|
|
47
|
+
* Visual style override. When omitted, the variant is derived from `type`.
|
|
48
|
+
*/
|
|
49
|
+
variant?: AlertVariant
|
|
43
50
|
/** Alert heading rendered in bold. */
|
|
44
51
|
title?: React.ReactNode
|
|
45
52
|
/** Alert body text. Alternatively pass `children`. */
|
|
@@ -57,10 +64,17 @@ function Alert({
|
|
|
57
64
|
children,
|
|
58
65
|
action,
|
|
59
66
|
className,
|
|
67
|
+
variant,
|
|
60
68
|
...alertProps
|
|
61
69
|
}: AlertProps) {
|
|
62
|
-
|
|
63
|
-
|
|
70
|
+
const typeVariants: Record<AlertType, AlertVariant> = {
|
|
71
|
+
default: 'default',
|
|
72
|
+
negative: 'destructive',
|
|
73
|
+
notice: 'info',
|
|
74
|
+
positive: 'success',
|
|
75
|
+
warning: 'warning',
|
|
76
|
+
}
|
|
77
|
+
const resolvedVariant = variant ?? typeVariants[type]
|
|
64
78
|
|
|
65
79
|
// Get icon based on type
|
|
66
80
|
const getIcon = () => {
|
|
@@ -82,7 +96,7 @@ function Alert({
|
|
|
82
96
|
const content = message || children
|
|
83
97
|
|
|
84
98
|
return (
|
|
85
|
-
<AlertPrimitive variant={
|
|
99
|
+
<AlertPrimitive variant={resolvedVariant} className={className} {...alertProps}>
|
|
86
100
|
{icon}
|
|
87
101
|
<div className="flex-1">
|
|
88
102
|
{title && <AlertTitle>{title}</AlertTitle>}
|
package/src/opinionated/tabs.tsx
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import type { Tabs as TabsPrimitiveBase } from '@base-ui/react/tabs'
|
|
2
|
-
import {
|
|
2
|
+
import type { VariantProps } from 'class-variance-authority'
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
TabsList,
|
|
6
|
+
Tabs as TabsPrimitive,
|
|
7
|
+
TabsTrigger,
|
|
8
|
+
type tabsListVariants,
|
|
9
|
+
} from '../_internal/tabs'
|
|
3
10
|
|
|
4
11
|
/** A single tab in the Tabs navigation bar. */
|
|
5
12
|
export type TabItem = {
|
|
@@ -9,6 +16,9 @@ export type TabItem = {
|
|
|
9
16
|
label: string
|
|
10
17
|
}
|
|
11
18
|
|
|
19
|
+
/** Visual style variants available for the Tabs navigation bar. */
|
|
20
|
+
export type TabsVariant = NonNullable<VariantProps<typeof tabsListVariants>['variant']>
|
|
21
|
+
|
|
12
22
|
/**
|
|
13
23
|
* Props for the opinionated Tabs component.
|
|
14
24
|
*
|
|
@@ -31,7 +41,7 @@ export type TabItem = {
|
|
|
31
41
|
* <TabsContent value="settings">...</TabsContent>
|
|
32
42
|
* ```
|
|
33
43
|
*/
|
|
34
|
-
type TabsProps = Omit<TabsPrimitiveBase.Root.Props, 'children'> & {
|
|
44
|
+
export type TabsProps = Omit<TabsPrimitiveBase.Root.Props, 'children'> & {
|
|
35
45
|
/** Tab definitions to render in the navigation bar. */
|
|
36
46
|
items: TabItem[]
|
|
37
47
|
/** Currently active tab value. */
|
|
@@ -40,6 +50,8 @@ type TabsProps = Omit<TabsPrimitiveBase.Root.Props, 'children'> & {
|
|
|
40
50
|
onValueChange: (value: string) => void
|
|
41
51
|
/** Accessible label for the tab list (for screen readers). */
|
|
42
52
|
ariaLabel?: string
|
|
53
|
+
/** Visual style of the tab list. @default 'line' */
|
|
54
|
+
variant?: TabsVariant
|
|
43
55
|
className?: string
|
|
44
56
|
}
|
|
45
57
|
|
|
@@ -48,12 +60,13 @@ export const Tabs = ({
|
|
|
48
60
|
value,
|
|
49
61
|
onValueChange,
|
|
50
62
|
ariaLabel,
|
|
63
|
+
variant = 'line',
|
|
51
64
|
className,
|
|
52
65
|
...tabsProps
|
|
53
66
|
}: TabsProps) => {
|
|
54
67
|
return (
|
|
55
68
|
<TabsPrimitive value={value} onValueChange={onValueChange} className={className} {...tabsProps}>
|
|
56
|
-
<TabsList variant=
|
|
69
|
+
<TabsList variant={variant} aria-label={ariaLabel}>
|
|
57
70
|
{items.map((item) => (
|
|
58
71
|
<TabsTrigger key={item.value} value={item.value}>
|
|
59
72
|
{item.label}
|