@uselets/ui 0.6.1 → 1.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.
Files changed (122) hide show
  1. package/README.md +85 -25
  2. package/dist/cli/uselets.mjs +2 -2
  3. package/dist/cli/uselets.mjs.map +1 -1
  4. package/dist/components/alert-dialog.d.ts +5 -3
  5. package/dist/components/alert-dialog.js +1 -1
  6. package/dist/components/alert-dialog.js.map +1 -1
  7. package/dist/components/anchor.js +1 -1
  8. package/dist/components/anchor.js.map +1 -1
  9. package/dist/components/avatar.d.ts +1 -1
  10. package/dist/components/avatar.js +1 -1
  11. package/dist/components/avatar.js.map +1 -1
  12. package/dist/components/badge.js +1 -1
  13. package/dist/components/badge.js.map +1 -1
  14. package/dist/components/button.d.ts +7 -3
  15. package/dist/components/button.js +1 -1
  16. package/dist/components/button.js.map +1 -1
  17. package/dist/components/calendar.js +1 -1
  18. package/dist/components/calendar.js.map +1 -1
  19. package/dist/components/card.d.ts +1 -1
  20. package/dist/components/card.js +1 -1
  21. package/dist/components/card.js.map +1 -1
  22. package/dist/components/checkbox.d.ts +14 -2
  23. package/dist/components/checkbox.js +1 -1
  24. package/dist/components/checkbox.js.map +1 -1
  25. package/dist/components/combobox.d.ts +8 -1
  26. package/dist/components/combobox.js +1 -1
  27. package/dist/components/combobox.js.map +1 -1
  28. package/dist/components/date-range-picker.d.ts +120 -0
  29. package/dist/components/date-range-picker.js +2 -0
  30. package/dist/components/date-range-picker.js.map +1 -0
  31. package/dist/components/grid.d.ts +37 -0
  32. package/dist/components/grid.js +2 -0
  33. package/dist/components/grid.js.map +1 -0
  34. package/dist/components/group.d.ts +2 -2
  35. package/dist/components/group.js +1 -1
  36. package/dist/components/group.js.map +1 -1
  37. package/dist/components/heading.js +1 -1
  38. package/dist/components/heading.js.map +1 -1
  39. package/dist/components/label.js +1 -1
  40. package/dist/components/label.js.map +1 -1
  41. package/dist/components/list.js +1 -1
  42. package/dist/components/list.js.map +1 -1
  43. package/dist/components/native-select.d.ts +1 -1
  44. package/dist/components/native-select.js +1 -1
  45. package/dist/components/native-select.js.map +1 -1
  46. package/dist/components/pagination.js +1 -1
  47. package/dist/components/pagination.js.map +1 -1
  48. package/dist/components/radio-group.d.ts +23 -2
  49. package/dist/components/radio-group.js +1 -1
  50. package/dist/components/radio-group.js.map +1 -1
  51. package/dist/components/select.d.ts +1 -1
  52. package/dist/components/select.js +1 -1
  53. package/dist/components/select.js.map +1 -1
  54. package/dist/components/sidebar.d.ts +1 -1
  55. package/dist/components/sidebar.js +1 -1
  56. package/dist/components/sidebar.js.map +1 -1
  57. package/dist/components/simple-grid.d.ts +24 -0
  58. package/dist/components/simple-grid.js +2 -0
  59. package/dist/components/simple-grid.js.map +1 -0
  60. package/dist/components/spinner.d.ts +1 -1
  61. package/dist/components/spinner.js +1 -1
  62. package/dist/components/spinner.js.map +1 -1
  63. package/dist/components/stack.d.ts +2 -2
  64. package/dist/components/stack.js +1 -1
  65. package/dist/components/stack.js.map +1 -1
  66. package/dist/components/switch.d.ts +11 -1
  67. package/dist/components/switch.js +1 -1
  68. package/dist/components/switch.js.map +1 -1
  69. package/dist/components/tabs.d.ts +5 -2
  70. package/dist/components/tabs.js +1 -1
  71. package/dist/components/tabs.js.map +1 -1
  72. package/dist/components/text.js +1 -1
  73. package/dist/components/text.js.map +1 -1
  74. package/dist/components/toggle-group.d.ts +2 -0
  75. package/dist/components/toggle-group.js +1 -1
  76. package/dist/components/toggle-group.js.map +1 -1
  77. package/dist/components/toggle.d.ts +4 -2
  78. package/dist/components/toggle.js +1 -1
  79. package/dist/components/toggle.js.map +1 -1
  80. package/dist/components/visibility.d.ts +25 -0
  81. package/dist/components/visibility.js +2 -0
  82. package/dist/components/visibility.js.map +1 -0
  83. package/dist/hooks/use-breakpoint-value.d.ts +9 -0
  84. package/dist/hooks/use-breakpoint-value.js +2 -0
  85. package/dist/hooks/use-breakpoint-value.js.map +1 -0
  86. package/dist/hooks/use-breakpoint-value.spec.d.ts +1 -0
  87. package/dist/hooks/use-breakpoint-value.spec.js +15 -0
  88. package/dist/hooks/use-breakpoint-value.spec.js.map +1 -0
  89. package/dist/hooks/use-breakpoint.d.ts +9 -0
  90. package/dist/hooks/use-breakpoint.js +2 -0
  91. package/dist/hooks/use-breakpoint.js.map +1 -0
  92. package/dist/hooks/use-breakpoint.spec.d.ts +1 -0
  93. package/dist/hooks/use-breakpoint.spec.js +2 -0
  94. package/dist/hooks/use-breakpoint.spec.js.map +1 -0
  95. package/dist/index.d.ts +10 -4
  96. package/dist/index.js +1 -1
  97. package/dist/lib/button.d.ts +12 -8
  98. package/dist/lib/button.js +1 -1
  99. package/dist/lib/button.js.map +1 -1
  100. package/dist/lib/color.d.ts +20 -0
  101. package/dist/lib/color.js +2 -0
  102. package/dist/lib/color.js.map +1 -0
  103. package/dist/skills/uselets-ui/SKILL.md +3 -3
  104. package/dist/skills/uselets-ui/references/component-catalog.md +34 -4
  105. package/dist/skills/uselets-ui/references/package-guide.md +51 -17
  106. package/dist/skills/uselets-ui/scripts/print-public-api.mjs +0 -1
  107. package/dist/styles/base.css +13 -0
  108. package/dist/styles/globals.css +8 -0
  109. package/dist/styles/gomax.css +202 -0
  110. package/dist/styles/max.css +203 -0
  111. package/dist/styles/theme.css +195 -0
  112. package/dist/themes/gomax.css +3 -2
  113. package/dist/themes/max.css +3 -2
  114. package/package.json +1 -2
  115. package/skills/uselets-ui/SKILL.md +3 -3
  116. package/skills/uselets-ui/references/component-catalog.md +34 -4
  117. package/skills/uselets-ui/references/package-guide.md +51 -17
  118. package/skills/uselets-ui/scripts/print-public-api.mjs +0 -1
  119. package/dist/components/sheet.d.ts +0 -61
  120. package/dist/components/sheet.js +0 -2
  121. package/dist/components/sheet.js.map +0 -1
  122. package/dist/styles.css +0 -2
