@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
package/README.md
CHANGED
|
@@ -92,7 +92,7 @@ import '@uselets/ui/themes/max.css'
|
|
|
92
92
|
import '@fontsource-variable/inter'
|
|
93
93
|
```
|
|
94
94
|
|
|
95
|
-
For
|
|
95
|
+
For GoMax apps, import `@uselets/ui/themes/gomax.css` instead. The legacy
|
|
96
96
|
`@uselets/ui/styles.css` entrypoint is still available and is equivalent to the Max theme.
|
|
97
97
|
|
|
98
98
|
2. Import components from the package root:
|
|
@@ -113,6 +113,7 @@ export function Example() {
|
|
|
113
113
|
|
|
114
114
|
```tsx
|
|
115
115
|
import { Button } from '@uselets/ui/button'
|
|
116
|
+
import { useBreakpointValue } from '@uselets/ui/hooks/use-breakpoint-value'
|
|
116
117
|
import { useIsMobile } from '@uselets/ui/hooks/use-mobile'
|
|
117
118
|
import { useDisclosure } from '@uselets/ui/hooks/use-disclosure'
|
|
118
119
|
import { useLocalStorage } from '@uselets/ui/hooks/use-local-storage'
|
|
@@ -127,35 +128,67 @@ The package ships brand theme entrypoints:
|
|
|
127
128
|
- `@uselets/ui/themes/gomax.css`
|
|
128
129
|
|
|
129
130
|
The compatibility stylesheet (`@uselets/ui/styles.css`) uses the Max theme.
|
|
131
|
+
Max and GoMax are maintained from their respective Figma style guides. The Storybook
|
|
132
|
+
`Foundations/Themes` story reads the active stylesheet tokens, so it is the theme-backed
|
|
133
|
+
palette preview for both theme entrypoints.
|
|
134
|
+
|
|
135
|
+
### Typography scale
|
|
136
|
+
|
|
137
|
+
The Max theme overrides Tailwind CSS text size utilities from `text-xs` through `text-6xl` to match the
|
|
138
|
+
Figma typography scale. Inter is the default sans-serif family, and each size uses a line height equal to
|
|
139
|
+
`font-size * 1.5`.
|
|
140
|
+
|
|
141
|
+
| Utility | Font size | Line height |
|
|
142
|
+
| --- | --- | --- |
|
|
143
|
+
| `text-xs` | `0.75rem` / `12px` | `1.125rem` / `18px` |
|
|
144
|
+
| `text-sm` | `0.875rem` / `14px` | `1.3125rem` / `21px` |
|
|
145
|
+
| `text-base` | `1rem` / `16px` | `1.5rem` / `24px` |
|
|
146
|
+
| `text-lg` | `1.125rem` / `18px` | `1.6875rem` / `27px` |
|
|
147
|
+
| `text-xl` | `1.25rem` / `20px` | `1.875rem` / `30px` |
|
|
148
|
+
| `text-2xl` | `1.5rem` / `24px` | `2.25rem` / `36px` |
|
|
149
|
+
| `text-3xl` | `1.875rem` / `30px` | `2.8125rem` / `45px` |
|
|
150
|
+
| `text-4xl` | `2.25rem` / `36px` | `3.375rem` / `54px` |
|
|
151
|
+
| `text-5xl` | `3rem` / `48px` | `4.5rem` / `72px` |
|
|
152
|
+
| `text-6xl` | `3.75rem` / `60px` | `5.625rem` / `90px` |
|
|
130
153
|
|
|
131
154
|
### Public palette families
|
|
132
155
|
|
|
133
156
|
The palette follows the Tailwind and shadcn convention of complete `50..950` scales.
|
|
134
157
|
|
|
158
|
+
- `primary`
|
|
135
159
|
- `brand`
|
|
160
|
+
- `gray`
|
|
136
161
|
- `zinc`
|
|
137
162
|
- `red`
|
|
163
|
+
- `yellow`
|
|
138
164
|
- `blue`
|
|
139
165
|
- `indigo`
|
|
140
166
|
- `pink`
|
|
141
167
|
- `green`
|
|
142
168
|
|
|
169
|
+
This same list is exported as `uiColors` and `UIColor` from `@uselets/ui` and `@uselets/ui/lib/color`.
|
|
170
|
+
Color-aware components such as `Button`, `Toggle`, `Checkbox`, `RadioGroupItem`, and `Switch` use `UIColor` for their public `color` props.
|
|
171
|
+
`ButtonColor` remains available as a compatibility alias for existing button consumers.
|
|
172
|
+
|
|
143
173
|
Each family is exposed in two layers:
|
|
144
174
|
|
|
145
|
-
- CSS variables such as `--brand-500` and `--zinc-900`
|
|
146
|
-
- Tailwind v4 theme utilities such as `bg-
|
|
175
|
+
- CSS variables such as `--primary-500`, `--brand-500` and `--zinc-900`
|
|
176
|
+
- Tailwind v4 theme utilities such as `bg-primary-500`, `text-zinc-900`, `border-red-300`
|
|
147
177
|
|
|
148
178
|
### Palette preview
|
|
149
179
|
|
|
150
180
|
| Family | Reference token | Preview |
|
|
151
181
|
| --- | --- | --- |
|
|
182
|
+
| `primary` | `primary-500` | <span style="display:inline-block;width:1.25rem;height:1.25rem;border-radius:0.375rem;border:1px solid #d9d9d9;background:#f93846;"></span> |
|
|
152
183
|
| `brand` | `brand-500` | <span style="display:inline-block;width:1.25rem;height:1.25rem;border-radius:0.375rem;border:1px solid #d9d9d9;background:#ff5c35;"></span> |
|
|
184
|
+
| `gray` | `gray-500` | <span style="display:inline-block;width:1.25rem;height:1.25rem;border-radius:0.375rem;border:1px solid #d9d9d9;background:#99afc4;"></span> |
|
|
153
185
|
| `zinc` | `zinc-500` | <span style="display:inline-block;width:1.25rem;height:1.25rem;border-radius:0.375rem;border:1px solid #d9d9d9;background:#989898;"></span> |
|
|
154
|
-
| `red` | `red-500` | <span style="display:inline-block;width:1.25rem;height:1.25rem;border-radius:0.375rem;border:1px solid #d9d9d9;background:#
|
|
186
|
+
| `red` | `red-500` | <span style="display:inline-block;width:1.25rem;height:1.25rem;border-radius:0.375rem;border:1px solid #d9d9d9;background:#e02535;"></span> |
|
|
187
|
+
| `yellow` | `yellow-500` | <span style="display:inline-block;width:1.25rem;height:1.25rem;border-radius:0.375rem;border:1px solid #d9d9d9;background:#ffa736;"></span> |
|
|
155
188
|
| `blue` | `blue-500` | <span style="display:inline-block;width:1.25rem;height:1.25rem;border-radius:0.375rem;border:1px solid #d9d9d9;background:#408ec5;"></span> |
|
|
156
|
-
| `indigo` | `indigo-500` | <span style="display:inline-block;width:1.25rem;height:1.25rem;border-radius:0.375rem;border:1px solid #d9d9d9;background:#
|
|
189
|
+
| `indigo` | `indigo-500` | <span style="display:inline-block;width:1.25rem;height:1.25rem;border-radius:0.375rem;border:1px solid #d9d9d9;background:#545ad4;"></span> |
|
|
157
190
|
| `pink` | `pink-500` | <span style="display:inline-block;width:1.25rem;height:1.25rem;border-radius:0.375rem;border:1px solid #d9d9d9;background:#bd138b;"></span> |
|
|
158
|
-
| `green` | `green-500` | <span style="display:inline-block;width:1.25rem;height:1.25rem;border-radius:0.375rem;border:1px solid #d9d9d9;background:#
|
|
191
|
+
| `green` | `green-500` | <span style="display:inline-block;width:1.25rem;height:1.25rem;border-radius:0.375rem;border:1px solid #d9d9d9;background:#52af4a;"></span> |
|
|
159
192
|
|
|
160
193
|
### Semantic tokens
|
|
161
194
|
|
|
@@ -174,12 +207,11 @@ The theme also exposes the shadcn foreground pair for destructive surfaces:
|
|
|
174
207
|
|
|
175
208
|
### Gradient tokens
|
|
176
209
|
|
|
177
|
-
The palette includes named gradient
|
|
210
|
+
The palette includes one named gradient token:
|
|
178
211
|
|
|
179
212
|
- `--gradient-primary`
|
|
180
|
-
- `--gradient-secondary`
|
|
181
213
|
|
|
182
|
-
|
|
214
|
+
This gradient is a documentation and styling primitive. It is not exposed as a Tailwind color family.
|
|
183
215
|
|
|
184
216
|
## Components
|
|
185
217
|
|
|
@@ -189,48 +221,60 @@ You can import from the package root (`@uselets/ui`) or by subpath (`@uselets/ui
|
|
|
189
221
|
| --- | --- | --- |
|
|
190
222
|
| `alert` | `Alert`, `AlertTitle`, `AlertDescription`, `AlertAction` | `Alert` supports `variant: 'default' \| 'destructive'` (default: `default`). |
|
|
191
223
|
| `anchor` | `Anchor`, `anchorVariants` | Link primitive rendered as `<a>` with `size: 'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'`, `underline: 'always' \| 'hover' \| 'never' \| 'not-hover'` (default: `hover`), and `asChild`. |
|
|
192
|
-
| `avatar` | `Avatar`, `AvatarImage`, `AvatarFallback`, `AvatarBadge`, `AvatarGroup`, `AvatarGroupCount` | `Avatar` supports `size: 'sm' \| '
|
|
193
|
-
| `button` | `Button`, `buttonVariants` | `variant: 'solid' \| 'outline' \| 'subtle' \| 'ghost' \| '
|
|
194
|
-
| `
|
|
224
|
+
| `avatar` | `Avatar`, `AvatarImage`, `AvatarFallback`, `AvatarBadge`, `AvatarGroup`, `AvatarGroupCount` | `Avatar` supports `size: 'sm' \| 'md' \| 'lg'` (default: `md`). |
|
|
225
|
+
| `button` | `Button`, `buttonVariants` | `variant: 'solid' \| 'outline' \| 'subtle' \| 'ghost' \| 'link'` (default: `solid`); `color: UIColor` (default: `primary`); `size: 'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl' \| 'icon-xs' \| 'icon-sm' \| 'icon' \| 'icon-lg' \| 'icon-xl'`; `loading?: boolean`. |
|
|
226
|
+
| `calendar` | `Calendar`, `CalendarDayButton` | 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. |
|
|
227
|
+
| `date-range-picker` | `DateRangePicker`, `DateRangePickerTrigger`, `DateRangePickerValue`, `DateRangePickerContent`, `DateRangePickerPresets`, `DateRangePickerPreset`, `DateRangePickerCalendar`, `DateRangePickerDateFields`, `DateRangePickerActions`, `DateRangePickerApply`, `DateRangePickerReset` | Compound popover picker backed by `Calendar` range mode. Draft edits from fixed presets, relative-day inputs, date inputs, and calendar stay in sync until `Apply`; reset/clear emits `null` through `onValueChange`. |
|
|
228
|
+
| `card` | `Card`, `CardHeader`, `CardTitle`, `CardDescription`, `CardAction`, `CardContent`, `CardFooter` | `Card` supports `size: 'sm' \| 'md'` (default: `md`). |
|
|
229
|
+
| `checkbox` | `Checkbox` | `Checkbox` supports `size: 'sm' \| 'md' \| 'lg'` (default: `md`), `color: UIColor` (default: `primary`), `label?: React.ReactNode`, and `labelProps` for the composed `Label`. When `label` is provided without `id`, it generates an id and wires `htmlFor` automatically. Label text follows checkbox size: `sm` 12px, `md` 14px, `lg` 20px. |
|
|
195
230
|
| `code` | `Code` | Inline code primitive rendered as `<code>`. |
|
|
231
|
+
| `combobox` | `Combobox`, `ComboboxInput`, `ComboboxContent`, `ComboboxList`, `ComboboxItem`, `ComboboxGroup`, `ComboboxLabel`, `ComboboxCollection`, `ComboboxClear`, `ComboboxEmpty`, `ComboboxSeparator`, `ComboboxChips`, `ComboboxChip`, `ComboboxChipsInput`, `ComboboxTrigger`, `ComboboxValue`, `useComboboxAnchor` | `ComboboxInput` supports `icon?: React.ReactNode`, `triggerIcon?: React.ReactNode`, `showTrigger?: boolean`, and `showClear?: boolean`; the trigger icon defaults to `IconSelector`. |
|
|
196
232
|
| `dialog` | `Dialog`, `DialogTrigger`, `DialogPortal`, `DialogClose`, `DialogOverlay`, `DialogContent`, `DialogHeader`, `DialogFooter`, `DialogTitle`, `DialogDescription` | `Dialog` supports `size: 'sm' \| 'md' \| 'lg' \| 'xl' \| '2xl'` (default: `sm`); `DialogContent.showCloseButton` (default: `true`); `DialogFooter.showCloseButton` (default: `false`). |
|
|
197
233
|
| `drawer` | `Drawer`, `DrawerTrigger`, `DrawerPortal`, `DrawerClose`, `DrawerOverlay`, `DrawerContent`, `DrawerHeader`, `DrawerFooter`, `DrawerTitle`, `DrawerDescription` | `Drawer` supports `size: 'sm' \| 'md' \| 'lg'` (default: `sm`). Direction (`top/right/bottom/left`) is handled by Vaul root props. |
|
|
198
234
|
| `dropzone` | `Dropzone`, `DropzoneArea`, `DropzoneDescription`, `DropzoneFileList`, `DropzoneFileListItem`, `DropzoneFileMessage`, `DropzoneMessage`, `DropzoneRemoveFile`, `DropzoneRetryFile`, `DropzoneTrigger`, `InfiniteProgress`, `useDropzone` | `useDropzone` manages upload lifecycle, validation (`accept`, `minSize`, `maxSize`, `maxFiles`), retry handling, and optional `shiftOnMaxFiles` replacement. Compose the returned state with `Dropzone` and its subcomponents. |
|
|
199
235
|
| `dropdown-menu` | `DropdownMenu`, `DropdownMenuTrigger`, `DropdownMenuContent`, `DropdownMenuItem`, `DropdownMenuCheckboxItem`, `DropdownMenuRadioGroup`, `DropdownMenuRadioItem`, `DropdownMenuSub`, `DropdownMenuSubTrigger`, `DropdownMenuSubContent`, `DropdownMenuSeparator`, `DropdownMenuShortcut` | `DropdownMenuContent` supports `side`, `sideOffset`, `align`, `alignOffset`; items support `inset`, and `DropdownMenuItem` supports `variant: 'default' \| 'destructive'`. |
|
|
200
236
|
| `empty` | `Empty`, `EmptyHeader`, `EmptyMedia`, `EmptyTitle`, `EmptyDescription`, `EmptyContent` | `EmptyMedia` supports `variant: 'default' \| 'icon'` (default: `default`). |
|
|
201
237
|
| `field` | `FieldSet`, `FieldLegend`, `FieldGroup`, `Field`, `FieldContent`, `FieldLabel`, `FieldTitle`, `FieldDescription`, `FieldSeparator`, `FieldError` | `Field.orientation: 'vertical' \| 'horizontal' \| 'responsive'` (default: `vertical`); `FieldLegend.variant: 'legend' \| 'label'`; `FieldError.errors` accepts an array of error objects. |
|
|
238
|
+
| `grid` | `Grid`, `GridItem` | `Grid` is a 12-column CSS grid by default and supports `gap`, `rowGap`, `columnGap`, `templateRows`, and `templateColumns`. `GridItem` defaults to `colSpan={12}` and supports numeric `colSpan` and `rowSpan`; use `useBreakpointValue` when spans or templates need responsive values. |
|
|
202
239
|
| `heading` | `Heading`, `headingVariants` | Heading primitive with `size: 'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` (default: `md`) and `asChild`. |
|
|
203
240
|
| `input` | `Input` | Wrapper for Base UI Input with all native `<input>` props. |
|
|
204
241
|
| `input-otp` | `InputOTP`, `InputOTPGroup`, `InputOTPSlot`, `InputOTPSeparator`, `REGEXP_ONLY_CHARS`, `REGEXP_ONLY_DIGITS`, `REGEXP_ONLY_DIGITS_AND_CHARS` | `InputOTP` supports all `input-otp` props plus `containerClassName`; use `maxLength` and `pattern` for validation. |
|
|
205
242
|
| `kbd` | `Kbd`, `KbdGroup` | Keyboard shortcut presentation primitives. |
|
|
206
243
|
| `label` | `Label` | Styled `<label>` wrapper. |
|
|
207
244
|
| `list` | `List`, `ListItem`, `ListIcon`, `listVariants` | `List.type: 'unordered' \| 'ordered'`; `size` and `spacing` use the `xs` to `xl` scale; `ListIcon` can use `asChild` and replaces the default marker with a primary-colored icon. |
|
|
208
|
-
| `native-select` | `NativeSelect`, `NativeSelectOption`, `NativeSelectOptGroup` | Native `<select>` API with `size: 'sm' \| '
|
|
245
|
+
| `native-select` | `NativeSelect`, `NativeSelectOption`, `NativeSelectOptGroup` | Native `<select>` API with `size: 'sm' \| 'md'` (default: `md`). |
|
|
209
246
|
| `popover` | `Popover`, `PopoverTrigger`, `PopoverContent`, `PopoverAnchor`, `PopoverHeader`, `PopoverTitle`, `PopoverDescription` | `PopoverContent` supports positioning props (`side`, `sideOffset`, `align`, `alignOffset`) and can be used in controlled mode via root props (`open`, `onOpenChange`). |
|
|
210
|
-
| `
|
|
247
|
+
| `radio-group` | `RadioGroup`, `RadioGroupItem` | `RadioGroup` supports `color: UIColor` (default: `primary`) for the group. `RadioGroupItem` supports `size: 'sm' \| 'md' \| 'lg'` (default: `md`), optional `color: UIColor` item overrides, `label?: React.ReactNode`, and `labelProps` for the composed `Label`. When `label` is provided without `id`, it generates an id and wires `htmlFor` automatically. Label text follows item size: `sm` 12px, `md` 14px, `lg` 20px. |
|
|
248
|
+
| `select` | `Select`, `SelectTrigger`, `SelectValue`, `SelectContent`, `SelectGroup`, `SelectItem`, `SelectLabel`, `SelectSeparator`, `SelectScrollUpButton`, `SelectScrollDownButton` | `SelectTrigger.size: 'sm' \| 'md'`; `SelectContent` supports positioning props (`side`, `sideOffset`, `align`, `alignOffset`, `alignItemWithTrigger`). |
|
|
211
249
|
| `separator` | `Separator` | `orientation: 'horizontal' \| 'vertical'` (default: `horizontal`). |
|
|
250
|
+
| `simple-grid` | `SimpleGrid` | 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. |
|
|
212
251
|
| `skeleton` | `Skeleton` | Generic loading placeholder block. |
|
|
213
|
-
| `spinner` | `Spinner` | Loader icon (`role="status"`), accepts SVG props and supports `size: 'sm' \| '
|
|
252
|
+
| `spinner` | `Spinner` | Loader icon (`role="status"`), accepts SVG props and supports `size: 'sm' \| 'md' \| 'lg'` (default: `md`). |
|
|
253
|
+
| `switch` | `Switch` | `Switch` supports `size: 'sm' \| 'md' \| 'lg'` (default: `md`), `color: UIColor` (default: `green`), `label?: React.ReactNode`, and `labelProps` for the composed `Label`. When `label` is provided without `id`, it generates an id and wires `htmlFor` automatically. Track size is `sm` 34x16px, `md` 42x20px, and `lg` 48x22px; the thumb and internal indicator scale with the switch. Label text follows switch size: `sm` 12px, `md` 14px, `lg` 20px. |
|
|
254
|
+
| `tabs` | `Tabs`, `TabsContent`, `TabsList`, `TabsTrigger`, `tabsListVariants` | `TabsList.variant: 'line' \| 'enclosed'` (default: `line`); `TabsList.grow?: boolean` makes horizontal tabs share the available width equally; `line` uses a neutral border line with a `primary` active indicator. |
|
|
214
255
|
| `text` | `Text`, `textVariants` | Text primitive with `size: 'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` (default: `md`) and `asChild`. |
|
|
215
256
|
| `timeline` | `Timeline`, `TimelineItem`, `TimelineConnector`, `TimelineContent`, `TimelineDescription`, `TimelineEmpty`, `TimelineHeader`, `TimelineIcon`, `TimelineTime`, `TimelineTitle`, `timelineVariants` | `Timeline.size: 'sm' \| 'md' \| 'lg'` (default: `md`); `Timeline.iconSize: 'sm' \| 'md' \| 'lg'`; `TimelineItem.status: 'completed' \| 'in-progress' \| 'pending'`; icon and connector colors use the semantic palette (`primary`, `secondary`, `muted`, `accent`, `destructive`). |
|
|
216
257
|
| `tooltip` | `TooltipProvider`, `Tooltip`, `TooltipTrigger`, `TooltipContent` | `TooltipProvider.delayDuration` controls global hover delay; `Tooltip` supports controlled mode (`open`, `onOpenChange`); `TooltipContent` supports positioning props like `side`, `align`, and `sideOffset`. |
|
|
258
|
+
| `visibility` | `HiddenFrom`, `VisibleFrom` | Breakpoint visibility helpers. `HiddenFrom breakpoint="md"` hides at `md` and above; `VisibleFrom breakpoint="md"` shows at `md` and above. |
|
|
217
259
|
| `sonner` | `Toaster`, `toast` | Toaster wrapper around Sonner with theme integration from `next-themes` and custom icons. |
|
|
218
260
|
|
|
219
261
|
### Additional components
|
|
220
262
|
|
|
221
263
|
The package also exports the following modules through the root entrypoint and subpaths:
|
|
222
264
|
|
|
223
|
-
- Layout and disclosure: `Accordion`, `Carousel`, `Center`, `Collapsible`, `Container`, `Group`, `Resizable`, `ScrollArea`, `
|
|
224
|
-
- Inputs and selection: `Calendar`, `
|
|
265
|
+
- Layout and disclosure: `Accordion`, `Carousel`, `Center`, `Collapsible`, `Container`, `Group`, `Resizable`, `ScrollArea`, `Sidebar`, `Stack`, `Tabs`
|
|
266
|
+
- Inputs and selection: `Calendar`, `DateRangePicker`, `InputGroup`, `RadioGroup`, `Slider`, `Switch`, `Textarea`, `Toggle`, `ToggleGroup`
|
|
225
267
|
- Navigation and feedback: `AlertDialog`, `Breadcrumb`, `NavigationMenu`, `Pagination`, `Progress`
|
|
226
268
|
- Data display and utilities: `Badge`, `ButtonGroup`, `Chart`, `Command`, `HoverCard`, `Table`, `ThemeProvider`, `useTheme`, `ModeToggle`
|
|
227
269
|
|
|
228
270
|
Each module exports its public composition parts and prop types from the same import path, for example `@uselets/ui/accordion` or `@uselets/ui`.
|
|
229
271
|
|
|
230
|
-
Layout primitives follow the same pattern: `Stack
|
|
272
|
+
Layout primitives follow the same pattern: `Stack` and `Group` support `gap: 'xs' | 'sm' | 'md' | 'lg' | 'xl'`; `Group` also supports `wrap`; `Center` supports `size: 'xs' | 'sm' | 'md' | 'lg' | 'xl'` and `direction: 'horizontal' | 'vertical'`; and `Container` supports `size: 'sm' | 'md' | 'lg' | 'full'`. `SimpleGrid`, `Grid`, and `GridItem` accept direct layout values; use `useBreakpointValue` to derive responsive values when needed. `HiddenFrom` and `VisibleFrom` provide breakpoint-based visibility wrappers.
|
|
231
273
|
|
|
232
274
|
Public hooks are exported from the package root and from the `@uselets/ui/hooks/*` namespace:
|
|
233
275
|
|
|
276
|
+
- `useBreakpoint` from `@uselets/ui/hooks/use-breakpoint`
|
|
277
|
+
- `useBreakpointValue` from `@uselets/ui/hooks/use-breakpoint-value`
|
|
234
278
|
- `useDisclosure` from `@uselets/ui/hooks/use-disclosure`
|
|
235
279
|
- `useInterval` from `@uselets/ui/hooks/use-interval`
|
|
236
280
|
- `useIdle` from `@uselets/ui/hooks/use-idle`
|
|
@@ -240,6 +284,14 @@ Public hooks are exported from the package root and from the `@uselets/ui/hooks/
|
|
|
240
284
|
|
|
241
285
|
Legacy hook subpaths such as `@uselets/ui/use-mobile` are not public entrypoints.
|
|
242
286
|
|
|
287
|
+
`useBreakpoint` checks Tailwind's default breakpoints (`base`, `sm`, `md`, `lg`, `xl`, `2xl`) and returns whether the current viewport is at or above the requested breakpoint. `useBreakpointValue` accepts a breakpoint map and returns the largest active value:
|
|
288
|
+
|
|
289
|
+
```tsx
|
|
290
|
+
const cols = useBreakpointValue({ base: 1, md: 2, lg: 3 }) ?? 1
|
|
291
|
+
|
|
292
|
+
return <SimpleGrid cols={cols} gap="md" />
|
|
293
|
+
```
|
|
294
|
+
|
|
243
295
|
`useLocalStorage` returns a tuple like `useState`, persists values as JSON, and syncs changes between browser tabs by default:
|
|
244
296
|
|
|
245
297
|
```tsx
|
|
@@ -10,15 +10,15 @@ type AlertDialogTriggerProps = React.ComponentProps<typeof AlertDialog$1.Trigger
|
|
|
10
10
|
type AlertDialogPortalProps = React.ComponentProps<typeof AlertDialog$1.Portal>;
|
|
11
11
|
type AlertDialogOverlayProps = React.ComponentProps<typeof AlertDialog$1.Overlay>;
|
|
12
12
|
type AlertDialogContentProps = React.ComponentProps<typeof AlertDialog$1.Content> & {
|
|
13
|
-
size?: '
|
|
13
|
+
size?: 'sm' | 'md';
|
|
14
14
|
};
|
|
15
15
|
type AlertDialogHeaderProps = React.ComponentProps<'div'>;
|
|
16
16
|
type AlertDialogFooterProps = React.ComponentProps<'div'>;
|
|
17
17
|
type AlertDialogMediaProps = React.ComponentProps<'div'>;
|
|
18
18
|
type AlertDialogTitleProps = React.ComponentProps<typeof AlertDialog$1.Title>;
|
|
19
19
|
type AlertDialogDescriptionProps = React.ComponentProps<typeof AlertDialog$1.Description>;
|
|
20
|
-
type AlertDialogActionProps = React.ComponentProps<typeof AlertDialog$1.Action> & Pick<React.ComponentProps<typeof Button>, 'variant' | 'size'>;
|
|
21
|
-
type AlertDialogCancelProps = React.ComponentProps<typeof AlertDialog$1.Cancel> & Pick<React.ComponentProps<typeof Button>, 'variant' | 'size'>;
|
|
20
|
+
type AlertDialogActionProps = React.ComponentProps<typeof AlertDialog$1.Action> & Pick<React.ComponentProps<typeof Button>, 'variant' | 'color' | 'size'>;
|
|
21
|
+
type AlertDialogCancelProps = React.ComponentProps<typeof AlertDialog$1.Cancel> & Pick<React.ComponentProps<typeof Button>, 'variant' | 'color' | 'size'>;
|
|
22
22
|
declare function AlertDialog({
|
|
23
23
|
...props
|
|
24
24
|
}: AlertDialogProps): _$react_jsx_runtime0.JSX.Element;
|
|
@@ -60,12 +60,14 @@ declare function AlertDialogDescription({
|
|
|
60
60
|
declare function AlertDialogAction({
|
|
61
61
|
className,
|
|
62
62
|
variant,
|
|
63
|
+
color,
|
|
63
64
|
size,
|
|
64
65
|
...props
|
|
65
66
|
}: AlertDialogActionProps): _$react_jsx_runtime0.JSX.Element;
|
|
66
67
|
declare function AlertDialogCancel({
|
|
67
68
|
className,
|
|
68
69
|
variant,
|
|
70
|
+
color,
|
|
69
71
|
size,
|
|
70
72
|
...props
|
|
71
73
|
}: AlertDialogCancelProps): _$react_jsx_runtime0.JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../chunk-CHh1Zzun.js";import{cn as e}from"../lib/utils.js";import{Button as t}from"./button.js";import{AlertDialog as n}from"radix-ui";import{jsx as r,jsxs as i}from"react/jsx-runtime";function AlertDialog({...e}){return r(n.Root,{"data-slot":`alert-dialog`,...e})}function AlertDialogTrigger({...e}){return r(n.Trigger,{"data-slot":`alert-dialog-trigger`,...e})}function AlertDialogPortal({...e}){return r(n.Portal,{"data-slot":`alert-dialog-portal`,...e})}function AlertDialogOverlay({className:t,...i}){return r(n.Overlay,{"data-slot":`alert-dialog-overlay`,className:e(`fixed inset-0 z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,t),...i})}function AlertDialogContent({className:t,size:a=`
|
|
1
|
+
import"../chunk-CHh1Zzun.js";import{cn as e}from"../lib/utils.js";import{Button as t}from"./button.js";import{AlertDialog as n}from"radix-ui";import{jsx as r,jsxs as i}from"react/jsx-runtime";function AlertDialog({...e}){return r(n.Root,{"data-slot":`alert-dialog`,...e})}function AlertDialogTrigger({...e}){return r(n.Trigger,{"data-slot":`alert-dialog-trigger`,...e})}function AlertDialogPortal({...e}){return r(n.Portal,{"data-slot":`alert-dialog-portal`,...e})}function AlertDialogOverlay({className:t,...i}){return r(n.Overlay,{"data-slot":`alert-dialog-overlay`,className:e(`fixed inset-0 z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,t),...i})}function AlertDialogContent({className:t,size:a=`md`,...o}){return i(AlertDialogPortal,{children:[r(AlertDialogOverlay,{}),r(n.Content,{"data-slot":`alert-dialog-content`,"data-size":a,className:e(`group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-background p-4 ring-1 ring-foreground/10 duration-100 outline-none data-[size=md]:max-w-xs data-[size=sm]:max-w-xs data-[size=md]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,t),...o})]})}function AlertDialogHeader({className:t,...n}){return r(`div`,{"data-slot":`alert-dialog-header`,className:e(`grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=md]/alert-dialog-content:place-items-start sm:group-data-[size=md]/alert-dialog-content:text-left sm:group-data-[size=md]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]`,t),...n})}function AlertDialogFooter({className:t,...n}){return r(`div`,{"data-slot":`alert-dialog-footer`,className:e(`-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end`,t),...n})}function AlertDialogMedia({className:t,...n}){return r(`div`,{"data-slot":`alert-dialog-media`,className:e(`mb-2 inline-flex size-10 items-center justify-center rounded-md bg-muted sm:group-data-[size=md]/alert-dialog-content:row-span-2 *:[svg:not([class*='size-'])]:size-6`,t),...n})}function AlertDialogTitle({className:t,...i}){return r(n.Title,{"data-slot":`alert-dialog-title`,className:e(`text-base font-medium sm:group-data-[size=md]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2`,t),...i})}function AlertDialogDescription({className:t,...i}){return r(n.Description,{"data-slot":`alert-dialog-description`,className:e(`text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,t),...i})}function AlertDialogAction({className:i,variant:a=`solid`,color:o=`primary`,size:s=`md`,...c}){return r(t,{variant:a,color:o,size:s,asChild:!0,children:r(n.Action,{"data-slot":`alert-dialog-action`,className:e(i),...c})})}function AlertDialogCancel({className:i,variant:a=`outline`,color:o=`primary`,size:s=`md`,...c}){return r(t,{variant:a,color:o,size:s,asChild:!0,children:r(n.Cancel,{"data-slot":`alert-dialog-cancel`,className:e(i),...c})})}export{AlertDialog,AlertDialogAction,AlertDialogCancel,AlertDialogContent,AlertDialogDescription,AlertDialogFooter,AlertDialogHeader,AlertDialogMedia,AlertDialogOverlay,AlertDialogPortal,AlertDialogTitle,AlertDialogTrigger};
|
|
2
2
|
//# sourceMappingURL=alert-dialog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert-dialog.js","names":["AlertDialogPrimitive"],"sources":["../../src/components/alert-dialog.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { AlertDialog as AlertDialogPrimitive } from 'radix-ui'\n\nimport { cn } from '../lib/utils'\nimport { Button } from './button'\n\nexport type AlertDialogProps = React.ComponentProps<typeof AlertDialogPrimitive.Root>\n\nexport type AlertDialogTriggerProps = React.ComponentProps<typeof AlertDialogPrimitive.Trigger>\n\nexport type AlertDialogPortalProps = React.ComponentProps<typeof AlertDialogPrimitive.Portal>\n\nexport type AlertDialogOverlayProps = React.ComponentProps<typeof AlertDialogPrimitive.Overlay>\n\nexport type AlertDialogContentProps = React.ComponentProps<typeof AlertDialogPrimitive.Content> & {\n size?: '
|
|
1
|
+
{"version":3,"file":"alert-dialog.js","names":["AlertDialogPrimitive"],"sources":["../../src/components/alert-dialog.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { AlertDialog as AlertDialogPrimitive } from 'radix-ui'\n\nimport { cn } from '../lib/utils'\nimport { Button } from './button'\n\nexport type AlertDialogProps = React.ComponentProps<typeof AlertDialogPrimitive.Root>\n\nexport type AlertDialogTriggerProps = React.ComponentProps<typeof AlertDialogPrimitive.Trigger>\n\nexport type AlertDialogPortalProps = React.ComponentProps<typeof AlertDialogPrimitive.Portal>\n\nexport type AlertDialogOverlayProps = React.ComponentProps<typeof AlertDialogPrimitive.Overlay>\n\nexport type AlertDialogContentProps = React.ComponentProps<typeof AlertDialogPrimitive.Content> & {\n size?: 'sm' | 'md'\n}\n\nexport type AlertDialogHeaderProps = React.ComponentProps<'div'>\n\nexport type AlertDialogFooterProps = React.ComponentProps<'div'>\n\nexport type AlertDialogMediaProps = React.ComponentProps<'div'>\n\nexport type AlertDialogTitleProps = React.ComponentProps<typeof AlertDialogPrimitive.Title>\n\nexport type AlertDialogDescriptionProps = React.ComponentProps<typeof AlertDialogPrimitive.Description>\n\nexport type AlertDialogActionProps = React.ComponentProps<typeof AlertDialogPrimitive.Action> &\n Pick<React.ComponentProps<typeof Button>, 'variant' | 'color' | 'size'>\n\nexport type AlertDialogCancelProps = React.ComponentProps<typeof AlertDialogPrimitive.Cancel> &\n Pick<React.ComponentProps<typeof Button>, 'variant' | 'color' | 'size'>\n\nfunction AlertDialog({ ...props }: AlertDialogProps) {\n return <AlertDialogPrimitive.Root data-slot=\"alert-dialog\" {...props} />\n}\n\nfunction AlertDialogTrigger({ ...props }: AlertDialogTriggerProps) {\n return <AlertDialogPrimitive.Trigger data-slot=\"alert-dialog-trigger\" {...props} />\n}\n\nfunction AlertDialogPortal({ ...props }: AlertDialogPortalProps) {\n return <AlertDialogPrimitive.Portal data-slot=\"alert-dialog-portal\" {...props} />\n}\n\nfunction AlertDialogOverlay({ className, ...props }: AlertDialogOverlayProps) {\n return (\n <AlertDialogPrimitive.Overlay\n data-slot=\"alert-dialog-overlay\"\n className={cn(\n 'fixed inset-0 z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AlertDialogContent({ className, size = 'md', ...props }: AlertDialogContentProps) {\n return (\n <AlertDialogPortal>\n <AlertDialogOverlay />\n <AlertDialogPrimitive.Content\n data-slot=\"alert-dialog-content\"\n data-size={size}\n className={cn(\n 'group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-background p-4 ring-1 ring-foreground/10 duration-100 outline-none data-[size=md]:max-w-xs data-[size=sm]:max-w-xs data-[size=md]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95',\n className\n )}\n {...props}\n />\n </AlertDialogPortal>\n )\n}\n\nfunction AlertDialogHeader({ className, ...props }: AlertDialogHeaderProps) {\n return (\n <div\n data-slot=\"alert-dialog-header\"\n className={cn(\n 'grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=md]/alert-dialog-content:place-items-start sm:group-data-[size=md]/alert-dialog-content:text-left sm:group-data-[size=md]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AlertDialogFooter({ className, ...props }: AlertDialogFooterProps) {\n return (\n <div\n data-slot=\"alert-dialog-footer\"\n className={cn(\n '-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AlertDialogMedia({ className, ...props }: AlertDialogMediaProps) {\n return (\n <div\n data-slot=\"alert-dialog-media\"\n className={cn(\n \"mb-2 inline-flex size-10 items-center justify-center rounded-md bg-muted sm:group-data-[size=md]/alert-dialog-content:row-span-2 *:[svg:not([class*='size-'])]:size-6\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AlertDialogTitle({ className, ...props }: AlertDialogTitleProps) {\n return (\n <AlertDialogPrimitive.Title\n data-slot=\"alert-dialog-title\"\n className={cn(\n 'text-base font-medium sm:group-data-[size=md]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AlertDialogDescription({ className, ...props }: AlertDialogDescriptionProps) {\n return (\n <AlertDialogPrimitive.Description\n data-slot=\"alert-dialog-description\"\n className={cn(\n 'text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AlertDialogAction({\n className,\n variant = 'solid',\n color = 'primary',\n size = 'md',\n ...props\n}: AlertDialogActionProps) {\n return (\n <Button variant={variant} color={color} size={size} asChild>\n <AlertDialogPrimitive.Action data-slot=\"alert-dialog-action\" className={cn(className)} {...props} />\n </Button>\n )\n}\n\nfunction AlertDialogCancel({\n className,\n variant = 'outline',\n color = 'primary',\n size = 'md',\n ...props\n}: AlertDialogCancelProps) {\n return (\n <Button variant={variant} color={color} size={size} asChild>\n <AlertDialogPrimitive.Cancel data-slot=\"alert-dialog-cancel\" className={cn(className)} {...props} />\n </Button>\n )\n}\n\nexport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogMedia,\n AlertDialogOverlay,\n AlertDialogPortal,\n AlertDialogTitle,\n AlertDialogTrigger\n}\n"],"mappings":"gMAmCA,SAAS,YAAY,CAAE,GAAG,GAA2B,CACnD,OAAO,EAACA,EAAqB,KAAtB,CAA2B,YAAU,eAAe,GAAI,EAAS,CAAA,CAG1E,SAAS,mBAAmB,CAAE,GAAG,GAAkC,CACjE,OAAO,EAACA,EAAqB,QAAtB,CAA8B,YAAU,uBAAuB,GAAI,EAAS,CAAA,CAGrF,SAAS,kBAAkB,CAAE,GAAG,GAAiC,CAC/D,OAAO,EAACA,EAAqB,OAAtB,CAA6B,YAAU,sBAAsB,GAAI,EAAS,CAAA,CAGnF,SAAS,mBAAmB,CAAE,YAAW,GAAG,GAAkC,CAC5E,OACE,EAACA,EAAqB,QAAtB,CACE,YAAU,uBACV,UAAW,EACT,gLACA,EACD,CACD,GAAI,EACJ,CAAA,CAIN,SAAS,mBAAmB,CAAE,YAAW,OAAO,KAAM,GAAG,GAAkC,CACzF,OACE,EAAC,kBAAD,CAAA,SAAA,CACE,EAAC,mBAAD,EAAsB,CAAA,CACtB,EAACA,EAAqB,QAAtB,CACE,YAAU,uBACV,YAAW,EACX,UAAW,EACT,8YACA,EACD,CACD,GAAI,EACJ,CAAA,CACgB,CAAA,CAAA,CAIxB,SAAS,kBAAkB,CAAE,YAAW,GAAG,GAAiC,CAC1E,OACE,EAAC,MAAD,CACE,YAAU,sBACV,UAAW,EACT,sYACA,EACD,CACD,GAAI,EACJ,CAAA,CAIN,SAAS,kBAAkB,CAAE,YAAW,GAAG,GAAiC,CAC1E,OACE,EAAC,MAAD,CACE,YAAU,sBACV,UAAW,EACT,gNACA,EACD,CACD,GAAI,EACJ,CAAA,CAIN,SAAS,iBAAiB,CAAE,YAAW,GAAG,GAAgC,CACxE,OACE,EAAC,MAAD,CACE,YAAU,qBACV,UAAW,EACT,wKACA,EACD,CACD,GAAI,EACJ,CAAA,CAIN,SAAS,iBAAiB,CAAE,YAAW,GAAG,GAAgC,CACxE,OACE,EAACA,EAAqB,MAAtB,CACE,YAAU,qBACV,UAAW,EACT,+IACA,EACD,CACD,GAAI,EACJ,CAAA,CAIN,SAAS,uBAAuB,CAAE,YAAW,GAAG,GAAsC,CACpF,OACE,EAACA,EAAqB,YAAtB,CACE,YAAU,2BACV,UAAW,EACT,iIACA,EACD,CACD,GAAI,EACJ,CAAA,CAIN,SAAS,kBAAkB,CACzB,YACA,UAAU,QACV,QAAQ,UACR,OAAO,KACP,GAAG,GACsB,CACzB,OACE,EAAC,EAAD,CAAiB,UAAgB,QAAa,OAAM,QAAA,YAClD,EAACA,EAAqB,OAAtB,CAA6B,YAAU,sBAAsB,UAAW,EAAG,EAAU,CAAE,GAAI,EAAS,CAAA,CAC7F,CAAA,CAIb,SAAS,kBAAkB,CACzB,YACA,UAAU,UACV,QAAQ,UACR,OAAO,KACP,GAAG,GACsB,CACzB,OACE,EAAC,EAAD,CAAiB,UAAgB,QAAa,OAAM,QAAA,YAClD,EAACA,EAAqB,OAAtB,CAA6B,YAAU,sBAAsB,UAAW,EAAG,EAAU,CAAE,GAAI,EAAS,CAAA,CAC7F,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../chunk-CHh1Zzun.js";import{cn as e}from"../lib/utils.js";import{Slot as t}from"radix-ui";import{jsx as n}from"react/jsx-runtime";import{cva as r}from"class-variance-authority";const i=r(`text-primary rounded-sm underline-offset-4 transition-colors outline-none hover:text-primary/80 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-3`,{variants:{size:{xs:`text-xs
|
|
1
|
+
import"../chunk-CHh1Zzun.js";import{cn as e}from"../lib/utils.js";import{Slot as t}from"radix-ui";import{jsx as n}from"react/jsx-runtime";import{cva as r}from"class-variance-authority";const i=r(`text-primary rounded-sm underline-offset-4 transition-colors outline-none hover:text-primary/80 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-3`,{variants:{size:{xs:`text-xs`,sm:`text-sm`,md:`text-base`,lg:`text-lg`,xl:`text-xl`},underline:{always:`underline`,hover:`no-underline hover:underline`,never:`no-underline`,"not-hover":`underline hover:no-underline`}},defaultVariants:{size:`md`,underline:`hover`}});function Anchor({className:r,size:a=`md`,underline:o=`hover`,asChild:s=!1,...c}){return n(s?t.Root:`a`,{"data-slot":`anchor`,"data-size":a,"data-underline":o,className:e(i({size:a,underline:o}),r),...c})}export{Anchor,i as anchorVariants};
|
|
2
2
|
//# sourceMappingURL=anchor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"anchor.js","names":[],"sources":["../../src/components/anchor.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { Slot } from 'radix-ui'\n\nimport { cn } from '../lib/utils'\n\nconst anchorVariants = cva(\n 'text-primary rounded-sm underline-offset-4 transition-colors outline-none hover:text-primary/80 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-3',\n {\n variants: {\n size: {\n xs: 'text-xs
|
|
1
|
+
{"version":3,"file":"anchor.js","names":[],"sources":["../../src/components/anchor.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { Slot } from 'radix-ui'\n\nimport { cn } from '../lib/utils'\n\nconst anchorVariants = cva(\n 'text-primary rounded-sm underline-offset-4 transition-colors outline-none hover:text-primary/80 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-3',\n {\n variants: {\n size: {\n xs: 'text-xs',\n sm: 'text-sm',\n md: 'text-base',\n lg: 'text-lg',\n xl: 'text-xl'\n },\n underline: {\n always: 'underline',\n hover: 'no-underline hover:underline',\n never: 'no-underline',\n 'not-hover': 'underline hover:no-underline'\n }\n },\n defaultVariants: {\n size: 'md',\n underline: 'hover'\n }\n }\n)\n\nexport type AnchorProps = React.ComponentProps<'a'> &\n VariantProps<typeof anchorVariants> & {\n asChild?: boolean\n }\n\nfunction Anchor({ className, size = 'md', underline = 'hover', asChild = false, ...props }: AnchorProps) {\n const Comp = asChild ? Slot.Root : 'a'\n\n return (\n <Comp\n data-slot=\"anchor\"\n data-size={size}\n data-underline={underline}\n className={cn(anchorVariants({ size, underline }), className)}\n {...props}\n />\n )\n}\n\nexport { Anchor, anchorVariants }\n"],"mappings":"yLAOA,MAAM,EAAiB,EACrB,4KACA,CACE,SAAU,CACR,KAAM,CACJ,GAAI,UACJ,GAAI,UACJ,GAAI,YACJ,GAAI,UACJ,GAAI,UACL,CACD,UAAW,CACT,OAAQ,YACR,MAAO,+BACP,MAAO,eACP,YAAa,+BACd,CACF,CACD,gBAAiB,CACf,KAAM,KACN,UAAW,QACZ,CACF,CACF,CAOD,SAAS,OAAO,CAAE,YAAW,OAAO,KAAM,YAAY,QAAS,UAAU,GAAO,GAAG,GAAsB,CAGvG,OACE,EAHW,EAAU,EAAK,KAAO,IAGjC,CACE,YAAU,SACV,YAAW,EACX,iBAAgB,EAChB,UAAW,EAAG,EAAe,CAAE,OAAM,YAAW,CAAC,CAAE,EAAU,CAC7D,GAAI,EACJ,CAAA"}
|
|
@@ -5,7 +5,7 @@ import * as React from "react";
|
|
|
5
5
|
|
|
6
6
|
//#region src/components/avatar.d.ts
|
|
7
7
|
type AvatarProps = React.ComponentProps<typeof Avatar$1.Root> & {
|
|
8
|
-
size?: '
|
|
8
|
+
size?: 'sm' | 'md' | 'lg';
|
|
9
9
|
};
|
|
10
10
|
type AvatarImageProps = React.ComponentProps<typeof Avatar$1.Image>;
|
|
11
11
|
type AvatarFallbackProps = React.ComponentProps<typeof Avatar$1.Fallback>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../chunk-CHh1Zzun.js";import{cn as e}from"../lib/utils.js";import{Avatar as t}from"radix-ui";import{jsx as n}from"react/jsx-runtime";function Avatar({className:r,size:i=`
|
|
1
|
+
import"../chunk-CHh1Zzun.js";import{cn as e}from"../lib/utils.js";import{Avatar as t}from"radix-ui";import{jsx as n}from"react/jsx-runtime";function Avatar({className:r,size:i=`md`,...a}){return n(t.Root,{"data-slot":`avatar`,"data-size":i,className:e(`group/avatar relative flex shrink-0 size-8 rounded-full select-none`,`data-[size=lg]:size-10 data-[size=sm]:size-6`,`after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken dark:after:mix-blend-lighten`,r),...a})}function AvatarImage({className:r,...i}){return n(t.Image,{"data-slot":`avatar-image`,className:e(`rounded-full aspect-square size-full object-cover`,r),...i})}function AvatarFallback({className:r,...i}){return n(t.Fallback,{"data-slot":`avatar-fallback`,className:e(`bg-muted text-muted-foreground rounded-full flex size-full items-center justify-center text-sm group-data-[size=sm]/avatar:text-xs`,r),...i})}function AvatarBadge({className:t,...r}){return n(`span`,{"data-slot":`avatar-badge`,className:e(`bg-primary text-primary-foreground ring-background absolute right-0 bottom-0 z-10 inline-flex items-center justify-center rounded-full bg-blend-color ring-2 select-none`,`group-data-[size=sm]/avatar:size-2 group-data-[size=sm]/avatar:[&>svg]:hidden`,`group-data-[size=md]/avatar:size-2.5 group-data-[size=md]/avatar:[&>svg]:size-2`,`group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>svg]:size-2`,t),...r})}function AvatarGroup({className:t,...r}){return n(`div`,{"data-slot":`avatar-group`,className:e(`*:data-[slot=avatar]:ring-background group/avatar-group flex -space-x-2 *:data-[slot=avatar]:ring-2`,t),...r})}function AvatarGroupCount({className:t,...r}){return n(`div`,{"data-slot":`avatar-group-count`,className:e(`bg-muted text-muted-foreground ring-background relative flex shrink-0 items-center justify-center size-8 rounded-full text-sm ring-2`,`group-has-data-[size=lg]/avatar-group:size-10 group-has-data-[size=sm]/avatar-group:size-6`,`[&>svg]:size-4 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3`,t),...r})}export{Avatar,AvatarBadge,AvatarFallback,AvatarGroup,AvatarGroupCount,AvatarImage};
|
|
2
2
|
//# sourceMappingURL=avatar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"avatar.js","names":["AvatarPrimitive"],"sources":["../../src/components/avatar.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { Avatar as AvatarPrimitive } from 'radix-ui'\n\nimport { cn } from '../lib/utils'\n\nexport type AvatarProps = React.ComponentProps<typeof AvatarPrimitive.Root> & {\n size?: '
|
|
1
|
+
{"version":3,"file":"avatar.js","names":["AvatarPrimitive"],"sources":["../../src/components/avatar.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { Avatar as AvatarPrimitive } from 'radix-ui'\n\nimport { cn } from '../lib/utils'\n\nexport type AvatarProps = React.ComponentProps<typeof AvatarPrimitive.Root> & {\n size?: 'sm' | 'md' | 'lg'\n}\n\nexport type AvatarImageProps = React.ComponentProps<typeof AvatarPrimitive.Image>\n\nexport type AvatarFallbackProps = React.ComponentProps<typeof AvatarPrimitive.Fallback>\n\nexport type AvatarBadgeProps = React.ComponentProps<'span'>\n\nexport type AvatarGroupProps = React.ComponentProps<'div'>\n\nexport type AvatarGroupCountProps = React.ComponentProps<'div'>\n\nfunction Avatar({ className, size = 'md', ...props }: AvatarProps) {\n return (\n <AvatarPrimitive.Root\n data-slot=\"avatar\"\n data-size={size}\n className={cn(\n 'group/avatar relative flex shrink-0 size-8 rounded-full select-none',\n 'data-[size=lg]:size-10 data-[size=sm]:size-6',\n 'after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken dark:after:mix-blend-lighten',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AvatarImage({ className, ...props }: AvatarImageProps) {\n return (\n <AvatarPrimitive.Image\n data-slot=\"avatar-image\"\n className={cn('rounded-full aspect-square size-full object-cover', className)}\n {...props}\n />\n )\n}\n\nfunction AvatarFallback({ className, ...props }: AvatarFallbackProps) {\n return (\n <AvatarPrimitive.Fallback\n data-slot=\"avatar-fallback\"\n className={cn(\n 'bg-muted text-muted-foreground rounded-full flex size-full items-center justify-center text-sm group-data-[size=sm]/avatar:text-xs',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AvatarBadge({ className, ...props }: AvatarBadgeProps) {\n return (\n <span\n data-slot=\"avatar-badge\"\n className={cn(\n 'bg-primary text-primary-foreground ring-background absolute right-0 bottom-0 z-10 inline-flex items-center justify-center rounded-full bg-blend-color ring-2 select-none',\n 'group-data-[size=sm]/avatar:size-2 group-data-[size=sm]/avatar:[&>svg]:hidden',\n 'group-data-[size=md]/avatar:size-2.5 group-data-[size=md]/avatar:[&>svg]:size-2',\n 'group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>svg]:size-2',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AvatarGroup({ className, ...props }: AvatarGroupProps) {\n return (\n <div\n data-slot=\"avatar-group\"\n className={cn(\n '*:data-[slot=avatar]:ring-background group/avatar-group flex -space-x-2 *:data-[slot=avatar]:ring-2',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AvatarGroupCount({ className, ...props }: AvatarGroupCountProps) {\n return (\n <div\n data-slot=\"avatar-group-count\"\n className={cn(\n 'bg-muted text-muted-foreground ring-background relative flex shrink-0 items-center justify-center size-8 rounded-full text-sm ring-2',\n 'group-has-data-[size=lg]/avatar-group:size-10 group-has-data-[size=sm]/avatar-group:size-6',\n '[&>svg]:size-4 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3',\n className\n )}\n {...props}\n />\n )\n}\n\nexport { Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage }\n"],"mappings":"4IAoBA,SAAS,OAAO,CAAE,YAAW,OAAO,KAAM,GAAG,GAAsB,CACjE,OACE,EAACA,EAAgB,KAAjB,CACE,YAAU,SACV,YAAW,EACX,UAAW,EACT,sEACA,+CACA,uIACA,EACD,CACD,GAAI,EACJ,CAAA,CAIN,SAAS,YAAY,CAAE,YAAW,GAAG,GAA2B,CAC9D,OACE,EAACA,EAAgB,MAAjB,CACE,YAAU,eACV,UAAW,EAAG,oDAAqD,EAAU,CAC7E,GAAI,EACJ,CAAA,CAIN,SAAS,eAAe,CAAE,YAAW,GAAG,GAA8B,CACpE,OACE,EAACA,EAAgB,SAAjB,CACE,YAAU,kBACV,UAAW,EACT,qIACA,EACD,CACD,GAAI,EACJ,CAAA,CAIN,SAAS,YAAY,CAAE,YAAW,GAAG,GAA2B,CAC9D,OACE,EAAC,OAAD,CACE,YAAU,eACV,UAAW,EACT,2KACA,gFACA,kFACA,gFACA,EACD,CACD,GAAI,EACJ,CAAA,CAIN,SAAS,YAAY,CAAE,YAAW,GAAG,GAA2B,CAC9D,OACE,EAAC,MAAD,CACE,YAAU,eACV,UAAW,EACT,sGACA,EACD,CACD,GAAI,EACJ,CAAA,CAIN,SAAS,iBAAiB,CAAE,YAAW,GAAG,GAAgC,CACxE,OACE,EAAC,MAAD,CACE,YAAU,qBACV,UAAW,EACT,uIACA,6FACA,2HACA,EACD,CACD,GAAI,EACJ,CAAA"}
|
package/dist/components/badge.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../chunk-CHh1Zzun.js";import{cn as e}from"../lib/utils.js";import{Slot as t}from"radix-ui";import{jsx as n}from"react/jsx-runtime";import{cva as r}from"class-variance-authority";const i=r(`group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-
|
|
1
|
+
import"../chunk-CHh1Zzun.js";import{cn as e}from"../lib/utils.js";import{Slot as t}from"radix-ui";import{jsx as n}from"react/jsx-runtime";import{cva as r}from"class-variance-authority";const i=r(`group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-[8px] border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,destructive:`bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20`,outline:`border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground`,ghost:`hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50`,link:`text-primary underline-offset-4 hover:underline`}},defaultVariants:{variant:`default`}});function Badge({className:r,variant:a=`default`,asChild:o=!1,...s}){return n(o?t.Root:`span`,{"data-slot":`badge`,"data-variant":a,className:e(i({variant:a}),r),...s})}export{Badge,i as badgeVariants};
|
|
2
2
|
//# sourceMappingURL=badge.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"badge.js","names":[],"sources":["../../src/components/badge.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { Slot } from 'radix-ui'\n\nimport { cn } from '../lib/utils'\n\nconst badgeVariants = cva(\n 'group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-
|
|
1
|
+
{"version":3,"file":"badge.js","names":[],"sources":["../../src/components/badge.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { Slot } from 'radix-ui'\n\nimport { cn } from '../lib/utils'\n\nconst badgeVariants = cva(\n 'group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-[8px] border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!',\n {\n variants: {\n variant: {\n default: 'bg-primary text-primary-foreground [a]:hover:bg-primary/80',\n secondary: 'bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80',\n destructive:\n 'bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20',\n outline: 'border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground',\n ghost: 'hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50',\n link: 'text-primary underline-offset-4 hover:underline'\n }\n },\n defaultVariants: {\n variant: 'default'\n }\n }\n)\n\nexport type BadgeProps = React.ComponentProps<'span'> &\n VariantProps<typeof badgeVariants> & {\n asChild?: boolean\n }\n\nfunction Badge({ className, variant = 'default', asChild = false, ...props }: BadgeProps) {\n const Comp = asChild ? Slot.Root : 'span'\n\n return (\n <Comp data-slot=\"badge\" data-variant={variant} className={cn(badgeVariants({ variant }), className)} {...props} />\n )\n}\n\nexport { Badge, badgeVariants }\n"],"mappings":"yLAOA,MAAM,EAAgB,EACpB,+eACA,CACE,SAAU,CACR,QAAS,CACP,QAAS,6DACT,UAAW,mEACX,YACE,iKACF,QAAS,mFACT,MAAO,oEACP,KAAM,kDACP,CACF,CACD,gBAAiB,CACf,QAAS,UACV,CACF,CACF,CAOD,SAAS,MAAM,CAAE,YAAW,UAAU,UAAW,UAAU,GAAO,GAAG,GAAqB,CAGxF,OACE,EAHW,EAAU,EAAK,KAAO,OAGjC,CAAM,YAAU,QAAQ,eAAc,EAAS,UAAW,EAAG,EAAc,CAAE,UAAS,CAAC,CAAE,EAAU,CAAE,GAAI,EAAS,CAAA"}
|
|
@@ -6,19 +6,23 @@ import * as _$class_variance_authority_types0 from "class-variance-authority/typ
|
|
|
6
6
|
|
|
7
7
|
//#region src/components/button.d.ts
|
|
8
8
|
declare const buttonVariants: (props?: ({
|
|
9
|
-
variant?: "
|
|
10
|
-
color?: "brand" | "zinc" | "red" | "blue" | "indigo" | "pink" | "green" | null | undefined;
|
|
11
|
-
size?: "
|
|
9
|
+
variant?: "outline" | "ghost" | "link" | "solid" | "subtle" | null | undefined;
|
|
10
|
+
color?: "primary" | "brand" | "gray" | "zinc" | "red" | "yellow" | "blue" | "indigo" | "pink" | "green" | null | undefined;
|
|
11
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | "icon-xl" | null | undefined;
|
|
12
12
|
} & _$class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
13
13
|
type ButtonProps = React.ComponentProps<'button'> & VariantProps<typeof buttonVariants> & {
|
|
14
14
|
asChild?: boolean;
|
|
15
|
+
loading?: boolean;
|
|
15
16
|
};
|
|
16
17
|
declare function Button({
|
|
18
|
+
children,
|
|
17
19
|
className,
|
|
18
20
|
variant,
|
|
19
21
|
color,
|
|
20
22
|
size,
|
|
21
23
|
asChild,
|
|
24
|
+
disabled,
|
|
25
|
+
loading,
|
|
22
26
|
...props
|
|
23
27
|
}: ButtonProps): _$react_jsx_runtime0.JSX.Element;
|
|
24
28
|
//#endregion
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../chunk-CHh1Zzun.js";import{cn as e}from"../lib/utils.js";import{buttonColorVariants as t}from"../lib/button.js";import{
|
|
1
|
+
import"../chunk-CHh1Zzun.js";import{cn as e}from"../lib/utils.js";import{buttonColorVariants as t}from"../lib/button.js";import{Spinner as n}from"./spinner.js";import{Slot as r}from"radix-ui";import{Fragment as i,jsx as a,jsxs as o}from"react/jsx-runtime";import{cva as s}from"class-variance-authority";const c=s(`focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 relative rounded-full border border-transparent bg-clip-padding text-sm font-medium focus-visible:ring-3 aria-invalid:ring-3 [&_svg:not([class*='size-'])]:size-4 inline-flex items-center justify-center whitespace-nowrap transition-all [&_svg]:transition-colors disabled:pointer-events-none disabled:opacity-50 disabled:data-[loading=true]:pointer-events-auto disabled:data-[loading=true]:cursor-not-allowed disabled:data-[loading=true]:opacity-100 [&_svg]:pointer-events-none shrink-0 [&_svg]:shrink-0 outline-none group/button select-none`,{variants:{variant:{solid:`bg-(--button-solid) text-(--button-solid-foreground) hover:bg-(--button-solid-hover) data-[loading=true]:hover:bg-(--button-solid)`,outline:`border-(--button-outline-border) bg-background text-(--button-outline-foreground) hover:bg-(--button-solid) hover:text-(--button-solid-foreground) hover:[&_svg]:text-(--button-solid-foreground) data-[loading=true]:hover:bg-background data-[loading=true]:hover:text-(--button-outline-foreground) aria-expanded:bg-(--button-solid) aria-expanded:text-(--button-solid-foreground) aria-expanded:[&_svg]:text-(--button-solid-foreground)`,subtle:`bg-(--button-soft) text-(--button-soft-foreground) hover:bg-(--button-soft-hover) hover:text-(--button-soft-foreground) data-[loading=true]:hover:bg-(--button-soft) data-[loading=true]:hover:text-(--button-soft-foreground) aria-expanded:bg-(--button-soft-hover) aria-expanded:text-(--button-soft-foreground)`,ghost:`text-(--button-ghost-foreground) hover:bg-(--button-ghost-hover) hover:text-(--button-ghost-foreground) data-[loading=true]:hover:bg-transparent data-[loading=true]:hover:text-(--button-ghost-foreground) aria-expanded:bg-(--button-ghost-hover) aria-expanded:text-(--button-ghost-foreground)`,link:`text-(--button-link-foreground) underline-offset-4 hover:underline data-[loading=true]:hover:no-underline`},color:t,size:{xs:`h-7 gap-1 px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-8 gap-1 px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,md:`h-9 gap-1.5 px-2.5 in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,lg:`h-10 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3`,xl:`h-11 gap-2 px-3 has-data-[icon=inline-end]:pr-4 has-data-[icon=inline-start]:pl-4`,icon:`size-9`,"icon-xs":`size-7 in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-8 in-data-[slot=button-group]:rounded-lg`,"icon-lg":`size-10`,"icon-xl":`size-11`}},defaultVariants:{variant:`solid`,color:`primary`,size:`md`}});function Button({children:t,className:s,variant:l=`solid`,color:u=`primary`,size:d=`md`,asChild:f=!1,disabled:p,loading:m=!1,...h}){return a(f?r.Root:`button`,{type:f?void 0:`button`,"data-slot":`button`,"data-variant":l,"data-color":u,"data-size":d,"data-loading":m,"aria-busy":m?!0:void 0,disabled:p||m,className:e(c({variant:l,color:u,size:d,className:s})),...h,children:m&&!f?o(i,{children:[a(`span`,{className:`invisible inline-flex items-center gap-[inherit]`,children:t}),a(`span`,{className:`absolute inset-0 inline-flex items-center justify-center`,children:a(n,{})})]}):m?a(n,{}):t})}export{Button,c as buttonVariants};
|
|
2
2
|
//# sourceMappingURL=button.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.js","names":[],"sources":["../../src/components/button.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { Slot } from 'radix-ui'\n\nimport { buttonColorVariants } from '../lib/button'\nimport { cn } from '../lib/utils'\n\nconst buttonVariants = cva(\n \"focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-
|
|
1
|
+
{"version":3,"file":"button.js","names":[],"sources":["../../src/components/button.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { Slot } from 'radix-ui'\n\nimport { buttonColorVariants } from '../lib/button'\nimport { cn } from '../lib/utils'\nimport { Spinner } from './spinner'\n\nconst buttonVariants = cva(\n \"focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 relative rounded-full border border-transparent bg-clip-padding text-sm font-medium focus-visible:ring-3 aria-invalid:ring-3 [&_svg:not([class*='size-'])]:size-4 inline-flex items-center justify-center whitespace-nowrap transition-all [&_svg]:transition-colors disabled:pointer-events-none disabled:opacity-50 disabled:data-[loading=true]:pointer-events-auto disabled:data-[loading=true]:cursor-not-allowed disabled:data-[loading=true]:opacity-100 [&_svg]:pointer-events-none shrink-0 [&_svg]:shrink-0 outline-none group/button select-none\",\n {\n variants: {\n variant: {\n solid:\n 'bg-(--button-solid) text-(--button-solid-foreground) hover:bg-(--button-solid-hover) data-[loading=true]:hover:bg-(--button-solid)',\n outline:\n 'border-(--button-outline-border) bg-background text-(--button-outline-foreground) hover:bg-(--button-solid) hover:text-(--button-solid-foreground) hover:[&_svg]:text-(--button-solid-foreground) data-[loading=true]:hover:bg-background data-[loading=true]:hover:text-(--button-outline-foreground) aria-expanded:bg-(--button-solid) aria-expanded:text-(--button-solid-foreground) aria-expanded:[&_svg]:text-(--button-solid-foreground)',\n subtle:\n 'bg-(--button-soft) text-(--button-soft-foreground) hover:bg-(--button-soft-hover) hover:text-(--button-soft-foreground) data-[loading=true]:hover:bg-(--button-soft) data-[loading=true]:hover:text-(--button-soft-foreground) aria-expanded:bg-(--button-soft-hover) aria-expanded:text-(--button-soft-foreground)',\n ghost:\n 'text-(--button-ghost-foreground) hover:bg-(--button-ghost-hover) hover:text-(--button-ghost-foreground) data-[loading=true]:hover:bg-transparent data-[loading=true]:hover:text-(--button-ghost-foreground) aria-expanded:bg-(--button-ghost-hover) aria-expanded:text-(--button-ghost-foreground)',\n link: 'text-(--button-link-foreground) underline-offset-4 hover:underline data-[loading=true]:hover:no-underline'\n },\n color: buttonColorVariants,\n size: {\n xs: \"h-7 gap-1 px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3\",\n sm: \"h-8 gap-1 px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5\",\n md: 'h-9 gap-1.5 px-2.5 in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2',\n lg: 'h-10 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3',\n xl: 'h-11 gap-2 px-3 has-data-[icon=inline-end]:pr-4 has-data-[icon=inline-start]:pl-4',\n icon: 'size-9',\n 'icon-xs': \"size-7 in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3\",\n 'icon-sm': 'size-8 in-data-[slot=button-group]:rounded-lg',\n 'icon-lg': 'size-10',\n 'icon-xl': 'size-11'\n }\n },\n defaultVariants: {\n variant: 'solid',\n color: 'primary',\n size: 'md'\n }\n }\n)\n\nexport type ButtonProps = React.ComponentProps<'button'> &\n VariantProps<typeof buttonVariants> & {\n asChild?: boolean\n loading?: boolean\n }\n\nfunction Button({\n children,\n className,\n variant = 'solid',\n color = 'primary',\n size = 'md',\n asChild = false,\n disabled,\n loading = false,\n ...props\n}: ButtonProps) {\n const Comp = asChild ? Slot.Root : 'button'\n const isDisabled = disabled || loading\n\n return (\n <Comp\n type={!asChild ? 'button' : undefined}\n data-slot=\"button\"\n data-variant={variant}\n data-color={color}\n data-size={size}\n data-loading={loading}\n aria-busy={loading ? true : undefined}\n disabled={isDisabled}\n className={cn(buttonVariants({ variant, color, size, className }))}\n {...props}\n >\n {loading && !asChild ? (\n <>\n <span className=\"invisible inline-flex items-center gap-[inherit]\">{children}</span>\n <span className=\"absolute inset-0 inline-flex items-center justify-center\">\n <Spinner />\n </span>\n </>\n ) : loading ? (\n <Spinner />\n ) : (\n children\n )}\n </Comp>\n )\n}\n\nexport { Button, buttonVariants }\n"],"mappings":"+SASA,MAAM,EAAiB,EACrB,kuBACA,CACE,SAAU,CACR,QAAS,CACP,MACE,qIACF,QACE,ibACF,OACE,sTACF,MACE,qSACF,KAAM,4GACP,CACD,MAAO,EACP,KAAM,CACJ,GAAI,2KACJ,GAAI,qLACJ,GAAI,8HACJ,GAAI,wFACJ,GAAI,oFACJ,KAAM,SACN,UAAW,qFACX,UAAW,gDACX,UAAW,UACX,UAAW,UACZ,CACF,CACD,gBAAiB,CACf,QAAS,QACT,MAAO,UACP,KAAM,KACP,CACF,CACF,CAQD,SAAS,OAAO,CACd,WACA,YACA,UAAU,QACV,QAAQ,UACR,OAAO,KACP,UAAU,GACV,WACA,UAAU,GACV,GAAG,GACW,CAId,OACE,EAJW,EAAU,EAAK,KAAO,SAIjC,CACE,KAAO,EAAqB,IAAA,GAAX,SACjB,YAAU,SACV,eAAc,EACd,aAAY,EACZ,YAAW,EACX,eAAc,EACd,YAAW,EAAU,GAAO,IAAA,GAC5B,SAXe,GAAY,EAY3B,UAAW,EAAG,EAAe,CAAE,UAAS,QAAO,OAAM,YAAW,CAAC,CAAC,CAClE,GAAI,WAEH,GAAW,CAAC,EACX,EAAA,EAAA,CAAA,SAAA,CACE,EAAC,OAAD,CAAM,UAAU,mDAAoD,WAAgB,CAAA,CACpF,EAAC,OAAD,CAAM,UAAU,oEACd,EAAC,EAAD,EAAW,CAAA,CACN,CAAA,CACN,CAAA,CAAA,CACD,EACF,EAAC,EAAD,EAAW,CAAA,CAEX,EAEG,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../chunk-CHh1Zzun.js";import{cn as e}from"../lib/utils.js";import{Button as t,buttonVariants as n}from"./button.js";import{IconChevronDown as r,IconChevronLeft as i,IconChevronRight as a}from"@tabler/icons-react";import{jsx as o}from"react/jsx-runtime";import*as s from"react";import{DayPicker as c,getDefaultClassNames as l}from"react-day-picker";import*as u from"react-day-picker/locale";function Calendar({className:t,classNames:s,showOutsideDays:u=!0,captionLayout:d=`label`,buttonVariant:f=`ghost`,locale:p,formatters:m,components:h,...g}){let _=l();return o(c,{showOutsideDays:u,className:e(`group/calendar bg-background p-2 [--cell-radius:var(--radius-md)] [--cell-size:--spacing(7)] in-data-[slot=card-content]:bg-transparent in-data-[slot=popover-content]:bg-transparent`,String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,t),captionLayout:d,locale:p,formatters:{formatMonthDropdown:e=>e.toLocaleString(p?.code,{month:`short`}),...m},classNames:{root:e(`w-fit`,_.root),months:e(`relative flex
|
|
1
|
+
import"../chunk-CHh1Zzun.js";import{cn as e}from"../lib/utils.js";import{Button as t,buttonVariants as n}from"./button.js";import{IconChevronDown as r,IconChevronLeft as i,IconChevronRight as a}from"@tabler/icons-react";import{jsx as o}from"react/jsx-runtime";import*as s from"react";import{DayPicker as c,getDefaultClassNames as l}from"react-day-picker";import*as u from"react-day-picker/locale";function Calendar({className:t,classNames:s,showOutsideDays:u=!0,captionLayout:d=`label`,buttonVariant:f=`ghost`,locale:p,formatters:m,components:h,...g}){let _=l();return o(c,{showOutsideDays:u,className:e(`group/calendar bg-background p-2 [--cell-radius:var(--radius-md)] [--cell-size:--spacing(7)] in-data-[slot=card-content]:bg-transparent in-data-[slot=popover-content]:bg-transparent`,String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,t),captionLayout:d,locale:p,formatters:{formatMonthDropdown:e=>e.toLocaleString(p?.code,{month:`short`}),...m},classNames:{root:e(`w-fit`,_.root),months:e(`relative flex gap-4`,_.months),month:e(`flex w-full flex-col gap-4`,_.month),nav:e(`absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1`,_.nav),button_previous:e(n({variant:f}),`size-(--cell-size) p-0 select-none aria-disabled:opacity-50`,_.button_previous),button_next:e(n({variant:f}),`size-(--cell-size) p-0 select-none aria-disabled:opacity-50`,_.button_next),month_caption:e(`flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)`,_.month_caption),dropdowns:e(`flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium`,_.dropdowns),dropdown_root:e(`relative rounded-(--cell-radius)`,_.dropdown_root),dropdown:e(`absolute inset-0 bg-popover opacity-0`,_.dropdown),caption_label:e(`font-medium select-none`,d===`label`?`text-sm`:`flex items-center gap-1 rounded-(--cell-radius) text-sm [&>svg]:size-3.5 [&>svg]:text-muted-foreground`,_.caption_label),table:`w-full border-collapse`,weekdays:e(`flex`,_.weekdays),weekday:e(`flex-1 rounded-(--cell-radius) text-[0.8rem] font-normal text-muted-foreground select-none`,_.weekday),week:e(`mt-2 flex w-full`,_.week),week_number_header:e(`w-(--cell-size) text-xs font-normal text-muted-foreground select-none`,_.week_number_header),week_number:e(`text-xs font-normal tabular-nums text-muted-foreground select-none`,_.week_number),day:e(`group/day relative aspect-square h-full w-full rounded-(--cell-radius) p-0 text-center select-none [&:last-child[data-selected=true]_button]:rounded-r-(--cell-radius)`,g.showWeekNumber?`[&:nth-child(2)[data-selected=true]_button]:rounded-l-(--cell-radius)`:`[&:first-child[data-selected=true]_button]:rounded-l-(--cell-radius)`,_.day),range_start:e(`relative isolate z-0 rounded-l-(--cell-radius) bg-primary-50 after:absolute after:inset-y-0 after:right-0 after:w-4 after:bg-primary-50 dark:bg-primary-950 dark:after:bg-primary-950`,_.range_start),range_middle:e(`rounded-none`,_.range_middle),range_end:e(`relative isolate z-0 rounded-r-(--cell-radius) bg-primary-50 after:absolute after:inset-y-0 after:left-0 after:w-4 after:bg-primary-50 dark:bg-primary-950 dark:after:bg-primary-950`,_.range_end),today:e(`rounded-(--cell-radius) bg-muted text-foreground data-[selected=true]:rounded-none`,_.today),outside:e(`text-muted-foreground aria-selected:text-muted-foreground`,_.outside),disabled:e(`text-muted-foreground opacity-50`,_.disabled),hidden:e(`invisible`,_.hidden),...s},components:{Root:({className:t,rootRef:n,...r})=>o(`div`,{"data-slot":`calendar`,ref:n,className:e(t),...r}),Chevron:({className:t,orientation:n,...s})=>o(n===`left`?i:n===`right`?a:r,{className:e(`size-4`,t),...s}),DayButton:({...e})=>o(CalendarDayButton,{locale:p,...e}),WeekNumber:({children:e,...t})=>o(`td`,{...t,children:o(`div`,{className:`flex size-(--cell-size) items-center justify-center text-center text-xs font-normal tabular-nums`,children:e})}),...h},...g})}function CalendarDayButton({className:n,day:r,modifiers:i,locale:a,...c}){let u=l(),d=r.date.getDay()===0||r.date.getDay()===6,f=s.useRef(null);return s.useEffect(()=>{i.focused&&f.current?.focus()},[i.focused]),o(t,{ref:f,variant:`ghost`,size:`icon`,color:`zinc`,"data-day":r.date.toLocaleDateString(a?.code),"data-weekend":d,"data-selected-single":i.selected&&!i.range_start&&!i.range_end&&!i.range_middle,"data-range-start":i.range_start,"data-range-end":i.range_end,"data-range-middle":i.range_middle,className:e(`relative isolate z-10 flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 border-0 text-foreground leading-none font-normal`,`hover:bg-primary-50 hover:text-foreground dark:hover:bg-primary-950 dark:hover:text-foreground`,`group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-[3px] group-data-[focused=true]/day:ring-ring/50`,`data-[weekend=true]:text-destructive data-[weekend=true]:hover:bg-red-50 data-[weekend=true]:hover:text-destructive dark:data-[weekend=true]:hover:bg-red-950`,`data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-primary-50 data-[range-middle=true]:text-foreground data-[range-middle=true]:hover:bg-primary-50 data-[range-middle=true]:hover:text-foreground dark:data-[range-middle=true]:bg-primary-950 dark:data-[range-middle=true]:hover:bg-primary-950`,`data-[range-middle=true]:data-[weekend=true]:text-destructive data-[range-middle=true]:data-[weekend=true]:hover:bg-red-50 data-[range-middle=true]:data-[weekend=true]:hover:text-destructive dark:data-[range-middle=true]:data-[weekend=true]:hover:bg-red-950`,`data-[range-end=true]:rounded-(--cell-radius) data-[range-end=true]:rounded-r-(--cell-radius) data-[range-end=true]:bg-primary-500 data-[range-end=true]:text-white data-[range-end=true]:hover:bg-primary-500 data-[range-end=true]:hover:text-white dark:data-[range-end=true]:hover:bg-primary-500`,`data-[range-end=true]:data-[weekend=true]:text-white data-[range-end=true]:data-[weekend=true]:hover:text-white`,`data-[range-start=true]:rounded-(--cell-radius) data-[range-start=true]:rounded-l-(--cell-radius) data-[range-start=true]:bg-primary-500 data-[range-start=true]:text-white data-[range-start=true]:hover:bg-primary-500 data-[range-start=true]:hover:text-white dark:data-[range-start=true]:hover:bg-primary-500`,`data-[range-start=true]:data-[weekend=true]:text-white data-[range-start=true]:data-[weekend=true]:hover:text-white`,`data-[selected-single=true]:bg-primary-500 data-[selected-single=true]:text-white data-[selected-single=true]:hover:bg-primary-500 data-[selected-single=true]:hover:text-white dark:data-[selected-single=true]:hover:bg-primary-500`,`data-[selected-single=true]:data-[weekend=true]:text-white data-[selected-single=true]:data-[weekend=true]:hover:text-white`,`[&>span]:text-xs [&>span]:opacity-70`,u.day,n),...c})}export{Calendar,CalendarDayButton,u as locale};
|
|
2
2
|
//# sourceMappingURL=calendar.js.map
|