@leitware/composables 2.0.0 → 3.1.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 +13 -12
- package/rules/composables.md +24 -21
- package/skills/use-composables/references/public-api.md +2 -2
- package/skills/use-composables/references/semantic-utilities.md +5 -0
- package/src/_internal/accordion.tsx +10 -10
- package/src/_internal/ai-elements/reasoning.tsx +2 -0
- 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 +25 -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/command.tsx +23 -0
- package/src/opinionated/data-grid.tsx +125 -0
- 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.1.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -13,7 +13,9 @@
|
|
|
13
13
|
"dist",
|
|
14
14
|
"rules",
|
|
15
15
|
"skills",
|
|
16
|
-
"src"
|
|
16
|
+
"src",
|
|
17
|
+
"!src/**/*.stories.tsx",
|
|
18
|
+
"!src/_storybook"
|
|
17
19
|
],
|
|
18
20
|
"exports": {
|
|
19
21
|
".": "./src/index.ts",
|
|
@@ -23,7 +25,7 @@
|
|
|
23
25
|
"./presets/*": "./dist/presets/*"
|
|
24
26
|
},
|
|
25
27
|
"scripts": {
|
|
26
|
-
"dev": "
|
|
28
|
+
"dev": "storybook dev -p 6006",
|
|
27
29
|
"lint": "oxlint",
|
|
28
30
|
"format": "oxfmt --write .",
|
|
29
31
|
"format:check": "oxfmt --check .",
|
|
@@ -32,19 +34,20 @@
|
|
|
32
34
|
"generate:palette": "bun scripts/generate-css.ts",
|
|
33
35
|
"generate:presets": "bun scripts/generate-preset-css.ts",
|
|
34
36
|
"generate:css": "bun run generate:palette && bun run generate:presets",
|
|
35
|
-
"generate:showcase-routes": "bun scripts/generate-showcase-routes.ts",
|
|
36
37
|
"generate:rules": "bun scripts/generate-rules.ts",
|
|
37
38
|
"build:css": "bun scripts/build-css.ts",
|
|
38
39
|
"prepack": "bun run build:css",
|
|
39
40
|
"test:tokens": "bun scripts/check-token-system.ts",
|
|
40
41
|
"test:rules": "bun scripts/generate-rules.ts --check",
|
|
41
42
|
"test:css": "bun scripts/test-downstream-css.ts",
|
|
42
|
-
"deploy:showcase": "./scripts/deploy-showcase.sh"
|
|
43
|
+
"deploy:showcase": "./scripts/deploy-showcase.sh",
|
|
44
|
+
"build:storybook": "storybook build -o showcase/dist && bun scripts/prepare-storybook.ts"
|
|
43
45
|
},
|
|
44
46
|
"dependencies": {
|
|
45
47
|
"@base-ui/react": "^1.6.0",
|
|
46
48
|
"class-variance-authority": "^0.7.1",
|
|
47
49
|
"clsx": "^2.1.1",
|
|
50
|
+
"cmdk": "^1.1.1",
|
|
48
51
|
"embla-carousel-react": "^8.6.0",
|
|
49
52
|
"lucide-react": "^1.23.0",
|
|
50
53
|
"radix-ui": "^1.0.0",
|
|
@@ -78,7 +81,6 @@
|
|
|
78
81
|
"use-stick-to-bottom": "^1.0.0",
|
|
79
82
|
"nanoid": "^5.0.0",
|
|
80
83
|
"@radix-ui/react-use-controllable-state": "^1.0.0",
|
|
81
|
-
"cmdk": "^1.0.0",
|
|
82
84
|
"motion": "^12.0.0"
|
|
83
85
|
},
|
|
84
86
|
"peerDependenciesMeta": {
|
|
@@ -142,9 +144,6 @@
|
|
|
142
144
|
"@radix-ui/react-use-controllable-state": {
|
|
143
145
|
"optional": true
|
|
144
146
|
},
|
|
145
|
-
"cmdk": {
|
|
146
|
-
"optional": true
|
|
147
|
-
},
|
|
148
147
|
"motion": {
|
|
149
148
|
"optional": true
|
|
150
149
|
}
|
|
@@ -161,20 +160,21 @@
|
|
|
161
160
|
"@fontsource/ibm-plex-mono": "^5.2.7",
|
|
162
161
|
"@fontsource/ibm-plex-sans": "^5.2.8",
|
|
163
162
|
"@radix-ui/react-use-controllable-state": "^1.2.3",
|
|
163
|
+
"@storybook/addon-a11y": "^10.6.2",
|
|
164
|
+
"@storybook/addon-docs": "^10.6.2",
|
|
165
|
+
"@storybook/addon-links": "^10.6.2",
|
|
166
|
+
"@storybook/react-vite": "^10.6.2",
|
|
164
167
|
"@streamdown/cjk": "^1.0.3",
|
|
165
168
|
"@streamdown/code": "^1.1.1",
|
|
166
169
|
"@streamdown/math": "^1.0.2",
|
|
167
170
|
"@streamdown/mermaid": "^1.0.2",
|
|
168
171
|
"@tailwindcss/cli": "^4.3.2",
|
|
169
172
|
"@tailwindcss/vite": "^4.3.2",
|
|
170
|
-
"@tanstack/react-router": "^1.170.17",
|
|
171
|
-
"@tanstack/router-plugin": "^1.168.19",
|
|
172
173
|
"@types/node": "^26.1.0",
|
|
173
174
|
"@types/react": "^19.2.17",
|
|
174
175
|
"@types/react-dom": "^19.2.3",
|
|
175
176
|
"@vitejs/plugin-react": "^6.0.3",
|
|
176
177
|
"ai": "^7.0.14",
|
|
177
|
-
"cmdk": "^1.1.1",
|
|
178
178
|
"motion": "^12.42.2",
|
|
179
179
|
"nanoid": "^5.1.16",
|
|
180
180
|
"oxfmt": "^0.57.0",
|
|
@@ -183,6 +183,7 @@
|
|
|
183
183
|
"react-dom": "^19.2.7",
|
|
184
184
|
"shadcn": "^4.13.0",
|
|
185
185
|
"shiki": "^4.3.0",
|
|
186
|
+
"storybook": "^10.6.2",
|
|
186
187
|
"streamdown": "^2.5.0",
|
|
187
188
|
"tailwindcss": "^4.3.2",
|
|
188
189
|
"tw-animate-css": "^1.4.0",
|
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
|
|
|
@@ -179,18 +179,21 @@ Use this catalog to choose public exports. The `Source module` column is for mai
|
|
|
179
179
|
|
|
180
180
|
### Other Public Exports
|
|
181
181
|
|
|
182
|
-
| Module | Source module | Import from | Public values | Public types
|
|
183
|
-
| --------------------------------- | ----------------------------------------- | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
184
|
-
| `aspect-ratio` | `./opinionated/aspect-ratio` | `@leitware/composables` | `AspectRatio` | -
|
|
185
|
-
| `
|
|
186
|
-
| `
|
|
187
|
-
| `
|
|
188
|
-
| `
|
|
189
|
-
| `
|
|
190
|
-
| `
|
|
191
|
-
| `
|
|
192
|
-
| `
|
|
193
|
-
| `
|
|
182
|
+
| Module | Source module | Import from | Public values | Public types | Description |
|
|
183
|
+
| --------------------------------- | ----------------------------------------- | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------- | --------------------------------------------------------- |
|
|
184
|
+
| `aspect-ratio` | `./opinionated/aspect-ratio` | `@leitware/composables` | `AspectRatio` | - | Public export not listed in the README component catalog. |
|
|
185
|
+
| `command` | `./opinionated/command` | `@leitware/composables` | `Command`, `CommandDialog`, `CommandEmpty`, `CommandGroup`, `CommandInput`, `CommandItem`, `CommandList`, `CommandSeparator`, `CommandShortcut` | - | Public export not listed in the README component catalog. |
|
|
186
|
+
| `data-grid` | `./opinionated/data-grid` | `@leitware/composables` | `DataGrid`, `DataLabel`, `DataRow`, `DataValue` | `DataGridProps`, `DataLabelProps`, `DataRowProps`, `DataValueProps` | Public export not listed in the README component catalog. |
|
|
187
|
+
| `direction` | `./opinionated/direction` | `@leitware/composables` | `DirectionProvider`, `useDirection` | `DirectionProviderProps`, `TextDirection` | Public export not listed in the README component catalog. |
|
|
188
|
+
| `field` | `./opinionated/field` | `@leitware/composables` | `Field`, `FieldContent`, `FieldDescription`, `FieldError`, `FieldGroup`, `FieldLabel`, `FieldLegend`, `FieldSeparator`, `FieldSet`, `FieldTitle` | - | Public export not listed in the README component catalog. |
|
|
189
|
+
| `grid-overlay` | `./opinionated/grid-overlay` | `@leitware/composables` | `GridOverlay` | `GridOverlayProps` | Public export not listed in the README component catalog. |
|
|
190
|
+
| `input-group` | `./opinionated/input-group` | `@leitware/composables` | `InputGroup`, `InputGroupAddon`, `InputGroupButton`, `InputGroupInput`, `InputGroupTextarea` | - | Public export not listed in the README component catalog. |
|
|
191
|
+
| `input` | `./opinionated/input` | `@leitware/composables` | `Input` | - | Public export not listed in the README component catalog. |
|
|
192
|
+
| `label` | `./opinionated/label` | `@leitware/composables` | `Label` | - | Public export not listed in the README component catalog. |
|
|
193
|
+
| `spinner` | `./opinionated/spinner` | `@leitware/composables` | `Spinner`, `spinnerVariants` | - | Public export not listed in the README component catalog. |
|
|
194
|
+
| `textarea` | `./opinionated/textarea` | `@leitware/composables` | `Textarea` | - | Public export not listed in the README component catalog. |
|
|
195
|
+
| `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. |
|
|
196
|
+
| `window-frame` | `./opinionated/window-frame` | `@leitware/composables` | `WindowFrame` | `WindowFrameProps` | Public export not listed in the README component catalog. |
|
|
194
197
|
|
|
195
198
|
## AI Entrypoint Catalog
|
|
196
199
|
|
|
@@ -6,8 +6,8 @@ This is the exact installed-package entrypoint and export-name contract. Import
|
|
|
6
6
|
|
|
7
7
|
## `@leitware/composables`
|
|
8
8
|
|
|
9
|
-
- Values (
|
|
10
|
-
- Types (
|
|
9
|
+
- Values (359): `ACCEPT_PRESETS`, `Accordion`, `AccordionContent`, `AccordionItem`, `AccordionTrigger`, `Alert`, `AlertAction`, `AlertDescription`, `AlertDialog`, `AlertDialogAction`, `AlertDialogCancel`, `AlertDialogContent`, `AlertDialogDescription`, `AlertDialogFooter`, `AlertDialogHeader`, `AlertDialogMedia`, `AlertDialogOverlay`, `AlertDialogPortal`, `AlertDialogTitle`, `AlertDialogTrigger`, `AlertTitle`, `AspectRatio`, `Avatar`, `AvatarFallback`, `AvatarImage`, `avatarVariants`, `Badge`, `BentoCell`, `BentoGrid`, `BentoLeader`, `BentoQuad`, `BentoSplit`, `BentoTriple`, `Breadcrumb`, `BreadcrumbEllipsis`, `BreadcrumbItem`, `BreadcrumbLink`, `BreadcrumbList`, `BreadcrumbPage`, `BreadcrumbSeparator`, `Bubble`, `BubbleContent`, `BubbleGroup`, `BubbleReactions`, `bubbleReactionsVariants`, `bubbleVariants`, `Button`, `Calendar`, `CalendarDayButton`, `Card`, `CardAction`, `CardContent`, `CardDescription`, `CardFooter`, `CardHeader`, `CardTitle`, `Carousel`, `CarouselContent`, `CarouselItem`, `CarouselNext`, `CarouselPrevious`, `CellGrid`, `CellRow`, `Checkbox`, `ClipboardText`, `cn`, `CodeBlock`, `Collapsible`, `CollapsibleContent`, `CollapsibleTrigger`, `Combobox`, `ComboboxChip`, `ComboboxChips`, `ComboboxChipsInput`, `ComboboxCollection`, `ComboboxContent`, `ComboboxEmpty`, `ComboboxGroup`, `ComboboxInput`, `ComboboxItem`, `ComboboxLabel`, `ComboboxList`, `ComboboxSeparator`, `ComboboxTrigger`, `ComboboxValue`, `Command`, `CommandDialog`, `CommandEmpty`, `CommandGroup`, `CommandInput`, `CommandItem`, `CommandList`, `CommandSeparator`, `CommandShortcut`, `Container`, `containerVariants`, `DataGrid`, `DataLabel`, `DataRow`, `DataValue`, `DEFAULT_ACCEPT`, `DEFAULT_MAX_SIZE`, `Dialog`, `DialogClose`, `DialogContent`, `DialogDescription`, `DialogFooter`, `DialogHeader`, `DialogOverlay`, `DialogPortal`, `DialogTitle`, `DialogTrigger`, `DirectionProvider`, `DISABLED_OPACITY`, `Divider`, `dividerVariants`, `DropdownMenu`, `DropdownMenuCheckboxItem`, `DropdownMenuContent`, `DropdownMenuGroup`, `DropdownMenuItem`, `DropdownMenuLabel`, `DropdownMenuPortal`, `DropdownMenuRadioGroup`, `DropdownMenuRadioItem`, `DropdownMenuSeparator`, `DropdownMenuShortcut`, `DropdownMenuSub`, `DropdownMenuSubContent`, `DropdownMenuSubTrigger`, `DropdownMenuTrigger`, `Dropzone`, `DropZone`, `DropZoneArea`, `DropzoneContent`, `DropZoneContent`, `DropZoneFile`, `DropZoneFileList`, `DropzoneInput`, `DropZoneInput`, `DropzoneLabel`, `Empty`, `EmptyContent`, `EmptyDescription`, `EmptyHeader`, `EmptyMedia`, `EmptyTableState`, `EmptyTitle`, `Field`, `FieldContent`, `FieldDescription`, `FieldError`, `FieldGroup`, `FieldLabel`, `FieldLegend`, `FieldSeparator`, `FieldSet`, `FieldTitle`, `FlexSpacer`, `Flow`, `FlowAnchor`, `FlowList`, `FlowNode`, `FlowParallel`, `FlowRoot`, `FOCUS_RING`, `FOCUS_RING_DESTRUCTIVE`, `formatFileSize`, `formatNumericValue`, `FormCalendarPopover`, `FormCheckbox`, `FormCombobox`, `FormDateOfBirth`, `FormDropZone`, `FormInput`, `FormInputGroup`, `FormMultiCombobox`, `FormMultiDropZone`, `FormRadioGroup`, `FormSelect`, `FormSlider`, `FormSwitch`, `FormTextarea`, `getAcceptDescription`, `getRejectionMessage`, `Grid`, `GridOverlay`, `gridVariants`, `HoverCard`, `HoverCardContent`, `HoverCardTrigger`, `Icon`, `iconVariants`, `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
|
+
- Types (116): `Accept`, `AccordionItemData`, `AccordionProps`, `AccordionVariant`, `AlertDialogProps`, `AlertProps`, `AlertType`, `AlertVariant`, `AvatarProps`, `BadgeProps`, `BreadcrumbItemData`, `BreadcrumbProps`, `BubbleProps`, `ButtonProps`, `CardProps`, `CarouselProps`, `ClipboardTextProps`, `ClipboardTextSize`, `ClipboardTextStatus`, `CodeBlockProps`, `CollapsibleProps`, `ComboboxOption`, `ComboboxProps`, `ContainerProps`, `DataGridProps`, `DataLabelProps`, `DataRowProps`, `DataValueProps`, `DateOfBirthValue`, `DialogProps`, `DirectionProviderProps`, `DividerProps`, `DropdownMenuItemData`, `DropdownMenuProps`, `DropZoneFileProps`, `DropZoneProps`, `EmptyProps`, `EmptyTableStateProps`, `FileRejection`, `FlowAlign`, `FlowAnchorProps`, `FlowBranch`, `FlowItem`, `FlowNodeProps`, `FlowOrientation`, `FlowProps`, `FlowRootProps`, `FlowStep`, `FormCalendarPopoverProps`, `FormCheckboxProps`, `FormComboboxOption`, `FormComboboxProps`, `FormDateOfBirthProps`, `FormDropZoneProps`, `FormInputGroupInputProps`, `FormInputGroupProps`, `FormInputProps`, `FormMultiComboboxOption`, `FormMultiComboboxProps`, `FormMultiDropZoneProps`, `FormRadioGroupOption`, `FormRadioGroupProps`, `FormSelectOption`, `FormSelectProps`, `FormSliderProps`, `FormSwitchProps`, `FormTextareaProps`, `GridOverlayProps`, `GridProps`, `HoverCardProps`, `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`
|
|
13
13
|
|
|
@@ -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: {
|