@@ -26,6 +26,14 @@ Unless noted otherwise, each module also exports its public `*Props` types from
26
26
  - `use-mobile`
27
27
  - Import path: `@uselets/ui/hooks/use-mobile`
28
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
29
37
  - `use-disclosure`
30
38
  - Import path: `@uselets/ui/hooks/use-disclosure`
31
39
  - Exports: `useDisclosure`
@@ -45,6 +53,10 @@ Unless noted otherwise, each module also exports its public `*Props` types from
45
53
  - `utils`
46
54
  - Import path: `@uselets/ui/utils`
47
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
48
60
  - `sonner`
49
61
  - Import path: `@uselets/ui/sonner`
50
62
  - Exports: `Toaster`, `toast`
@@ -82,7 +94,7 @@ Unless noted otherwise, each module also exports its public `*Props` types from
82
94
  - Exports: `Badge`, `badgeVariants`
83
95
  - `button`
84
96
  - Exports: `Button`, `buttonVariants`
85
- - Notes: action button with `solid`, `outline`, `subtle`, `ghost`, `destructive`, and `link` variants, theme color families (`brand` default), and icon sizes
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`
86
98
  - `button-group`
87
99
  - Exports: `ButtonGroup`, `ButtonGroupSeparator`, `ButtonGroupText`, `buttonGroupVariants`
88
100
  - `empty`
@@ -99,6 +111,15 @@ Unless noted otherwise, each module also exports its public `*Props` types from
99
111
  - `field`
100
112
  - Exports: `Field`, `FieldContent`, `FieldDescription`, `FieldError`, `FieldGroup`, `FieldLabel`, `FieldLegend`, `FieldSeparator`, `FieldSet`, `FieldTitle`
101
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.
102
123
  - `input`
103
124
  - Exports: `Input`
104
125
  - `textarea`
@@ -110,28 +131,36 @@ Unless noted otherwise, each module also exports its public `*Props` types from
110
131
  - Exports: `InputOTP`, `InputOTPGroup`, `InputOTPSeparator`, `InputOTPSlot`, `REGEXP_ONLY_CHARS`, `REGEXP_ONLY_DIGITS`, `REGEXP_ONLY_DIGITS_AND_CHARS`
111
132
  - `checkbox`
112
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)
113
135
  - `switch`
114
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)
115
138
  - `radio-group`
116
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)
117
141
  - `select`
118
142
  - Exports: `Select`, `SelectContent`, `SelectGroup`, `SelectItem`, `SelectLabel`, `SelectScrollDownButton`, `SelectScrollUpButton`, `SelectSeparator`, `SelectTrigger`, `SelectValue`
119
143
  - `native-select`
120
144
  - Exports: `NativeSelect`, `NativeSelectOptGroup`, `NativeSelectOption`
121
145
  - `combobox`
122
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`
123
148
  - `dropzone`
