@uselets/ui 0.6.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/skills/uselets-ui/SKILL.md +72 -0
- package/dist/skills/uselets-ui/agents/openai.yaml +4 -0
- package/dist/skills/uselets-ui/references/component-catalog.md +202 -0
- package/dist/skills/uselets-ui/references/package-guide.md +264 -0
- package/dist/skills/uselets-ui/scripts/print-public-api.mjs +174 -0
- package/dist/styles.css +1 -1
- package/dist/themes/gomax.css +1 -1
- package/dist/themes/max.css +1 -1
- package/package.json +1 -1
- package/skills/uselets-ui/SKILL.md +72 -0
- package/skills/uselets-ui/agents/openai.yaml +4 -0
- package/skills/uselets-ui/references/component-catalog.md +202 -0
- package/skills/uselets-ui/references/package-guide.md +264 -0
- package/skills/uselets-ui/scripts/print-public-api.mjs +174 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: uselets-ui
|
|
3
|
+
description: Use @uselets/ui in apps: install it, configure themes, choose public imports/components, and inspect the installed package API.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# @uselets/ui
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Use this skill as portable documentation for projects that consume `@uselets/ui` from npm.
|
|
11
|
+
It should help with installation, styling setup, public imports, component selection, and implementation using the package API that exists in the current app.
|
|
12
|
+
|
|
13
|
+
To set up a consumer project after installing `@uselets/ui`, run `bun uselets init` from that project root. To install or update only this skill, run `bun uselets skill`. The skill command replaces the Codex and Claude Code copies with the version bundled in the installed package.
|
|
14
|
+
|
|
15
|
+
## Workflow
|
|
16
|
+
|
|
17
|
+
1. Start with the bundled package references.
|
|
18
|
+
- Read `references/package-guide.md` for setup, entrypoints, wrappers, and usage rules.
|
|
19
|
+
- Read `references/component-catalog.md` for the module list and exported symbols snapshot.
|
|
20
|
+
2. If `@uselets/ui` is installed in the current project, inspect the installed package for exact local-version details.
|
|
21
|
+
- Run `node .agents/skills/uselets-ui/scripts/print-public-api.mjs` in Codex projects.
|
|
22
|
+
- Run `node .claude/skills/uselets-ui/scripts/print-public-api.mjs` in Claude Code projects.
|
|
23
|
+
3. When exact props or type signatures matter, inspect the installed declaration files directly:
|
|
24
|
+
- `node_modules/@uselets/ui/dist/index.d.ts`
|
|
25
|
+
- `node_modules/@uselets/ui/dist/components/*.d.ts`
|
|
26
|
+
- `node_modules/@uselets/ui/dist/hooks/*.d.ts`
|
|
27
|
+
- `node_modules/@uselets/ui/dist/lib/*.d.ts`
|
|
28
|
+
|
|
29
|
+
## Answering Rules
|
|
30
|
+
|
|
31
|
+
- Do not invent components, props, variants, hooks, or helper exports.
|
|
32
|
+
- Prefer the installed package in `node_modules` over the bundled snapshot whenever it exists.
|
|
33
|
+
- Make it explicit when an answer is based on the bundled snapshot rather than the installed package.
|
|
34
|
+
- Recommend only public entrypoints:
|
|
35
|
+
- `@uselets/ui`
|
|
36
|
+
- `@uselets/ui/<module>`
|
|
37
|
+
- `@uselets/ui/hooks/<hook-module>`
|
|
38
|
+
- `@uselets/ui/utils`
|
|
39
|
+
- `@uselets/ui/styles.css`
|
|
40
|
+
- `@uselets/ui/themes/max.css`
|
|
41
|
+
- `@uselets/ui/themes/gomax.css`
|
|
42
|
+
- `@uselets/ui/postcss.config`
|
|
43
|
+
- Do not rely on package internals or unpublished source paths.
|
|
44
|
+
|
|
45
|
+
## Implementation Rules
|
|
46
|
+
|
|
47
|
+
- Prefer barrel imports for common app usage and readability.
|
|
48
|
+
- Use module subpaths when you want a single module or when the user asks for the exact import path.
|
|
49
|
+
- Use `@uselets/ui/hooks/<hook-module>` for dedicated hook subpaths, not legacy `@uselets/ui/use-*` paths.
|
|
50
|
+
- Recommend importing one theme stylesheet once in the app entrypoint: `@uselets/ui/themes/max.css` for Max apps or `@uselets/ui/themes/gomax.css` for Gomax apps.
|
|
51
|
+
- Treat `@uselets/ui/styles.css` as a legacy compatibility alias for the Max theme.
|
|
52
|
+
- Recommend `@fontsource-variable/inter` when matching the package typography setup.
|
|
53
|
+
- Recommend `@uselets/ui/postcss.config` when the app needs the package PostCSS preset for Tailwind v4.
|
|
54
|
+
- For tooltip-heavy apps, wrap the app with `TooltipProvider`.
|
|
55
|
+
- For toast usage, mount `Toaster` near the app root before calling `toast(...)`.
|
|
56
|
+
- For package theme helpers, use `ThemeProvider`, `useTheme`, and `ModeToggle` from `@uselets/ui/theme` or the root barrel.
|
|
57
|
+
|
|
58
|
+
## Quick Routing
|
|
59
|
+
|
|
60
|
+
- Need installation or global setup: run `bun uselets init` or read `references/package-guide.md`.
|
|
61
|
+
- Need to install or update this skill locally: run `bun uselets skill`.
|
|
62
|
+
- Need to choose a component: read `references/component-catalog.md`.
|
|
63
|
+
- Need the exact local API: run `scripts/print-public-api.mjs`.
|
|
64
|
+
- Need exact props for one module: open the matching `.d.ts` file in `node_modules/@uselets/ui/dist`.
|
|
65
|
+
|
|
66
|
+
## Example Requests
|
|
67
|
+
|
|
68
|
+
- "How do I install and configure `@uselets/ui` in my app?"
|
|
69
|
+
- "Which `@uselets/ui` component should I use for this form?"
|
|
70
|
+
- "Show me the correct import for `TooltipProvider` or `Sidebar`."
|
|
71
|
+
- "Inspect the installed version of `@uselets/ui` and tell me what `button` exports."
|
|
72
|
+
- "Build this screen only with `@uselets/ui` components."
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
interface:
|
|
2
|
+
display_name: "@uselets/ui"
|
|
3
|
+
short_description: "Documents the @uselets/ui package for npm consumers."
|
|
4
|
+
default_prompt: "Use $uselets-ui to inspect the installed @uselets/ui package, choose the right public components and imports, and explain how to use it in this app."
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
# @uselets/ui component catalog
|
|
2
|
+
|
|
3
|
+
This file is a portable snapshot of the public package API for `@uselets/ui`.
|
|
4
|
+
|
|
5
|
+
Snapshot basis:
|
|
6
|
+
|
|
7
|
+
- package name: `@uselets/ui`
|
|
8
|
+
- snapshot version: `0.5.0`
|
|
9
|
+
|
|
10
|
+
Use this snapshot to choose modules and imports when the package is not yet installed.
|
|
11
|
+
When `@uselets/ui` is installed locally, confirm exact exports with:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
node .agents/skills/uselets-ui/scripts/print-public-api.mjs
|
|
15
|
+
# or, in Claude Code projects:
|
|
16
|
+
node .claude/skills/uselets-ui/scripts/print-public-api.mjs
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Unless noted otherwise, each module also exports its public `*Props` types from the same import path.
|
|
20
|
+
|
|
21
|
+
## Core setup and utilities
|
|
22
|
+
|
|
23
|
+
- `theme`
|
|
24
|
+
- Import path: `@uselets/ui/theme`
|
|
25
|
+
- Exports: `ThemeProvider`, `useTheme`, `ModeToggle`
|
|
26
|
+
- `use-mobile`
|
|
27
|
+
- Import path: `@uselets/ui/hooks/use-mobile`
|
|
28
|
+
- Exports: `useIsMobile`
|
|
29
|
+
- `use-disclosure`
|
|
30
|
+
- Import path: `@uselets/ui/hooks/use-disclosure`
|
|
31
|
+
- Exports: `useDisclosure`
|
|
32
|
+
- `use-interval`
|
|
33
|
+
- Import path: `@uselets/ui/hooks/use-interval`
|
|
34
|
+
- Exports: `useInterval`
|
|
35
|
+
- `use-idle`
|
|
36
|
+
- Import path: `@uselets/ui/hooks/use-idle`
|
|
37
|
+
- Exports: `useIdle`
|
|
38
|
+
- `use-document-visibility`
|
|
39
|
+
- Import path: `@uselets/ui/hooks/use-document-visibility`
|
|
40
|
+
- Exports: `useDocumentVisibility`
|
|
41
|
+
- `use-local-storage`
|
|
42
|
+
- Import path: `@uselets/ui/hooks/use-local-storage`
|
|
43
|
+
- Exports: `useLocalStorage`, `UseLocalStorageOptions`
|
|
44
|
+
- Notes: returns a `[value, setValue]` tuple, stores values with JSON serialization, and syncs storage changes between browser tabs by default (`sync: true`)
|
|
45
|
+
- `utils`
|
|
46
|
+
- Import path: `@uselets/ui/utils`
|
|
47
|
+
- Exports: `cn`, `randomId`
|
|
48
|
+
- `sonner`
|
|
49
|
+
- Import path: `@uselets/ui/sonner`
|
|
50
|
+
- Exports: `Toaster`, `toast`
|
|
51
|
+
- `tooltip`
|
|
52
|
+
- Import path: `@uselets/ui/tooltip`
|
|
53
|
+
- Exports: `TooltipProvider`, `Tooltip`, `TooltipTrigger`, `TooltipContent`
|
|
54
|
+
|
|
55
|
+
## Typography
|
|
56
|
+
|
|
57
|
+
- `anchor`
|
|
58
|
+
- Exports: `Anchor`, `anchorVariants`
|
|
59
|
+
- Notes: link primitive with text size, underline behavior variants, and `asChild`
|
|
60
|
+
- `code`
|
|
61
|
+
- Exports: `Code`
|
|
62
|
+
- Notes: inline code primitive rendered as `<code>`
|
|
63
|
+
- `heading`
|
|
64
|
+
- Exports: `Heading`, `headingVariants`
|
|
65
|
+
- Notes: heading primitive with `size` scale and `asChild`
|
|
66
|
+
- `list`
|
|
67
|
+
- Exports: `List`, `ListItem`, `ListIcon`, `listVariants`
|
|
68
|
+
- Notes: supports `unordered` and `ordered` types, text size, item spacing, and icon marker replacement
|
|
69
|
+
- `text`
|
|
70
|
+
- Exports: `Text`, `textVariants`
|
|
71
|
+
- Notes: text primitive with `size` scale and `asChild`
|
|
72
|
+
|
|
73
|
+
## Actions and feedback
|
|
74
|
+
|
|
75
|
+
- `alert`
|
|
76
|
+
- Exports: `Alert`, `AlertAction`, `AlertDescription`, `AlertTitle`
|
|
77
|
+
- Notes: alert surface with `default` and `destructive` variants
|
|
78
|
+
- `alert-dialog`
|
|
79
|
+
- Exports: `AlertDialog`, `AlertDialogAction`, `AlertDialogCancel`, `AlertDialogContent`, `AlertDialogDescription`, `AlertDialogFooter`, `AlertDialogHeader`, `AlertDialogMedia`, `AlertDialogOverlay`, `AlertDialogPortal`, `AlertDialogTitle`, `AlertDialogTrigger`
|
|
80
|
+
- Notes: confirmation dialog composition
|
|
81
|
+
- `badge`
|
|
82
|
+
- Exports: `Badge`, `badgeVariants`
|
|
83
|
+
- `button`
|
|
84
|
+
- Exports: `Button`, `buttonVariants`
|
|
85
|
+
- Notes: action button with `solid`, `outline`, `subtle`, `ghost`, `destructive`, and `link` variants, theme color families (`brand` default), and icon sizes
|
|
86
|
+
- `button-group`
|
|
87
|
+
- Exports: `ButtonGroup`, `ButtonGroupSeparator`, `ButtonGroupText`, `buttonGroupVariants`
|
|
88
|
+
- `empty`
|
|
89
|
+
- Exports: `Empty`, `EmptyContent`, `EmptyDescription`, `EmptyHeader`, `EmptyMedia`, `EmptyTitle`
|
|
90
|
+
- `progress`
|
|
91
|
+
- Exports: `Progress`
|
|
92
|
+
- `skeleton`
|
|
93
|
+
- Exports: `Skeleton`
|
|
94
|
+
- `spinner`
|
|
95
|
+
- Exports: `Spinner`, `spinnerVariants`
|
|
96
|
+
|
|
97
|
+
## Forms and input composition
|
|
98
|
+
|
|
99
|
+
- `field`
|
|
100
|
+
- Exports: `Field`, `FieldContent`, `FieldDescription`, `FieldError`, `FieldGroup`, `FieldLabel`, `FieldLegend`, `FieldSeparator`, `FieldSet`, `FieldTitle`
|
|
101
|
+
- Notes: form layout and validation helpers
|
|
102
|
+
- `input`
|
|
103
|
+
- Exports: `Input`
|
|
104
|
+
- `textarea`
|
|
105
|
+
- Exports: `Textarea`
|
|
106
|
+
- `input-group`
|
|
107
|
+
- Exports: `InputGroup`, `InputGroupAddon`, `InputGroupButton`, `InputGroupInput`, `InputGroupText`, `InputGroupTextarea`
|
|
108
|
+
- Notes: compose controls with prefixes, suffixes, or inline actions
|
|
109
|
+
- `input-otp`
|
|
110
|
+
- Exports: `InputOTP`, `InputOTPGroup`, `InputOTPSeparator`, `InputOTPSlot`, `REGEXP_ONLY_CHARS`, `REGEXP_ONLY_DIGITS`, `REGEXP_ONLY_DIGITS_AND_CHARS`
|
|
111
|
+
- `checkbox`
|
|
112
|
+
- Exports: `Checkbox`
|
|
113
|
+
- `switch`
|
|
114
|
+
- Exports: `Switch`
|
|
115
|
+
- `radio-group`
|
|
116
|
+
- Exports: `RadioGroup`, `RadioGroupItem`
|
|
117
|
+
- `select`
|
|
118
|
+
- Exports: `Select`, `SelectContent`, `SelectGroup`, `SelectItem`, `SelectLabel`, `SelectScrollDownButton`, `SelectScrollUpButton`, `SelectSeparator`, `SelectTrigger`, `SelectValue`
|
|
119
|
+
- `native-select`
|
|
120
|
+
- Exports: `NativeSelect`, `NativeSelectOptGroup`, `NativeSelectOption`
|
|
121
|
+
- `combobox`
|
|
122
|
+
- Exports: `Combobox`, `ComboboxInput`, `ComboboxContent`, `ComboboxList`, `ComboboxItem`, `ComboboxGroup`, `ComboboxLabel`, `ComboboxCollection`, `ComboboxClear`, `ComboboxEmpty`, `ComboboxSeparator`, `ComboboxChips`, `ComboboxChip`, `ComboboxChipsInput`, `ComboboxTrigger`, `ComboboxValue`, `useComboboxAnchor`
|
|
123
|
+
- `dropzone`
|
|
124
|
+
- Exports: `Dropzone`, `DropzoneArea`, `DropzoneDescription`, `DropzoneFileList`, `DropzoneFileListItem`, `DropzoneFileMessage`, `DropzoneMessage`, `DropzoneRemoveFile`, `DropzoneRetryFile`, `DropzoneTrigger`, `InfiniteProgress`, `useDropzone`
|
|
125
|
+
- Notes: upload composition with validation, retry handling, status list UI, and optional `shiftOnMaxFiles`
|
|
126
|
+
- `calendar`
|
|
127
|
+
- Exports: `Calendar`, `CalendarDayButton`
|
|
128
|
+
- Notes: also exports the `DateRange` type
|
|
129
|
+
- `slider`
|
|
130
|
+
- Exports: `Slider`
|
|
131
|
+
- `label`
|
|
132
|
+
- Exports: `Label`
|
|
133
|
+
- `toggle`
|
|
134
|
+
- Exports: `Toggle`, `toggleVariants`
|
|
135
|
+
- `toggle-group`
|
|
136
|
+
- Exports: `ToggleGroup`, `ToggleGroupItem`
|
|
137
|
+
|
|
138
|
+
## Overlays and floating UI
|
|
139
|
+
|
|
140
|
+
- `dialog`
|
|
141
|
+
- Exports: `Dialog`, `DialogClose`, `DialogContent`, `DialogDescription`, `DialogFooter`, `DialogHeader`, `DialogOverlay`, `DialogPortal`, `DialogTitle`, `DialogTrigger`
|
|
142
|
+
- `drawer`
|
|
143
|
+
- Exports: `Drawer`, `DrawerClose`, `DrawerContent`, `DrawerDescription`, `DrawerFooter`, `DrawerHeader`, `DrawerOverlay`, `DrawerPortal`, `DrawerTitle`, `DrawerTrigger`
|
|
144
|
+
- `sheet`
|
|
145
|
+
- Exports: `Sheet`, `SheetPortal`, `SheetTrigger`, `SheetClose`, `SheetOverlay`, `SheetContent`, `SheetHeader`, `SheetFooter`, `SheetTitle`, `SheetDescription`
|
|
146
|
+
- `popover`
|
|
147
|
+
- Exports: `Popover`, `PopoverAnchor`, `PopoverContent`, `PopoverDescription`, `PopoverHeader`, `PopoverTitle`, `PopoverTrigger`
|
|
148
|
+
- `hover-card`
|
|
149
|
+
- Exports: `HoverCard`, `HoverCardTrigger`, `HoverCardContent`
|
|
150
|
+
- `dropdown-menu`
|
|
151
|
+
- Exports: `DropdownMenu`, `DropdownMenuCheckboxItem`, `DropdownMenuContent`, `DropdownMenuGroup`, `DropdownMenuItem`, `DropdownMenuLabel`, `DropdownMenuPortal`, `DropdownMenuRadioGroup`, `DropdownMenuRadioItem`, `DropdownMenuSeparator`, `DropdownMenuShortcut`, `DropdownMenuSub`, `DropdownMenuSubContent`, `DropdownMenuSubTrigger`, `DropdownMenuTrigger`
|
|
152
|
+
|
|
153
|
+
## Navigation
|
|
154
|
+
|
|
155
|
+
- `breadcrumb`
|
|
156
|
+
- Exports: `Breadcrumb`, `BreadcrumbList`, `BreadcrumbItem`, `BreadcrumbLink`, `BreadcrumbPage`, `BreadcrumbSeparator`, `BreadcrumbEllipsis`
|
|
157
|
+
- `command`
|
|
158
|
+
- Exports: `Command`, `CommandDialog`, `CommandInput`, `CommandList`, `CommandEmpty`, `CommandGroup`, `CommandItem`, `CommandShortcut`, `CommandSeparator`
|
|
159
|
+
- `navigation-menu`
|
|
160
|
+
- Exports: `NavigationMenu`, `NavigationMenuList`, `NavigationMenuItem`, `NavigationMenuContent`, `NavigationMenuTrigger`, `NavigationMenuLink`, `NavigationMenuIndicator`, `NavigationMenuViewport`, `navigationMenuTriggerStyle`
|
|
161
|
+
- `pagination`
|
|
162
|
+
- Exports: `Pagination`, `PaginationContent`, `PaginationEllipsis`, `PaginationItem`, `PaginationLink`, `PaginationNext`, `PaginationPrevious`
|
|
163
|
+
- `sidebar`
|
|
164
|
+
- Exports: `Sidebar`, `SidebarContent`, `SidebarFooter`, `SidebarGroup`, `SidebarGroupAction`, `SidebarGroupContent`, `SidebarGroupLabel`, `SidebarHeader`, `SidebarInput`, `SidebarInset`, `SidebarMenu`, `SidebarMenuAction`, `SidebarMenuBadge`, `SidebarMenuButton`, `SidebarMenuItem`, `SidebarMenuSkeleton`, `SidebarMenuSub`, `SidebarMenuSubButton`, `SidebarMenuSubItem`, `SidebarProvider`, `SidebarRail`, `SidebarSeparator`, `SidebarTrigger`, `useSidebar`
|
|
165
|
+
- `tabs`
|
|
166
|
+
- Exports: `Tabs`, `TabsContent`, `TabsList`, `tabsListVariants`, `TabsTrigger`
|
|
167
|
+
|
|
168
|
+
## Layout and display
|
|
169
|
+
|
|
170
|
+
- `accordion`
|
|
171
|
+
- Exports: `Accordion`, `AccordionItem`, `AccordionTrigger`, `AccordionContent`
|
|
172
|
+
- `avatar`
|
|
173
|
+
- Exports: `Avatar`, `AvatarBadge`, `AvatarFallback`, `AvatarGroup`, `AvatarGroupCount`, `AvatarImage`
|
|
174
|
+
- `card`
|
|
175
|
+
- Exports: `Card`, `CardAction`, `CardContent`, `CardDescription`, `CardFooter`, `CardHeader`, `CardTitle`
|
|
176
|
+
- `carousel`
|
|
177
|
+
- Exports: `Carousel`, `CarouselContent`, `CarouselItem`, `CarouselPrevious`, `CarouselNext`, `useCarousel`
|
|
178
|
+
- `center`
|
|
179
|
+
- Exports: `Center`, `centerVariants`
|
|
180
|
+
- `chart`
|
|
181
|
+
- Exports: `Bar`, `BarChart`, `CartesianGrid`, `XAxis`, `ChartContainer`, `ChartLegend`, `ChartLegendContent`, `ChartStyle`, `ChartTooltip`, `ChartTooltipContent`
|
|
182
|
+
- `collapsible`
|
|
183
|
+
- Exports: `Collapsible`, `CollapsibleTrigger`, `CollapsibleContent`
|
|
184
|
+
- `container`
|
|
185
|
+
- Exports: `Container`, `containerVariants`
|
|
186
|
+
- `group`
|
|
187
|
+
- Exports: `Group`, `groupVariants`
|
|
188
|
+
- `kbd`
|
|
189
|
+
- Exports: `Kbd`, `KbdGroup`
|
|
190
|
+
- `resizable`
|
|
191
|
+
- Exports: `ResizableHandle`, `ResizablePanel`, `ResizablePanelGroup`
|
|
192
|
+
- `scroll-area`
|
|
193
|
+
- Exports: `ScrollArea`, `ScrollBar`
|
|
194
|
+
- `separator`
|
|
195
|
+
- Exports: `Separator`
|
|
196
|
+
- `stack`
|
|
197
|
+
- Exports: `Stack`, `stackVariants`
|
|
198
|
+
- `table`
|
|
199
|
+
- Exports: `Table`, `TableHeader`, `TableBody`, `TableFooter`, `TableHead`, `TableRow`, `TableCell`, `TableCaption`
|
|
200
|
+
- `timeline`
|
|
201
|
+
- Exports: `Timeline`, `TimelineConnector`, `TimelineContent`, `TimelineDescription`, `TimelineEmpty`, `TimelineHeader`, `TimelineIcon`, `TimelineItem`, `TimelineTime`, `TimelineTitle`, `timelineVariants`
|
|
202
|
+
- Notes: timeline flow with root `size`, inherited `iconSize`, item `status`, optional loading/error states, and semantic icon or connector colors
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
# @uselets/ui package guide
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
Use this reference in any app that consumes `@uselets/ui` from npm.
|
|
6
|
+
It describes the public entrypoints, setup, and package-level usage patterns.
|
|
7
|
+
|
|
8
|
+
## Source priority
|
|
9
|
+
|
|
10
|
+
Use sources in this order:
|
|
11
|
+
|
|
12
|
+
1. Installed package in the current workspace:
|
|
13
|
+
- `node_modules/@uselets/ui/package.json`
|
|
14
|
+
- `node_modules/@uselets/ui/README.md`
|
|
15
|
+
- `node_modules/@uselets/ui/dist/**/*.d.ts`
|
|
16
|
+
2. This skill's bundled references:
|
|
17
|
+
- `references/package-guide.md`
|
|
18
|
+
- `references/component-catalog.md`
|
|
19
|
+
|
|
20
|
+
If the package is not installed yet, use the bundled references as a snapshot and verify against the installed package after installation.
|
|
21
|
+
|
|
22
|
+
## Requirements
|
|
23
|
+
|
|
24
|
+
- React `>=19`
|
|
25
|
+
- React DOM `>=19`
|
|
26
|
+
- Tailwind CSS 4
|
|
27
|
+
|
|
28
|
+
## Installation
|
|
29
|
+
|
|
30
|
+
Use the project's package manager:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
npm install @uselets/ui
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
pnpm add @uselets/ui
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
yarn add @uselets/ui
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
bun add @uselets/ui
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Project setup command
|
|
49
|
+
|
|
50
|
+
Run the package setup command from the project root to install dependencies, configure PostCSS, and prepare the global CSS imports:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
bun uselets init
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
The command asks for the package theme, defaults the global CSS path to `src/styles/globals.css`, creates that CSS file when missing, preserves an existing `postcss.config.mjs`, and asks whether to install the agent skill.
|
|
57
|
+
|
|
58
|
+
For non-interactive setup, provide explicit options:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
bun uselets init --theme max --css src/styles/globals.css --no-install-skill
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Agent skill installation
|
|
65
|
+
|
|
66
|
+
After installing `@uselets/ui`, projects can install or update this bundled agent skill:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
bun uselets skill
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
By default, the command removes any existing skill copy in the current project and copies the current package version into place for both supported agent layouts:
|
|
73
|
+
|
|
74
|
+
- `.agents/skills/uselets-ui` for Codex
|
|
75
|
+
- `.claude/skills/uselets-ui` for Claude Code
|
|
76
|
+
|
|
77
|
+
Use `bun uselets skill --agent codex` or `bun uselets skill --agent claude` to install only one target.
|
|
78
|
+
|
|
79
|
+
## Public entrypoints
|
|
80
|
+
|
|
81
|
+
`@uselets/ui` exposes these public entrypoint patterns:
|
|
82
|
+
|
|
83
|
+
- `@uselets/ui`
|
|
84
|
+
- root barrel for components, hooks, and utilities re-exported by the package
|
|
85
|
+
- `@uselets/ui/<module>`
|
|
86
|
+
- subpath import for components such as `button`, `dialog`, or `tooltip`
|
|
87
|
+
- `@uselets/ui/hooks/<hook-module>`
|
|
88
|
+
- subpath import for dedicated hooks such as `use-mobile`, `use-disclosure`, or `use-local-storage`
|
|
89
|
+
- `@uselets/ui/utils`
|
|
90
|
+
- utility helpers such as `cn` and `randomId`
|
|
91
|
+
- `@uselets/ui/styles.css`
|
|
92
|
+
- legacy compatibility stylesheet equivalent to the Max theme
|
|
93
|
+
- `@uselets/ui/themes/max.css`
|
|
94
|
+
- Max theme tokens and component styles
|
|
95
|
+
- `@uselets/ui/themes/gomax.css`
|
|
96
|
+
- Gomax theme tokens and component styles
|
|
97
|
+
- `@uselets/ui/postcss.config`
|
|
98
|
+
- reusable PostCSS preset for Tailwind v4 setups
|
|
99
|
+
|
|
100
|
+
## Base setup
|
|
101
|
+
|
|
102
|
+
Import one package theme once near the app entrypoint:
|
|
103
|
+
|
|
104
|
+
```tsx
|
|
105
|
+
import '@uselets/ui/themes/max.css'
|
|
106
|
+
import '@fontsource-variable/inter'
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
For Gomax apps, import `@uselets/ui/themes/gomax.css` instead. The legacy `@uselets/ui/styles.css` entrypoint remains available as a Max-theme alias.
|
|
110
|
+
|
|
111
|
+
If the app needs Tailwind v4 PostCSS setup, reuse the package preset:
|
|
112
|
+
|
|
113
|
+
```js
|
|
114
|
+
export { default } from '@uselets/ui/postcss.config'
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Make sure Tailwind itself is imported in the app stylesheet:
|
|
118
|
+
|
|
119
|
+
```css
|
|
120
|
+
@import 'tailwindcss';
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## Import patterns
|
|
124
|
+
|
|
125
|
+
Use these patterns:
|
|
126
|
+
|
|
127
|
+
```tsx
|
|
128
|
+
import { Alert, Button, cn, randomId } from '@uselets/ui'
|
|
129
|
+
import { Dialog } from '@uselets/ui/dialog'
|
|
130
|
+
import { useIsMobile } from '@uselets/ui/hooks/use-mobile'
|
|
131
|
+
import { useDisclosure } from '@uselets/ui/hooks/use-disclosure'
|
|
132
|
+
import { useLocalStorage } from '@uselets/ui/hooks/use-local-storage'
|
|
133
|
+
import { Toaster, toast } from '@uselets/ui/sonner'
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Guidance:
|
|
137
|
+
|
|
138
|
+
- Prefer `@uselets/ui` for common imports.
|
|
139
|
+
- Use `@uselets/ui/<module>` when the user asks for the exact module path or when documenting one specific module.
|
|
140
|
+
- Use `@uselets/ui/hooks/<hook-module>` for dedicated hook subpaths.
|
|
141
|
+
- Do not invent undocumented subpaths.
|
|
142
|
+
|
|
143
|
+
Public hook subpaths currently include `hooks/use-mobile`, `hooks/use-disclosure`, `hooks/use-interval`, `hooks/use-idle`, `hooks/use-document-visibility`, and `hooks/use-local-storage`. Legacy `@uselets/ui/use-*` paths are not public entrypoints. Utility helpers are available from `@uselets/ui/utils`.
|
|
144
|
+
|
|
145
|
+
`useLocalStorage` uses an options object and returns a tuple like `useState`:
|
|
146
|
+
|
|
147
|
+
```tsx
|
|
148
|
+
const [settings, setSettings] = useLocalStorage('settings', {
|
|
149
|
+
defaultValue: { compact: false }
|
|
150
|
+
})
|
|
151
|
+
|
|
152
|
+
const [draft, setDraft] = useLocalStorage('draft', {
|
|
153
|
+
defaultValue: '',
|
|
154
|
+
sync: false
|
|
155
|
+
})
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
It stores values with `JSON.stringify`, reads with `JSON.parse` with string fallback, and synchronizes changes from other browser tabs unless `sync` is set to `false`.
|
|
159
|
+
|
|
160
|
+
## Package-wide wrappers and providers
|
|
161
|
+
|
|
162
|
+
Use these package-level helpers when relevant:
|
|
163
|
+
|
|
164
|
+
- `TooltipProvider`
|
|
165
|
+
- Wrap the app or feature root when using tooltips broadly.
|
|
166
|
+
- `Toaster`
|
|
167
|
+
- Mount near the app root before calling `toast(...)`.
|
|
168
|
+
- `ThemeProvider`
|
|
169
|
+
- Provide package theme state for `useTheme` and `ModeToggle`.
|
|
170
|
+
|
|
171
|
+
Examples:
|
|
172
|
+
|
|
173
|
+
```tsx
|
|
174
|
+
import { TooltipProvider } from '@uselets/ui/tooltip'
|
|
175
|
+
|
|
176
|
+
export function AppRoot({ children }: { children: React.ReactNode }) {
|
|
177
|
+
return <TooltipProvider delayDuration={200}>{children}</TooltipProvider>
|
|
178
|
+
}
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
```tsx
|
|
182
|
+
import { Toaster, toast } from '@uselets/ui/sonner'
|
|
183
|
+
|
|
184
|
+
export function App() {
|
|
185
|
+
return (
|
|
186
|
+
<>
|
|
187
|
+
<button onClick={() => toast.success('Saved')}>Notify</button>
|
|
188
|
+
<Toaster />
|
|
189
|
+
</>
|
|
190
|
+
)
|
|
191
|
+
}
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
```tsx
|
|
195
|
+
import { ModeToggle, ThemeProvider } from '@uselets/ui/theme'
|
|
196
|
+
|
|
197
|
+
export function AppRoot({ children }: { children: React.ReactNode }) {
|
|
198
|
+
return (
|
|
199
|
+
<ThemeProvider defaultTheme="system">
|
|
200
|
+
<ModeToggle />
|
|
201
|
+
{children}
|
|
202
|
+
</ThemeProvider>
|
|
203
|
+
)
|
|
204
|
+
}
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
## Theme tokens
|
|
208
|
+
|
|
209
|
+
The package stylesheet exposes these palette families:
|
|
210
|
+
|
|
211
|
+
- `brand`
|
|
212
|
+
- `zinc`
|
|
213
|
+
- `red`
|
|
214
|
+
- `blue`
|
|
215
|
+
- `indigo`
|
|
216
|
+
- `pink`
|
|
217
|
+
- `green`
|
|
218
|
+
|
|
219
|
+
Each palette family is exposed as:
|
|
220
|
+
|
|
221
|
+
- CSS variables such as `--brand-500`
|
|
222
|
+
- Tailwind v4 utilities such as `bg-brand-500`, `text-zinc-900`, `border-red-300`
|
|
223
|
+
|
|
224
|
+
Primary semantic tokens:
|
|
225
|
+
|
|
226
|
+
- surfaces and text: `background`, `foreground`, `card`, `popover`
|
|
227
|
+
- actions and emphasis: `primary`, `secondary`, `accent`, `destructive`
|
|
228
|
+
- controls: `border`, `input`, `ring`
|
|
229
|
+
- sidebar: `sidebar`, `sidebar-primary`, `sidebar-accent`, `sidebar-border`, `sidebar-ring`
|
|
230
|
+
- charts: `chart-1` through `chart-5`
|
|
231
|
+
|
|
232
|
+
Additional tokens:
|
|
233
|
+
|
|
234
|
+
- `--destructive-foreground`
|
|
235
|
+
- `text-destructive-foreground`
|
|
236
|
+
- `--gradient-primary`
|
|
237
|
+
- `--gradient-secondary`
|
|
238
|
+
|
|
239
|
+
The `Button` component can apply those palette families directly through `color: 'brand' | 'zinc' | 'red' | 'blue' | 'indigo' | 'pink' | 'green'`, with `brand` as the default. Its public variants are `solid`, `outline`, `subtle`, `ghost`, `destructive`, and `link`, with `solid` as the default.
|
|
240
|
+
|
|
241
|
+
## Component selection
|
|
242
|
+
|
|
243
|
+
Choose components by intent:
|
|
244
|
+
|
|
245
|
+
- actions and status:
|
|
246
|
+
- `Button`, `Badge`, `Alert`, `Progress`, `Skeleton`, `Spinner`, `toast`
|
|
247
|
+
- forms and inputs:
|
|
248
|
+
- `Field`, `Input`, `Textarea`, `Checkbox`, `Switch`, `RadioGroup`, `Select`, `NativeSelect`, `Combobox`, `Dropzone`, `InputGroup`, `InputOTP`, `Slider`
|
|
249
|
+
- overlays and floating UI:
|
|
250
|
+
- `Dialog`, `Drawer`, `Sheet`, `Popover`, `Tooltip`, `HoverCard`, `AlertDialog`
|
|
251
|
+
- navigation:
|
|
252
|
+
- `Breadcrumb`, `NavigationMenu`, `Pagination`, `Sidebar`, `Tabs`, `DropdownMenu`, `Command`
|
|
253
|
+
- typography:
|
|
254
|
+
- `Anchor`, `Code`, `Heading`, `List`, `Text`
|
|
255
|
+
- layout and display:
|
|
256
|
+
- `Card`, `Accordion`, `Collapsible`, `Container`, `Group`, `Stack`, `Center`, `Separator`, `ScrollArea`, `Resizable`, `Table`, `Timeline`, `Chart`, `Carousel`, `Avatar`, `Empty`, `Kbd`
|
|
257
|
+
|
|
258
|
+
## Inspection workflow
|
|
259
|
+
|
|
260
|
+
When the local version matters:
|
|
261
|
+
|
|
262
|
+
1. Run the installed `scripts/print-public-api.mjs` from this skill folder.
|
|
263
|
+
2. Open the target declaration file under `node_modules/@uselets/ui/dist`
|
|
264
|
+
3. Confirm the exact exported names and prop types before answering
|