@uselets/ui 0.6.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/README.md +70 -18
  2. package/dist/components/alert-dialog.d.ts +5 -3
  3. package/dist/components/alert-dialog.js +1 -1
  4. package/dist/components/alert-dialog.js.map +1 -1
  5. package/dist/components/anchor.js +1 -1
  6. package/dist/components/anchor.js.map +1 -1
  7. package/dist/components/avatar.d.ts +1 -1
  8. package/dist/components/avatar.js +1 -1
  9. package/dist/components/avatar.js.map +1 -1
  10. package/dist/components/badge.js +1 -1
  11. package/dist/components/badge.js.map +1 -1
  12. package/dist/components/button.d.ts +7 -3
  13. package/dist/components/button.js +1 -1
  14. package/dist/components/button.js.map +1 -1
  15. package/dist/components/calendar.js +1 -1
  16. package/dist/components/calendar.js.map +1 -1
  17. package/dist/components/card.d.ts +1 -1
  18. package/dist/components/card.js +1 -1
  19. package/dist/components/card.js.map +1 -1
  20. package/dist/components/checkbox.d.ts +14 -2
  21. package/dist/components/checkbox.js +1 -1
  22. package/dist/components/checkbox.js.map +1 -1
  23. package/dist/components/combobox.d.ts +8 -1
  24. package/dist/components/combobox.js +1 -1
  25. package/dist/components/combobox.js.map +1 -1
  26. package/dist/components/date-range-picker.d.ts +120 -0
  27. package/dist/components/date-range-picker.js +2 -0
  28. package/dist/components/date-range-picker.js.map +1 -0
  29. package/dist/components/grid.d.ts +37 -0
  30. package/dist/components/grid.js +2 -0
  31. package/dist/components/grid.js.map +1 -0
  32. package/dist/components/group.d.ts +2 -2
  33. package/dist/components/group.js +1 -1
  34. package/dist/components/group.js.map +1 -1
  35. package/dist/components/heading.js +1 -1
  36. package/dist/components/heading.js.map +1 -1
  37. package/dist/components/label.js +1 -1
  38. package/dist/components/label.js.map +1 -1
  39. package/dist/components/list.js +1 -1
  40. package/dist/components/list.js.map +1 -1
  41. package/dist/components/native-select.d.ts +1 -1
  42. package/dist/components/native-select.js +1 -1
  43. package/dist/components/native-select.js.map +1 -1
  44. package/dist/components/pagination.js +1 -1
  45. package/dist/components/pagination.js.map +1 -1
  46. package/dist/components/radio-group.d.ts +23 -2
  47. package/dist/components/radio-group.js +1 -1
  48. package/dist/components/radio-group.js.map +1 -1
  49. package/dist/components/select.d.ts +1 -1
  50. package/dist/components/select.js +1 -1
  51. package/dist/components/select.js.map +1 -1
  52. package/dist/components/sidebar.d.ts +1 -1
  53. package/dist/components/sidebar.js +1 -1
  54. package/dist/components/sidebar.js.map +1 -1
  55. package/dist/components/simple-grid.d.ts +24 -0
  56. package/dist/components/simple-grid.js +2 -0
  57. package/dist/components/simple-grid.js.map +1 -0
  58. package/dist/components/spinner.d.ts +1 -1
  59. package/dist/components/spinner.js +1 -1
  60. package/dist/components/spinner.js.map +1 -1
  61. package/dist/components/stack.d.ts +2 -2
  62. package/dist/components/stack.js +1 -1
  63. package/dist/components/stack.js.map +1 -1
  64. package/dist/components/switch.d.ts +11 -1
  65. package/dist/components/switch.js +1 -1
  66. package/dist/components/switch.js.map +1 -1
  67. package/dist/components/tabs.d.ts +5 -2
  68. package/dist/components/tabs.js +1 -1
  69. package/dist/components/tabs.js.map +1 -1
  70. package/dist/components/text.js +1 -1
  71. package/dist/components/text.js.map +1 -1
  72. package/dist/components/toggle-group.d.ts +2 -0
  73. package/dist/components/toggle-group.js +1 -1
  74. package/dist/components/toggle-group.js.map +1 -1
  75. package/dist/components/toggle.d.ts +4 -2
  76. package/dist/components/toggle.js +1 -1
  77. package/dist/components/toggle.js.map +1 -1
  78. package/dist/components/visibility.d.ts +25 -0
  79. package/dist/components/visibility.js +2 -0
  80. package/dist/components/visibility.js.map +1 -0
  81. package/dist/hooks/use-breakpoint-value.d.ts +9 -0
  82. package/dist/hooks/use-breakpoint-value.js +2 -0
  83. package/dist/hooks/use-breakpoint-value.js.map +1 -0
  84. package/dist/hooks/use-breakpoint-value.spec.d.ts +1 -0
  85. package/dist/hooks/use-breakpoint-value.spec.js +15 -0
  86. package/dist/hooks/use-breakpoint-value.spec.js.map +1 -0
  87. package/dist/hooks/use-breakpoint.d.ts +9 -0
  88. package/dist/hooks/use-breakpoint.js +2 -0
  89. package/dist/hooks/use-breakpoint.js.map +1 -0
  90. package/dist/hooks/use-breakpoint.spec.d.ts +1 -0
  91. package/dist/hooks/use-breakpoint.spec.js +2 -0
  92. package/dist/hooks/use-breakpoint.spec.js.map +1 -0
  93. package/dist/index.d.ts +10 -4
  94. package/dist/index.js +1 -1
  95. package/dist/lib/button.d.ts +12 -8
  96. package/dist/lib/button.js +1 -1
  97. package/dist/lib/button.js.map +1 -1
  98. package/dist/lib/color.d.ts +20 -0
  99. package/dist/lib/color.js +2 -0
  100. package/dist/lib/color.js.map +1 -0
  101. package/dist/skills/uselets-ui/SKILL.md +73 -0
  102. package/dist/skills/uselets-ui/agents/openai.yaml +4 -0
  103. package/dist/skills/uselets-ui/references/component-catalog.md +232 -0
  104. package/dist/skills/uselets-ui/references/package-guide.md +299 -0
  105. package/dist/skills/uselets-ui/scripts/print-public-api.mjs +174 -0
  106. package/dist/styles.css +1 -1
  107. package/dist/themes/gomax.css +1 -1
  108. package/dist/themes/max.css +1 -1
  109. package/package.json +1 -1
  110. package/skills/uselets-ui/SKILL.md +73 -0
  111. package/skills/uselets-ui/agents/openai.yaml +4 -0
  112. package/skills/uselets-ui/references/component-catalog.md +232 -0
  113. package/skills/uselets-ui/references/package-guide.md +299 -0
  114. package/skills/uselets-ui/scripts/print-public-api.mjs +174 -0
  115. package/dist/components/sheet.d.ts +0 -61
  116. package/dist/components/sheet.js +0 -2
  117. package/dist/components/sheet.js.map +0 -1
