@leitware/composables 0.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/LICENSE +21 -0
- package/README.md +387 -0
- package/dist/presets/brutalist.css +298 -0
- package/dist/presets/default.css +298 -0
- package/dist/presets/signal-pop.css +369 -0
- package/dist/styles.css +2 -0
- package/package.json +216 -0
- package/rules/composables.md +244 -0
- package/src/_internal/accordion.tsx +93 -0
- package/src/_internal/ai-elements/attachments.tsx +385 -0
- package/src/_internal/ai-elements/chain-of-thought.tsx +197 -0
- package/src/_internal/ai-elements/code-block.tsx +516 -0
- package/src/_internal/ai-elements/confirmation.tsx +150 -0
- package/src/_internal/ai-elements/conversation.tsx +148 -0
- package/src/_internal/ai-elements/inline-citation.tsx +248 -0
- package/src/_internal/ai-elements/message.tsx +292 -0
- package/src/_internal/ai-elements/plan.tsx +126 -0
- package/src/_internal/ai-elements/prompt-input.tsx +1285 -0
- package/src/_internal/ai-elements/reasoning.tsx +208 -0
- package/src/_internal/ai-elements/shimmer.tsx +72 -0
- package/src/_internal/ai-elements/sources.tsx +53 -0
- package/src/_internal/ai-elements/suggestion.tsx +48 -0
- package/src/_internal/ai-elements/task.tsx +64 -0
- package/src/_internal/ai-elements/tool.tsx +156 -0
- package/src/_internal/alert-dialog.tsx +159 -0
- package/src/_internal/alert.tsx +88 -0
- package/src/_internal/aspect-ratio.tsx +23 -0
- package/src/_internal/avatar.tsx +58 -0
- package/src/_internal/badge.tsx +60 -0
- package/src/_internal/breadcrumb.tsx +104 -0
- package/src/_internal/bubble.tsx +125 -0
- package/src/_internal/button-group.tsx +78 -0
- package/src/_internal/button.tsx +62 -0
- package/src/_internal/calendar.tsx +179 -0
- package/src/_internal/card.tsx +83 -0
- package/src/_internal/carousel.tsx +215 -0
- package/src/_internal/checkbox.tsx +26 -0
- package/src/_internal/code-block.tsx +53 -0
- package/src/_internal/collapsible.tsx +15 -0
- package/src/_internal/combobox.tsx +264 -0
- package/src/_internal/command.tsx +155 -0
- package/src/_internal/container.tsx +35 -0
- package/src/_internal/dialog.tsx +132 -0
- package/src/_internal/direction.tsx +12 -0
- package/src/_internal/divider.tsx +162 -0
- package/src/_internal/dropdown-menu.tsx +247 -0
- package/src/_internal/dropzone.tsx +481 -0
- package/src/_internal/empty.tsx +94 -0
- package/src/_internal/field.tsx +221 -0
- package/src/_internal/grid-overlay.tsx +48 -0
- package/src/_internal/grid.tsx +109 -0
- package/src/_internal/hover-card.tsx +47 -0
- package/src/_internal/icon.tsx +45 -0
- package/src/_internal/input-group.tsx +146 -0
- package/src/_internal/input.tsx +24 -0
- package/src/_internal/item.tsx +187 -0
- package/src/_internal/kbd.tsx +28 -0
- package/src/_internal/label.tsx +18 -0
- package/src/_internal/layout-bento.tsx +386 -0
- package/src/_internal/layout.tsx +174 -0
- package/src/_internal/marker.tsx +66 -0
- package/src/_internal/message.tsx +85 -0
- package/src/_internal/native-select.tsx +50 -0
- package/src/_internal/pagination.tsx +108 -0
- package/src/_internal/popover.tsx +83 -0
- package/src/_internal/progress.tsx +59 -0
- package/src/_internal/radio-group.tsx +36 -0
- package/src/_internal/resizable.tsx +44 -0
- package/src/_internal/scroll-area.tsx +48 -0
- package/src/_internal/select.tsx +187 -0
- package/src/_internal/separator.tsx +19 -0
- package/src/_internal/sheet.tsx +122 -0
- package/src/_internal/sidebar.tsx +687 -0
- package/src/_internal/skeleton.tsx +13 -0
- package/src/_internal/slider.tsx +60 -0
- package/src/_internal/sonner.tsx +51 -0
- package/src/_internal/spacer.tsx +42 -0
- package/src/_internal/spinner.tsx +16 -0
- package/src/_internal/stack.tsx +78 -0
- package/src/_internal/switch.tsx +31 -0
- package/src/_internal/table.tsx +84 -0
- package/src/_internal/tabs.tsx +74 -0
- package/src/_internal/textarea.tsx +19 -0
- package/src/_internal/toggle-group.tsx +99 -0
- package/src/_internal/toggle.tsx +42 -0
- package/src/_internal/tooltip.tsx +55 -0
- package/src/_internal/typography.tsx +129 -0
- package/src/hooks/use-mobile.ts +19 -0
- package/src/hooks/use-numeric-input.ts +119 -0
- package/src/index.ts +443 -0
- package/src/lib/numeric-input.ts +88 -0
- package/src/lib/utils.ts +39 -0
- package/src/opinionated/accordion.tsx +92 -0
- package/src/opinionated/ai/attachments.tsx +27 -0
- package/src/opinionated/ai/chain-of-thought.tsx +16 -0
- package/src/opinionated/ai/code-block.tsx +22 -0
- package/src/opinionated/ai/confirmation.tsx +16 -0
- package/src/opinionated/ai/conversation.tsx +13 -0
- package/src/opinionated/ai/index.ts +15 -0
- package/src/opinionated/ai/inline-citation.tsx +30 -0
- package/src/opinionated/ai/message.tsx +26 -0
- package/src/opinionated/ai/plan.tsx +18 -0
- package/src/opinionated/ai/prompt-input.tsx +29 -0
- package/src/opinionated/ai/reasoning.tsx +9 -0
- package/src/opinionated/ai/shimmer.tsx +4 -0
- package/src/opinionated/ai/sources.tsx +10 -0
- package/src/opinionated/ai/suggestion.tsx +6 -0
- package/src/opinionated/ai/task.tsx +12 -0
- package/src/opinionated/ai/tool.tsx +14 -0
- package/src/opinionated/alert-dialog.tsx +143 -0
- package/src/opinionated/alert.tsx +99 -0
- package/src/opinionated/aspect-ratio.tsx +12 -0
- package/src/opinionated/avatar.tsx +59 -0
- package/src/opinionated/badge.tsx +33 -0
- package/src/opinionated/breadcrumb.tsx +99 -0
- package/src/opinionated/bubble.tsx +9 -0
- package/src/opinionated/button.tsx +59 -0
- package/src/opinionated/calendar.tsx +20 -0
- package/src/opinionated/card.tsx +83 -0
- package/src/opinionated/carousel.tsx +99 -0
- package/src/opinionated/checkbox.tsx +11 -0
- package/src/opinionated/code-block.tsx +12 -0
- package/src/opinionated/collapsible.tsx +123 -0
- package/src/opinionated/combobox.tsx +123 -0
- package/src/opinionated/container.tsx +12 -0
- package/src/opinionated/dialog.tsx +124 -0
- package/src/opinionated/direction.tsx +6 -0
- package/src/opinionated/divider.tsx +13 -0
- package/src/opinionated/dropdown-menu.tsx +131 -0
- package/src/opinionated/dropzone.tsx +39 -0
- package/src/opinionated/empty.tsx +191 -0
- package/src/opinionated/field.tsx +26 -0
- package/src/opinionated/form-calendar-popover.tsx +138 -0
- package/src/opinionated/form-checkbox.tsx +107 -0
- package/src/opinionated/form-combobox.tsx +181 -0
- package/src/opinionated/form-date-of-birth.tsx +193 -0
- package/src/opinionated/form-dropzone.tsx +126 -0
- package/src/opinionated/form-input-group.tsx +184 -0
- package/src/opinionated/form-input.tsx +118 -0
- package/src/opinionated/form-multi-combobox.tsx +213 -0
- package/src/opinionated/form-multi-dropzone.tsx +141 -0
- package/src/opinionated/form-radiogroup.tsx +116 -0
- package/src/opinionated/form-select.tsx +176 -0
- package/src/opinionated/form-slider.tsx +100 -0
- package/src/opinionated/form-switch.tsx +117 -0
- package/src/opinionated/form-textarea.tsx +79 -0
- package/src/opinionated/grid-overlay.tsx +11 -0
- package/src/opinionated/grid.tsx +14 -0
- package/src/opinionated/hover-card.tsx +59 -0
- package/src/opinionated/icon.tsx +14 -0
- package/src/opinionated/input-group.tsx +20 -0
- package/src/opinionated/input.tsx +11 -0
- package/src/opinionated/item.tsx +182 -0
- package/src/opinionated/kbd.tsx +16 -0
- package/src/opinionated/label.tsx +11 -0
- package/src/opinionated/layout-bento.tsx +29 -0
- package/src/opinionated/layout.tsx +26 -0
- package/src/opinionated/list.tsx +94 -0
- package/src/opinionated/marker.tsx +7 -0
- package/src/opinionated/message.tsx +8 -0
- package/src/opinionated/native-select.tsx +51 -0
- package/src/opinionated/pagination.tsx +204 -0
- package/src/opinionated/popover.tsx +68 -0
- package/src/opinionated/progress.tsx +48 -0
- package/src/opinionated/radio-group.tsx +13 -0
- package/src/opinionated/resizable.tsx +2 -0
- package/src/opinionated/scroll-area.tsx +82 -0
- package/src/opinionated/select.tsx +101 -0
- package/src/opinionated/separator.tsx +11 -0
- package/src/opinionated/sheet.tsx +120 -0
- package/src/opinionated/sidebar.tsx +68 -0
- package/src/opinionated/skeleton.tsx +246 -0
- package/src/opinionated/slider.tsx +11 -0
- package/src/opinionated/sonner.tsx +15 -0
- package/src/opinionated/spacer.tsx +11 -0
- package/src/opinionated/stack.tsx +18 -0
- package/src/opinionated/switch.tsx +11 -0
- package/src/opinionated/table.tsx +11 -0
- package/src/opinionated/tabs.tsx +68 -0
- package/src/opinionated/textarea.tsx +11 -0
- package/src/opinionated/theme-injector.tsx +31 -0
- package/src/opinionated/toggle-group.tsx +63 -0
- package/src/opinionated/toggle.tsx +75 -0
- package/src/opinionated/token-config-panel/color-editor.tsx +85 -0
- package/src/opinionated/token-config-panel/helpers.ts +31 -0
- package/src/opinionated/token-config-panel/index.tsx +398 -0
- package/src/opinionated/token-config-panel/json-import-export.tsx +89 -0
- package/src/opinionated/token-config-panel/preset-manager.ts +31 -0
- package/src/opinionated/token-config-panel/presets-data.ts +23 -0
- package/src/opinionated/token-config-panel/spacing-editor.tsx +325 -0
- package/src/opinionated/token-config-panel/types.ts +39 -0
- package/src/opinionated/token-config-panel/typography-editor.tsx +145 -0
- package/src/opinionated/tooltip.tsx +62 -0
- package/src/opinionated/typography.tsx +7 -0
- package/src/scripts/lint-no-arbitrary.ts +155 -0
- package/src/styles/composable.css +68 -0
- package/src/styles/presets/brutalist.css +298 -0
- package/src/styles/presets/default.css +298 -0
- package/src/styles/presets/signal-pop.css +369 -0
- package/src/styles/presets-data/brutalist.ts +325 -0
- package/src/styles/presets-data/default.ts +315 -0
- package/src/styles/presets-data/index.ts +45 -0
- package/src/styles/presets-data/signal-pop.ts +393 -0
- package/src/styles/tokens/base.css +71 -0
- package/src/styles/tokens/components.css +150 -0
- package/src/styles/tokens/palette.css +795 -0
- package/src/styles/tokens/registry.ts +324 -0
- package/src/styles/tokens/semantic.css +266 -0
- package/src/styles/tokens/tailwind-theme.css +247 -0
package/package.json
ADDED
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@leitware/composables",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"access": "public"
|
|
7
|
+
},
|
|
8
|
+
"files": [
|
|
9
|
+
"dist",
|
|
10
|
+
"rules",
|
|
11
|
+
"src"
|
|
12
|
+
],
|
|
13
|
+
"exports": {
|
|
14
|
+
".": "./src/index.ts",
|
|
15
|
+
"./ai": "./src/opinionated/ai/index.ts",
|
|
16
|
+
"./styles.css": "./dist/styles.css",
|
|
17
|
+
"./presets/*": "./dist/presets/*"
|
|
18
|
+
},
|
|
19
|
+
"scripts": {
|
|
20
|
+
"dev": "vite showcase",
|
|
21
|
+
"lint": "oxlint",
|
|
22
|
+
"format": "oxfmt --write .",
|
|
23
|
+
"format:check": "oxfmt --check .",
|
|
24
|
+
"typecheck": "tsc --noEmit",
|
|
25
|
+
"hooks:install": "git config core.hooksPath .githooks",
|
|
26
|
+
"generate:palette": "bun scripts/generate-css.ts",
|
|
27
|
+
"generate:presets": "bun scripts/generate-preset-css.ts",
|
|
28
|
+
"generate:css": "bun run generate:palette && bun run generate:presets",
|
|
29
|
+
"generate:showcase-routes": "bun scripts/generate-showcase-routes.ts",
|
|
30
|
+
"generate:rules": "bun scripts/generate-rules.ts",
|
|
31
|
+
"build:css": "bun scripts/build-css.ts",
|
|
32
|
+
"prepack": "bun run build:css",
|
|
33
|
+
"test:tokens": "bun scripts/check-token-system.ts",
|
|
34
|
+
"test:rules": "bun scripts/generate-rules.ts --check",
|
|
35
|
+
"test:css": "bun scripts/test-downstream-css.ts",
|
|
36
|
+
"deploy:showcase": "./scripts/deploy-showcase.sh"
|
|
37
|
+
},
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"@base-ui/react": "^1.6.0",
|
|
40
|
+
"class-variance-authority": "^0.7.1",
|
|
41
|
+
"clsx": "^2.1.1",
|
|
42
|
+
"lucide-react": "^1.23.0",
|
|
43
|
+
"tailwind-merge": "^3.6.0"
|
|
44
|
+
},
|
|
45
|
+
"peerDependencies": {
|
|
46
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
47
|
+
"react-dom": "^18.0.0 || ^19.0.0",
|
|
48
|
+
"@fontsource-variable/inter": "^5.0.0",
|
|
49
|
+
"@fontsource-variable/bricolage-grotesque": "^5.0.0",
|
|
50
|
+
"@fontsource-variable/dm-sans": "^5.0.0",
|
|
51
|
+
"@fontsource-variable/fraunces": "^5.0.0",
|
|
52
|
+
"@fontsource-variable/source-serif-4": "^5.0.0",
|
|
53
|
+
"@fontsource-variable/space-grotesk": "^5.0.0",
|
|
54
|
+
"@fontsource-variable/plus-jakarta-sans": "^5.0.0",
|
|
55
|
+
"@fontsource-variable/jetbrains-mono": "^5.0.0",
|
|
56
|
+
"@fontsource/ibm-plex-mono": "^5.0.0",
|
|
57
|
+
"@fontsource/ibm-plex-sans": "^5.0.0",
|
|
58
|
+
"ai": "^6.0.0 || ^7.0.0",
|
|
59
|
+
"shiki": "^4.0.0",
|
|
60
|
+
"streamdown": "^2.0.0",
|
|
61
|
+
"@streamdown/cjk": "^1.0.0",
|
|
62
|
+
"@streamdown/code": "^1.0.0",
|
|
63
|
+
"@streamdown/math": "^1.0.0",
|
|
64
|
+
"@streamdown/mermaid": "^1.0.0",
|
|
65
|
+
"use-stick-to-bottom": "^1.0.0",
|
|
66
|
+
"nanoid": "^5.0.0",
|
|
67
|
+
"@radix-ui/react-use-controllable-state": "^1.0.0",
|
|
68
|
+
"react-day-picker": "^9.0.0 || ^10.0.0",
|
|
69
|
+
"react-dropzone": "^15.0.0",
|
|
70
|
+
"embla-carousel-react": "^8.0.0",
|
|
71
|
+
"react-resizable-panels": "^4.0.0",
|
|
72
|
+
"sonner": "^2.0.0",
|
|
73
|
+
"cmdk": "^1.0.0",
|
|
74
|
+
"react-colorful": "^5.0.0",
|
|
75
|
+
"motion": "^12.0.0",
|
|
76
|
+
"radix-ui": "^1.0.0"
|
|
77
|
+
},
|
|
78
|
+
"peerDependenciesMeta": {
|
|
79
|
+
"@fontsource-variable/inter": {
|
|
80
|
+
"optional": true
|
|
81
|
+
},
|
|
82
|
+
"@fontsource-variable/bricolage-grotesque": {
|
|
83
|
+
"optional": true
|
|
84
|
+
},
|
|
85
|
+
"@fontsource-variable/dm-sans": {
|
|
86
|
+
"optional": true
|
|
87
|
+
},
|
|
88
|
+
"@fontsource-variable/fraunces": {
|
|
89
|
+
"optional": true
|
|
90
|
+
},
|
|
91
|
+
"@fontsource-variable/source-serif-4": {
|
|
92
|
+
"optional": true
|
|
93
|
+
},
|
|
94
|
+
"@fontsource-variable/space-grotesk": {
|
|
95
|
+
"optional": true
|
|
96
|
+
},
|
|
97
|
+
"@fontsource-variable/plus-jakarta-sans": {
|
|
98
|
+
"optional": true
|
|
99
|
+
},
|
|
100
|
+
"@fontsource-variable/jetbrains-mono": {
|
|
101
|
+
"optional": true
|
|
102
|
+
},
|
|
103
|
+
"@fontsource/ibm-plex-mono": {
|
|
104
|
+
"optional": true
|
|
105
|
+
},
|
|
106
|
+
"@fontsource/ibm-plex-sans": {
|
|
107
|
+
"optional": true
|
|
108
|
+
},
|
|
109
|
+
"ai": {
|
|
110
|
+
"optional": true
|
|
111
|
+
},
|
|
112
|
+
"shiki": {
|
|
113
|
+
"optional": true
|
|
114
|
+
},
|
|
115
|
+
"streamdown": {
|
|
116
|
+
"optional": true
|
|
117
|
+
},
|
|
118
|
+
"@streamdown/cjk": {
|
|
119
|
+
"optional": true
|
|
120
|
+
},
|
|
121
|
+
"@streamdown/code": {
|
|
122
|
+
"optional": true
|
|
123
|
+
},
|
|
124
|
+
"@streamdown/math": {
|
|
125
|
+
"optional": true
|
|
126
|
+
},
|
|
127
|
+
"@streamdown/mermaid": {
|
|
128
|
+
"optional": true
|
|
129
|
+
},
|
|
130
|
+
"use-stick-to-bottom": {
|
|
131
|
+
"optional": true
|
|
132
|
+
},
|
|
133
|
+
"nanoid": {
|
|
134
|
+
"optional": true
|
|
135
|
+
},
|
|
136
|
+
"@radix-ui/react-use-controllable-state": {
|
|
137
|
+
"optional": true
|
|
138
|
+
},
|
|
139
|
+
"react-day-picker": {
|
|
140
|
+
"optional": true
|
|
141
|
+
},
|
|
142
|
+
"react-dropzone": {
|
|
143
|
+
"optional": true
|
|
144
|
+
},
|
|
145
|
+
"embla-carousel-react": {
|
|
146
|
+
"optional": true
|
|
147
|
+
},
|
|
148
|
+
"react-resizable-panels": {
|
|
149
|
+
"optional": true
|
|
150
|
+
},
|
|
151
|
+
"sonner": {
|
|
152
|
+
"optional": true
|
|
153
|
+
},
|
|
154
|
+
"cmdk": {
|
|
155
|
+
"optional": true
|
|
156
|
+
},
|
|
157
|
+
"react-colorful": {
|
|
158
|
+
"optional": true
|
|
159
|
+
},
|
|
160
|
+
"motion": {
|
|
161
|
+
"optional": true
|
|
162
|
+
},
|
|
163
|
+
"radix-ui": {
|
|
164
|
+
"optional": true
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
"devDependencies": {
|
|
168
|
+
"@fontsource-variable/bricolage-grotesque": "^5.2.10",
|
|
169
|
+
"@fontsource-variable/dm-sans": "^5.2.8",
|
|
170
|
+
"@fontsource-variable/fraunces": "^5.2.9",
|
|
171
|
+
"@fontsource-variable/inter": "^5.2.8",
|
|
172
|
+
"@fontsource-variable/jetbrains-mono": "^5.2.8",
|
|
173
|
+
"@fontsource-variable/plus-jakarta-sans": "^5.2.8",
|
|
174
|
+
"@fontsource-variable/source-serif-4": "^5.2.9",
|
|
175
|
+
"@fontsource-variable/space-grotesk": "^5.2.10",
|
|
176
|
+
"@fontsource/ibm-plex-mono": "^5.2.7",
|
|
177
|
+
"@fontsource/ibm-plex-sans": "^5.2.8",
|
|
178
|
+
"@radix-ui/react-use-controllable-state": "^1.2.3",
|
|
179
|
+
"@streamdown/cjk": "^1.0.3",
|
|
180
|
+
"@streamdown/code": "^1.1.1",
|
|
181
|
+
"@streamdown/math": "^1.0.2",
|
|
182
|
+
"@streamdown/mermaid": "^1.0.2",
|
|
183
|
+
"@tailwindcss/cli": "^4.3.2",
|
|
184
|
+
"@tailwindcss/vite": "^4.3.2",
|
|
185
|
+
"@tanstack/react-router": "^1.170.17",
|
|
186
|
+
"@tanstack/router-plugin": "^1.168.19",
|
|
187
|
+
"@types/node": "^26.1.0",
|
|
188
|
+
"@types/react": "^19.2.17",
|
|
189
|
+
"@types/react-dom": "^19.2.3",
|
|
190
|
+
"@vitejs/plugin-react": "^6.0.3",
|
|
191
|
+
"ai": "^7.0.14",
|
|
192
|
+
"cmdk": "^1.1.1",
|
|
193
|
+
"embla-carousel-react": "^8.6.0",
|
|
194
|
+
"motion": "^12.42.2",
|
|
195
|
+
"nanoid": "^5.1.16",
|
|
196
|
+
"oxfmt": "^0.57.0",
|
|
197
|
+
"oxlint": "^1.72.0",
|
|
198
|
+
"radix-ui": "^1.6.1",
|
|
199
|
+
"react": "^19.2.7",
|
|
200
|
+
"react-colorful": "^5.7.0",
|
|
201
|
+
"react-day-picker": "^10.0.1",
|
|
202
|
+
"react-dom": "^19.2.7",
|
|
203
|
+
"react-dropzone": "^15.0.0",
|
|
204
|
+
"react-resizable-panels": "^4.12.0",
|
|
205
|
+
"shadcn": "^4.13.0",
|
|
206
|
+
"shiki": "^4.3.0",
|
|
207
|
+
"sonner": "^2.0.7",
|
|
208
|
+
"streamdown": "^2.5.0",
|
|
209
|
+
"tailwindcss": "^4.3.2",
|
|
210
|
+
"tw-animate-css": "^1.4.0",
|
|
211
|
+
"typescript": "^6.0.3",
|
|
212
|
+
"use-stick-to-bottom": "^1.1.6",
|
|
213
|
+
"vite": "^8.1.3",
|
|
214
|
+
"wrangler": "^4.107.0"
|
|
215
|
+
}
|
|
216
|
+
}
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
# @leitware/composables AI Usage Rules
|
|
2
|
+
|
|
3
|
+
Generated by `bun scripts/generate-rules.ts`. Do not hand-edit this file.
|
|
4
|
+
|
|
5
|
+
## Package Rules
|
|
6
|
+
|
|
7
|
+
- Install with `npm install @leitware/composables`.
|
|
8
|
+
- Import normal components, hooks, and utilities from `@leitware/composables`.
|
|
9
|
+
- Import AI components from `@leitware/composables/ai`.
|
|
10
|
+
- Import `@leitware/composables/styles.css` once in root/global CSS before using components.
|
|
11
|
+
- Import at most one preset after the base styles, for example `@leitware/composables/presets/brutalist.css`.
|
|
12
|
+
- Prefer `Form*` components when building labeled fields with description, validation, or error text.
|
|
13
|
+
- Prefer array APIs where provided, such as `Tabs`, `Breadcrumb`, `Pagination`, `Accordion`, `Carousel`, and form selects.
|
|
14
|
+
- Do not import from `src/_internal` or package-internal file paths in downstream apps.
|
|
15
|
+
- Use semantic token utilities such as `bg-surface-*`, `text-*`, `border-*`, `stroke-*`, and `icon-*` rather than arbitrary colors.
|
|
16
|
+
- Use `cn` from the package when composing class names.
|
|
17
|
+
|
|
18
|
+
## Required CSS
|
|
19
|
+
|
|
20
|
+
```css
|
|
21
|
+
@import '@leitware/composables/styles.css';
|
|
22
|
+
|
|
23
|
+
/* Optional: apply exactly one preset after the base styles. */
|
|
24
|
+
@import '@leitware/composables/presets/brutalist.css';
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Entrypoints
|
|
28
|
+
|
|
29
|
+
| Import | Source |
|
|
30
|
+
| ---------------------------------- | ------------------------------- |
|
|
31
|
+
| `@leitware/composables` | `./src/index.ts` |
|
|
32
|
+
| `@leitware/composables/ai` | `./src/opinionated/ai/index.ts` |
|
|
33
|
+
| `@leitware/composables/styles.css` | `./dist/styles.css` |
|
|
34
|
+
| `@leitware/composables/presets/*` | `./dist/presets/*` |
|
|
35
|
+
|
|
36
|
+
## Optional Dependencies
|
|
37
|
+
|
|
38
|
+
| Install when using… | Package |
|
|
39
|
+
| ----------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
40
|
+
| `Calendar`, `FormCalendarPopover` | `react-day-picker` |
|
|
41
|
+
| `Carousel` | `embla-carousel-react` |
|
|
42
|
+
| `Dropzone`, `FormDropzone`, `FormMultiDropzone` | `react-dropzone` |
|
|
43
|
+
| `ResizablePanels` | `react-resizable-panels` |
|
|
44
|
+
| `Sonner` (toasts) | `sonner` |
|
|
45
|
+
| AI elements from `@leitware/composables/ai` | `ai`, `shiki`, `streamdown`, `@streamdown/cjk`, `@streamdown/code`, `@streamdown/math`, `@streamdown/mermaid`, `use-stick-to-bottom`, `nanoid`, `@radix-ui/react-use-controllable-state` |
|
|
46
|
+
| `ThemeInjector` / `TokenConfigPanel` | `react-colorful` |
|
|
47
|
+
| Default preset fonts | `@fontsource-variable/inter` |
|
|
48
|
+
| Brutalist preset fonts | `@fontsource-variable/space-grotesk`, `@fontsource-variable/jetbrains-mono` |
|
|
49
|
+
|
|
50
|
+
## Component Catalog
|
|
51
|
+
|
|
52
|
+
Use this catalog to choose public exports. The `Source module` column is for maintainers; downstream apps should import from the package entrypoint.
|
|
53
|
+
|
|
54
|
+
### Foundation
|
|
55
|
+
|
|
56
|
+
| Module | Source module | Import from | Public values | Public types | Description |
|
|
57
|
+
| --------------- | --------------------- | ---------------------------------- | --------------------------------------------------------------------------- | ------------- | ------------------------------------------------------------- |
|
|
58
|
+
| `utils` | `./lib/utils` | `@leitware/composables` | `cn`, `DISABLED_OPACITY`, `FOCUS_RING`, `FOCUS_RING_DESTRUCTIVE`, `leftPad` | - | Utility functions for className merging and focus ring styles |
|
|
59
|
+
| `styles` | `./styles.css` | `@leitware/composables/styles.css` | `styles.css` | - | Base design system CSS styles and theme tokens |
|
|
60
|
+
| `numeric-input` | `./lib/numeric-input` | `@leitware/composables` | `formatNumericValue`, `parseNumericValue`, `sanitizeNumericInput` | `NumericMode` | Numeric input parsing and formatting utilities |
|
|
61
|
+
|
|
62
|
+
### Hooks
|
|
63
|
+
|
|
64
|
+
| Module | Source module | Import from | Public values | Public types | Description |
|
|
65
|
+
| -------------------- | ---------------------------------- | ----------------------- | ----------------- | ------------------------------------------------------------------------ | ------------------------------------------------------------- |
|
|
66
|
+
| `use-mobile` | `./hooks/use-mobile` | `@leitware/composables` | `useIsMobile` | - | Hook to detect mobile viewport breakpoint |
|
|
67
|
+
| `use-numeric-input` | `./hooks/use-numeric-input` | `@leitware/composables` | `useNumericInput` | `NumericInputOptions`, `UseNumericInputOptions`, `UseNumericInputReturn` | Hook for numeric input handling with sanitization and parsing |
|
|
68
|
+
| `direction-provider` | `./opinionated/direction-provider` | `@leitware/composables` | - | - | Base UI reading-direction provider with `useDirection` |
|
|
69
|
+
|
|
70
|
+
### Layout
|
|
71
|
+
|
|
72
|
+
| Module | Source module | Import from | Public values | Public types | Description |
|
|
73
|
+
| -------------- | ---------------------------- | ----------------------- | ---------------------------------------------------------- | ----------------- | ----------------------------------------------------------- |
|
|
74
|
+
| `stack` | `./opinionated/stack` | `@leitware/composables` | `Stack` | - | Flex-based vertical or horizontal stack layout |
|
|
75
|
+
| `grid` | `./opinionated/grid` | `@leitware/composables` | `Grid` | - | Responsive CSS grid layout component |
|
|
76
|
+
| `container` | `./opinionated/container` | `@leitware/composables` | `Container` | - | Centered max-width content wrapper |
|
|
77
|
+
| `spacer` | `./opinionated/spacer` | `@leitware/composables` | `Spacer` | - | Flexible whitespace component for spacing |
|
|
78
|
+
| `separator` | `./opinionated/separator` | `@leitware/composables` | `Separator` | - | Visual divider line between content sections |
|
|
79
|
+
| `layout` | `./opinionated/layout` | `@leitware/composables` | `NewspaperCell`, `NewspaperGrid`, `Section` | - | Rigid layout primitives: Section, FlexSpacer, NewspaperGrid |
|
|
80
|
+
| `layout-bento` | `./opinionated/layout-bento` | `@leitware/composables` | `BentoCell`, `BentoGrid` | - | Bento grid layout with BentoGrid, BentoCell, and composites |
|
|
81
|
+
| `resizable` | `./opinionated/resizable` | `@leitware/composables` | `ResizableHandle`, `ResizablePanel`, `ResizablePanelGroup` | - | Resizable split pane panels |
|
|
82
|
+
| `scroll-area` | `./opinionated/scroll-area` | `@leitware/composables` | `ScrollArea`, `ScrollBar` | `ScrollAreaProps` | Custom scrollbar container with overflow handling |
|
|
83
|
+
|
|
84
|
+
### Typography & Display
|
|
85
|
+
|
|
86
|
+
| Module | Source module | Import from | Public values | Public types | Description |
|
|
87
|
+
| ------------ | -------------------------- | ----------------------- | ---------------------------------------------------------------------------------- | --------------------------- | ------------------------------------------------------------------- |
|
|
88
|
+
| `typography` | `./opinionated/typography` | `@leitware/composables` | `Typography` | - | Polymorphic text component with typographic scale variants |
|
|
89
|
+
| `badge` | `./opinionated/badge` | `@leitware/composables` | `Badge` | `BadgeProps` | Small status label with color variants |
|
|
90
|
+
| `avatar` | `./opinionated/avatar` | `@leitware/composables` | `Avatar`, `AvatarFallback`, `AvatarImage` | `AvatarProps` | Circular image element with automatic initials fallback |
|
|
91
|
+
| `icon` | `./opinionated/icon` | `@leitware/composables` | `Icon` | - | Icon wrapper with size and color variants |
|
|
92
|
+
| `kbd` | `./opinionated/kbd` | `@leitware/composables` | `Kbd`, `KbdGroup` | `KbdGroupProps`, `KbdProps` | Keyboard shortcut key and key group display |
|
|
93
|
+
| `skeleton` | `./opinionated/skeleton` | `@leitware/composables` | `Skeleton`, `SkeletonAvatar`, `SkeletonButton`, `SkeletonInput`, `SkeletonText` | `SkeletonProps` | Animated placeholder for loading content |
|
|
94
|
+
| `progress` | `./opinionated/progress` | `@leitware/composables` | `Progress`, `ProgressIndicator`, `ProgressLabel`, `ProgressTrack`, `ProgressValue` | `ProgressProps` | Horizontal progress bar indicator |
|
|
95
|
+
| `divider` | `./opinionated/divider` | `@leitware/composables` | `Divider` | - | Horizontal or vertical divider with solid, dots, and pills variants |
|
|
96
|
+
|
|
97
|
+
### Feedback & Overlay
|
|
98
|
+
|
|
99
|
+
| Module | Source module | Import from | Public values | Public types | Description |
|
|
100
|
+
| -------------- | ---------------------------- | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------- | ---------------------------------------------------------- |
|
|
101
|
+
| `alert` | `./opinionated/alert` | `@leitware/composables` | `Alert`, `AlertAction`, `AlertDescription`, `AlertTitle` | `AlertProps`, `AlertType` | Contextual feedback messages with type-based icon mapping |
|
|
102
|
+
| `dialog` | `./opinionated/dialog` | `@leitware/composables` | `Dialog`, `DialogClose`, `DialogContent`, `DialogDescription`, `DialogFooter`, `DialogHeader`, `DialogTitle`, `DialogTrigger` | `DialogProps` | Modal dialog overlay with trigger, title, and footer props |
|
|
103
|
+
| `alert-dialog` | `./opinionated/alert-dialog` | `@leitware/composables` | `AlertDialog`, `AlertDialogAction`, `AlertDialogCancel`, `AlertDialogContent`, `AlertDialogDescription`, `AlertDialogTitle`, `AlertDialogTrigger` | `AlertDialogProps` | Modal dialog for important confirmations |
|
|
104
|
+
| `sheet` | `./opinionated/sheet` | `@leitware/composables` | `Sheet`, `SheetClose`, `SheetContent`, `SheetDescription`, `SheetFooter`, `SheetHeader`, `SheetTitle`, `SheetTrigger` | `SheetProps` | Slide-out panel from screen edge |
|
|
105
|
+
| `popover` | `./opinionated/popover` | `@leitware/composables` | `Popover`, `PopoverContent`, `PopoverDescription`, `PopoverHeader`, `PopoverTitle`, `PopoverTrigger` | `PopoverProps` | Floating content panel anchored to a trigger |
|
|
106
|
+
| `tooltip` | `./opinionated/tooltip` | `@leitware/composables` | `Tooltip`, `TooltipContent`, `TooltipTrigger` | `TooltipProps` | Informational popup on hover or focus |
|
|
107
|
+
| `hover-card` | `./opinionated/hover-card` | `@leitware/composables` | `HoverCard`, `HoverCardContent`, `HoverCardTrigger` | `HoverCardProps` | Preview card shown on hover |
|
|
108
|
+
| `sonner` | `./opinionated/sonner` | `@leitware/composables` | `Toaster` | - | Toast notification system powered by Sonner |
|
|
109
|
+
|
|
110
|
+
### Navigation
|
|
111
|
+
|
|
112
|
+
| Module | Source module | Import from | Public values | Public types | Description |
|
|
113
|
+
| --------------- | ----------------------------- | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------- | ------------------------------------------------------ |
|
|
114
|
+
| `tabs` | `./opinionated/tabs` | `@leitware/composables` | `Tabs`, `TabsContent` | `TabItem` | Tabbed content navigation with items array API |
|
|
115
|
+
| `breadcrumb` | `./opinionated/breadcrumb` | `@leitware/composables` | `Breadcrumb`, `BreadcrumbEllipsis`, `BreadcrumbItem`, `BreadcrumbLink`, `BreadcrumbList`, `BreadcrumbPage`, `BreadcrumbSeparator` | `BreadcrumbItemData`, `BreadcrumbProps` | Navigation trail with items array API |
|
|
116
|
+
| `pagination` | `./opinionated/pagination` | `@leitware/composables` | `Pagination`, `PaginationContent`, `PaginationEllipsis`, `PaginationItem`, `PaginationLink`, `PaginationNext`, `PaginationPrevious` | `PaginationProps` | Page navigation with currentPage and totalPages API |
|
|
117
|
+
| `sidebar` | `./opinionated/sidebar` | `@leitware/composables` | `Sidebar`, `SidebarContent`, `SidebarFooter`, `SidebarGroup`, `SidebarGroupAction`, `SidebarGroupContent`, `SidebarGroupLabel`, `SidebarHeader`, `SidebarInput`, `SidebarInset`, `SidebarMenu`, `SidebarMenuAction`, `SidebarMenuBadge`, `SidebarMenuButton`, `SidebarMenuItem`, `SidebarMenuSkeleton`, `SidebarMenuSub`, `SidebarMenuSubButton`, `SidebarMenuSubItem`, `SidebarProvider`, `SidebarRail`, `SidebarSeparator`, `SidebarTrigger`, `useSidebar` | - | Application sidebar with collapsible navigation groups |
|
|
118
|
+
| `dropdown-menu` | `./opinionated/dropdown-menu` | `@leitware/composables` | `DropdownMenu`, `DropdownMenuCheckboxItem`, `DropdownMenuContent`, `DropdownMenuGroup`, `DropdownMenuItem`, `DropdownMenuLabel`, `DropdownMenuRadioGroup`, `DropdownMenuRadioItem`, `DropdownMenuSeparator`, `DropdownMenuSub`, `DropdownMenuSubContent`, `DropdownMenuSubTrigger`, `DropdownMenuTrigger` | `DropdownMenuItemData`, `DropdownMenuProps` | Contextual menu triggered by a button |
|
|
119
|
+
|
|
120
|
+
### Data Display
|
|
121
|
+
|
|
122
|
+
| Module | Source module | Import from | Public values | Public types | Description |
|
|
123
|
+
| ------------- | --------------------------- | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------ | ---------------------------------------------------------------------------- |
|
|
124
|
+
| `table` | `./opinionated/table` | `@leitware/composables` | `Table`, `TableBody`, `TableCaption`, `TableCell`, `TableFooter`, `TableHead`, `TableHeader`, `TableRow` | - | Semantic HTML table with styled rows and cells |
|
|
125
|
+
| `card` | `./opinionated/card` | `@leitware/composables` | `Card`, `CardAction`, `CardContent`, `CardDescription`, `CardFooter`, `CardHeader`, `CardTitle` | `CardProps` | Bordered content container with title, description, action, and footer props |
|
|
126
|
+
| `accordion` | `./opinionated/accordion` | `@leitware/composables` | `Accordion`, `AccordionContent`, `AccordionItem`, `AccordionTrigger` | `AccordionItemData`, `AccordionProps` | Vertically collapsible content sections with items array API |
|
|
127
|
+
| `collapsible` | `./opinionated/collapsible` | `@leitware/composables` | `Collapsible`, `CollapsibleContent`, `CollapsibleTrigger` | `CollapsibleProps` | Expandable and collapsible content panel with trigger prop |
|
|
128
|
+
| `item` | `./opinionated/item` | `@leitware/composables` | `Item`, `ItemActions`, `ItemContent`, `ItemDescription`, `ItemFooter`, `ItemGroup`, `ItemHeader`, `ItemMedia`, `ItemSeparator`, `ItemTitle` | `ItemProps` | Flexible list item with title, description, icon, and actions |
|
|
129
|
+
| `message` | `./opinionated/message` | `@leitware/composables` | `Message`, `MessageAvatar`, `MessageContent`, `MessageFooter`, `MessageGroup`, `MessageHeader` | - | Message row primitives for chat, activity, and assistant UIs |
|
|
130
|
+
| `bubble` | `./opinionated/bubble` | `@leitware/composables` | `Bubble`, `BubbleContent`, `BubbleGroup`, `BubbleReactions` | `BubbleProps` | Message bubble primitives with semantic variants |
|
|
131
|
+
| `marker` | `./opinionated/marker` | `@leitware/composables` | `Marker`, `MarkerContent`, `MarkerIcon` | `MarkerProps` | Inline metadata marker with icon, separator, and border variants |
|
|
132
|
+
| `empty` | `./opinionated/empty` | `@leitware/composables` | `Empty`, `EmptyContent`, `EmptyDescription`, `EmptyHeader`, `EmptyMedia`, `EmptyTableState`, `EmptyTitle` | `EmptyProps`, `EmptyTableStateProps` | Empty state placeholder with icon, title, and description |
|
|
133
|
+
| `carousel` | `./opinionated/carousel` | `@leitware/composables` | `Carousel`, `CarouselContent`, `CarouselItem`, `CarouselNext`, `CarouselPrevious` | `CarouselProps` | Horizontally scrollable content slider with items array API |
|
|
134
|
+
| `code-block` | `./opinionated/code-block` | `@leitware/composables` | `CodeBlock` | - | Monospace code display with line numbers |
|
|
135
|
+
| `list` | `./opinionated/list` | `@leitware/composables` | `List`, `ListArrowItem`, `ListBulletItem` | `ListItemData`, `ListProps`, `ListVariant` | Variant list renderer: arrow, bullet |
|
|
136
|
+
|
|
137
|
+
### Form Components
|
|
138
|
+
|
|
139
|
+
| Module | Source module | Import from | Public values | Public types | Description |
|
|
140
|
+
| ----------------------- | ------------------------------------- | ----------------------- | ------------------------------------------------------------ | --------------------------------------------------- | ------------------------------------------------------------ |
|
|
141
|
+
| `form-input` | `./opinionated/form-input` | `@leitware/composables` | `FormInput` | `FormInputProps` | Text input field with label, error, and numeric mode support |
|
|
142
|
+
| `form-select` | `./opinionated/form-select` | `@leitware/composables` | `FormSelect` | `FormSelectOption`, `FormSelectProps` | Select dropdown field with options array API |
|
|
143
|
+
| `native-select` | `./opinionated/native-select` | `@leitware/composables` | `NativeSelect`, `NativeSelectOptGroup`, `NativeSelectOption` | `NativeSelectOptionData`, `NativeSelectProps` | Native HTML select with the design-system field treatment |
|
|
144
|
+
| `form-combobox` | `./opinionated/form-combobox` | `@leitware/composables` | `FormCombobox` | `FormComboboxOption`, `FormComboboxProps` | Searchable select field with options array API |
|
|
145
|
+
| `form-multi-combobox` | `./opinionated/form-multi-combobox` | `@leitware/composables` | `FormMultiCombobox` | `FormMultiComboboxOption`, `FormMultiComboboxProps` | Multi-select combobox field with chip display |
|
|
146
|
+
| `form-textarea` | `./opinionated/form-textarea` | `@leitware/composables` | `FormTextarea` | `FormTextareaProps` | Textarea field with label, description, and error handling |
|
|
147
|
+
| `form-checkbox` | `./opinionated/form-checkbox` | `@leitware/composables` | `FormCheckbox` | `FormCheckboxProps` | Checkbox field with label, description, and error handling |
|
|
148
|
+
| `form-switch` | `./opinionated/form-switch` | `@leitware/composables` | `FormSwitch` | `FormSwitchProps` | Switch toggle field with label and description |
|
|
149
|
+
| `form-radiogroup` | `./opinionated/form-radiogroup` | `@leitware/composables` | `FormRadioGroup` | `FormRadioGroupOption`, `FormRadioGroupProps` | Radio group field with options array API |
|
|
150
|
+
| `form-slider` | `./opinionated/form-slider` | `@leitware/composables` | `FormSlider` | `FormSliderProps` | Slider field with label, value display, and error handling |
|
|
151
|
+
| `form-input-group` | `./opinionated/form-input-group` | `@leitware/composables` | `FormInputGroup` | `FormInputGroupInputProps`, `FormInputGroupProps` | Input group field with addons, buttons, and numeric support |
|
|
152
|
+
| `form-calendar-popover` | `./opinionated/form-calendar-popover` | `@leitware/composables` | `FormCalendarPopover` | `FormCalendarPopoverProps` | Date picker field with calendar popover |
|
|
153
|
+
| `form-date-of-birth` | `./opinionated/form-date-of-birth` | `@leitware/composables` | `FormDateOfBirth` | `DateOfBirthValue`, `FormDateOfBirthProps` | Three-field date of birth input with auto-advance |
|
|
154
|
+
| `form-dropzone` | `./opinionated/form-dropzone` | `@leitware/composables` | `ACCEPT_PRESETS`, `FormDropZone` | `FormDropZoneProps` | Single file upload field with drag-and-drop |
|
|
155
|
+
| `form-multi-dropzone` | `./opinionated/form-multi-dropzone` | `@leitware/composables` | `FormMultiDropZone` | `FormMultiDropZoneProps` | Multi-file upload field with drag-and-drop |
|
|
156
|
+
|
|
157
|
+
### Interactive
|
|
158
|
+
|
|
159
|
+
| Module | Source module | Import from | Public values | Public types | Description |
|
|
160
|
+
| -------------- | ---------------------------- | ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------- | ------------------------------------------------------- |
|
|
161
|
+
| `button` | `./opinionated/button` | `@leitware/composables` | `Button` | `ButtonProps` | Clickable button with loading spinner support |
|
|
162
|
+
| `toggle` | `./opinionated/toggle` | `@leitware/composables` | `Toggle` | `ToggleProps` | Pressable toggle button with left and right icon slots |
|
|
163
|
+
| `toggle-group` | `./opinionated/toggle-group` | `@leitware/composables` | `ToggleGroup`, `ToggleGroupItem` | `ToggleGroupOption`, `ToggleGroupProps` | Grouped toggle buttons for single or multiple selection |
|
|
164
|
+
| `switch` | `./opinionated/switch` | `@leitware/composables` | `Switch` | - | Toggle switch for on/off states |
|
|
165
|
+
| `slider` | `./opinionated/slider` | `@leitware/composables` | `Slider` | - | Draggable range slider input |
|
|
166
|
+
| `checkbox` | `./opinionated/checkbox` | `@leitware/composables` | `Checkbox` | - | Toggle checkbox input with checked state |
|
|
167
|
+
| `radio-group` | `./opinionated/radio-group` | `@leitware/composables` | `RadioGroup`, `RadioGroupItem` | - | Group of mutually exclusive radio options |
|
|
168
|
+
| `combobox` | `./opinionated/combobox` | `@leitware/composables` | `Combobox`, `ComboboxChip`, `ComboboxChips`, `ComboboxChipsInput`, `ComboboxCollection`, `ComboboxContent`, `ComboboxEmpty`, `ComboboxGroup`, `ComboboxInput`, `ComboboxItem`, `ComboboxLabel`, `ComboboxList`, `ComboboxSeparator`, `ComboboxTrigger`, `ComboboxValue` | `ComboboxOption`, `ComboboxProps` | Searchable select dropdown with autocomplete |
|
|
169
|
+
| `select` | `./opinionated/select` | `@leitware/composables` | `Select`, `SelectContent`, `SelectGroup`, `SelectItem`, `SelectLabel`, `SelectTrigger`, `SelectValue` | `SelectOption`, `SelectProps` | Dropdown select menu with scrollable options |
|
|
170
|
+
| `calendar` | `./opinionated/calendar` | `@leitware/composables` | `Calendar`, `CalendarDayButton` | - | Date picker calendar powered by react-day-picker |
|
|
171
|
+
| `dropzone` | `./opinionated/dropzone` | `@leitware/composables` | `DropZone`, `DropZoneFile` | - | Drag-and-drop file upload area |
|
|
172
|
+
|
|
173
|
+
### Tooling Components
|
|
174
|
+
|
|
175
|
+
| Module | Source module | Import from | Public values | Public types | Description |
|
|
176
|
+
| -------------------- | ---------------------------------- | ----------------------- | ------------------ | ------------ | --------------------------------------------------------------------------------- |
|
|
177
|
+
| `token-config-panel` | `./opinionated/token-config-panel` | `@leitware/composables` | `TokenConfigPanel` | - | Live token editor with color pickers, sliders, font selector, and preset switcher |
|
|
178
|
+
| `theme-injector` | `./opinionated/theme-injector` | `@leitware/composables` | `ThemeInjector` | - | Floating palette button that opens the token editor from any page |
|
|
179
|
+
|
|
180
|
+
### Other Public Exports
|
|
181
|
+
|
|
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
|
+
| `direction` | `./opinionated/direction` | `@leitware/composables` | `DirectionProvider`, `useDirection` | `DirectionProviderProps`, `TextDirection` | Public export not listed in the README component catalog. |
|
|
186
|
+
| `field` | `./opinionated/field` | `@leitware/composables` | `Field`, `FieldContent`, `FieldDescription`, `FieldError`, `FieldGroup`, `FieldLabel`, `FieldLegend`, `FieldSeparator`, `FieldSet`, `FieldTitle` | - | Public export not listed in the README component catalog. |
|
|
187
|
+
| `grid-overlay` | `./opinionated/grid-overlay` | `@leitware/composables` | `GridOverlay` | `GridOverlayProps` | Public export not listed in the README component catalog. |
|
|
188
|
+
| `input-group` | `./opinionated/input-group` | `@leitware/composables` | `InputGroup`, `InputGroupAddon`, `InputGroupButton`, `InputGroupInput`, `InputGroupTextarea` | - | Public export not listed in the README component catalog. |
|
|
189
|
+
| `input` | `./opinionated/input` | `@leitware/composables` | `Input` | - | Public export not listed in the README component catalog. |
|
|
190
|
+
| `label` | `./opinionated/label` | `@leitware/composables` | `Label` | - | Public export not listed in the README component catalog. |
|
|
191
|
+
| `textarea` | `./opinionated/textarea` | `@leitware/composables` | `Textarea` | - | Public export not listed in the README component catalog. |
|
|
192
|
+
|
|
193
|
+
## AI Entrypoint Catalog
|
|
194
|
+
|
|
195
|
+
AI exports are prefixed with `AI` where they wrap shared primitives. Import these from `@leitware/composables/ai`.
|
|
196
|
+
|
|
197
|
+
| Module | Import from | Public values | Public types | Description |
|
|
198
|
+
| ------------------ | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
|
|
199
|
+
| `attachments` | `@leitware/composables/ai` | `AIAttachment`, `AIAttachmentEmpty`, `AIAttachmentHoverCard`, `AIAttachmentHoverCardContent`, `AIAttachmentHoverCardTrigger`, `AIAttachmentInfo`, `AIAttachmentPreview`, `AIAttachmentRemove`, `AIAttachments`, `getAttachmentLabel`, `getMediaCategory`, `useAttachmentContext`, `useAttachmentsContext` | `AIAttachmentEmptyProps`, `AIAttachmentHoverCardContentProps`, `AIAttachmentHoverCardProps`, `AIAttachmentHoverCardTriggerProps`, `AIAttachmentInfoProps`, `AIAttachmentPreviewProps`, `AIAttachmentProps`, `AIAttachmentRemoveProps`, `AIAttachmentsProps`, `AttachmentData`, `AttachmentMediaCategory`, `AttachmentVariant` | Attachment previews, metadata, removal controls, and helpers for file/source UI parts. |
|
|
200
|
+
| `chain-of-thought` | `@leitware/composables/ai` | `AIChainOfThought`, `AIChainOfThoughtContent`, `AIChainOfThoughtHeader`, `AIChainOfThoughtImage`, `AIChainOfThoughtSearchResult`, `AIChainOfThoughtSearchResults`, `AIChainOfThoughtStep` | `AIChainOfThoughtContentProps`, `AIChainOfThoughtHeaderProps`, `AIChainOfThoughtImageProps`, `AIChainOfThoughtProps`, `AIChainOfThoughtSearchResultProps`, `AIChainOfThoughtSearchResultsProps`, `AIChainOfThoughtStepProps` | Expandable reasoning step display for AI traces and search results. |
|
|
201
|
+
| `code-block` | `@leitware/composables/ai` | `AICodeBlock`, `AICodeBlockActions`, `AICodeBlockContainer`, `AICodeBlockContent`, `AICodeBlockCopyButton`, `AICodeBlockFilename`, `AICodeBlockHeader`, `AICodeBlockLanguageSelector`, `AICodeBlockLanguageSelectorContent`, `AICodeBlockLanguageSelectorItem`, `AICodeBlockLanguageSelectorTrigger`, `AICodeBlockLanguageSelectorValue`, `AICodeBlockTitle`, `highlightCode` | `AICodeBlockCopyButtonProps`, `AICodeBlockLanguageSelectorContentProps`, `AICodeBlockLanguageSelectorItemProps`, `AICodeBlockLanguageSelectorProps`, `AICodeBlockLanguageSelectorTriggerProps`, `AICodeBlockLanguageSelectorValueProps` | AI code block primitives, syntax highlighting, copy controls, and language selectors. |
|
|
202
|
+
| `confirmation` | `@leitware/composables/ai` | `AIConfirmation`, `AIConfirmationAccepted`, `AIConfirmationAction`, `AIConfirmationActions`, `AIConfirmationRejected`, `AIConfirmationRequest`, `AIConfirmationTitle` | `AIConfirmationAcceptedProps`, `AIConfirmationActionProps`, `AIConfirmationActionsProps`, `AIConfirmationProps`, `AIConfirmationRejectedProps`, `AIConfirmationRequestProps`, `AIConfirmationTitleProps` | Approval request, accepted, rejected, and action components for tool confirmations. |
|
|
203
|
+
| `conversation` | `@leitware/composables/ai` | `AIConversation`, `AIConversationContent`, `AIConversationDownload`, `AIConversationEmptyState`, `AIConversationScrollButton`, `messagesToMarkdown` | `AIConversationContentProps`, `AIConversationDownloadProps`, `AIConversationEmptyStateProps`, `AIConversationProps`, `AIConversationScrollButtonProps` | Conversation container, empty state, scroll affordance, and markdown download helper. |
|
|
204
|
+
| `inline-citation` | `@leitware/composables/ai` | `AIInlineCitation`, `AIInlineCitationCard`, `AIInlineCitationCardBody`, `AIInlineCitationCardTrigger`, `AIInlineCitationCarousel`, `AIInlineCitationCarouselContent`, `AIInlineCitationCarouselHeader`, `AIInlineCitationCarouselIndex`, `AIInlineCitationCarouselItem`, `AIInlineCitationCarouselNext`, `AIInlineCitationCarouselPrev`, `AIInlineCitationQuote`, `AIInlineCitationSource`, `AIInlineCitationText` | `AIInlineCitationCardBodyProps`, `AIInlineCitationCardProps`, `AIInlineCitationCardTriggerProps`, `AIInlineCitationCarouselContentProps`, `AIInlineCitationCarouselHeaderProps`, `AIInlineCitationCarouselIndexProps`, `AIInlineCitationCarouselItemProps`, `AIInlineCitationCarouselNextProps`, `AIInlineCitationCarouselPrevProps`, `AIInlineCitationCarouselProps`, `AIInlineCitationProps`, `AIInlineCitationQuoteProps`, `AIInlineCitationSourceProps`, `AIInlineCitationTextProps` | Inline citation badges, hover cards, source carousel, quotes, and source metadata. |
|
|
205
|
+
| `message` | `@leitware/composables/ai` | `AIMessage`, `AIMessageAction`, `AIMessageActions`, `AIMessageBranch`, `AIMessageBranchContent`, `AIMessageBranchNext`, `AIMessageBranchPage`, `AIMessageBranchPrevious`, `AIMessageBranchSelector`, `AIMessageContent`, `AIMessageResponse`, `AIMessageToolbar` | `AIMessageActionProps`, `AIMessageActionsProps`, `AIMessageBranchContentProps`, `AIMessageBranchNextProps`, `AIMessageBranchPageProps`, `AIMessageBranchPreviousProps`, `AIMessageBranchProps`, `AIMessageBranchSelectorProps`, `AIMessageContentProps`, `AIMessageProps`, `AIMessageResponseProps`, `AIMessageToolbarProps` | User/assistant message bubbles, streamed markdown response content, actions, and branches. |
|
|
206
|
+
| `plan` | `@leitware/composables/ai` | `AIPlan`, `AIPlanAction`, `AIPlanContent`, `AIPlanDescription`, `AIPlanFooter`, `AIPlanHeader`, `AIPlanTitle`, `AIPlanTrigger` | `AIPlanActionProps`, `AIPlanContentProps`, `AIPlanDescriptionProps`, `AIPlanFooterProps`, `AIPlanHeaderProps`, `AIPlanProps`, `AIPlanTitleProps`, `AIPlanTriggerProps` | Collapsible plan card with title, description, action, content, footer, and trigger slots. |
|
|
207
|
+
| `prompt-input` | `@leitware/composables/ai` | `AIPromptInput`, `AIPromptInputActionAddAttachments`, `AIPromptInputActionAddScreenshot`, `AIPromptInputActionMenu`, `AIPromptInputActionMenuContent`, `AIPromptInputActionMenuItem`, `AIPromptInputActionMenuTrigger`, `AIPromptInputBody`, `AIPromptInputButton`, `AIPromptInputFooter`, `AIPromptInputHeader`, `AIPromptInputProvider`, `AIPromptInputSelect`, `AIPromptInputSelectContent`, `AIPromptInputSelectItem`, `AIPromptInputSelectTrigger`, `AIPromptInputSelectValue`, `AIPromptInputSubmit`, `AIPromptInputTextarea`, `AIPromptInputTools`, `usePromptInputAttachments`, `usePromptInputController`, `usePromptInputReferencedSources`, `useProviderAttachments` | `AIPromptInputProps`, `AIPromptInputSubmitProps`, `PromptInputMessage` | Composable prompt form, textarea, submit button, action menu, model select, and hooks. |
|
|
208
|
+
| `reasoning` | `@leitware/composables/ai` | `AIReasoning`, `AIReasoningContent`, `AIReasoningTrigger`, `useReasoning` | `AIReasoningContentProps`, `AIReasoningProps`, `AIReasoningTriggerProps` | Collapsible reasoning disclosure with streaming state and duration display. |
|
|
209
|
+
| `shimmer` | `@leitware/composables/ai` | `AIShimmer` | `AIShimmerProps` | Animated shimmer text for pending or streaming AI states. |
|
|
210
|
+
| `sources` | `@leitware/composables/ai` | `AISource`, `AISources`, `AISourcesContent`, `AISourcesTrigger` | `AISourceProps`, `AISourcesContentProps`, `AISourcesProps`, `AISourcesTriggerProps` | Collapsible source list with trigger, content region, and source links. |
|
|
211
|
+
| `suggestion` | `@leitware/composables/ai` | `AISuggestion`, `AISuggestions` | `AISuggestionProps`, `AISuggestionsProps` | Horizontal suggestion rail and individual prompt suggestion buttons. |
|
|
212
|
+
| `task` | `@leitware/composables/ai` | `AITask`, `AITaskContent`, `AITaskItem`, `AITaskItemFile`, `AITaskTrigger` | `AITaskContentProps`, `AITaskItemFileProps`, `AITaskItemProps`, `AITaskProps`, `AITaskTriggerProps` | Collapsible task and task item components for multi-step agent work. |
|
|
213
|
+
| `tool` | `@leitware/composables/ai` | `AITool`, `AIToolContent`, `AIToolHeader`, `AIToolInput`, `AIToolOutput`, `getStatusBadge` | `AIToolContentProps`, `AIToolHeaderProps`, `AIToolInputProps`, `AIToolOutputProps`, `AIToolProps`, `ToolPart` | Tool invocation shell with status header, input payload, output payload, and error display. |
|
|
214
|
+
|
|
215
|
+
## Useful Examples
|
|
216
|
+
|
|
217
|
+
```tsx
|
|
218
|
+
import { Button, Card, FormInput, Tabs, TabsContent } from '@leitware/composables'
|
|
219
|
+
import { AIMessage, AIMessageContent, AIMessageResponse, AIPromptInput } from '@leitware/composables/ai'
|
|
220
|
+
|
|
221
|
+
<Button variant="outline" size="sm">Cancel</Button>
|
|
222
|
+
|
|
223
|
+
<Card title="Settings" description="Profile details">
|
|
224
|
+
<FormInput label="Name" error={errors.name?.message} required />
|
|
225
|
+
</Card>
|
|
226
|
+
|
|
227
|
+
<Tabs
|
|
228
|
+
items={[
|
|
229
|
+
{ value: 'overview', label: 'Overview' },
|
|
230
|
+
{ value: 'settings', label: 'Settings' },
|
|
231
|
+
]}
|
|
232
|
+
value={tab}
|
|
233
|
+
onValueChange={setTab}
|
|
234
|
+
/>
|
|
235
|
+
<TabsContent value="overview">Overview content</TabsContent>
|
|
236
|
+
|
|
237
|
+
<AIMessage from="assistant">
|
|
238
|
+
<AIMessageContent>
|
|
239
|
+
<AIMessageResponse>{message}</AIMessageResponse>
|
|
240
|
+
</AIMessageContent>
|
|
241
|
+
</AIMessage>
|
|
242
|
+
|
|
243
|
+
<AIPromptInput onSubmit={handleSubmit} />
|
|
244
|
+
```
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { Accordion as AccordionPrimitive } from '@base-ui/react/accordion'
|
|
2
|
+
import { cva, type VariantProps } from 'class-variance-authority'
|
|
3
|
+
import { ChevronDownIcon, ChevronUpIcon } from 'lucide-react'
|
|
4
|
+
import { cn, FOCUS_RING } from '../lib/utils'
|
|
5
|
+
|
|
6
|
+
const accordionVariants = cva('flex w-full flex-col', {
|
|
7
|
+
variants: {
|
|
8
|
+
variant: {
|
|
9
|
+
default: 'overflow-hidden rounded-md border',
|
|
10
|
+
flush: '',
|
|
11
|
+
separated: 'gap-2',
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
defaultVariants: {
|
|
15
|
+
variant: 'default',
|
|
16
|
+
},
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
function Accordion({
|
|
20
|
+
className,
|
|
21
|
+
variant = 'default',
|
|
22
|
+
...props
|
|
23
|
+
}: AccordionPrimitive.Root.Props & VariantProps<typeof accordionVariants>) {
|
|
24
|
+
return (
|
|
25
|
+
<AccordionPrimitive.Root
|
|
26
|
+
data-slot="accordion"
|
|
27
|
+
data-variant={variant}
|
|
28
|
+
className={cn(accordionVariants({ variant }), className)}
|
|
29
|
+
{...props}
|
|
30
|
+
/>
|
|
31
|
+
)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function AccordionItem({ className, ...props }: AccordionPrimitive.Item.Props) {
|
|
35
|
+
return (
|
|
36
|
+
<AccordionPrimitive.Item
|
|
37
|
+
data-slot="accordion-item"
|
|
38
|
+
className={cn(
|
|
39
|
+
'data-open:bg-muted/50 not-last:border-b',
|
|
40
|
+
'[[data-variant=separated]>&]:rounded-md [[data-variant=separated]>&]:border [[data-variant=separated]>&]:not-last:border-b',
|
|
41
|
+
className,
|
|
42
|
+
)}
|
|
43
|
+
{...props}
|
|
44
|
+
/>
|
|
45
|
+
)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function AccordionTrigger({ className, children, ...props }: AccordionPrimitive.Trigger.Props) {
|
|
49
|
+
return (
|
|
50
|
+
<AccordionPrimitive.Header className="flex">
|
|
51
|
+
<AccordionPrimitive.Trigger
|
|
52
|
+
data-slot="accordion-trigger"
|
|
53
|
+
className={cn(
|
|
54
|
+
'**:data-[slot=accordion-trigger-icon]:text-muted-foreground gap-6 p-2 text-left text-xs/relaxed font-medium 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
|
+
FOCUS_RING,
|
|
56
|
+
className,
|
|
57
|
+
)}
|
|
58
|
+
{...props}
|
|
59
|
+
>
|
|
60
|
+
{children}
|
|
61
|
+
<ChevronDownIcon
|
|
62
|
+
data-slot="accordion-trigger-icon"
|
|
63
|
+
className="pointer-events-none shrink-0 group-aria-expanded/accordion-trigger:hidden"
|
|
64
|
+
/>
|
|
65
|
+
<ChevronUpIcon
|
|
66
|
+
data-slot="accordion-trigger-icon"
|
|
67
|
+
className="pointer-events-none hidden shrink-0 group-aria-expanded/accordion-trigger:inline"
|
|
68
|
+
/>
|
|
69
|
+
</AccordionPrimitive.Trigger>
|
|
70
|
+
</AccordionPrimitive.Header>
|
|
71
|
+
)
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function AccordionContent({ className, children, ...props }: AccordionPrimitive.Panel.Props) {
|
|
75
|
+
return (
|
|
76
|
+
<AccordionPrimitive.Panel
|
|
77
|
+
data-slot="accordion-content"
|
|
78
|
+
className="data-open:animate-accordion-down data-closed:animate-accordion-up px-2 text-xs/relaxed overflow-hidden"
|
|
79
|
+
{...props}
|
|
80
|
+
>
|
|
81
|
+
<div
|
|
82
|
+
className={cn(
|
|
83
|
+
'pt-0 pb-4 [&_a]:hover:text-foreground h-(--accordion-panel-height) data-ending-style:h-0 data-starting-style:h-0 [&_a]:underline [&_a]:underline-offset-3',
|
|
84
|
+
className,
|
|
85
|
+
)}
|
|
86
|
+
>
|
|
87
|
+
{children}
|
|
88
|
+
</div>
|
|
89
|
+
</AccordionPrimitive.Panel>
|
|
90
|
+
)
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent, accordionVariants }
|