@uselets/ui 0.6.1 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +85 -25
- package/dist/cli/uselets.mjs +2 -2
- package/dist/cli/uselets.mjs.map +1 -1
- 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 +3 -3
- package/dist/skills/uselets-ui/references/component-catalog.md +34 -4
- package/dist/skills/uselets-ui/references/package-guide.md +51 -17
- package/dist/skills/uselets-ui/scripts/print-public-api.mjs +0 -1
- package/dist/styles/base.css +13 -0
- package/dist/styles/globals.css +8 -0
- package/dist/styles/gomax.css +202 -0
- package/dist/styles/max.css +203 -0
- package/dist/styles/theme.css +195 -0
- package/dist/themes/gomax.css +3 -2
- package/dist/themes/max.css +3 -2
- package/package.json +1 -2
- package/skills/uselets-ui/SKILL.md +3 -3
- package/skills/uselets-ui/references/component-catalog.md +34 -4
- package/skills/uselets-ui/references/package-guide.md +51 -17
- package/skills/uselets-ui/scripts/print-public-api.mjs +0 -1
- package/dist/components/sheet.d.ts +0 -61
- package/dist/components/sheet.js +0 -2
- package/dist/components/sheet.js.map +0 -1
- package/dist/styles.css +0 -2
|
@@ -88,25 +88,26 @@ Use `bun uselets skill --agent codex` or `bun uselets skill --agent claude` to i
|
|
|
88
88
|
- subpath import for dedicated hooks such as `use-mobile`, `use-disclosure`, or `use-local-storage`
|
|
89
89
|
- `@uselets/ui/utils`
|
|
90
90
|
- utility helpers such as `cn` and `randomId`
|
|
91
|
-
- `@uselets/ui/
|
|
92
|
-
-
|
|
91
|
+
- `@uselets/ui/lib/color`
|
|
92
|
+
- shared UI color list and type: `uiColors`, `UIColor`
|
|
93
93
|
- `@uselets/ui/themes/max.css`
|
|
94
94
|
- Max theme tokens and component styles
|
|
95
95
|
- `@uselets/ui/themes/gomax.css`
|
|
96
|
-
-
|
|
96
|
+
- GoMax theme tokens and component styles backed by the GoMax Figma palette
|
|
97
97
|
- `@uselets/ui/postcss.config`
|
|
98
98
|
- reusable PostCSS preset for Tailwind v4 setups
|
|
99
99
|
|
|
100
100
|
## Base setup
|
|
101
101
|
|
|
102
|
-
Import one package theme once
|
|
102
|
+
Import Tailwind, one package theme, and Inter once in the app global stylesheet:
|
|
103
103
|
|
|
104
|
-
```
|
|
105
|
-
import '
|
|
106
|
-
import '@
|
|
104
|
+
```css
|
|
105
|
+
@import 'tailwindcss';
|
|
106
|
+
@import '@uselets/ui/themes/max.css';
|
|
107
|
+
@import '@fontsource-variable/inter';
|
|
107
108
|
```
|
|
108
109
|
|
|
109
|
-
For
|
|
110
|
+
For GoMax apps, import `@uselets/ui/themes/gomax.css` instead.
|
|
110
111
|
|
|
111
112
|
If the app needs Tailwind v4 PostCSS setup, reuse the package preset:
|
|
112
113
|
|
|
@@ -114,18 +115,37 @@ If the app needs Tailwind v4 PostCSS setup, reuse the package preset:
|
|
|
114
115
|
export { default } from '@uselets/ui/postcss.config'
|
|
115
116
|
```
|
|
116
117
|
|
|
117
|
-
|
|
118
|
+
When the app uses installed `@uselets/ui` components, add a Tailwind source directive so component classes from the package are generated:
|
|
118
119
|
|
|
119
120
|
```css
|
|
120
|
-
@
|
|
121
|
+
@source '../node_modules/@uselets/ui/dist';
|
|
121
122
|
```
|
|
122
123
|
|
|
124
|
+
## Typography scale
|
|
125
|
+
|
|
126
|
+
The Max theme uses Inter as `font-sans` and overrides Tailwind CSS text size utilities from `text-xs` through
|
|
127
|
+
`text-6xl`. Each size includes a default line height equal to `font-size * 1.5`.
|
|
128
|
+
|
|
129
|
+
| Utility | Font size | Line height |
|
|
130
|
+
| --- | --- | --- |
|
|
131
|
+
| `text-xs` | `0.75rem` / `12px` | `1.125rem` / `18px` |
|
|
132
|
+
| `text-sm` | `0.875rem` / `14px` | `1.3125rem` / `21px` |
|
|
133
|
+
| `text-base` | `1rem` / `16px` | `1.5rem` / `24px` |
|
|
134
|
+
| `text-lg` | `1.125rem` / `18px` | `1.6875rem` / `27px` |
|
|
135
|
+
| `text-xl` | `1.25rem` / `20px` | `1.875rem` / `30px` |
|
|
136
|
+
| `text-2xl` | `1.5rem` / `24px` | `2.25rem` / `36px` |
|
|
137
|
+
| `text-3xl` | `1.875rem` / `30px` | `2.8125rem` / `45px` |
|
|
138
|
+
| `text-4xl` | `2.25rem` / `36px` | `3.375rem` / `54px` |
|
|
139
|
+
| `text-5xl` | `3rem` / `48px` | `4.5rem` / `72px` |
|
|
140
|
+
| `text-6xl` | `3.75rem` / `60px` | `5.625rem` / `90px` |
|
|
141
|
+
|
|
123
142
|
## Import patterns
|
|
124
143
|
|
|
125
144
|
Use these patterns:
|
|
126
145
|
|
|
127
146
|
```tsx
|
|
128
147
|
import { Alert, Button, cn, randomId } from '@uselets/ui'
|
|
148
|
+
import type { UIColor } from '@uselets/ui'
|
|
129
149
|
import { Dialog } from '@uselets/ui/dialog'
|
|
130
150
|
import { useIsMobile } from '@uselets/ui/hooks/use-mobile'
|
|
131
151
|
import { useDisclosure } from '@uselets/ui/hooks/use-disclosure'
|
|
@@ -140,7 +160,7 @@ Guidance:
|
|
|
140
160
|
- Use `@uselets/ui/hooks/<hook-module>` for dedicated hook subpaths.
|
|
141
161
|
- Do not invent undocumented subpaths.
|
|
142
162
|
|
|
143
|
-
Public hook subpaths currently include `hooks/use-mobile`, `hooks/use-disclosure`, `hooks/use-interval`, `hooks/use-idle`, `hooks/use-document-visibility`, and `hooks/use-local-storage`. Legacy `@uselets/ui/use-*` paths are not public entrypoints. Utility helpers are available from `@uselets/ui/utils`.
|
|
163
|
+
Public hook subpaths currently include `hooks/use-mobile`, `hooks/use-disclosure`, `hooks/use-interval`, `hooks/use-idle`, `hooks/use-document-visibility`, and `hooks/use-local-storage`. Legacy `@uselets/ui/use-*` paths are not public entrypoints. Utility helpers are available from `@uselets/ui/utils`, and shared UI color helpers are available from the root barrel or `@uselets/ui/lib/color`.
|
|
144
164
|
|
|
145
165
|
`useLocalStorage` uses an options object and returns a tuple like `useState`:
|
|
146
166
|
|
|
@@ -208,18 +228,23 @@ export function AppRoot({ children }: { children: React.ReactNode }) {
|
|
|
208
228
|
|
|
209
229
|
The package stylesheet exposes these palette families:
|
|
210
230
|
|
|
231
|
+
- `primary`
|
|
211
232
|
- `brand`
|
|
233
|
+
- `gray`
|
|
212
234
|
- `zinc`
|
|
213
235
|
- `red`
|
|
236
|
+
- `yellow`
|
|
214
237
|
- `blue`
|
|
215
238
|
- `indigo`
|
|
216
239
|
- `pink`
|
|
217
240
|
- `green`
|
|
218
241
|
|
|
242
|
+
The same palette family names are exported as `uiColors` and `UIColor`. `Button`, `Toggle`, `Checkbox`, `RadioGroupItem`, and `Switch` use `UIColor` for color props. `ButtonColor` remains available as a compatibility alias, but new public APIs should use `UIColor`.
|
|
243
|
+
|
|
219
244
|
Each palette family is exposed as:
|
|
220
245
|
|
|
221
|
-
- CSS variables such as `--brand-500`
|
|
222
|
-
- Tailwind v4 utilities such as `bg-
|
|
246
|
+
- CSS variables such as `--primary-500`, `--brand-500`, and `--zinc-900`
|
|
247
|
+
- Tailwind v4 utilities such as `bg-primary-500`, `text-zinc-900`, `border-red-300`
|
|
223
248
|
|
|
224
249
|
Primary semantic tokens:
|
|
225
250
|
|
|
@@ -234,9 +259,18 @@ Additional tokens:
|
|
|
234
259
|
- `--destructive-foreground`
|
|
235
260
|
- `text-destructive-foreground`
|
|
236
261
|
- `--gradient-primary`
|
|
237
|
-
- `--gradient-secondary`
|
|
238
262
|
|
|
239
|
-
The `Button` component can apply those palette families directly through `color:
|
|
263
|
+
The `Button` component can apply those palette families directly through `color: UIColor`, with `primary` as the default. Its public variants are `solid`, `outline`, `subtle`, `ghost`, and `link`, with `solid` as the default. Its public sizes are `xs`, `sm`, `md`, `lg`, `xl`, `icon-xs`, `icon-sm`, `icon`, `icon-lg`, and `icon-xl`; `loading` shows a centered spinner, keeps native button content invisible to preserve size, and disables the button without dimming it.
|
|
264
|
+
|
|
265
|
+
The `Checkbox` component can be used as a bare checkbox or with `label?: React.ReactNode`. It supports `size: 'sm' | 'md' | 'lg'` and `color: UIColor`, with `primary` as the default color. When `label` is provided, it composes the package `Label`, accepts `labelProps` for that label, and generates an accessible `id`/`htmlFor` pair when no `id` prop is passed. Composed label text follows checkbox size: `sm` 12px, `md` 14px, and `lg` 20px.
|
|
266
|
+
|
|
267
|
+
The `Switch` component can be used as a bare switch or with `label?: React.ReactNode`. It supports `size: 'sm' | 'md' | 'lg'` and `color: UIColor`, with `green` as the default color. The `color` prop controls only the checked track and indicator color; unchecked remains neutral. Track size is `sm` 34x16px, `md` 42x20px, and `lg` 48x22px. The thumb and its internal indicator scale with the selected size. Composed label text follows switch size: `sm` 12px, `md` 14px, and `lg` 20px.
|
|
268
|
+
|
|
269
|
+
The `TabsList` component supports `variant: 'line' | 'enclosed'`, with `line` as the default, and `grow?: boolean` for equal-width horizontal tabs. The `line` variant keeps a neutral border line across tabs and uses the `primary` color for the active indicator; use `enclosed` for the filled container treatment.
|
|
270
|
+
|
|
271
|
+
The `RadioGroup` component supports `color: UIColor`, with `primary` as the default group color. `RadioGroupItem` can be used as a bare radio item inside `RadioGroup` or with `label?: React.ReactNode`; it supports `size: 'sm' | 'md' | 'lg'` and optional `color: UIColor` item overrides. Composed label text follows item size: `sm` 12px, `md` 14px, and `lg` 20px.
|
|
272
|
+
|
|
273
|
+
The `DateRangePicker` component is a compound popover date range picker built on `Calendar` range mode. Use `DateRange | null` for controlled values; applying an empty draft or resetting emits `null` through `onValueChange`. Fixed presets, relative-day inputs, date inputs, and the calendar all edit the same draft, and `DateRangePickerPreset` displays a selected state when its range matches the current draft by calendar day.
|
|
240
274
|
|
|
241
275
|
## Component selection
|
|
242
276
|
|
|
@@ -245,9 +279,9 @@ Choose components by intent:
|
|
|
245
279
|
- actions and status:
|
|
246
280
|
- `Button`, `Badge`, `Alert`, `Progress`, `Skeleton`, `Spinner`, `toast`
|
|
247
281
|
- forms and inputs:
|
|
248
|
-
- `Field`, `Input`, `Textarea`, `Checkbox`, `Switch`, `RadioGroup`, `Select`, `NativeSelect`, `Combobox`, `Dropzone`, `InputGroup`, `InputOTP`, `Slider`
|
|
282
|
+
- `Field`, `Input`, `Textarea`, `Checkbox`, `Switch`, `RadioGroup`, `Select`, `NativeSelect`, `Combobox`, `Dropzone`, `InputGroup`, `InputOTP`, `Slider`, `DateRangePicker`
|
|
249
283
|
- overlays and floating UI:
|
|
250
|
-
- `Dialog`, `Drawer`, `
|
|
284
|
+
- `Dialog`, `Drawer`, `Popover`, `Tooltip`, `HoverCard`, `AlertDialog`
|
|
251
285
|
- navigation:
|
|
252
286
|
- `Breadcrumb`, `NavigationMenu`, `Pagination`, `Sidebar`, `Tabs`, `DropdownMenu`, `Command`
|
|
253
287
|
- typography:
|
|
@@ -160,7 +160,6 @@ console.log('- barrel: `@uselets/ui`')
|
|
|
160
160
|
console.log('- component subpaths: `@uselets/ui/*`')
|
|
161
161
|
console.log('- hook subpaths: `@uselets/ui/hooks/*`')
|
|
162
162
|
console.log('- utility helpers: `@uselets/ui/utils`')
|
|
163
|
-
console.log('- styles: `@uselets/ui/styles.css` (legacy Max theme alias)')
|
|
164
163
|
console.log('- Max theme: `@uselets/ui/themes/max.css`')
|
|
165
164
|
console.log('- Gomax theme: `@uselets/ui/themes/gomax.css`')
|
|
166
165
|
console.log('- PostCSS preset: `@uselets/ui/postcss.config`')
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { n as __name } from "../chunk-CHh1Zzun.js";
|
|
2
|
-
import { Dialog } from "radix-ui";
|
|
3
|
-
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
|
-
import * as React from "react";
|
|
5
|
-
|
|
6
|
-
//#region src/components/sheet.d.ts
|
|
7
|
-
type SheetProps = React.ComponentProps<typeof Dialog.Root>;
|
|
8
|
-
type SheetTriggerProps = React.ComponentProps<typeof Dialog.Trigger>;
|
|
9
|
-
type SheetCloseProps = React.ComponentProps<typeof Dialog.Close>;
|
|
10
|
-
type SheetPortalProps = React.ComponentProps<typeof Dialog.Portal>;
|
|
11
|
-
type SheetOverlayProps = React.ComponentProps<typeof Dialog.Overlay>;
|
|
12
|
-
type SheetContentProps = React.ComponentProps<typeof Dialog.Content> & {
|
|
13
|
-
side?: 'top' | 'right' | 'bottom' | 'left';
|
|
14
|
-
showCloseButton?: boolean;
|
|
15
|
-
};
|
|
16
|
-
type SheetHeaderProps = React.ComponentProps<'div'>;
|
|
17
|
-
type SheetFooterProps = React.ComponentProps<'div'>;
|
|
18
|
-
type SheetTitleProps = React.ComponentProps<typeof Dialog.Title>;
|
|
19
|
-
type SheetDescriptionProps = React.ComponentProps<typeof Dialog.Description>;
|
|
20
|
-
declare function Sheet({
|
|
21
|
-
...props
|
|
22
|
-
}: SheetProps): _$react_jsx_runtime0.JSX.Element;
|
|
23
|
-
declare function SheetTrigger({
|
|
24
|
-
...props
|
|
25
|
-
}: SheetTriggerProps): _$react_jsx_runtime0.JSX.Element;
|
|
26
|
-
declare function SheetClose({
|
|
27
|
-
...props
|
|
28
|
-
}: SheetCloseProps): _$react_jsx_runtime0.JSX.Element;
|
|
29
|
-
declare function SheetPortal({
|
|
30
|
-
...props
|
|
31
|
-
}: SheetPortalProps): _$react_jsx_runtime0.JSX.Element;
|
|
32
|
-
declare function SheetOverlay({
|
|
33
|
-
className,
|
|
34
|
-
...props
|
|
35
|
-
}: SheetOverlayProps): _$react_jsx_runtime0.JSX.Element;
|
|
36
|
-
declare function SheetContent({
|
|
37
|
-
className,
|
|
38
|
-
children,
|
|
39
|
-
side,
|
|
40
|
-
showCloseButton,
|
|
41
|
-
...props
|
|
42
|
-
}: SheetContentProps): _$react_jsx_runtime0.JSX.Element;
|
|
43
|
-
declare function SheetHeader({
|
|
44
|
-
className,
|
|
45
|
-
...props
|
|
46
|
-
}: SheetHeaderProps): _$react_jsx_runtime0.JSX.Element;
|
|
47
|
-
declare function SheetFooter({
|
|
48
|
-
className,
|
|
49
|
-
...props
|
|
50
|
-
}: SheetFooterProps): _$react_jsx_runtime0.JSX.Element;
|
|
51
|
-
declare function SheetTitle({
|
|
52
|
-
className,
|
|
53
|
-
...props
|
|
54
|
-
}: SheetTitleProps): _$react_jsx_runtime0.JSX.Element;
|
|
55
|
-
declare function SheetDescription({
|
|
56
|
-
className,
|
|
57
|
-
...props
|
|
58
|
-
}: SheetDescriptionProps): _$react_jsx_runtime0.JSX.Element;
|
|
59
|
-
//#endregion
|
|
60
|
-
export { Sheet, SheetClose, SheetCloseProps, SheetContent, SheetContentProps, SheetDescription, SheetDescriptionProps, SheetFooter, SheetFooterProps, SheetHeader, SheetHeaderProps, SheetOverlay, SheetOverlayProps, SheetPortal, SheetPortalProps, SheetProps, SheetTitle, SheetTitleProps, SheetTrigger, SheetTriggerProps };
|
|
61
|
-
//# sourceMappingURL=sheet.d.ts.map
|
package/dist/components/sheet.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import"../chunk-CHh1Zzun.js";import{cn as e}from"../lib/utils.js";import{Button as t}from"./button.js";import{IconX as n}from"@tabler/icons-react";import{Dialog as r}from"radix-ui";import{jsx as i,jsxs as a}from"react/jsx-runtime";function Sheet({...e}){return i(r.Root,{"data-slot":`sheet`,...e})}function SheetTrigger({...e}){return i(r.Trigger,{"data-slot":`sheet-trigger`,...e})}function SheetClose({...e}){return i(r.Close,{"data-slot":`sheet-close`,...e})}function SheetPortal({...e}){return i(r.Portal,{"data-slot":`sheet-portal`,...e})}function SheetOverlay({className:t,...n}){return i(r.Overlay,{"data-slot":`sheet-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),...n})}function SheetContent({className:o,children:s,side:c=`right`,showCloseButton:l=!0,...u}){return a(SheetPortal,{children:[i(SheetOverlay,{}),a(r.Content,{"data-slot":`sheet-content`,"data-side":c,className:e(`fixed z-50 flex flex-col gap-4 bg-background bg-clip-padding text-sm shadow-lg transition duration-200 ease-in-out data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-[side=bottom]:data-open:slide-in-from-bottom-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=top]:data-open:slide-in-from-top-10 data-closed:animate-out data-closed:fade-out-0 data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=right]:data-closed:slide-out-to-right-10 data-[side=top]:data-closed:slide-out-to-top-10`,o),...u,children:[s,l&&i(r.Close,{"data-slot":`sheet-close`,asChild:!0,children:a(t,{variant:`ghost`,className:`absolute top-3 right-3`,size:`icon-sm`,children:[i(n,{}),i(`span`,{className:`sr-only`,children:`Close`})]})})]})]})}function SheetHeader({className:t,...n}){return i(`div`,{"data-slot":`sheet-header`,className:e(`flex flex-col gap-0.5 p-4`,t),...n})}function SheetFooter({className:t,...n}){return i(`div`,{"data-slot":`sheet-footer`,className:e(`mt-auto flex flex-col gap-2 p-4`,t),...n})}function SheetTitle({className:t,...n}){return i(r.Title,{"data-slot":`sheet-title`,className:e(`text-base font-medium text-foreground`,t),...n})}function SheetDescription({className:t,...n}){return i(r.Description,{"data-slot":`sheet-description`,className:e(`text-sm text-muted-foreground`,t),...n})}export{Sheet,SheetClose,SheetContent,SheetDescription,SheetFooter,SheetHeader,SheetOverlay,SheetPortal,SheetTitle,SheetTrigger};
|
|
2
|
-
//# sourceMappingURL=sheet.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sheet.js","names":["SheetPrimitive"],"sources":["../../src/components/sheet.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { IconX } from '@tabler/icons-react'\nimport { Dialog as SheetPrimitive } from 'radix-ui'\n\nimport { cn } from '../lib/utils'\nimport { Button } from './button'\n\nexport type SheetProps = React.ComponentProps<typeof SheetPrimitive.Root>\n\nexport type SheetTriggerProps = React.ComponentProps<typeof SheetPrimitive.Trigger>\n\nexport type SheetCloseProps = React.ComponentProps<typeof SheetPrimitive.Close>\n\nexport type SheetPortalProps = React.ComponentProps<typeof SheetPrimitive.Portal>\n\nexport type SheetOverlayProps = React.ComponentProps<typeof SheetPrimitive.Overlay>\n\nexport type SheetContentProps = React.ComponentProps<typeof SheetPrimitive.Content> & {\n side?: 'top' | 'right' | 'bottom' | 'left'\n showCloseButton?: boolean\n}\n\nexport type SheetHeaderProps = React.ComponentProps<'div'>\n\nexport type SheetFooterProps = React.ComponentProps<'div'>\n\nexport type SheetTitleProps = React.ComponentProps<typeof SheetPrimitive.Title>\n\nexport type SheetDescriptionProps = React.ComponentProps<typeof SheetPrimitive.Description>\n\nfunction Sheet({ ...props }: SheetProps) {\n return <SheetPrimitive.Root data-slot=\"sheet\" {...props} />\n}\n\nfunction SheetTrigger({ ...props }: SheetTriggerProps) {\n return <SheetPrimitive.Trigger data-slot=\"sheet-trigger\" {...props} />\n}\n\nfunction SheetClose({ ...props }: SheetCloseProps) {\n return <SheetPrimitive.Close data-slot=\"sheet-close\" {...props} />\n}\n\nfunction SheetPortal({ ...props }: SheetPortalProps) {\n return <SheetPrimitive.Portal data-slot=\"sheet-portal\" {...props} />\n}\n\nfunction SheetOverlay({ className, ...props }: SheetOverlayProps) {\n return (\n <SheetPrimitive.Overlay\n data-slot=\"sheet-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 SheetContent({ className, children, side = 'right', showCloseButton = true, ...props }: SheetContentProps) {\n return (\n <SheetPortal>\n <SheetOverlay />\n <SheetPrimitive.Content\n data-slot=\"sheet-content\"\n data-side={side}\n className={cn(\n 'fixed z-50 flex flex-col gap-4 bg-background bg-clip-padding text-sm shadow-lg transition duration-200 ease-in-out data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-[side=bottom]:data-open:slide-in-from-bottom-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=top]:data-open:slide-in-from-top-10 data-closed:animate-out data-closed:fade-out-0 data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=right]:data-closed:slide-out-to-right-10 data-[side=top]:data-closed:slide-out-to-top-10',\n className\n )}\n {...props}\n >\n {children}\n {showCloseButton && (\n <SheetPrimitive.Close data-slot=\"sheet-close\" asChild>\n <Button variant=\"ghost\" className=\"absolute top-3 right-3\" size=\"icon-sm\">\n <IconX />\n <span className=\"sr-only\">Close</span>\n </Button>\n </SheetPrimitive.Close>\n )}\n </SheetPrimitive.Content>\n </SheetPortal>\n )\n}\n\nfunction SheetHeader({ className, ...props }: SheetHeaderProps) {\n return <div data-slot=\"sheet-header\" className={cn('flex flex-col gap-0.5 p-4', className)} {...props} />\n}\n\nfunction SheetFooter({ className, ...props }: SheetFooterProps) {\n return <div data-slot=\"sheet-footer\" className={cn('mt-auto flex flex-col gap-2 p-4', className)} {...props} />\n}\n\nfunction SheetTitle({ className, ...props }: SheetTitleProps) {\n return (\n <SheetPrimitive.Title\n data-slot=\"sheet-title\"\n className={cn('text-base font-medium text-foreground', className)}\n {...props}\n />\n )\n}\n\nfunction SheetDescription({ className, ...props }: SheetDescriptionProps) {\n return (\n <SheetPrimitive.Description\n data-slot=\"sheet-description\"\n className={cn('text-sm text-muted-foreground', className)}\n {...props}\n />\n )\n}\n\nexport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetFooter,\n SheetHeader,\n SheetOverlay,\n SheetPortal,\n SheetTitle,\n SheetTrigger\n}\n"],"mappings":"uOA+BA,SAAS,MAAM,CAAE,GAAG,GAAqB,CACvC,OAAO,EAACA,EAAe,KAAhB,CAAqB,YAAU,QAAQ,GAAI,EAAS,CAAA,CAG7D,SAAS,aAAa,CAAE,GAAG,GAA4B,CACrD,OAAO,EAACA,EAAe,QAAhB,CAAwB,YAAU,gBAAgB,GAAI,EAAS,CAAA,CAGxE,SAAS,WAAW,CAAE,GAAG,GAA0B,CACjD,OAAO,EAACA,EAAe,MAAhB,CAAsB,YAAU,cAAc,GAAI,EAAS,CAAA,CAGpE,SAAS,YAAY,CAAE,GAAG,GAA2B,CACnD,OAAO,EAACA,EAAe,OAAhB,CAAuB,YAAU,eAAe,GAAI,EAAS,CAAA,CAGtE,SAAS,aAAa,CAAE,YAAW,GAAG,GAA4B,CAChE,OACE,EAACA,EAAe,QAAhB,CACE,YAAU,gBACV,UAAW,EACT,gLACA,EACD,CACD,GAAI,EACJ,CAAA,CAIN,SAAS,aAAa,CAAE,YAAW,WAAU,OAAO,QAAS,kBAAkB,GAAM,GAAG,GAA4B,CAClH,OACE,EAAC,YAAD,CAAA,SAAA,CACE,EAAC,aAAD,EAAgB,CAAA,CAChB,EAACA,EAAe,QAAhB,CACE,YAAU,gBACV,YAAW,EACX,UAAW,EACT,ymCACA,EACD,CACD,GAAI,WAPN,CASG,EACA,GACC,EAACA,EAAe,MAAhB,CAAsB,YAAU,cAAc,QAAA,YAC5C,EAAC,EAAD,CAAQ,QAAQ,QAAQ,UAAU,yBAAyB,KAAK,mBAAhE,CACE,EAAC,EAAD,EAAS,CAAA,CACT,EAAC,OAAD,CAAM,UAAU,mBAAU,QAAY,CAAA,CAC/B,GACY,CAAA,CAEF,GACb,CAAA,CAAA,CAIlB,SAAS,YAAY,CAAE,YAAW,GAAG,GAA2B,CAC9D,OAAO,EAAC,MAAD,CAAK,YAAU,eAAe,UAAW,EAAG,4BAA6B,EAAU,CAAE,GAAI,EAAS,CAAA,CAG3G,SAAS,YAAY,CAAE,YAAW,GAAG,GAA2B,CAC9D,OAAO,EAAC,MAAD,CAAK,YAAU,eAAe,UAAW,EAAG,kCAAmC,EAAU,CAAE,GAAI,EAAS,CAAA,CAGjH,SAAS,WAAW,CAAE,YAAW,GAAG,GAA0B,CAC5D,OACE,EAACA,EAAe,MAAhB,CACE,YAAU,cACV,UAAW,EAAG,wCAAyC,EAAU,CACjE,GAAI,EACJ,CAAA,CAIN,SAAS,iBAAiB,CAAE,YAAW,GAAG,GAAgC,CACxE,OACE,EAACA,EAAe,YAAhB,CACE,YAAU,oBACV,UAAW,EAAG,gCAAiC,EAAU,CACzD,GAAI,EACJ,CAAA"}
|