124
149
  - Exports: `Dropzone`, `DropzoneArea`, `DropzoneDescription`, `DropzoneFileList`, `DropzoneFileListItem`, `DropzoneFileMessage`, `DropzoneMessage`, `DropzoneRemoveFile`, `DropzoneRetryFile`, `DropzoneTrigger`, `InfiniteProgress`, `useDropzone`
125
150
  - Notes: upload composition with validation, retry handling, status list UI, and optional `shiftOnMaxFiles`
126
151
  - `calendar`
127
152
  - Exports: `Calendar`, `CalendarDayButton`
128
- - Notes: also exports the `DateRange` type
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
129
157
  - `slider`
130
158
  - Exports: `Slider`
131
159
  - `label`
132
160
  - Exports: `Label`
133
161
  - `toggle`
134
162
  - Exports: `Toggle`, `toggleVariants`
163
+ - Notes: supports `color: UIColor` using the same color variants as `Button`
135
164
  - `toggle-group`
136
165
  - Exports: `ToggleGroup`, `ToggleGroupItem`
137
166
 
@@ -141,8 +170,6 @@ Unless noted otherwise, each module also exports its public `*Props` types from
141
170
  - Exports: `Dialog`, `DialogClose`, `DialogContent`, `DialogDescription`, `DialogFooter`, `DialogHeader`, `DialogOverlay`, `DialogPortal`, `DialogTitle`, `DialogTrigger`
142
171
  - `drawer`
143
172
  - 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
173
  - `popover`
147
174
  - Exports: `Popover`, `PopoverAnchor`, `PopoverContent`, `PopoverDescription`, `PopoverHeader`, `PopoverTitle`, `PopoverTrigger`
148
175
  - `hover-card`
@@ -164,6 +191,7 @@ Unless noted otherwise, each module also exports its public `*Props` types from
164
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`
165
192
  - `tabs`
166
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
167
195
 
168
196
  ## Layout and display
169
197
 
@@ -185,6 +213,7 @@ Unless noted otherwise, each module also exports its public `*Props` types from
185
213
  - Exports: `Container`, `containerVariants`
186
214
  - `group`
187
215
  - Exports: `Group`, `groupVariants`
216
+ - Notes: supports `gap: 'xs' | 'sm' | 'md' | 'lg' | 'xl'` and `wrap`
188
217
  - `kbd`
189
218
  - Exports: `Kbd`, `KbdGroup`
190
219
  - `resizable`
@@ -195,6 +224,7 @@ Unless noted otherwise, each module also exports its public `*Props` types from
195
224
  - Exports: `Separator`
196
225
  - `stack`
197
226
  - Exports: `Stack`, `stackVariants`
227
+ - Notes: supports `gap: 'xs' | 'sm' | 'md' | 'lg' | 'xl'`
198
228
  - `table`
199
229
  - Exports: `Table`, `TableHeader`, `TableBody`, `TableFooter`, `TableHead`, `TableRow`, `TableCell`, `TableCaption`
200
230
  - `timeline`
@@ -88,25 +88,26 @@ Use `bun uselets skill --agent codex` or `bun uselets skill --agent claude` to i
88
88
  - subpath import for dedicated hooks such as `use-mobile`, `use-disclosure`, or `use-local-storage`
89
89
  - `@uselets/ui/utils`
90
90
  - utility helpers such as `cn` and `randomId`
91
- - `@uselets/ui/styles.css`
92
- - legacy compatibility stylesheet equivalent to the Max theme
91
+ - `@uselets/ui/lib/color`
92
+ - shared UI color list and type: `uiColors`, `UIColor`
93
93
  - `@uselets/ui/themes/max.css`
94
94
  - Max theme tokens and component styles
95
95
  - `@uselets/ui/themes/gomax.css`
96
- - Gomax theme tokens and component styles
96
+ - GoMax theme tokens and component styles backed by the GoMax Figma palette
97
97
  - `@uselets/ui/postcss.config`
98
98
  - reusable PostCSS preset for Tailwind v4 setups
99
99
 
100
100
  ## Base setup
101
101
 
102
- Import one package theme once near the app entrypoint:
102
+ Import Tailwind, one package theme, and Inter once in the app global stylesheet:
103
103
 
104
- ```tsx
105
- import '@uselets/ui/themes/max.css'
106
- import '@fontsource-variable/inter'
104
+ ```css
105
+ @import 'tailwindcss';
106
+ @import '@uselets/ui/themes/max.css';
107
+ @import '@fontsource-variable/inter';
107
108
  ```
