@leitware/composables 2.0.0 → 3.0.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/README.md +16 -0
- package/dist/presets/brutalist.css +16 -17
- package/dist/presets/default.css +11 -13
- package/dist/presets/editorial-grid.css +12 -13
- package/dist/presets/kumo.css +14 -20
- package/dist/presets/signal-pop.css +14 -26
- package/dist/styles.css +1 -1
- package/dist/tailwind.css +20 -0
- package/package.json +7 -7
- package/rules/composables.md +10 -9
- package/skills/use-composables/references/public-api.md +1 -1
- package/skills/use-composables/references/semantic-utilities.md +5 -0
- package/src/_internal/accordion.tsx +10 -10
- package/src/_internal/alert-dialog.tsx +3 -3
- package/src/_internal/alert.tsx +9 -7
- package/src/_internal/avatar.tsx +25 -14
- package/src/_internal/badge.tsx +2 -1
- package/src/_internal/bubble.tsx +2 -2
- package/src/_internal/button.tsx +16 -8
- package/src/_internal/calendar.tsx +3 -3
- package/src/_internal/card.tsx +53 -17
- package/src/_internal/checkbox.tsx +2 -2
- package/src/_internal/combobox.tsx +2 -2
- package/src/_internal/dialog.tsx +29 -9
- package/src/_internal/divider.tsx +14 -16
- package/src/_internal/dropdown-menu.tsx +4 -4
- package/src/_internal/empty.tsx +6 -3
- package/src/_internal/field.tsx +11 -7
- package/src/_internal/hover-card.tsx +1 -1
- package/src/_internal/input-group.tsx +17 -12
- package/src/_internal/input.tsx +33 -4
- package/src/_internal/item.tsx +2 -2
- package/src/_internal/label.tsx +1 -1
- package/src/_internal/message.tsx +1 -1
- package/src/_internal/native-select.tsx +1 -1
- package/src/_internal/popover.tsx +9 -3
- package/src/_internal/progress.tsx +37 -7
- package/src/_internal/radio-group.tsx +39 -4
- package/src/_internal/select.tsx +2 -2
- package/src/_internal/separator.tsx +1 -1
- package/src/_internal/sheet.tsx +9 -3
- package/src/_internal/sidebar.tsx +0 -35
- package/src/_internal/skeleton.tsx +26 -3
- package/src/_internal/slider.tsx +9 -7
- package/src/_internal/sonner.tsx +4 -4
- package/src/_internal/spinner.tsx +43 -3
- package/src/_internal/switch.tsx +2 -2
- package/src/_internal/table.tsx +20 -5
- package/src/_internal/tabs.tsx +4 -1
- package/src/_internal/textarea.tsx +1 -1
- package/src/_internal/toggle.tsx +1 -1
- package/src/_internal/tooltip.tsx +53 -8
- package/src/_internal/typography.tsx +4 -2
- package/src/index.ts +2 -1
- package/src/lib/utils.ts +2 -2
- package/src/opinionated/alert.tsx +8 -10
- package/src/opinionated/avatar.tsx +2 -2
- package/src/opinionated/button.tsx +13 -3
- package/src/opinionated/dialog.tsx +10 -1
- package/src/opinionated/form-calendar-popover.tsx +5 -10
- package/src/opinionated/form-checkbox.tsx +2 -2
- package/src/opinionated/form-date-of-birth.tsx +12 -8
- package/src/opinionated/form-input-group.tsx +1 -1
- package/src/opinionated/form-radiogroup.tsx +24 -7
- package/src/opinionated/form-switch.tsx +7 -6
- package/src/opinionated/progress.tsx +7 -2
- package/src/opinionated/select.tsx +4 -1
- package/src/opinionated/sidebar.tsx +0 -1
- package/src/opinionated/skeleton.tsx +3 -13
- package/src/opinionated/spinner.tsx +2 -0
- package/src/opinionated/token-config-panel/spacing-editor.tsx +21 -3
- package/src/opinionated/tooltip.tsx +20 -2
- package/src/styles/presets/brutalist.css +16 -17
- package/src/styles/presets/default.css +11 -13
- package/src/styles/presets/editorial-grid.css +12 -13
- package/src/styles/presets/kumo.css +14 -20
- package/src/styles/presets/signal-pop.css +14 -26
- package/src/styles/presets-data/brutalist.ts +16 -19
- package/src/styles/presets-data/default.ts +11 -15
- package/src/styles/presets-data/editorial-grid.ts +12 -6
- package/src/styles/presets-data/kumo.ts +12 -6
- package/src/styles/presets-data/signal-pop.ts +14 -30
- package/src/styles/tokens/components.css +64 -20
- package/src/styles/tokens/registry.ts +33 -0
- package/src/styles/tokens/semantic-utilities.css +20 -0
- package/src/styles/tokens/semantic.css +10 -0
- package/src/styles/tokens/tailwind-color-adapter.css +3 -0
- package/src/styles/tokens/tailwind-public-utilities.css +20 -0
package/dist/tailwind.css
CHANGED
|
@@ -91,6 +91,10 @@
|
|
|
91
91
|
background-color: var(--bg-surface-hover);
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
+
@utility bg-surface-input {
|
|
95
|
+
background-color: var(--bg-surface-input);
|
|
96
|
+
}
|
|
97
|
+
|
|
94
98
|
@utility bg-fill-default {
|
|
95
99
|
background-color: var(--bg-fill-default);
|
|
96
100
|
}
|
|
@@ -99,6 +103,10 @@
|
|
|
99
103
|
background-color: var(--bg-fill-primary);
|
|
100
104
|
}
|
|
101
105
|
|
|
106
|
+
@utility bg-fill-primary-hover {
|
|
107
|
+
background-color: var(--bg-fill-primary-hover);
|
|
108
|
+
}
|
|
109
|
+
|
|
102
110
|
@utility bg-fill-brand {
|
|
103
111
|
background-color: var(--bg-fill-brand);
|
|
104
112
|
}
|
|
@@ -147,6 +155,14 @@
|
|
|
147
155
|
background-color: var(--bg-fill-secondary);
|
|
148
156
|
}
|
|
149
157
|
|
|
158
|
+
@utility bg-fill-secondary-hover {
|
|
159
|
+
background-color: var(--bg-fill-secondary-hover);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
@utility bg-fill-selected {
|
|
163
|
+
background-color: var(--bg-fill-selected);
|
|
164
|
+
}
|
|
165
|
+
|
|
150
166
|
@utility bg-fill-secondary-inverse {
|
|
151
167
|
background-color: var(--bg-fill-secondary-inverse);
|
|
152
168
|
}
|
|
@@ -183,6 +199,10 @@
|
|
|
183
199
|
color: var(--text-on-fill-secondary);
|
|
184
200
|
}
|
|
185
201
|
|
|
202
|
+
@utility text-on-fill-selected {
|
|
203
|
+
color: var(--text-on-fill-selected);
|
|
204
|
+
}
|
|
205
|
+
|
|
186
206
|
@utility text-on-surface-accent {
|
|
187
207
|
color: var(--text-on-surface-accent);
|
|
188
208
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leitware/composables",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"./presets/*": "./dist/presets/*"
|
|
24
24
|
},
|
|
25
25
|
"scripts": {
|
|
26
|
-
"dev": "
|
|
26
|
+
"dev": "storybook dev -p 6006",
|
|
27
27
|
"lint": "oxlint",
|
|
28
28
|
"format": "oxfmt --write .",
|
|
29
29
|
"format:check": "oxfmt --check .",
|
|
@@ -32,14 +32,14 @@
|
|
|
32
32
|
"generate:palette": "bun scripts/generate-css.ts",
|
|
33
33
|
"generate:presets": "bun scripts/generate-preset-css.ts",
|
|
34
34
|
"generate:css": "bun run generate:palette && bun run generate:presets",
|
|
35
|
-
"generate:showcase-routes": "bun scripts/generate-showcase-routes.ts",
|
|
36
35
|
"generate:rules": "bun scripts/generate-rules.ts",
|
|
37
36
|
"build:css": "bun scripts/build-css.ts",
|
|
38
37
|
"prepack": "bun run build:css",
|
|
39
38
|
"test:tokens": "bun scripts/check-token-system.ts",
|
|
40
39
|
"test:rules": "bun scripts/generate-rules.ts --check",
|
|
41
40
|
"test:css": "bun scripts/test-downstream-css.ts",
|
|
42
|
-
"deploy:showcase": "./scripts/deploy-showcase.sh"
|
|
41
|
+
"deploy:showcase": "./scripts/deploy-showcase.sh",
|
|
42
|
+
"build:storybook": "storybook build -o showcase/dist && bun scripts/prepare-storybook.ts"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@base-ui/react": "^1.6.0",
|
|
@@ -167,8 +167,6 @@
|
|
|
167
167
|
"@streamdown/mermaid": "^1.0.2",
|
|
168
168
|
"@tailwindcss/cli": "^4.3.2",
|
|
169
169
|
"@tailwindcss/vite": "^4.3.2",
|
|
170
|
-
"@tanstack/react-router": "^1.170.17",
|
|
171
|
-
"@tanstack/router-plugin": "^1.168.19",
|
|
172
170
|
"@types/node": "^26.1.0",
|
|
173
171
|
"@types/react": "^19.2.17",
|
|
174
172
|
"@types/react-dom": "^19.2.3",
|
|
@@ -189,6 +187,8 @@
|
|
|
189
187
|
"typescript": "^6.0.3",
|
|
190
188
|
"use-stick-to-bottom": "^1.1.6",
|
|
191
189
|
"vite": "^8.1.3",
|
|
192
|
-
"wrangler": "^4.107.0"
|
|
190
|
+
"wrangler": "^4.107.0",
|
|
191
|
+
"storybook": "^10.6.1",
|
|
192
|
+
"@storybook/react-vite": "^10.6.1"
|
|
193
193
|
}
|
|
194
194
|
}
|
package/rules/composables.md
CHANGED
|
@@ -105,14 +105,14 @@ Use this catalog to choose public exports. The `Source module` column is for mai
|
|
|
105
105
|
|
|
106
106
|
### Navigation
|
|
107
107
|
|
|
108
|
-
| Module | Source module | Import from | Public values
|
|
109
|
-
| ------------------- | --------------------------------- | ----------------------- |
|
|
110
|
-
| `tabs` | `./opinionated/tabs` | `@leitware/composables` | `Tabs`, `TabsContent`
|
|
111
|
-
| `breadcrumb` | `./opinionated/breadcrumb` | `@leitware/composables` | `Breadcrumb`, `BreadcrumbEllipsis`, `BreadcrumbItem`, `BreadcrumbLink`, `BreadcrumbList`, `BreadcrumbPage`, `BreadcrumbSeparator`
|
|
112
|
-
| `pagination` | `./opinionated/pagination` | `@leitware/composables` | `Pagination`, `PaginationContent`, `PaginationEllipsis`, `PaginationItem`, `PaginationLink`, `PaginationNext`, `PaginationPrevious`
|
|
113
|
-
| `sidebar` | `./opinionated/sidebar` | `@leitware/composables` | `Sidebar`, `SidebarContent`, `SidebarFooter`, `SidebarGroup`, `SidebarGroupAction`, `SidebarGroupContent`, `SidebarGroupLabel`, `SidebarHeader`, `SidebarInput`, `SidebarInset`, `SidebarMenu`, `SidebarMenuAction`, `SidebarMenuBadge`, `SidebarMenuButton`, `SidebarMenuItem`, `
|
|
114
|
-
| `dropdown-menu` | `./opinionated/dropdown-menu` | `@leitware/composables` | `DropdownMenu`, `DropdownMenuCheckboxItem`, `DropdownMenuContent`, `DropdownMenuGroup`, `DropdownMenuItem`, `DropdownMenuLabel`, `DropdownMenuPortal`, `DropdownMenuRadioGroup`, `DropdownMenuRadioItem`, `DropdownMenuSeparator`, `DropdownMenuShortcut`, `DropdownMenuSub`, `DropdownMenuSubContent`, `DropdownMenuSubTrigger`, `DropdownMenuTrigger`
|
|
115
|
-
| `table-of-contents` | `./opinionated/table-of-contents` | `@leitware/composables` | `TableOfContents`, `TableOfContentsGroup`, `TableOfContentsItem`, `TableOfContentsList`, `TableOfContentsRoot`, `TableOfContentsTitle`
|
|
108
|
+
| Module | Source module | Import from | Public values | Public types | Description |
|
|
109
|
+
| ------------------- | --------------------------------- | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------- |
|
|
110
|
+
| `tabs` | `./opinionated/tabs` | `@leitware/composables` | `Tabs`, `TabsContent` | `TabItem`, `TabsProps`, `TabsVariant` | Tabbed content navigation with items array API |
|
|
111
|
+
| `breadcrumb` | `./opinionated/breadcrumb` | `@leitware/composables` | `Breadcrumb`, `BreadcrumbEllipsis`, `BreadcrumbItem`, `BreadcrumbLink`, `BreadcrumbList`, `BreadcrumbPage`, `BreadcrumbSeparator` | `BreadcrumbItemData`, `BreadcrumbProps` | Navigation trail with items array API |
|
|
112
|
+
| `pagination` | `./opinionated/pagination` | `@leitware/composables` | `Pagination`, `PaginationContent`, `PaginationEllipsis`, `PaginationItem`, `PaginationLink`, `PaginationNext`, `PaginationPrevious` | `PaginationProps` | Page navigation with currentPage and totalPages API |
|
|
113
|
+
| `sidebar` | `./opinionated/sidebar` | `@leitware/composables` | `Sidebar`, `SidebarContent`, `SidebarFooter`, `SidebarGroup`, `SidebarGroupAction`, `SidebarGroupContent`, `SidebarGroupLabel`, `SidebarHeader`, `SidebarInput`, `SidebarInset`, `SidebarMenu`, `SidebarMenuAction`, `SidebarMenuBadge`, `SidebarMenuButton`, `SidebarMenuItem`, `SidebarMenuSub`, `SidebarMenuSubButton`, `SidebarMenuSubItem`, `SidebarProvider`, `SidebarRail`, `SidebarSeparator`, `SidebarTrigger`, `useSidebar` | - | Application sidebar with collapsible navigation groups |
|
|
114
|
+
| `dropdown-menu` | `./opinionated/dropdown-menu` | `@leitware/composables` | `DropdownMenu`, `DropdownMenuCheckboxItem`, `DropdownMenuContent`, `DropdownMenuGroup`, `DropdownMenuItem`, `DropdownMenuLabel`, `DropdownMenuPortal`, `DropdownMenuRadioGroup`, `DropdownMenuRadioItem`, `DropdownMenuSeparator`, `DropdownMenuShortcut`, `DropdownMenuSub`, `DropdownMenuSubContent`, `DropdownMenuSubTrigger`, `DropdownMenuTrigger` | `DropdownMenuItemData`, `DropdownMenuProps` | Contextual menu triggered by a button |
|
|
115
|
+
| `table-of-contents` | `./opinionated/table-of-contents` | `@leitware/composables` | `TableOfContents`, `TableOfContentsGroup`, `TableOfContentsItem`, `TableOfContentsList`, `TableOfContentsRoot`, `TableOfContentsTitle` | `TableOfContentsGroupProps`, `TableOfContentsItemData`, `TableOfContentsItemProps`, `TableOfContentsProps` | Nested section navigation with an active rail and optional scroll tracking |
|
|
116
116
|
|
|
117
117
|
### Data Display
|
|
118
118
|
|
|
@@ -166,7 +166,7 @@ Use this catalog to choose public exports. The `Source module` column is for mai
|
|
|
166
166
|
| `checkbox` | `./opinionated/checkbox` | `@leitware/composables` | `Checkbox` | - | Toggle checkbox input with checked state |
|
|
167
167
|
| `radio-group` | `./opinionated/radio-group` | `@leitware/composables` | `RadioGroup`, `RadioGroupItem` | - | Group of mutually exclusive radio options |
|
|
168
168
|
| `combobox` | `./opinionated/combobox` | `@leitware/composables` | `Combobox`, `ComboboxChip`, `ComboboxChips`, `ComboboxChipsInput`, `ComboboxCollection`, `ComboboxContent`, `ComboboxEmpty`, `ComboboxGroup`, `ComboboxInput`, `ComboboxItem`, `ComboboxLabel`, `ComboboxList`, `ComboboxSeparator`, `ComboboxTrigger`, `ComboboxValue`, `useComboboxAnchor` | `ComboboxOption`, `ComboboxProps` | Searchable select dropdown with autocomplete |
|
|
169
|
-
| `select` | `./opinionated/select` | `@leitware/composables` | `Select`, `SelectContent`, `SelectGroup`, `SelectItem`, `SelectLabel`, `SelectScrollDownButton`, `SelectScrollUpButton`, `SelectSeparator`, `SelectTrigger`, `SelectValue`
|
|
169
|
+
| `select` | `./opinionated/select` | `@leitware/composables` | `Select`, `SelectContent`, `SelectGroup`, `SelectItem`, `SelectLabel`, `SelectRoot`, `SelectScrollDownButton`, `SelectScrollUpButton`, `SelectSeparator`, `SelectTrigger`, `SelectValue` | `SelectOption`, `SelectProps` | Dropdown select menu with scrollable options |
|
|
170
170
|
| `calendar` | `./opinionated/calendar` | `@leitware/composables` | `Calendar`, `CalendarDayButton` | - | Date picker calendar powered by react-day-picker |
|
|
171
171
|
| `dropzone` | `./opinionated/dropzone` | `@leitware/composables` | `ACCEPT_PRESETS`, `DEFAULT_ACCEPT`, `DEFAULT_MAX_SIZE`, `Dropzone`, `DropZone`, `DropZoneArea`, `DropzoneContent`, `DropZoneContent`, `DropZoneFile`, `DropZoneFileList`, `DropzoneInput`, `DropZoneInput`, `DropzoneLabel`, `formatFileSize`, `getAcceptDescription`, `getRejectionMessage`, `useDropZoneContext` | `Accept`, `DropZoneFileProps`, `DropZoneProps`, `FileRejection` | Drag-and-drop file upload area |
|
|
172
172
|
|
|
@@ -188,6 +188,7 @@ Use this catalog to choose public exports. The `Source module` column is for mai
|
|
|
188
188
|
| `input-group` | `./opinionated/input-group` | `@leitware/composables` | `InputGroup`, `InputGroupAddon`, `InputGroupButton`, `InputGroupInput`, `InputGroupTextarea` | - | Public export not listed in the README component catalog. |
|
|
189
189
|
| `input` | `./opinionated/input` | `@leitware/composables` | `Input` | - | Public export not listed in the README component catalog. |
|
|
190
190
|
| `label` | `./opinionated/label` | `@leitware/composables` | `Label` | - | Public export not listed in the README component catalog. |
|
|
191
|
+
| `spinner` | `./opinionated/spinner` | `@leitware/composables` | `Spinner`, `spinnerVariants` | - | Public export not listed in the README component catalog. |
|
|
191
192
|
| `textarea` | `./opinionated/textarea` | `@leitware/composables` | `Textarea` | - | Public export not listed in the README component catalog. |
|
|
192
193
|
| `use-table-of-contents-active-id` | `./hooks/use-table-of-contents-active-id` | `@leitware/composables` | `useTableOfContentsActiveId` | `TableOfContentsTrackingOptions` | Public export not listed in the README component catalog. |
|
|
193
194
|
| `window-frame` | `./opinionated/window-frame` | `@leitware/composables` | `WindowFrame` | `WindowFrameProps` | 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 (
|
|
9
|
+
- Values (346): `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`, `Container`, `containerVariants`, `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`, `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 (112): `Accept`, `AccordionItemData`, `AccordionProps`, `AccordionVariant`, `AlertDialogProps`, `AlertProps`, `AlertType`, `AlertVariant`, `AvatarProps`, `BadgeProps`, `BreadcrumbItemData`, `BreadcrumbProps`, `BubbleProps`, `ButtonProps`, `CardProps`, `CarouselProps`, `ClipboardTextProps`, `ClipboardTextSize`, `ClipboardTextStatus`, `CodeBlockProps`, `CollapsibleProps`, `ComboboxOption`, `ComboboxProps`, `ContainerProps`, `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`, `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`
|
|
@@ -27,8 +27,10 @@ This is the exact allowlist of framework-independent semantic colour classes shi
|
|
|
27
27
|
| `bg-surface-brand-4` | bg | `--bg-surface-brand-4` | `background-color: var(--bg-surface-brand-4)` |
|
|
28
28
|
| `bg-surface-brand-5` | bg | `--bg-surface-brand-5` | `background-color: var(--bg-surface-brand-5)` |
|
|
29
29
|
| `bg-surface-hover` | bg | `--bg-surface-hover` | `background-color: var(--bg-surface-hover)` |
|
|
30
|
+
| `bg-surface-input` | bg | `--bg-surface-input` | `background-color: var(--bg-surface-input)` |
|
|
30
31
|
| `bg-fill-default` | bg | `--bg-fill-default` | `background-color: var(--bg-fill-default)` |
|
|
31
32
|
| `bg-fill-primary` | bg | `--bg-fill-primary` | `background-color: var(--bg-fill-primary)` |
|
|
33
|
+
| `bg-fill-primary-hover` | bg | `--bg-fill-primary-hover` | `background-color: var(--bg-fill-primary-hover)` |
|
|
32
34
|
| `bg-fill-brand` | bg | `--bg-fill-brand` | `background-color: var(--bg-fill-brand)` |
|
|
33
35
|
| `bg-fill-brand-2` | bg | `--bg-fill-brand-2` | `background-color: var(--bg-fill-brand-2)` |
|
|
34
36
|
| `bg-fill-brand-3` | bg | `--bg-fill-brand-3` | `background-color: var(--bg-fill-brand-3)` |
|
|
@@ -41,6 +43,8 @@ This is the exact allowlist of framework-independent semantic colour classes shi
|
|
|
41
43
|
| `bg-fill-emphasis` | bg | `--bg-fill-emphasis` | `background-color: var(--bg-fill-emphasis)` |
|
|
42
44
|
| `bg-fill-transparent` | bg | `--bg-fill-transparent` | `background-color: var(--bg-fill-transparent)` |
|
|
43
45
|
| `bg-fill-secondary` | bg | `--bg-fill-secondary` | `background-color: var(--bg-fill-secondary)` |
|
|
46
|
+
| `bg-fill-secondary-hover` | bg | `--bg-fill-secondary-hover` | `background-color: var(--bg-fill-secondary-hover)` |
|
|
47
|
+
| `bg-fill-selected` | bg | `--bg-fill-selected` | `background-color: var(--bg-fill-selected)` |
|
|
44
48
|
| `bg-fill-secondary-inverse` | bg | `--bg-fill-secondary-inverse` | `background-color: var(--bg-fill-secondary-inverse)` |
|
|
45
49
|
| `text-default` | text | `--text-default` | `color: var(--text-default)` |
|
|
46
50
|
| `text-content-secondary` | text | `--text-secondary` | `color: var(--text-secondary)` |
|
|
@@ -50,6 +54,7 @@ This is the exact allowlist of framework-independent semantic colour classes shi
|
|
|
50
54
|
| `text-on-fill-primary` | text | `--text-on-fill-primary` | `color: var(--text-on-fill-primary)` |
|
|
51
55
|
| `text-on-fill-brand` | text | `--text-on-fill-brand` | `color: var(--text-on-fill-brand)` |
|
|
52
56
|
| `text-on-fill-secondary` | text | `--text-on-fill-secondary` | `color: var(--text-on-fill-secondary)` |
|
|
57
|
+
| `text-on-fill-selected` | text | `--text-on-fill-selected` | `color: var(--text-on-fill-selected)` |
|
|
53
58
|
| `text-on-surface-accent` | text | `--text-on-surface-accent` | `color: var(--text-on-surface-accent)` |
|
|
54
59
|
| `text-info` | text | `--text-info` | `color: var(--text-info)` |
|
|
55
60
|
| `text-success` | text | `--text-success` | `color: var(--text-success)` |
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import { Accordion as AccordionPrimitive } from '@base-ui/react/accordion'
|
|
2
2
|
import { cva, type VariantProps } from 'class-variance-authority'
|
|
3
|
-
import { ChevronDownIcon
|
|
3
|
+
import { ChevronDownIcon } from 'lucide-react'
|
|
4
4
|
import { cn, FOCUS_RING } from '../lib/utils'
|
|
5
5
|
|
|
6
|
-
const accordionVariants = cva('flex w-full flex-col', {
|
|
6
|
+
const accordionVariants = cva('group/accordion flex w-full flex-col', {
|
|
7
7
|
variants: {
|
|
8
8
|
variant: {
|
|
9
9
|
default: 'overflow-hidden rounded-md border',
|
|
10
|
+
// Edge-to-edge rows divided by rules.
|
|
10
11
|
flush: '',
|
|
12
|
+
// Rules inside a filled, rounded panel.
|
|
13
|
+
filled: 'bg-accent rounded-(--card-radius) px-(--card-padding)',
|
|
11
14
|
separated: 'gap-2',
|
|
12
15
|
},
|
|
13
16
|
},
|
|
@@ -36,7 +39,8 @@ function AccordionItem({ className, ...props }: AccordionPrimitive.Item.Props) {
|
|
|
36
39
|
<AccordionPrimitive.Item
|
|
37
40
|
data-slot="accordion-item"
|
|
38
41
|
className={cn(
|
|
39
|
-
'
|
|
42
|
+
'not-last:border-b-(length:--rule-width)',
|
|
43
|
+
'[[data-variant=default]>&]:data-open:bg-muted/50 [[data-variant=separated]>&]:data-open:bg-muted/50 [[data-variant=flush]>&]:border-b-(length:--rule-width)',
|
|
40
44
|
'[[data-variant=separated]>&]:rounded-md [[data-variant=separated]>&]:border [[data-variant=separated]>&]:not-last:border-b',
|
|
41
45
|
className,
|
|
42
46
|
)}
|
|
@@ -51,7 +55,7 @@ function AccordionTrigger({ className, children, ...props }: AccordionPrimitive.
|
|
|
51
55
|
<AccordionPrimitive.Trigger
|
|
52
56
|
data-slot="accordion-trigger"
|
|
53
57
|
className={cn(
|
|
54
|
-
'**:data-[slot=accordion-trigger-icon]:text-muted-foreground gap-6 p-2 text-left text-
|
|
58
|
+
'**:data-[slot=accordion-trigger-icon]:text-muted-foreground gap-6 p-2 group-data-[variant=flush]/accordion:px-0 group-data-[variant=filled]/accordion:px-0 group-data-[variant=flush]/accordion:py-3 group-data-[variant=filled]/accordion:py-3 text-left text-(length:--body-font-size) leading-relaxed font-medium group-data-[variant=default]/accordion:hover:underline group-data-[variant=separated]/accordion:hover:underline active:opacity-80 **:data-[slot=accordion-trigger-icon]:ml-auto **:data-[slot=accordion-trigger-icon]:size-4 group/accordion-trigger relative flex flex-1 items-start justify-between rounded-sm border border-transparent transition-[opacity,box-shadow] outline-none disabled:pointer-events-none disabled:opacity-disabled',
|
|
55
59
|
FOCUS_RING,
|
|
56
60
|
className,
|
|
57
61
|
)}
|
|
@@ -60,11 +64,7 @@ function AccordionTrigger({ className, children, ...props }: AccordionPrimitive.
|
|
|
60
64
|
{children}
|
|
61
65
|
<ChevronDownIcon
|
|
62
66
|
data-slot="accordion-trigger-icon"
|
|
63
|
-
className="pointer-events-none shrink-0 group-aria-expanded/accordion-trigger:
|
|
64
|
-
/>
|
|
65
|
-
<ChevronUpIcon
|
|
66
|
-
data-slot="accordion-trigger-icon"
|
|
67
|
-
className="pointer-events-none hidden shrink-0 group-aria-expanded/accordion-trigger:inline"
|
|
67
|
+
className="pointer-events-none shrink-0 motion-safe:transition-transform motion-safe:duration-(--motion-duration-disclosure) group-aria-expanded/accordion-trigger:rotate-180"
|
|
68
68
|
/>
|
|
69
69
|
</AccordionPrimitive.Trigger>
|
|
70
70
|
</AccordionPrimitive.Header>
|
|
@@ -75,7 +75,7 @@ function AccordionContent({ className, children, ...props }: AccordionPrimitive.
|
|
|
75
75
|
return (
|
|
76
76
|
<AccordionPrimitive.Panel
|
|
77
77
|
data-slot="accordion-content"
|
|
78
|
-
className="data-open:animate-accordion-down data-closed:animate-accordion-up px-2 text-
|
|
78
|
+
className="data-open:animate-accordion-down data-closed:animate-accordion-up px-2 group-data-[variant=flush]/accordion:px-0 group-data-[variant=filled]/accordion:px-0 text-(length:--body-font-size) leading-relaxed overflow-hidden"
|
|
79
79
|
{...props}
|
|
80
80
|
>
|
|
81
81
|
<div
|
|
@@ -42,7 +42,7 @@ function AlertDialogContent({
|
|
|
42
42
|
data-slot="alert-dialog-content"
|
|
43
43
|
data-size={size}
|
|
44
44
|
className={cn(
|
|
45
|
-
'data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 bg-page ring-foreground/10 gap-3 rounded-
|
|
45
|
+
'data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 bg-page ring-foreground/10 gap-3 rounded-(--dialog-radius) p-4 ring-(length:--dialog-border-width) duration-fast data-[size=default]:max-w-xs data-[size=sm]:max-w-64 data-[size=default]:sm:max-w-sm group/alert-dialog-content fixed top-1/2 left-1/2 z-modal grid w-full -translate-x-1/2 -translate-y-1/2 outline-none',
|
|
46
46
|
className,
|
|
47
47
|
)}
|
|
48
48
|
{...props}
|
|
@@ -98,7 +98,7 @@ function AlertDialogTitle({
|
|
|
98
98
|
<AlertDialogPrimitive.Title
|
|
99
99
|
data-slot="alert-dialog-title"
|
|
100
100
|
className={cn(
|
|
101
|
-
'text-
|
|
101
|
+
'text-(length:--heading-font-size) leading-(--heading-line-height) font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2',
|
|
102
102
|
className,
|
|
103
103
|
)}
|
|
104
104
|
{...props}
|
|
@@ -114,7 +114,7 @@ function AlertDialogDescription({
|
|
|
114
114
|
<AlertDialogPrimitive.Description
|
|
115
115
|
data-slot="alert-dialog-description"
|
|
116
116
|
className={cn(
|
|
117
|
-
'text-muted-foreground *:[a]:hover:text-foreground text-
|
|
117
|
+
'text-muted-foreground *:[a]:hover:text-foreground text-(length:--body-font-size) leading-relaxed text-balance md:text-pretty *:[a]:underline *:[a]:underline-offset-3',
|
|
118
118
|
className,
|
|
119
119
|
)}
|
|
120
120
|
{...props}
|
package/src/_internal/alert.tsx
CHANGED
|
@@ -4,7 +4,9 @@ import type * as React from 'react'
|
|
|
4
4
|
import { cn } from '../lib/utils'
|
|
5
5
|
|
|
6
6
|
const alertVariants = cva(
|
|
7
|
-
|
|
7
|
+
// Padding and icon scale with the body copy. --alert-accent-width draws a
|
|
8
|
+
// leading bar in the variant's --alert-accent colour (0 by default).
|
|
9
|
+
"grid gap-0.5 overflow-hidden rounded-lg border-(length:--alert-border-width) p-[0.75em] pl-[calc(0.75em_+_var(--alert-accent-width))] before:absolute before:inset-y-0 before:left-0 before:w-(--alert-accent-width) before:bg-(--alert-accent) [--alert-accent:var(--bg-fill-secondary)] text-left text-(length:--body-font-size) leading-relaxed has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-[0.5em] *:[svg]:row-span-2 *:[svg]:translate-y-[0.125em] *:[svg]:text-current *:[svg:not([class*='size-'])]:size-[1.25em] w-full relative group/alert",
|
|
8
10
|
{
|
|
9
11
|
variants: {
|
|
10
12
|
variant: {
|
|
@@ -12,12 +14,12 @@ const alertVariants = cva(
|
|
|
12
14
|
secondary: 'bg-muted text-foreground',
|
|
13
15
|
outline: 'border-stroke bg-transparent text-foreground',
|
|
14
16
|
destructive:
|
|
15
|
-
'bg-surface-critical border-stroke-critical text-critical *:data-[slot=alert-description]:text-critical/90 *:[svg]:text-icon-critical',
|
|
17
|
+
'[--alert-accent:var(--bg-fill-critical)] bg-surface-critical border-stroke-critical text-critical *:data-[slot=alert-description]:text-critical/90 *:[svg]:text-icon-critical',
|
|
16
18
|
warning:
|
|
17
|
-
'bg-surface-warning border-stroke-warning text-warning *:data-[slot=alert-description]:text-warning *:[svg]:text-icon-warning',
|
|
19
|
+
'[--alert-accent:var(--bg-fill-warning)] bg-surface-warning border-stroke-warning text-warning *:data-[slot=alert-description]:text-warning *:[svg]:text-icon-warning',
|
|
18
20
|
success:
|
|
19
|
-
'bg-surface-success border-stroke-success text-success *:data-[slot=alert-description]:text-success *:[svg]:text-icon-success',
|
|
20
|
-
info: 'bg-surface-info border-stroke-info text-info *:data-[slot=alert-description]:text-info *:[svg]:text-icon-info',
|
|
21
|
+
'[--alert-accent:var(--bg-fill-success)] bg-surface-success border-stroke-success text-success *:data-[slot=alert-description]:text-success *:[svg]:text-icon-success',
|
|
22
|
+
info: '[--alert-accent:var(--bg-fill-info)] bg-surface-info border-stroke-info text-info *:data-[slot=alert-description]:text-info *:[svg]:text-icon-info',
|
|
21
23
|
brand:
|
|
22
24
|
'bg-surface-brand border-stroke-brand text-brand *:data-[slot=alert-description]:text-brand/90 *:[svg]:text-icon-brand',
|
|
23
25
|
'brand-2':
|
|
@@ -69,7 +71,7 @@ function AlertDescription({ className, ...props }: React.ComponentProps<'div'>)
|
|
|
69
71
|
<div
|
|
70
72
|
data-slot="alert-description"
|
|
71
73
|
className={cn(
|
|
72
|
-
'text-muted-foreground text-
|
|
74
|
+
'text-muted-foreground text-(length:--body-font-size) leading-relaxed text-balance md:text-pretty [&_p:not(:last-child)]:mb-4 [&_a]:hover:text-foreground [&_a]:underline [&_a]:underline-offset-3',
|
|
73
75
|
className,
|
|
74
76
|
)}
|
|
75
77
|
{...props}
|
|
@@ -81,7 +83,7 @@ function AlertAction({ className, ...props }: React.ComponentProps<'div'>) {
|
|
|
81
83
|
return (
|
|
82
84
|
<div
|
|
83
85
|
data-slot="alert-action"
|
|
84
|
-
className={cn('absolute top-
|
|
86
|
+
className={cn('absolute top-[0.75em] right-[0.75em]', className)}
|
|
85
87
|
{...props}
|
|
86
88
|
/>
|
|
87
89
|
)
|
package/src/_internal/avatar.tsx
CHANGED
|
@@ -3,30 +3,41 @@ import { cva, type VariantProps } from 'class-variance-authority'
|
|
|
3
3
|
|
|
4
4
|
import { cn } from '../lib/utils'
|
|
5
5
|
|
|
6
|
-
const avatarVariants = cva(
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
const avatarVariants = cva(
|
|
7
|
+
'group/avatar relative flex shrink-0 overflow-hidden rounded-full bg-muted',
|
|
8
|
+
{
|
|
9
|
+
variants: {
|
|
10
|
+
variant: {
|
|
11
|
+
default: '',
|
|
12
|
+
// Brand ring around the avatar and its initials.
|
|
13
|
+
brand: 'border border-(color:--bg-fill-primary-hover)',
|
|
14
|
+
},
|
|
15
|
+
size: {
|
|
16
|
+
xs: 'size-5',
|
|
17
|
+
sm: 'size-6',
|
|
18
|
+
md: 'size-8',
|
|
19
|
+
lg: 'size-10',
|
|
20
|
+
xl: 'size-14',
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
defaultVariants: {
|
|
24
|
+
size: 'md',
|
|
25
|
+
variant: 'default',
|
|
14
26
|
},
|
|
15
27
|
},
|
|
16
|
-
|
|
17
|
-
size: 'md',
|
|
18
|
-
},
|
|
19
|
-
})
|
|
28
|
+
)
|
|
20
29
|
|
|
21
30
|
function Avatar({
|
|
22
31
|
className,
|
|
23
32
|
size = 'md',
|
|
33
|
+
variant = 'default',
|
|
24
34
|
...props
|
|
25
35
|
}: AvatarPrimitive.Root.Props & VariantProps<typeof avatarVariants>) {
|
|
26
36
|
return (
|
|
27
37
|
<AvatarPrimitive.Root
|
|
28
38
|
data-slot="avatar"
|
|
29
|
-
|
|
39
|
+
data-variant={variant}
|
|
40
|
+
className={cn(avatarVariants({ size, variant }), className)}
|
|
30
41
|
{...props}
|
|
31
42
|
/>
|
|
32
43
|
)
|
|
@@ -47,7 +58,7 @@ function AvatarFallback({ className, ...props }: AvatarPrimitive.Fallback.Props)
|
|
|
47
58
|
<AvatarPrimitive.Fallback
|
|
48
59
|
data-slot="avatar-fallback"
|
|
49
60
|
className={cn(
|
|
50
|
-
'flex size-full items-center justify-center rounded-full bg-muted text-muted-foreground font-medium',
|
|
61
|
+
'flex size-full items-center justify-center rounded-full bg-muted text-muted-foreground font-medium group-data-[variant=brand]/avatar:bg-surface-brand group-data-[variant=brand]/avatar:text-foreground group-data-[variant=brand]/avatar:font-bold',
|
|
51
62
|
className,
|
|
52
63
|
)}
|
|
53
64
|
{...props}
|
package/src/_internal/badge.tsx
CHANGED
|
@@ -8,7 +8,7 @@ const BADGE_LINK_HOVER =
|
|
|
8
8
|
'[a]:hover:ring-[length:var(--hover-ring-width)] [a]:hover:ring-[color:var(--hover-ring-color)]/30'
|
|
9
9
|
|
|
10
10
|
const badgeVariants = cva(
|
|
11
|
-
`${FOCUS_RING} gap-1 rounded-(--badge-radius) border border-transparent py-0.5 font-medium transition-[opacity,box-shadow] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 inline-flex items-center justify-center w-fit whitespace-nowrap shrink-0 [&>svg]:pointer-events-none overflow-hidden group/badge`,
|
|
11
|
+
`${FOCUS_RING} gap-1 rounded-(--badge-radius) border border-transparent py-0.5 font-medium [text-transform:var(--label-text-transform)] transition-[opacity,box-shadow] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 inline-flex items-center justify-center w-fit whitespace-nowrap shrink-0 [&>svg]:pointer-events-none overflow-hidden group/badge`,
|
|
12
12
|
{
|
|
13
13
|
variants: {
|
|
14
14
|
variant: {
|
|
@@ -16,6 +16,7 @@ const badgeVariants = cva(
|
|
|
16
16
|
secondary: `bg-secondary text-secondary-foreground ${BADGE_LINK_HOVER}`,
|
|
17
17
|
destructive: `bg-surface-critical ${BADGE_LINK_HOVER} ${FOCUS_RING_DESTRUCTIVE} text-critical border-stroke-critical`,
|
|
18
18
|
outline: `border-stroke text-foreground ${BADGE_LINK_HOVER} bg-surface-field/20 dark:bg-surface-field/30`,
|
|
19
|
+
inverse: `bg-(--bg-inverse) text-(color:--text-inverse) ${BADGE_LINK_HOVER}`,
|
|
19
20
|
ghost: `${HOVER_RING} hover:text-muted-foreground`,
|
|
20
21
|
success: 'bg-surface-success text-success border-stroke-success',
|
|
21
22
|
warning: 'bg-surface-warning text-warning border-stroke-warning',
|
package/src/_internal/bubble.tsx
CHANGED
|
@@ -75,7 +75,7 @@ function BubbleContent({
|
|
|
75
75
|
<Comp
|
|
76
76
|
data-slot="bubble-content"
|
|
77
77
|
className={cn(
|
|
78
|
-
`${FOCUS_RING} w-fit max-w-full min-w-0 overflow-hidden rounded-xl border border-transparent px-3 py-2 text-
|
|
78
|
+
`${FOCUS_RING} w-fit max-w-full min-w-0 overflow-hidden rounded-xl border border-transparent px-3 py-2 text-(length:--body-font-size) leading-relaxed wrap-break-word motion-colors [button]:text-left [button,a]:outline-none`,
|
|
79
79
|
className,
|
|
80
80
|
)}
|
|
81
81
|
{...props}
|
|
@@ -84,7 +84,7 @@ function BubbleContent({
|
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
const bubbleReactionsVariants = cva(
|
|
87
|
-
'bg-muted ring-card absolute z-10 flex w-fit shrink-0 items-center justify-center gap-1 rounded-full px-1.5 py-0.5 text-
|
|
87
|
+
'bg-muted ring-card absolute z-10 flex w-fit shrink-0 items-center justify-center gap-1 rounded-full px-1.5 py-0.5 text-(length:--body-font-size) leading-(--body-line-height) ring-[length:var(--focus-ring-width)] has-[button]:p-0',
|
|
88
88
|
{
|
|
89
89
|
variants: {
|
|
90
90
|
side: {
|
package/src/_internal/button.tsx
CHANGED
|
@@ -7,18 +7,24 @@ 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-
|
|
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`,
|
|
11
11
|
{
|
|
12
12
|
variants: {
|
|
13
13
|
variant: {
|
|
14
14
|
default:
|
|
15
|
-
'bg-primary text-primary-foreground border-(--button-primary-border) bg-[image:var(--button-primary-background-image)] shadow-(--button-primary-shadow) hover:shadow-[var(--button-primary-hover-shadow,var(--hover-shadow))] hover:bg-[image:var(--button-primary-hover-background-image)] hover:border-[var(--button-primary-hover-border,var(--hover-ring-color))]',
|
|
15
|
+
'bg-primary text-primary-foreground border-(--button-primary-border) bg-[image:var(--button-primary-background-image)] shadow-(--button-primary-shadow) hover:bg-(--bg-fill-primary-hover) hover:shadow-[var(--button-primary-hover-shadow,var(--hover-shadow))] hover:bg-[image:var(--button-primary-hover-background-image)] hover:border-[var(--button-primary-hover-border,var(--hover-ring-color))]',
|
|
16
16
|
outline:
|
|
17
17
|
'border-stroke shadow-(--button-outline-shadow) hover:shadow-[var(--button-outline-hover-shadow,var(--hover-shadow))] hover:bg-[var(--button-quiet-hover-bg,transparent)] hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground',
|
|
18
18
|
secondary:
|
|
19
|
-
'bg-secondary text-secondary-foreground border-(--button-secondary-border) shadow-(--button-secondary-shadow) hover:shadow-[var(--button-secondary-hover-shadow,var(--hover-shadow))] hover:bg-[var(--button-secondary-hover-bg,var(--bg-fill-secondary))] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground',
|
|
19
|
+
'bg-secondary text-secondary-foreground border-(--button-secondary-border) shadow-(--button-secondary-shadow) hover:shadow-[var(--button-secondary-hover-shadow,var(--hover-shadow))] hover:bg-[var(--button-secondary-hover-bg,var(--bg-fill-secondary-hover))] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground',
|
|
20
|
+
// Neutral (white) and ghost fill on hover, like filled buttons, rather
|
|
21
|
+
// than drawing the hover ring's border.
|
|
22
|
+
neutral:
|
|
23
|
+
'bg-(--bg-fill-secondary-inverse) text-foreground hover:bg-(--bg-surface-hover) hover:border-(color:--bg-surface-hover) focus-visible:border-(color:--bg-fill-secondary-inverse) aria-expanded:bg-(--bg-surface-hover)',
|
|
24
|
+
inverse:
|
|
25
|
+
'bg-(--bg-inverse) text-(color:--text-inverse) hover:bg-(--bg-inverse)/85 hover:border-transparent focus-visible:border-(color:--bg-inverse)',
|
|
20
26
|
ghost:
|
|
21
|
-
'hover:bg-[var(--button-quiet-hover-bg,
|
|
27
|
+
'hover:bg-[var(--button-quiet-hover-bg,var(--bg-surface-hover))] hover:border-[var(--button-quiet-hover-bg,var(--bg-surface-hover))] hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground',
|
|
22
28
|
destructive: `bg-[var(--button-destructive-bg,var(--bg-surface-critical))] ${FOCUS_RING_DESTRUCTIVE} text-[var(--button-destructive-text,var(--text-critical))] border-[var(--button-destructive-border,var(--border-critical))] bg-[image:var(--button-destructive-background-image)] shadow-(--button-destructive-shadow) hover:shadow-[var(--button-destructive-hover-shadow,var(--hover-shadow))] hover:bg-[image:var(--button-destructive-hover-background-image)] hover:border-[var(--button-destructive-hover-border,var(--hover-ring-color))]`,
|
|
23
29
|
success: 'bg-surface-success text-success border-stroke-success',
|
|
24
30
|
warning: 'bg-surface-warning text-warning border-stroke-warning',
|
|
@@ -34,14 +40,14 @@ const buttonVariants = cva(
|
|
|
34
40
|
'brand-5':
|
|
35
41
|
'font-(--button-brand-font-weight) text-shadow-(--button-brand-text-shadow) bg-[var(--button-brand-5-bg,var(--bg-surface-brand-5))] text-[var(--button-brand-5-text,var(--text-brand-5))] border-[var(--button-brand-5-border,var(--border-brand-5))] bg-[image:var(--button-brand-5-background-image)] shadow-(--button-brand-5-shadow) hover:shadow-[var(--button-brand-5-hover-shadow,var(--hover-shadow))] hover:bg-[image:var(--button-brand-5-hover-background-image)] hover:border-[var(--button-brand-5-hover-border,var(--hover-ring-color))]',
|
|
36
42
|
emphasis: 'bg-surface-emphasis text-emphasis border-stroke-emphasis',
|
|
37
|
-
link: 'text-
|
|
43
|
+
link: 'text-link underline underline-offset-4 hover:text-(--text-secondary) hover:border-transparent hover:ring-0',
|
|
38
44
|
},
|
|
39
45
|
size: {
|
|
40
46
|
default:
|
|
41
|
-
"h-(--button-height) gap-(--button-gap) px-3 text-(length:--button-font-size)/relaxed has-data-[icon=inline-end]:pr-2.5 has-data-[icon=inline-start]:pl-2.5 [&_svg:not([class*='size-'])]:size-3.5",
|
|
47
|
+
"h-(--button-height) min-w-[calc(var(--button-height)*var(--button-min-width-ratio))] gap-(--button-gap) px-3 text-(length:--button-font-size)/relaxed has-data-[icon=inline-end]:pr-2.5 has-data-[icon=inline-start]:pl-2.5 [&_svg:not([class*='size-'])]:size-3.5",
|
|
42
48
|
xs: "h-(--button-height-xs) rounded-(--button-radius-xs) gap-1 px-2.5 text-(length:--button-font-size-xs) has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2 [&_svg:not([class*='size-'])]:size-2.5",
|
|
43
|
-
sm: "h-(--button-height-sm) rounded-(--button-radius-sm) gap-1 px-2.5 text-(length:--button-font-size-sm)/relaxed has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2 [&_svg:not([class*='size-'])]:size-3",
|
|
44
|
-
lg: "h-(--button-height-lg) gap-(--button-gap) px-3.5 text-(length:--button-font-size)/relaxed has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3 [&_svg:not([class*='size-'])]:size-4",
|
|
49
|
+
sm: "h-(--button-height-sm) min-w-[calc(var(--button-height-sm)*var(--button-min-width-ratio))] rounded-(--button-radius-sm) gap-1 px-2.5 text-(length:--button-font-size-sm)/relaxed has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2 [&_svg:not([class*='size-'])]:size-3",
|
|
50
|
+
lg: "h-(--button-height-lg) min-w-[calc(var(--button-height-lg)*var(--button-min-width-ratio))] gap-(--button-gap) px-3.5 text-(length:--button-font-size)/relaxed has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3 [&_svg:not([class*='size-'])]:size-4",
|
|
45
51
|
icon: "size-(--button-height) [&_svg:not([class*='size-'])]:size-3.5",
|
|
46
52
|
'icon-xs':
|
|
47
53
|
"size-(--button-height-xs) rounded-(--button-radius-xs) [&_svg:not([class*='size-'])]:size-2.5",
|
|
@@ -56,6 +62,8 @@ const buttonVariants = cva(
|
|
|
56
62
|
pill: 'rounded-full',
|
|
57
63
|
},
|
|
58
64
|
},
|
|
65
|
+
// Links sit inline with text: no control height or side padding.
|
|
66
|
+
compoundVariants: [{ variant: 'link', class: 'h-auto min-w-0 px-0' }],
|
|
59
67
|
defaultVariants: {
|
|
60
68
|
variant: 'default',
|
|
61
69
|
size: 'default',
|
|
@@ -22,7 +22,7 @@ function Calendar({
|
|
|
22
22
|
<DayPicker
|
|
23
23
|
showOutsideDays={showOutsideDays}
|
|
24
24
|
className={cn(
|
|
25
|
-
'p-3 [--cell-radius:var(--radius-md)] [--cell-size:--spacing(8)] bg-page rounded-lg border shadow-sm group/calendar [[data-slot=card-content]_&]:bg-transparent [[data-slot=card-content]_&]:border-0 [[data-slot=card-content]_&]:shadow-none [[data-slot=popover-content]_&]:bg-transparent [[data-slot=popover-content]_&]:border-0 [[data-slot=popover-content]_&]:shadow-none
|
|
25
|
+
'p-3 [--cell-radius:var(--radius-md)] [--cell-size:--spacing(8)] bg-page rounded-lg border shadow-sm group/calendar [[data-slot=card-content]_&]:bg-transparent [[data-slot=card-content]_&]:border-0 [[data-slot=card-content]_&]:shadow-none [[data-slot=popover-content]_&]:bg-transparent [[data-slot=popover-content]_&]:border-0 [[data-slot=popover-content]_&]:shadow-none',
|
|
26
26
|
String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,
|
|
27
27
|
String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
|
|
28
28
|
className,
|
|
@@ -80,7 +80,7 @@ function Calendar({
|
|
|
80
80
|
week_number_header: cn('select-none w-(--cell-size)', defaultClassNames.week_number_header),
|
|
81
81
|
week_number: cn('text-xs select-none text-muted-foreground', defaultClassNames.week_number),
|
|
82
82
|
day: cn(
|
|
83
|
-
'relative w-full rounded-(--cell-radius) h-full p-0 text-center [&:last-child[data-selected=true]_button]:rounded-r-(--cell-radius) group/day aspect-square select-none',
|
|
83
|
+
'relative flex w-full items-center justify-center rounded-(--cell-radius) h-full p-0 text-center text-(length:--body-font-size) leading-none [&:last-child[data-selected=true]_button]:rounded-r-(--cell-radius) group/day aspect-square select-none',
|
|
84
84
|
props.showWeekNumber
|
|
85
85
|
? '[&:nth-child(2)[data-selected=true]_button]:rounded-l-(--cell-radius)'
|
|
86
86
|
: '[&:first-child[data-selected=true]_button]:rounded-l-(--cell-radius)',
|
|
@@ -167,7 +167,7 @@ function CalendarDayButton({
|
|
|
167
167
|
data-range-end={modifiers.range_end}
|
|
168
168
|
data-range-middle={modifiers.range_middle}
|
|
169
169
|
className={cn(
|
|
170
|
-
'data-[selected-single=true]:bg-
|
|
170
|
+
'data-[selected-single=true]:bg-selected data-[selected-single=true]:text-selected-foreground data-[selected-single=true]:hover:bg-selected/90 data-[range-middle=true]:bg-muted data-[range-middle=true]:text-foreground data-[range-start=true]:bg-selected data-[range-start=true]:text-selected-foreground data-[range-end=true]:bg-selected data-[range-end=true]:text-selected-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-[color:var(--focus-ring-color)]/50 dark:hover:text-foreground relative isolate z-10 flex aspect-square h-auto w-full flex-col gap-1 rounded-(--cell-radius) border-0 text-(length:--body-font-size) leading-none font-normal transition-colors group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[length:var(--focus-ring-width)] data-[range-end=true]:rounded-r-(--cell-radius) data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-l-(--cell-radius) [&>span]:text-[0.75em] [&>span]:opacity-70',
|
|
171
171
|
defaultClassNames.day,
|
|
172
172
|
className,
|
|
173
173
|
)}
|