@uselets/ui 0.6.1 → 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.
- package/README.md +70 -18
- package/dist/components/alert-dialog.d.ts +5 -3
- package/dist/components/alert-dialog.js +1 -1
- package/dist/components/alert-dialog.js.map +1 -1
- package/dist/components/anchor.js +1 -1
- package/dist/components/anchor.js.map +1 -1
- package/dist/components/avatar.d.ts +1 -1
- package/dist/components/avatar.js +1 -1
- package/dist/components/avatar.js.map +1 -1
- package/dist/components/badge.js +1 -1
- package/dist/components/badge.js.map +1 -1
- package/dist/components/button.d.ts +7 -3
- package/dist/components/button.js +1 -1
- package/dist/components/button.js.map +1 -1
- package/dist/components/calendar.js +1 -1
- package/dist/components/calendar.js.map +1 -1
- package/dist/components/card.d.ts +1 -1
- package/dist/components/card.js +1 -1
- package/dist/components/card.js.map +1 -1
- package/dist/components/checkbox.d.ts +14 -2
- package/dist/components/checkbox.js +1 -1
- package/dist/components/checkbox.js.map +1 -1
- package/dist/components/combobox.d.ts +8 -1
- package/dist/components/combobox.js +1 -1
- package/dist/components/combobox.js.map +1 -1
- package/dist/components/date-range-picker.d.ts +120 -0
- package/dist/components/date-range-picker.js +2 -0
- package/dist/components/date-range-picker.js.map +1 -0
- package/dist/components/grid.d.ts +37 -0
- package/dist/components/grid.js +2 -0
- package/dist/components/grid.js.map +1 -0
- package/dist/components/group.d.ts +2 -2
- package/dist/components/group.js +1 -1
- package/dist/components/group.js.map +1 -1
- package/dist/components/heading.js +1 -1
- package/dist/components/heading.js.map +1 -1
- package/dist/components/label.js +1 -1
- package/dist/components/label.js.map +1 -1
- package/dist/components/list.js +1 -1
- package/dist/components/list.js.map +1 -1
- package/dist/components/native-select.d.ts +1 -1
- package/dist/components/native-select.js +1 -1
- package/dist/components/native-select.js.map +1 -1
- package/dist/components/pagination.js +1 -1
- package/dist/components/pagination.js.map +1 -1
- package/dist/components/radio-group.d.ts +23 -2
- package/dist/components/radio-group.js +1 -1
- package/dist/components/radio-group.js.map +1 -1
- package/dist/components/select.d.ts +1 -1
- package/dist/components/select.js +1 -1
- package/dist/components/select.js.map +1 -1
- package/dist/components/sidebar.d.ts +1 -1
- package/dist/components/sidebar.js +1 -1
- package/dist/components/sidebar.js.map +1 -1
- package/dist/components/simple-grid.d.ts +24 -0
- package/dist/components/simple-grid.js +2 -0
- package/dist/components/simple-grid.js.map +1 -0
- package/dist/components/spinner.d.ts +1 -1
- package/dist/components/spinner.js +1 -1
- package/dist/components/spinner.js.map +1 -1
- package/dist/components/stack.d.ts +2 -2
- package/dist/components/stack.js +1 -1
- package/dist/components/stack.js.map +1 -1
- package/dist/components/switch.d.ts +11 -1
- package/dist/components/switch.js +1 -1
- package/dist/components/switch.js.map +1 -1
- package/dist/components/tabs.d.ts +5 -2
- package/dist/components/tabs.js +1 -1
- package/dist/components/tabs.js.map +1 -1
- package/dist/components/text.js +1 -1
- package/dist/components/text.js.map +1 -1
- package/dist/components/toggle-group.d.ts +2 -0
- package/dist/components/toggle-group.js +1 -1
- package/dist/components/toggle-group.js.map +1 -1
- package/dist/components/toggle.d.ts +4 -2
- package/dist/components/toggle.js +1 -1
- package/dist/components/toggle.js.map +1 -1
- package/dist/components/visibility.d.ts +25 -0
- package/dist/components/visibility.js +2 -0
- package/dist/components/visibility.js.map +1 -0
- package/dist/hooks/use-breakpoint-value.d.ts +9 -0
- package/dist/hooks/use-breakpoint-value.js +2 -0
- package/dist/hooks/use-breakpoint-value.js.map +1 -0
- package/dist/hooks/use-breakpoint-value.spec.d.ts +1 -0
- package/dist/hooks/use-breakpoint-value.spec.js +15 -0
- package/dist/hooks/use-breakpoint-value.spec.js.map +1 -0
- package/dist/hooks/use-breakpoint.d.ts +9 -0
- package/dist/hooks/use-breakpoint.js +2 -0
- package/dist/hooks/use-breakpoint.js.map +1 -0
- package/dist/hooks/use-breakpoint.spec.d.ts +1 -0
- package/dist/hooks/use-breakpoint.spec.js +2 -0
- package/dist/hooks/use-breakpoint.spec.js.map +1 -0
- package/dist/index.d.ts +10 -4
- package/dist/index.js +1 -1
- package/dist/lib/button.d.ts +12 -8
- package/dist/lib/button.js +1 -1
- package/dist/lib/button.js.map +1 -1
- package/dist/lib/color.d.ts +20 -0
- package/dist/lib/color.js +2 -0
- package/dist/lib/color.js.map +1 -0
- package/dist/skills/uselets-ui/SKILL.md +1 -0
- package/dist/skills/uselets-ui/references/component-catalog.md +34 -4
- package/dist/skills/uselets-ui/references/package-guide.md +44 -9
- 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 +1 -0
- package/skills/uselets-ui/references/component-catalog.md +34 -4
- package/skills/uselets-ui/references/package-guide.md +44 -9
- package/dist/components/sheet.d.ts +0 -61
- package/dist/components/sheet.js +0 -2
- package/dist/components/sheet.js.map +0 -1
|
@@ -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`,
|
|
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,12 +88,14 @@ 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/lib/color`
|
|
92
|
+
- shared UI color list and type: `uiColors`, `UIColor`
|
|
91
93
|
- `@uselets/ui/styles.css`
|
|
92
94
|
- legacy compatibility stylesheet equivalent to the Max theme
|
|
93
95
|
- `@uselets/ui/themes/max.css`
|
|
94
96
|
- Max theme tokens and component styles
|
|
95
97
|
- `@uselets/ui/themes/gomax.css`
|
|
96
|
-
-
|
|
98
|
+
- GoMax theme tokens and component styles backed by the GoMax Figma palette
|
|
97
99
|
- `@uselets/ui/postcss.config`
|
|
98
100
|
- reusable PostCSS preset for Tailwind v4 setups
|
|
99
101
|
|
|
@@ -106,7 +108,7 @@ import '@uselets/ui/themes/max.css'
|
|
|
106
108
|
import '@fontsource-variable/inter'
|
|
107
109
|
```
|
|
108
110
|
|
|
109
|
-
For
|
|
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.
|
|
110
112
|
|
|
111
113
|
If the app needs Tailwind v4 PostCSS setup, reuse the package preset:
|
|
112
114
|
|
|
@@ -120,12 +122,31 @@ Make sure Tailwind itself is imported in the app stylesheet:
|
|
|
120
122
|
@import 'tailwindcss';
|
|
121
123
|
```
|
|
122
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
|
+
|
|
123
143
|
## Import patterns
|
|
124
144
|
|
|
125
145
|
Use these patterns:
|
|
126
146
|
|
|
127
147
|
```tsx
|
|
128
148
|
import { Alert, Button, cn, randomId } from '@uselets/ui'
|
|
149
|
+
import type { UIColor } from '@uselets/ui'
|
|
129
150
|
import { Dialog } from '@uselets/ui/dialog'
|
|
130
151
|
import { useIsMobile } from '@uselets/ui/hooks/use-mobile'
|
|
131
152
|
import { useDisclosure } from '@uselets/ui/hooks/use-disclosure'
|
|
@@ -140,7 +161,7 @@ Guidance:
|
|
|
140
161
|
- Use `@uselets/ui/hooks/<hook-module>` for dedicated hook subpaths.
|
|
141
162
|
- Do not invent undocumented subpaths.
|
|
142
163
|
|
|
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`.
|
|
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`.
|
|
144
165
|
|
|
145
166
|
`useLocalStorage` uses an options object and returns a tuple like `useState`:
|
|
146
167
|
|
|
@@ -208,18 +229,23 @@ export function AppRoot({ children }: { children: React.ReactNode }) {
|
|
|
208
229
|
|
|
209
230
|
The package stylesheet exposes these palette families:
|
|
210
231
|
|
|
232
|
+
- `primary`
|
|
211
233
|
- `brand`
|
|
234
|
+
- `gray`
|
|
212
235
|
- `zinc`
|
|
213
236
|
- `red`
|
|
237
|
+
- `yellow`
|
|
214
238
|
- `blue`
|
|
215
239
|
- `indigo`
|
|
216
240
|
- `pink`
|
|
217
241
|
- `green`
|
|
218
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
|
+
|
|
219
245
|
Each palette family is exposed as:
|
|
220
246
|
|
|
221
|
-
- CSS variables such as `--brand-500`
|
|
222
|
-
- Tailwind v4 utilities such as `bg-
|
|
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`
|
|
223
249
|
|
|
224
250
|
Primary semantic tokens:
|
|
225
251
|
|
|
@@ -234,9 +260,18 @@ Additional tokens:
|
|
|
234
260
|
- `--destructive-foreground`
|
|
235
261
|
- `text-destructive-foreground`
|
|
236
262
|
- `--gradient-primary`
|
|
237
|
-
- `--gradient-secondary`
|
|
238
263
|
|
|
239
|
-
The `Button` component can apply those palette families directly through `color:
|
|
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.
|
|
240
275
|
|
|
241
276
|
## Component selection
|
|
242
277
|
|
|
@@ -245,9 +280,9 @@ Choose components by intent:
|
|
|
245
280
|
- actions and status:
|
|
246
281
|
- `Button`, `Badge`, `Alert`, `Progress`, `Skeleton`, `Spinner`, `toast`
|
|
247
282
|
- forms and inputs:
|
|
248
|
-
- `Field`, `Input`, `Textarea`, `Checkbox`, `Switch`, `RadioGroup`, `Select`, `NativeSelect`, `Combobox`, `Dropzone`, `InputGroup`, `InputOTP`, `Slider`
|
|
283
|
+
- `Field`, `Input`, `Textarea`, `Checkbox`, `Switch`, `RadioGroup`, `Select`, `NativeSelect`, `Combobox`, `Dropzone`, `InputGroup`, `InputOTP`, `Slider`, `DateRangePicker`
|
|
249
284
|
- overlays and floating UI:
|
|
250
|
-
- `Dialog`, `Drawer`, `
|
|
285
|
+
- `Dialog`, `Drawer`, `Popover`, `Tooltip`, `HoverCard`, `AlertDialog`
|
|
251
286
|
- navigation:
|
|
252
287
|
- `Breadcrumb`, `NavigationMenu`, `Pagination`, `Sidebar`, `Tabs`, `DropdownMenu`, `Command`
|
|
253
288
|
- typography:
|