108
109
 
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
+ For GoMax apps, import `@uselets/ui/themes/gomax.css` instead.
110
111
 
111
112
  If the app needs Tailwind v4 PostCSS setup, reuse the package preset:
112
113
 
@@ -114,18 +115,37 @@ If the app needs Tailwind v4 PostCSS setup, reuse the package preset:
114
115
  export { default } from '@uselets/ui/postcss.config'
115
116
  ```
116
117
 
117
- Make sure Tailwind itself is imported in the app stylesheet:
118
+ When the app uses installed `@uselets/ui` components, add a Tailwind source directive so component classes from the package are generated:
118
119
 
119
120
  ```css
120
- @import 'tailwindcss';
121
+ @source '../node_modules/@uselets/ui/dist';
121
122
  ```
122
123
 
124
+ ## Typography scale
125
+
126
+ The Max theme uses Inter as `font-sans` and overrides Tailwind CSS text size utilities from `text-xs` through
127
+ `text-6xl`. Each size includes a default line height equal to `font-size * 1.5`.
128
+
129
+ | Utility | Font size | Line height |
130
+ | --- | --- | --- |
131
+ | `text-xs` | `0.75rem` / `12px` | `1.125rem` / `18px` |
132
+ | `text-sm` | `0.875rem` / `14px` | `1.3125rem` / `21px` |
133
+ | `text-base` | `1rem` / `16px` | `1.5rem` / `24px` |
134
+ | `text-lg` | `1.125rem` / `18px` | `1.6875rem` / `27px` |
135
+ | `text-xl` | `1.25rem` / `20px` | `1.875rem` / `30px` |
136
+ | `text-2xl` | `1.5rem` / `24px` | `2.25rem` / `36px` |
137
+ | `text-3xl` | `1.875rem` / `30px` | `2.8125rem` / `45px` |
138
+ | `text-4xl` | `2.25rem` / `36px` | `3.375rem` / `54px` |
139
+ | `text-5xl` | `3rem` / `48px` | `4.5rem` / `72px` |
140
+ | `text-6xl` | `3.75rem` / `60px` | `5.625rem` / `90px` |
141
+
123
142
  ## Import patterns
124
143
 
125
144
  Use these patterns:
126
145
 
127
146
  ```tsx
128
147
  import { Alert, Button, cn, randomId } from '@uselets/ui'
148
+ import type { UIColor } from '@uselets/ui'
129
149
  import { Dialog } from '@uselets/ui/dialog'
130
150
  import { useIsMobile } from '@uselets/ui/hooks/use-mobile'
131
151
  import { useDisclosure } from '@uselets/ui/hooks/use-disclosure'
@@ -140,7 +160,7 @@ Guidance:
140
160
  - Use `@uselets/ui/hooks/<hook-module>` for dedicated hook subpaths.
141
161
  - Do not invent undocumented subpaths.
142
162
 
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`.
163
+ 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`.
144
164
 
145
165
  `useLocalStorage` uses an options object and returns a tuple like `useState`:
146
166
 