@@ -0,0 +1,73 @@
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/themes/gomax.css` as the GoMax Figma-backed palette, exposed through the same public color families as the Max theme.
52
+ - Treat `@uselets/ui/styles.css` as a legacy compatibility alias for the Max theme.
53
+ - Recommend `@fontsource-variable/inter` when matching the package typography setup.
54
+ - Recommend `@uselets/ui/postcss.config` when the app needs the package PostCSS preset for Tailwind v4.
55
+ - For tooltip-heavy apps, wrap the app with `TooltipProvider`.
56
+ - For toast usage, mount `Toaster` near the app root before calling `toast(...)`.
57
+ - For package theme helpers, use `ThemeProvider`, `useTheme`, and `ModeToggle` from `@uselets/ui/theme` or the root barrel.
58
+
59
+ ## Quick Routing
60
+
61
+ - Need installation or global setup: run `bun uselets init` or read `references/package-guide.md`.
62
+ - Need to install or update this skill locally: run `bun uselets skill`.
63
+ - Need to choose a component: read `references/component-catalog.md`.
64
+ - Need the exact local API: run `scripts/print-public-api.mjs`.
65
+ - Need exact props for one module: open the matching `.d.ts` file in `node_modules/@uselets/ui/dist`.
66
+
67
+ ## Example Requests
68
+
69
+ - "How do I install and configure `@uselets/ui` in my app?"
70
+ - "Which `@uselets/ui` component should I use for this form?"
71
+ - "Show me the correct import for `TooltipProvider` or `Sidebar`."
72
+ - "Inspect the installed version of `@uselets/ui` and tell me what `button` exports."
73
+ - "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,232 @@
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-breakpoint`
30
+ - Import path: `@uselets/ui/hooks/use-breakpoint`
31
+ - Exports: `useBreakpoint`, `Breakpoint`, `breakpointValues`
32
+ - Notes: returns whether the current viewport is at or above a Tailwind default breakpoint (`base`, `sm`, `md`, `lg`, `xl`, `2xl`)
33
+ - `use-breakpoint-value`
34
+ - Import path: `@uselets/ui/hooks/use-breakpoint-value`
35
+ - Exports: `useBreakpointValue`, `ResponsiveValueMap`
36
+ - Notes: accepts a breakpoint value map such as `{ base: 1, md: 2 }` and returns the largest active value
37
+ - `use-disclosure`
38
+ - Import path: `@uselets/ui/hooks/use-disclosure`
39
+ - Exports: `useDisclosure`
40
+ - `use-interval`
41
+ - Import path: `@uselets/ui/hooks/use-interval`
42
+ - Exports: `useInterval`
43
+ - `use-idle`
44
+ - Import path: `@uselets/ui/hooks/use-idle`
45
+ - Exports: `useIdle`
46
+ - `use-document-visibility`
47
+ - Import path: `@uselets/ui/hooks/use-document-visibility`
48
+ - Exports: `useDocumentVisibility`
49
+ - `use-local-storage`
50
+ - Import path: `@uselets/ui/hooks/use-local-storage`
51
+ - Exports: `useLocalStorage`, `UseLocalStorageOptions`
52
+ - Notes: returns a `[value, setValue]` tuple, stores values with JSON serialization, and syncs storage changes between browser tabs by default (`sync: true`)
53
+ - `utils`
54
+ - Import path: `@uselets/ui/utils`
55
+ - Exports: `cn`, `randomId`
56
+ - `color`
57
+ - Import path: `@uselets/ui/lib/color`
58
+ - Exports: `uiColors`, `UIColor`, `selectionControlColorVariants`
59
+ - Notes: canonical public color list used by `Button`, `Toggle`, `Checkbox`, `RadioGroupItem`, and `Switch`; `ButtonColor` is a compatibility alias for `UIColor`; `selectionControlColorVariants` is an internal styling map for checked selection controls
60
+ - `sonner`
61
+ - Import path: `@uselets/ui/sonner`
62
+ - Exports: `Toaster`, `toast`
63
+ - `tooltip`
64
+ - Import path: `@uselets/ui/tooltip`
65
+ - Exports: `TooltipProvider`, `Tooltip`, `TooltipTrigger`, `TooltipContent`
66
+
67
+ ## Typography
68
+
69
+ - `anchor`
70
+ - Exports: `Anchor`, `anchorVariants`
71
+ - Notes: link primitive with text size, underline behavior variants, and `asChild`
72
+ - `code`
73
+ - Exports: `Code`
74
+ - Notes: inline code primitive rendered as `<code>`
75
+ - `heading`
76
+ - Exports: `Heading`, `headingVariants`
77
+ - Notes: heading primitive with `size` scale and `asChild`
78
+ - `list`
79
+ - Exports: `List`, `ListItem`, `ListIcon`, `listVariants`
80
+ - Notes: supports `unordered` and `ordered` types, text size, item spacing, and icon marker replacement
81
+ - `text`
82
+ - Exports: `Text`, `textVariants`
83
+ - Notes: text primitive with `size` scale and `asChild`
84
+
85
+ ## Actions and feedback
86
+
87
+ - `alert`
88
+ - Exports: `Alert`, `AlertAction`, `AlertDescription`, `AlertTitle`
89
+ - Notes: alert surface with `default` and `destructive` variants
90
+ - `alert-dialog`
91
+ - Exports: `AlertDialog`, `AlertDialogAction`, `AlertDialogCancel`, `AlertDialogContent`, `AlertDialogDescription`, `AlertDialogFooter`, `AlertDialogHeader`, `AlertDialogMedia`, `AlertDialogOverlay`, `AlertDialogPortal`, `AlertDialogTitle`, `AlertDialogTrigger`
92
+ - Notes: confirmation dialog composition
93
+ - `badge`
94
+ - Exports: `Badge`, `badgeVariants`
95
+ - `button`
96
+ - Exports: `Button`, `buttonVariants`
97
+ - Notes: action button with `solid`, `outline`, `subtle`, `ghost`, and `link` variants, `color: UIColor` (`primary` default), sizes from `xs` through `xl` plus icon sizes through `icon-xl`, and `loading`
98
+ - `button-group`
99
+ - Exports: `ButtonGroup`, `ButtonGroupSeparator`, `ButtonGroupText`, `buttonGroupVariants`
100
+ - `empty`
101
+ - Exports: `Empty`, `EmptyContent`, `EmptyDescription`, `EmptyHeader`, `EmptyMedia`, `EmptyTitle`
102
+ - `progress`
103
+ - Exports: `Progress`
104
+ - `skeleton`
105
+ - Exports: `Skeleton`
106
+ - `spinner`
107
+ - Exports: `Spinner`, `spinnerVariants`
108
+
109
+ ## Forms and input composition
110
+
111
+ - `field`
112
+ - Exports: `Field`, `FieldContent`, `FieldDescription`, `FieldError`, `FieldGroup`, `FieldLabel`, `FieldLegend`, `FieldSeparator`, `FieldSet`, `FieldTitle`
113
+ - Notes: form layout and validation helpers
114
+ - `grid`
115
+ - Exports: `Grid`, `GridItem`
116
+ - Notes: 12-column CSS grid by default. `Grid` supports spacing props plus direct `templateRows` and `templateColumns`; `GridItem` defaults to `colSpan={12}` and supports numeric `colSpan` and `rowSpan`. Use `useBreakpointValue` when these values need to change by breakpoint.
117
+ - `simple-grid`
118
+ - Exports: `SimpleGrid`
119
+ - Notes: simple grid with `cols`, `gap`, `rowGap`, and `columnGap`. `cols` accepts a number; spacing uses the `xs` to `xl` scale. Use `useBreakpointValue` when column count needs responsive values.
120
+ - `visibility`
121
+ - Exports: `HiddenFrom`, `VisibleFrom`
122
+ - Notes: breakpoint visibility wrappers. `HiddenFrom breakpoint="md"` hides at `md` and above; `VisibleFrom breakpoint="md"` shows at `md` and above.
123
+ - `input`
124
+ - Exports: `Input`
125
+ - `textarea`
126
+ - Exports: `Textarea`
127
+ - `input-group`
128
+ - Exports: `InputGroup`, `InputGroupAddon`, `InputGroupButton`, `InputGroupInput`, `InputGroupText`, `InputGroupTextarea`
129
+ - Notes: compose controls with prefixes, suffixes, or inline actions
130
+ - `input-otp`
131
+ - Exports: `InputOTP`, `InputOTPGroup`, `InputOTPSeparator`, `InputOTPSlot`, `REGEXP_ONLY_CHARS`, `REGEXP_ONLY_DIGITS`, `REGEXP_ONLY_DIGITS_AND_CHARS`
132
+ - `checkbox`
133
+ - Exports: `Checkbox`
134
+ - Notes: supports `size: 'sm' | 'md' | 'lg'`, `color: UIColor` (default `primary`), `label?: React.ReactNode`, `labelProps`, and automatic `id`/`htmlFor` wiring when a label is provided without an explicit `id`; composed label text follows checkbox size (`sm` 12px, `md` 14px, `lg` 20px)
135
+ - `switch`
136
+ - Exports: `Switch`
137
+ - Notes: supports `size: 'sm' | 'md' | 'lg'`, `color: UIColor` (default `green`), `label?: React.ReactNode`, `labelProps`, and automatic `id`/`htmlFor` wiring when a label is provided without an explicit `id`; `color` controls the checked track and indicator color only; track size is `sm` 34x16px, `md` 42x20px, and `lg` 48x22px; the thumb and internal indicator scale with the switch; composed label text follows switch size (`sm` 12px, `md` 14px, `lg` 20px)
138
+ - `radio-group`
139
+ - Exports: `RadioGroup`, `RadioGroupItem`
140
+ - Notes: `RadioGroup` supports `color: UIColor` (default `primary`) for the group; `RadioGroupItem` supports `size: 'sm' | 'md' | 'lg'`, optional `color: UIColor` item overrides, `label?: React.ReactNode`, `labelProps`, and automatic `id`/`htmlFor` wiring when a label is provided without an explicit `id`; composed label text follows item size (`sm` 12px, `md` 14px, `lg` 20px)
141
+ - `select`
142
+ - Exports: `Select`, `SelectContent`, `SelectGroup`, `SelectItem`, `SelectLabel`, `SelectScrollDownButton`, `SelectScrollUpButton`, `SelectSeparator`, `SelectTrigger`, `SelectValue`
143
+ - `native-select`
144
+ - Exports: `NativeSelect`, `NativeSelectOptGroup`, `NativeSelectOption`
145
+ - `combobox`
146
+ - Exports: `Combobox`, `ComboboxInput`, `ComboboxContent`, `ComboboxList`, `ComboboxItem`, `ComboboxGroup`, `ComboboxLabel`, `ComboboxCollection`, `ComboboxClear`, `ComboboxEmpty`, `ComboboxSeparator`, `ComboboxChips`, `ComboboxChip`, `ComboboxChipsInput`, `ComboboxTrigger`, `ComboboxValue`, `useComboboxAnchor`
147
+ - Notes: `ComboboxInput` supports `icon?: React.ReactNode`, `triggerIcon?: React.ReactNode`, `showTrigger?: boolean`, and `showClear?: boolean`; the trigger icon defaults to `IconSelector`
148
+ - `dropzone`
149
+ - Exports: `Dropzone`, `DropzoneArea`, `DropzoneDescription`, `DropzoneFileList`, `DropzoneFileListItem`, `DropzoneFileMessage`, `DropzoneMessage`, `DropzoneRemoveFile`, `DropzoneRetryFile`, `DropzoneTrigger`, `InfiniteProgress`, `useDropzone`
150
+ - Notes: upload composition with validation, retry handling, status list UI, and optional `shiftOnMaxFiles`
151
+ - `calendar`
152
+ - Exports: `Calendar`, `CalendarDayButton`
153
+ - Notes: also exports the `DateRange` type; weekends render with destructive text, week numbers are low-emphasis, and selected single/range endpoints use the `primary` palette with a subtle primary range fill
154
+ - `date-range-picker`
155
+ - Exports: `DateRangePicker`, `DateRangePickerTrigger`, `DateRangePickerValue`, `DateRangePickerContent`, `DateRangePickerPresets`, `DateRangePickerPreset`, `DateRangePickerCalendar`, `DateRangePickerDateFields`, `DateRangePickerActions`, `DateRangePickerApply`, `DateRangePickerReset`
156
+ - Notes: compound popover picker using `Calendar` range mode with two months; draft changes from fixed presets, relative-day inputs, date inputs, and calendar stay synchronized until apply; reset and applied clear emit `null` through `onValueChange`; preset buttons show selected state when the draft range matches by calendar day
157
+ - `slider`
158
+ - Exports: `Slider`
159
+ - `label`
160
+ - Exports: `Label`
161
+ - `toggle`
162
+ - Exports: `Toggle`, `toggleVariants`
163
+ - Notes: supports `color: UIColor` using the same color variants as `Button`
164
+ - `toggle-group`
165
+ - Exports: `ToggleGroup`, `ToggleGroupItem`
166
+
167
+ ## Overlays and floating UI
168
+
169
+ - `dialog`
170
+ - Exports: `Dialog`, `DialogClose`, `DialogContent`, `DialogDescription`, `DialogFooter`, `DialogHeader`, `DialogOverlay`, `DialogPortal`, `DialogTitle`, `DialogTrigger`
171
+ - `drawer`
172
+ - Exports: `Drawer`, `DrawerClose`, `DrawerContent`, `DrawerDescription`, `DrawerFooter`, `DrawerHeader`, `DrawerOverlay`, `DrawerPortal`, `DrawerTitle`, `DrawerTrigger`
173
+ - `popover`
174
+ - Exports: `Popover`, `PopoverAnchor`, `PopoverContent`, `PopoverDescription`, `PopoverHeader`, `PopoverTitle`, `PopoverTrigger`
175
+ - `hover-card`
176
+ - Exports: `HoverCard`, `HoverCardTrigger`, `HoverCardContent`
177
+ - `dropdown-menu`
178
+ - Exports: `DropdownMenu`, `DropdownMenuCheckboxItem`, `DropdownMenuContent`, `DropdownMenuGroup`, `DropdownMenuItem`, `DropdownMenuLabel`, `DropdownMenuPortal`, `DropdownMenuRadioGroup`, `DropdownMenuRadioItem`, `DropdownMenuSeparator`, `DropdownMenuShortcut`, `DropdownMenuSub`, `DropdownMenuSubContent`, `DropdownMenuSubTrigger`, `DropdownMenuTrigger`
179
+
180
+ ## Navigation
181
+
182
+ - `breadcrumb`
183
+ - Exports: `Breadcrumb`, `BreadcrumbList`, `BreadcrumbItem`, `BreadcrumbLink`, `BreadcrumbPage`, `BreadcrumbSeparator`, `BreadcrumbEllipsis`
184
+ - `command`
185
+ - Exports: `Command`, `CommandDialog`, `CommandInput`, `CommandList`, `CommandEmpty`, `CommandGroup`, `CommandItem`, `CommandShortcut`, `CommandSeparator`
186
+ - `navigation-menu`
187
+ - Exports: `NavigationMenu`, `NavigationMenuList`, `NavigationMenuItem`, `NavigationMenuContent`, `NavigationMenuTrigger`, `NavigationMenuLink`, `NavigationMenuIndicator`, `NavigationMenuViewport`, `navigationMenuTriggerStyle`
188
+ - `pagination`
189
+ - Exports: `Pagination`, `PaginationContent`, `PaginationEllipsis`, `PaginationItem`, `PaginationLink`, `PaginationNext`, `PaginationPrevious`
190
+ - `sidebar`
191
+ - 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`
192
+ - `tabs`
193
+ - Exports: `Tabs`, `TabsContent`, `TabsList`, `tabsListVariants`, `TabsTrigger`
194
+ - Notes: `TabsList.variant` supports `line` and `enclosed`, defaults to `line`, accepts `grow?: boolean` for equal-width horizontal tabs, and uses the `primary` color for the active line indicator
195
+
196
+ ## Layout and display
197
+
198
+ - `accordion`
199
+ - Exports: `Accordion`, `AccordionItem`, `AccordionTrigger`, `AccordionContent`
200
+ - `avatar`
201
+ - Exports: `Avatar`, `AvatarBadge`, `AvatarFallback`, `AvatarGroup`, `AvatarGroupCount`, `AvatarImage`
202
+ - `card`
203
+ - Exports: `Card`, `CardAction`, `CardContent`, `CardDescription`, `CardFooter`, `CardHeader`, `CardTitle`
204
+ - `carousel`
205
+ - Exports: `Carousel`, `CarouselContent`, `CarouselItem`, `CarouselPrevious`, `CarouselNext`, `useCarousel`
206
+ - `center`
207
+ - Exports: `Center`, `centerVariants`
208
+ - `chart`
209
+ - Exports: `Bar`, `BarChart`, `CartesianGrid`, `XAxis`, `ChartContainer`, `ChartLegend`, `ChartLegendContent`, `ChartStyle`, `ChartTooltip`, `ChartTooltipContent`
210
+ - `collapsible`
211
+ - Exports: `Collapsible`, `CollapsibleTrigger`, `CollapsibleContent`
212
+ - `container`
213
+ - Exports: `Container`, `containerVariants`
214
+ - `group`
215
+ - Exports: `Group`, `groupVariants`
216
+ - Notes: supports `gap: 'xs' | 'sm' | 'md' | 'lg' | 'xl'` and `wrap`
217
+ - `kbd`
218
+ - Exports: `Kbd`, `KbdGroup`
219
+ - `resizable`
220
+ - Exports: `ResizableHandle`, `ResizablePanel`, `ResizablePanelGroup`
221
+ - `scroll-area`
222
+ - Exports: `ScrollArea`, `ScrollBar`
223
+ - `separator`
224
+ - Exports: `Separator`
225
+ - `stack`
226
+ - Exports: `Stack`, `stackVariants`
227
+ - Notes: supports `gap: 'xs' | 'sm' | 'md' | 'lg' | 'xl'`
228
+ - `table`
229
+ - Exports: `Table`, `TableHeader`, `TableBody`, `TableFooter`, `TableHead`, `TableRow`, `TableCell`, `TableCaption`
230
+ - `timeline`
231
+ - Exports: `Timeline`, `TimelineConnector`, `TimelineContent`, `TimelineDescription`, `TimelineEmpty`, `TimelineHeader`, `TimelineIcon`, `TimelineItem`, `TimelineTime`, `TimelineTitle`, `timelineVariants`
232
+ - Notes: timeline flow with root `size`, inherited `iconSize`, item `status`, optional loading/error states, and semantic icon or connector colors
@@ -0,0 +1,299 @@
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/lib/color`
92
+ - shared UI color list and type: `uiColors`, `UIColor`
93
+ - `@uselets/ui/styles.css`
94
+ - legacy compatibility stylesheet equivalent to the Max theme
95
+ - `@uselets/ui/themes/max.css`
96
+ - Max theme tokens and component styles
97
+ - `@uselets/ui/themes/gomax.css`
98
+ - GoMax theme tokens and component styles backed by the GoMax Figma palette
99
+ - `@uselets/ui/postcss.config`
100
+ - reusable PostCSS preset for Tailwind v4 setups
101
+
102
+ ## Base setup
103
+
104
+ Import one package theme once near the app entrypoint:
105
+
106
+ ```tsx
107
+ import '@uselets/ui/themes/max.css'
108
+ import '@fontsource-variable/inter'
109
+ ```
110
+
111
+ For GoMax apps, import `@uselets/ui/themes/gomax.css` instead. The legacy `@uselets/ui/styles.css` entrypoint remains available as a Max-theme alias.
112
+
113
+ If the app needs Tailwind v4 PostCSS setup, reuse the package preset:
114
+
115
+ ```js
116
+ export { default } from '@uselets/ui/postcss.config'
117
+ ```
118
+
119
+ Make sure Tailwind itself is imported in the app stylesheet:
120
+
121
+ ```css
122
+ @import 'tailwindcss';
123
+ ```
124
+
125
+ ## Typography scale
126
+
127
+ The Max theme uses Inter as `font-sans` and overrides Tailwind CSS text size utilities from `text-xs` through
128
+ `text-6xl`. Each size includes a default line height equal to `font-size * 1.5`.
129
+
130
+ | Utility | Font size | Line height |
131
+ | --- | --- | --- |
132
+ | `text-xs` | `0.75rem` / `12px` | `1.125rem` / `18px` |
133
+ | `text-sm` | `0.875rem` / `14px` | `1.3125rem` / `21px` |
134
+ | `text-base` | `1rem` / `16px` | `1.5rem` / `24px` |
135
+ | `text-lg` | `1.125rem` / `18px` | `1.6875rem` / `27px` |
136
+ | `text-xl` | `1.25rem` / `20px` | `1.875rem` / `30px` |
137
+ | `text-2xl` | `1.5rem` / `24px` | `2.25rem` / `36px` |
138
+ | `text-3xl` | `1.875rem` / `30px` | `2.8125rem` / `45px` |
139
+ | `text-4xl` | `2.25rem` / `36px` | `3.375rem` / `54px` |
140
+ | `text-5xl` | `3rem` / `48px` | `4.5rem` / `72px` |
141
+ | `text-6xl` | `3.75rem` / `60px` | `5.625rem` / `90px` |
142
+
143
+ ## Import patterns
144
+
145
+ Use these patterns:
146
+
147
+ ```tsx
148
+ import { Alert, Button, cn, randomId } from '@uselets/ui'
149
+ import type { UIColor } from '@uselets/ui'
150
+ import { Dialog } from '@uselets/ui/dialog'
151
+ import { useIsMobile } from '@uselets/ui/hooks/use-mobile'
152
+ import { useDisclosure } from '@uselets/ui/hooks/use-disclosure'
153
+ import { useLocalStorage } from '@uselets/ui/hooks/use-local-storage'
154
+ import { Toaster, toast } from '@uselets/ui/sonner'
155
+ ```
156
+
157
+ Guidance:
158
+
159
+ - Prefer `@uselets/ui` for common imports.
160
+ - Use `@uselets/ui/<module>` when the user asks for the exact module path or when documenting one specific module.
161
+ - Use `@uselets/ui/hooks/<hook-module>` for dedicated hook subpaths.
162
+ - Do not invent undocumented subpaths.
163
+
164
+ 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`, and shared UI color helpers are available from the root barrel or `@uselets/ui/lib/color`.
165
+
166
+ `useLocalStorage` uses an options object and returns a tuple like `useState`:
167
+
168
+ ```tsx
169
+ const [settings, setSettings] = useLocalStorage('settings', {
170
+ defaultValue: { compact: false }
171
+ })
172
+
173
+ const [draft, setDraft] = useLocalStorage('draft', {
174
+ defaultValue: '',
175
+ sync: false
176
+ })
177
+ ```
178
+
179
+ 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`.
180
+
181
+ ## Package-wide wrappers and providers
182
+
183
+ Use these package-level helpers when relevant:
184
+
185
+ - `TooltipProvider`
186
+ - Wrap the app or feature root when using tooltips broadly.
187
+ - `Toaster`
188
+ - Mount near the app root before calling `toast(...)`.
189
+ - `ThemeProvider`
190
+ - Provide package theme state for `useTheme` and `ModeToggle`.
191
+
192
+ Examples:
193
+
194
+ ```tsx
195
+ import { TooltipProvider } from '@uselets/ui/tooltip'
196
+
197
+ export function AppRoot({ children }: { children: React.ReactNode }) {
198
+ return <TooltipProvider delayDuration={200}>{children}</TooltipProvider>
199
+ }
200
+ ```
201
+
202
+ ```tsx
203
+ import { Toaster, toast } from '@uselets/ui/sonner'
204
+
205
+ export function App() {
206
+ return (
207
+ <>
208
+ <button onClick={() => toast.success('Saved')}>Notify</button>
209
+ <Toaster />
210
+ </>
211
+ )
212
+ }
213
+ ```
214
+
215
+ ```tsx
216
+ import { ModeToggle, ThemeProvider } from '@uselets/ui/theme'
217
+
218
+ export function AppRoot({ children }: { children: React.ReactNode }) {
219
+ return (
220
+ <ThemeProvider defaultTheme="system">
221
+ <ModeToggle />
222
+ {children}
223
+ </ThemeProvider>
224
+ )
225
+ }
226
+ ```
227
+
228
+ ## Theme tokens
229
+
230
+ The package stylesheet exposes these palette families:
231
+
232
+ - `primary`
233
+ - `brand`
234
+ - `gray`
235
+ - `zinc`
236
+ - `red`
237
+ - `yellow`
238
+ - `blue`
239
+ - `indigo`
240
+ - `pink`
241
+ - `green`
242
+
243
+ The same palette family names are exported as `uiColors` and `UIColor`. `Button`, `Toggle`, `Checkbox`, `RadioGroupItem`, and `Switch` use `UIColor` for color props. `ButtonColor` remains available as a compatibility alias, but new public APIs should use `UIColor`.
244
+
245
+ Each palette family is exposed as:
246
+
247
+ - CSS variables such as `--primary-500`, `--brand-500`, and `--zinc-900`
248
+ - Tailwind v4 utilities such as `bg-primary-500`, `text-zinc-900`, `border-red-300`
249
+
250
+ Primary semantic tokens:
251
+
252
+ - surfaces and text: `background`, `foreground`, `card`, `popover`
253
+ - actions and emphasis: `primary`, `secondary`, `accent`, `destructive`
254
+ - controls: `border`, `input`, `ring`
255
+ - sidebar: `sidebar`, `sidebar-primary`, `sidebar-accent`, `sidebar-border`, `sidebar-ring`
256
+ - charts: `chart-1` through `chart-5`
257
+
258
+ Additional tokens:
259
+
260
+ - `--destructive-foreground`
261
+ - `text-destructive-foreground`
262
+ - `--gradient-primary`
263
+
264
+ The `Button` component can apply those palette families directly through `color: UIColor`, with `primary` as the default. Its public variants are `solid`, `outline`, `subtle`, `ghost`, and `link`, with `solid` as the default. Its public sizes are `xs`, `sm`, `md`, `lg`, `xl`, `icon-xs`, `icon-sm`, `icon`, `icon-lg`, and `icon-xl`; `loading` shows a centered spinner, keeps native button content invisible to preserve size, and disables the button without dimming it.
265
+
266
+ The `Checkbox` component can be used as a bare checkbox or with `label?: React.ReactNode`. It supports `size: 'sm' | 'md' | 'lg'` and `color: UIColor`, with `primary` as the default color. When `label` is provided, it composes the package `Label`, accepts `labelProps` for that label, and generates an accessible `id`/`htmlFor` pair when no `id` prop is passed. Composed label text follows checkbox size: `sm` 12px, `md` 14px, and `lg` 20px.
267
+
268
+ The `Switch` component can be used as a bare switch or with `label?: React.ReactNode`. It supports `size: 'sm' | 'md' | 'lg'` and `color: UIColor`, with `green` as the default color. The `color` prop controls only the checked track and indicator color; unchecked remains neutral. Track size is `sm` 34x16px, `md` 42x20px, and `lg` 48x22px. The thumb and its internal indicator scale with the selected size. Composed label text follows switch size: `sm` 12px, `md` 14px, and `lg` 20px.
269
+
270
+ The `TabsList` component supports `variant: 'line' | 'enclosed'`, with `line` as the default, and `grow?: boolean` for equal-width horizontal tabs. The `line` variant keeps a neutral border line across tabs and uses the `primary` color for the active indicator; use `enclosed` for the filled container treatment.
271
+
272
+ The `RadioGroup` component supports `color: UIColor`, with `primary` as the default group color. `RadioGroupItem` can be used as a bare radio item inside `RadioGroup` or with `label?: React.ReactNode`; it supports `size: 'sm' | 'md' | 'lg'` and optional `color: UIColor` item overrides. Composed label text follows item size: `sm` 12px, `md` 14px, and `lg` 20px.
273
+
274
+ The `DateRangePicker` component is a compound popover date range picker built on `Calendar` range mode. Use `DateRange | null` for controlled values; applying an empty draft or resetting emits `null` through `onValueChange`. Fixed presets, relative-day inputs, date inputs, and the calendar all edit the same draft, and `DateRangePickerPreset` displays a selected state when its range matches the current draft by calendar day.
275
+
276
+ ## Component selection
277
+
278
+ Choose components by intent:
279
+
280
+ - actions and status:
281
+ - `Button`, `Badge`, `Alert`, `Progress`, `Skeleton`, `Spinner`, `toast`
282
+ - forms and inputs:
283
+ - `Field`, `Input`, `Textarea`, `Checkbox`, `Switch`, `RadioGroup`, `Select`, `NativeSelect`, `Combobox`, `Dropzone`, `InputGroup`, `InputOTP`, `Slider`, `DateRangePicker`
284
+ - overlays and floating UI:
285
+ - `Dialog`, `Drawer`, `Popover`, `Tooltip`, `HoverCard`, `AlertDialog`
286
+ - navigation:
287
+ - `Breadcrumb`, `NavigationMenu`, `Pagination`, `Sidebar`, `Tabs`, `DropdownMenu`, `Command`
288
+ - typography:
289
+ - `Anchor`, `Code`, `Heading`, `List`, `Text`
290
+ - layout and display:
291
+ - `Card`, `Accordion`, `Collapsible`, `Container`, `Group`, `Stack`, `Center`, `Separator`, `ScrollArea`, `Resizable`, `Table`, `Timeline`, `Chart`, `Carousel`, `Avatar`, `Empty`, `Kbd`
292
+
293
+ ## Inspection workflow
294
+
295
+ When the local version matters:
296
+
297
+ 1. Run the installed `scripts/print-public-api.mjs` from this skill folder.
298
+ 2. Open the target declaration file under `node_modules/@uselets/ui/dist`
299
+ 3. Confirm the exact exported names and prop types before answering