@@ -208,18 +228,23 @@ export function AppRoot({ children }: { children: React.ReactNode }) {
208
228
 
209
229
  The package stylesheet exposes these palette families:
210
230
 
231
+ - `primary`
211
232
  - `brand`
233
+ - `gray`
212
234
  - `zinc`
213
235
  - `red`
236
+ - `yellow`
214
237
  - `blue`
215
238
  - `indigo`
216
239
  - `pink`
217
240
  - `green`
218
241
 
242
+ 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`.
243
+
219
244
  Each palette family is exposed as:
220
245
 
221
- - CSS variables such as `--brand-500`
222
- - Tailwind v4 utilities such as `bg-brand-500`, `text-zinc-900`, `border-red-300`
246
+ - CSS variables such as `--primary-500`, `--brand-500`, and `--zinc-900`
247
+ - Tailwind v4 utilities such as `bg-primary-500`, `text-zinc-900`, `border-red-300`
223
248
 
224
249
  Primary semantic tokens:
225
250
 
@@ -234,9 +259,18 @@ Additional tokens:
234
259
  - `--destructive-foreground`
235
260
  - `text-destructive-foreground`
236
261
  - `--gradient-primary`
237
- - `--gradient-secondary`
238
262
 
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.
263
+ 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.
264
+
265
+ 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.
266
+
267
+ 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.
268
+
269
+ 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.
270
+
271
+ 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.
272
+
273
+ 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.
240
274
 
241
275
  ## Component selection
242
276
 
@@ -245,9 +279,9 @@ Choose components by intent:
245
279
  - actions and status:
246
280
  - `Button`, `Badge`, `Alert`, `Progress`, `Skeleton`, `Spinner`, `toast`
247
281
  - forms and inputs:
248
- - `Field`, `Input`, `Textarea`, `Checkbox`, `Switch`, `RadioGroup`, `Select`, `NativeSelect`, `Combobox`, `Dropzone`, `InputGroup`, `InputOTP`, `Slider`
282
+ - `Field`, `Input`, `Textarea`, `Checkbox`, `Switch`, `RadioGroup`, `Select`, `NativeSelect`, `Combobox`, `Dropzone`, `InputGroup`, `InputOTP`, `Slider`, `DateRangePicker`
249
283
  - overlays and floating UI:
250
- - `Dialog`, `Drawer`, `Sheet`, `Popover`, `Tooltip`, `HoverCard`, `AlertDialog`
284
+ - `Dialog`, `Drawer`, `Popover`, `Tooltip`, `HoverCard`, `AlertDialog`
251
285
  - navigation:
252
286
  - `Breadcrumb`, `NavigationMenu`, `Pagination`, `Sidebar`, `Tabs`, `DropdownMenu`, `Command`
253
287
  - typography:
@@ -160,7 +160,6 @@ console.log('- barrel: `@uselets/ui`')
160
160
  console.log('- component subpaths: `@uselets/ui/*`')
161
161
  console.log('- hook subpaths: `@uselets/ui/hooks/*`')
162
162
  console.log('- utility helpers: `@uselets/ui/utils`')
163
- console.log('- styles: `@uselets/ui/styles.css` (legacy Max theme alias)')
164
163
  console.log('- Max theme: `@uselets/ui/themes/max.css`')
165
164
  console.log('- Gomax theme: `@uselets/ui/themes/gomax.css`')
166
165
  console.log('- PostCSS preset: `@uselets/ui/postcss.config`')
@@ -0,0 +1,13 @@
1
+ @layer base {
2
+ * {
3
+ @apply border-border outline-ring/50;
4
+ }
5
+
6
+ body {
7
+ @apply bg-background font-sans text-base text-foreground;
8
+ }
9
+
10
+ html {
11
+ @apply font-sans;
12
+ }
13
+ }
@@ -0,0 +1,8 @@
1
+ @import "tailwindcss";
2
+ @import "./theme.css";
3
+ @import "./max.css";
4
+ @import "./base.css";
5
+
6
+ @source "../../../../apps/**/*.{ts,tsx}";
7
+ @source "../../../../components/**/*.{ts,tsx}";
8
+ @source "../**/*.{ts,tsx}";
@@ -0,0 +1,202 @@
1
+ :root {
2
+ /* palette tokens */
3
+ --primary-50: oklch(0.967 0.011 269.55); /* #F1F4FC */
4
+ --primary-100: oklch(0.934 0.021 268.428); /* #E3E9F8 */
5
+ --primary-200: oklch(0.859 0.043 270.875); /* #C6D0EE */
6
+ --primary-300: oklch(0.752 0.078 272.162); /* #9DACE1 */
7
+ --primary-400: oklch(0.647 0.104 271.342); /* #778ACE */
8
+ --primary-500: oklch(0.534 0.167 269.617); /* #4862CC */
9
+ --primary-600: oklch(0.423 0.174 269.851); /* #2C3EAB */
10
+ --primary-700: oklch(0.353 0.143 272.141); /* #252E84 */
11
+ --primary-800: oklch(0.286 0.111 274.807); /* #1D2060 */
12
+ --primary-900: oklch(0.23 0.08 278.141); /* #161641 */
13
+ --primary-950: oklch(0.192 0.053 281.835); /* #11102B */
14
+
15
+ --brand-50: oklch(0.974 0.01 9.532); /* #FDF4F5 */
16
+ --brand-100: oklch(0.931 0.032 29.76); /* #FDE1DC */
17
+ --brand-200: oklch(0.791 0.122 33.999); /* #FF9D86 */
18
+ --brand-300: oklch(0.734 0.166 34.994); /* #FF7D5D */
19
+ --brand-400: oklch(0.708 0.187 34.708); /* #FF6C49 */
20
+ --brand-500: oklch(0.686 0.205 34.607); /* #FF5C35 */
21
+ --brand-600: oklch(0.64 0.192 34.625); /* #E9532F */
22
+ --brand-700: oklch(0.585 0.175 34.659); /* #CE4929 */
23
+ --brand-800: oklch(0.537 0.163 34.517); /* #B93F22 */
24
+ --brand-900: oklch(0.471 0.141 34.467); /* #9A341C */
25
+ --brand-950: oklch(0.401 0.118 34.378); /* #7B2916 */
26
+
27
+ --gray-50: oklch(0.981 0.005 247.876); /* #F6F9FC */
28
+ --gray-100: oklch(0.952 0.01 247.935); /* #EAF0F6 */
29
+ --gray-200: oklch(0.915 0.016 247.999); /* #DBE4ED */
30
+ --gray-300: oklch(0.821 0.028 244.747); /* #B6C7D6 */
31
+ --gray-400: oklch(0.744 0.039 247.107); /* #99AFC4 */
32
+ --gray-500: oklch(0.646 0.052 249.575); /* #7691AD */
33
+ --gray-600: oklch(0.532 0.063 251.386); /* #516F90 */
34
+ --gray-700: oklch(0.454 0.055 249.121); /* #3E5974 */
35
+ --gray-800: oklch(0.313 0.037 246.164); /* #213343 */
36
+ --gray-900: oklch(0.266 0.03 245.1); /* #192733 */
37
+ --gray-950: oklch(0.216 0.021 243.075); /* #111B23 */
38
+
39
+ --zinc-50: oklch(0.979 0 0); /* #F8F8F8 */
40
+ --zinc-100: oklch(0.952 0 0); /* #EFEFEF */
41
+ --zinc-200: oklch(0.885 0 0); /* #D9D9D9 */
42
+ --zinc-300: oklch(0.798 0 0); /* #BDBDBD */
43
+ --zinc-400: oklch(0.68 0 0); /* #989898 */
44
+ --zinc-500: oklch(0.586 0 0); /* #7C7C7C */
45
+ --zinc-600: oklch(0.507 0 0); /* #656565 */
46
+ --zinc-700: oklch(0.394 0 0); /* #464646 */
47
+ --zinc-800: oklch(0.305 0.002 106.504); /* #2F2F2E */
48
+ --zinc-900: oklch(0.207 0.004 345.603); /* #191718 */
49
+ --zinc-950: oklch(0.155 0.003 67.627); /* #0D0C0B */
50
+
51
+ --red-50: oklch(0.968 0.013 5.8); /* #FDF1F3 */
52
+ --red-100: oklch(0.936 0.03 7.525); /* #FDE2E6 */
53
+ --red-200: oklch(0.862 0.071 9.896); /* #FCBFC7 */
54
+ --red-300: oklch(0.755 0.145 13.73); /* #FD8694 */
55
+ --red-400: oklch(0.673 0.211 19.364); /* #FD4D5F */
56
+ --red-500: oklch(0.615 0.224 22.558); /* #ED2D40 */
57
+ --red-600: oklch(0.538 0.21 26.258); /* #CC1420 */
58
+ --red-700: oklch(0.44 0.165 25.779); /* #99151B */
59
+ --red-800: oklch(0.349 0.122 24.328); /* #6C1317 */
60
+ --red-900: oklch(0.266 0.084 22.977); /* #460F11 */
61
+ --red-950: oklch(0.211 0.055 21.251); /* #2D0C0D */
62
+
63
+ --yellow-50: oklch(0.988 0.014 88.681); /* #FFFBF1 */
64
+ --yellow-100: oklch(0.974 0.029 89.569); /* #FEF6E1 */
65
+ --yellow-200: oklch(0.944 0.059 84.511); /* #FFEAC0 */
66
+ --yellow-300: oklch(0.885 0.104 78.009); /* #FFD189 */
67
+ --yellow-400: oklch(0.827 0.142 71.92); /* #FFB652 */
68
+ --yellow-500: oklch(0.798 0.158 67.669); /* #FFA736 */
69
+ --yellow-600: oklch(0.709 0.171 55.903); /* #EF7F0A */
70
+ --yellow-700: oklch(0.564 0.138 53.071); /* #B25A0E */
71
+ --yellow-800: oklch(0.433 0.1 52.359); /* #7A3E11 */
72
+ --yellow-900: oklch(0.324 0.069 50.591); /* #4F280F */
73
+ --yellow-950: oklch(0.249 0.046 47.281); /* #331A0D */
74
+
75
+ --green-50: oklch(0.98 0.003 145.55); /* #F7F9F7 */
76
+ --green-100: oklch(0.957 0.012 145.482); /* #ECF3EC */
77
+ --green-200: oklch(0.912 0.032 143.849); /* #D6E8D5 */
78
+ --green-300: oklch(0.838 0.073 143.695); /* #AED7AC */
79
+ --green-400: oklch(0.767 0.12 142.694); /* #85C780 */
80
+ --green-500: oklch(0.675 0.165 142.096); /* #52AF4A */
81
+ --green-600: oklch(0.567 0.13 141.644); /* #45893D */
82
+ --green-700: oklch(0.467 0.097 140.77); /* #396731 */
83
+ --green-800: oklch(0.366 0.066 140.101); /* #2B4725 */
84
+ --green-900: oklch(0.281 0.041 139.471); /* #1E2E1A */
85
+ --green-950: oklch(0.222 0.026 138.012); /* #151E12 */
86
+
87
+ --blue-50: oklch(0.976 0.002 247.839); /* #F6F7F8 */
88
+ --blue-100: oklch(0.948 0.006 255.476); /* #EBEEF2 */
89
+ --blue-200: oklch(0.891 0.018 240.018); /* #D1DDE6 */
90
+ --blue-300: oklch(0.8 0.044 240.87); /* #A5C2D8 */
91
+ --blue-400: oklch(0.715 0.077 240.176); /* #76AACF */
92
+ --blue-500: oklch(0.622 0.113 242.424); /* #408EC5 */
93
+ --blue-600: oklch(0.538 0.097 239.26); /* #2F75A0 */
94
+ --blue-700: oklch(0.452 0.072 234.642); /* #275C78 */
95
+ --blue-800: oklch(0.363 0.05 228.7); /* #1E4353 */
96
+ --blue-900: oklch(0.282 0.032 222.574); /* #162D35 */
97
+ --blue-950: oklch(0.224 0.021 217.756); /* #101E22 */
98
+
99
+ --indigo-50: oklch(0.966 0.012 301.287); /* #F5F2FB */
100
+ --indigo-100: oklch(0.929 0.028 299.539); /* #EAE4F8 */
101
+ --indigo-200: oklch(0.851 0.062 297.56); /* #D2C6F2 */
102
+ --indigo-300: oklch(0.743 0.087 295.69); /* #B0A1DD */
103
+ --indigo-400: oklch(0.611 0.153 291.363); /* #866FD7 */
104
+ --indigo-500: oklch(0.559 0.193 287.911); /* #7358DC */
105
+ --indigo-600: oklch(0.42 0.218 279.213); /* #4026BE */
106
+ --indigo-700: oklch(0.351 0.17 279.238); /* #30218F */
107
+ --indigo-800: oklch(0.286 0.122 280.262); /* #231B64 */
108
+ --indigo-900: oklch(0.229 0.079 281.288); /* #181540 */
109
+ --indigo-950: oklch(0.19 0.049 282.432); /* #111029 */
110
+
111
+ --pink-50: oklch(0.969 0.016 341.389); /* #FDF1F8 */
112
+ --pink-100: oklch(0.944 0.027 337.065); /* #F9E6F3 */
113
+ --pink-200: oklch(0.903 0.045 338.704); /* #F4D4E9 */
114
+ --pink-300: oklch(0.778 0.085 337.731); /* #DBA2CA */
115
+ --pink-400: oklch(0.68 0.145 338.806); /* #D172B6 */
116
+ --pink-500: oklch(0.624 0.191 340.354); /* #CE4EAA */
117
+ --pink-600: oklch(0.532 0.19 339.952); /* #AE2F8E */
118
+ --pink-700: oklch(0.436 0.148 337.368); /* #81276E */
119
+ --pink-800: oklch(0.345 0.103 335.104); /* #58204E */
120
+ --pink-900: oklch(0.266 0.065 332.23); /* #371833 */
121
+ --pink-950: oklch(0.211 0.036 331.312); /* #221220 */
122
+
123
+ /* gradient tokens */
124
+ --gradient-primary: linear-gradient(
125
+ 87.14044870021029deg,
126
+ oklch(0.534 0.167 269.617) 0% /* #4862CC */,
127
+ oklch(0.71 0.167 13.3) 100% /* #F76F83 */
128
+ );
129
+
130
+ /* semantic tokens */
131
+ --background: var(--gray-50);
132
+ --foreground: var(--gray-900);
133
+ --card: oklch(1 0 0);
134
+ --card-foreground: var(--gray-900);
135
+ --popover: oklch(1 0 0);
136
+ --popover-foreground: var(--gray-900);
137
+ --primary: var(--primary-500);
138
+ --primary-foreground: oklch(1 0 0);
139
+ --brand: var(--brand-500);
140
+ --brand-foreground: oklch(1 0 0);
141
+ --secondary: var(--gray-100);
142
+ --secondary-foreground: var(--gray-900);
143
+ --muted: var(--gray-100);
144
+ --muted-foreground: var(--gray-600);
145
+ --accent: var(--gray-200);
146
+ --accent-foreground: var(--gray-900);
147
+ --destructive: var(--red-500);
148
+ --destructive-foreground: oklch(1 0 0);
149
+ --border: var(--gray-200);
150
+ --input: var(--gray-200);
151
+ --ring: var(--primary-300);
152
+ --chart-1: var(--primary-500);
153
+ --chart-2: var(--green-500);
154
+ --chart-3: var(--blue-500);
155
+ --chart-4: var(--indigo-500);
156
+ --chart-5: var(--pink-500);
157
+ --sidebar: var(--gray-100);
158
+ --sidebar-foreground: var(--gray-900);
159
+ --sidebar-primary: var(--primary-500);
160
+ --sidebar-primary-foreground: oklch(1 0 0);
161
+ --sidebar-accent: var(--gray-200);
162
+ --sidebar-accent-foreground: var(--gray-900);
163
+ --sidebar-border: var(--gray-200);
164
+ --sidebar-ring: var(--primary-300);
165
+ }
166
+
167
+ .dark {
168
+ --background: var(--zinc-950);
169
+ --foreground: var(--zinc-50);
170
+ --card: var(--zinc-900);
171
+ --card-foreground: var(--zinc-50);
172
+ --popover: var(--zinc-900);
173
+ --popover-foreground: var(--zinc-50);
174
+ --primary: var(--primary-400);
175
+ --primary-foreground: oklch(1 0 0);
176
+ --brand: var(--brand-400);
177
+ --brand-foreground: oklch(1 0 0);
178
+ --secondary: var(--zinc-800);
179
+ --secondary-foreground: var(--zinc-50);
180
+ --muted: var(--zinc-800);
181
+ --muted-foreground: var(--zinc-400);
182
+ --accent: var(--zinc-700);
183
+ --accent-foreground: var(--zinc-50);
184
+ --destructive: var(--red-400);
185
+ --destructive-foreground: oklch(1 0 0);
186
+ --border: var(--zinc-700);
187
+ --input: var(--zinc-600);
188
+ --ring: var(--primary-400);
189
+ --chart-1: var(--primary-400);
190
+ --chart-2: var(--green-400);
191
+ --chart-3: var(--blue-400);
192
+ --chart-4: var(--indigo-400);
193
+ --chart-5: var(--pink-300);
194
+ --sidebar: var(--zinc-900);
195
+ --sidebar-foreground: var(--zinc-50);
196
+ --sidebar-primary: var(--primary-400);
197
+ --sidebar-primary-foreground: oklch(1 0 0);
198
+ --sidebar-accent: var(--zinc-700);
199
+ --sidebar-accent-foreground: var(--zinc-50);
200
+ --sidebar-border: var(--zinc-700);
201
+ --sidebar-ring: var(--primary-400);
202
+ }