@deftui/react 0.0.3 → 0.0.5
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/dist/index.d.mts +7 -2
- package/dist/index.mjs +6 -2
- package/dist/styles.css +4 -1
- package/dist/vendor/README.md +65 -0
- package/dist/vendor/coss/scroll-area.d.mts +2 -2
- package/dist/vendor/coss/scroll-area.mjs +2 -2
- package/dist/vendor/shadcn/alert-dialog.d.mts +10 -8
- package/dist/vendor/shadcn/alert-dialog.mjs +14 -11
- package/dist/vendor/shadcn/combobox.d.mts +16 -14
- package/dist/vendor/shadcn/combobox.mjs +23 -20
- package/dist/vendor/shadcn/dialog.d.mts +10 -8
- package/dist/vendor/shadcn/dialog.mjs +15 -12
- package/dist/vendor/shadcn/drawer.d.mts +10 -8
- package/dist/vendor/shadcn/drawer.mjs +16 -13
- package/dist/vendor/shadcn/field.mjs +0 -1
- package/dist/vendor/shadcn/input.mjs +1 -1
- package/dist/vendor/shadcn/sidebar.mjs +0 -1
- package/dist/vendor/shadcn/skeleton.mjs +11 -3
- package/dist/vendor/tailored/lightbox.d.mts +187 -0
- package/dist/vendor/tailored/lightbox.mjs +2395 -0
- package/dist/widgets/breadcrumb.mjs +1 -1
- package/dist/widgets/index.d.mts +10 -15
- package/dist/widgets/index.mjs +27 -35
- package/dist/widgets/multimedia.d.mts +22 -0
- package/dist/widgets/multimedia.mjs +69 -0
- package/dist/widgets/pagination.mjs +1 -1
- package/dist/widgets/sidebar.mjs +1 -1
- package/dist/widgets/utils.d.mts +5 -0
- package/package.json +5 -1
- package/dist/vendor.css +0 -1
- package/dist/widgets/image-display.d.mts +0 -12
- package/dist/widgets/image-display.mjs +0 -29
- package/dist/widgets/toast.mjs +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { useCopyToClipboard } from "./vendor/coss/hooks/use-copy-to-clipboard.mjs";
|
|
2
2
|
import { useIsMobile, useMediaQuery } from "./vendor/coss/hooks/use-media-query.mjs";
|
|
3
3
|
import { Button } from "./vendor/shadcn/button.mjs";
|
|
4
|
+
import { AlertDialogHandle, createAlertDialogHandle } from "./vendor/shadcn/alert-dialog.mjs";
|
|
5
|
+
import { ComboboxItemCollection, ComboboxPrimitiveValue, CreateComboboxItemsOptions, createComboboxItems } from "./vendor/shadcn/combobox.mjs";
|
|
6
|
+
import { DialogHandle, createDialogHandle } from "./vendor/shadcn/dialog.mjs";
|
|
7
|
+
import { DrawerHandle, createDrawerHandle } from "./vendor/shadcn/drawer.mjs";
|
|
4
8
|
import { Label } from "./vendor/shadcn/label.mjs";
|
|
5
9
|
import { Toaster, toast } from "./vendor/shadcn/toast.mjs";
|
|
6
10
|
import { Input } from "./vendor/shadcn/input.mjs";
|
|
@@ -9,7 +13,8 @@ import { useSidebar } from "./vendor/shadcn/sidebar.mjs";
|
|
|
9
13
|
import { Sidebar } from "./widgets/sidebar.mjs";
|
|
10
14
|
import { Breadcrumb } from "./widgets/breadcrumb.mjs";
|
|
11
15
|
import { Pagination } from "./widgets/pagination.mjs";
|
|
12
|
-
import {
|
|
16
|
+
import { LightboxActions, LightboxBackdrop, LightboxCaptions, LightboxChangeReason, LightboxClose, LightboxContent, LightboxControl, LightboxControlContext, LightboxCounter, LightboxDownload, LightboxImageChangeEventDetails, LightboxImageItem, LightboxItem, LightboxMore, LightboxNext, LightboxOpenEventDetails, LightboxPrevious, LightboxProps, LightboxSlide, LightboxSlides, LightboxThumbnail, LightboxThumbnails, LightboxToolbar, LightboxTrigger, LightboxTriggerProps, LightboxVideoItem, LightboxViewport, LightboxZoom, LightboxZoomButton, useLightbox } from "./vendor/tailored/lightbox.mjs";
|
|
17
|
+
import { Carousel, Image, ImageProps, Lightbox } from "./widgets/multimedia.mjs";
|
|
13
18
|
import { DatePicker, DateRange, DateRangePicker, TimePicker } from "./widgets/datetime-picker.mjs";
|
|
14
19
|
import { Form } from "./vendor/coss/form.mjs";
|
|
15
20
|
import { Badge } from "./vendor/shadcn/badge.mjs";
|
|
@@ -21,4 +26,4 @@ import { AlertDialog, Card, Combobox, Dialog, Drawer, Dropdown, Empty, Field, In
|
|
|
21
26
|
import { cn } from "cn";
|
|
22
27
|
import { cva } from "class-variance-authority";
|
|
23
28
|
import { mergeProps } from "@base-ui/react/merge-props";
|
|
24
|
-
export { AlertDialog, Badge, Breadcrumb, Button, Card, Carousel, Combobox, DatePicker, type DateRange, DateRangePicker, Dialog, Drawer, Dropdown, Empty,
|
|
29
|
+
export { AlertDialog, type AlertDialogHandle, Badge, Breadcrumb, Button, Card, Carousel, Combobox, type ComboboxItemCollection, type ComboboxPrimitiveValue, type CreateComboboxItemsOptions, DatePicker, type DateRange, DateRangePicker, Dialog, type DialogHandle, Drawer, type DrawerHandle, Dropdown, Empty, Field, Form, Image, ImageProps, Input, InputGroup, Kbd, Label, Lightbox, type LightboxActions, type LightboxBackdrop, type LightboxCaptions, type LightboxChangeReason, type LightboxClose, type LightboxContent, type LightboxControl, type LightboxControlContext, type LightboxCounter, type LightboxDownload, type LightboxImageChangeEventDetails, type LightboxImageItem, type LightboxItem, type LightboxMore, type LightboxNext, type LightboxOpenEventDetails, type LightboxPrevious, type LightboxProps, type LightboxSlide, type LightboxSlides, type LightboxThumbnail, type LightboxThumbnails, type LightboxToolbar, type LightboxTrigger, type LightboxTriggerProps, type LightboxVideoItem, type LightboxViewport, type LightboxZoom, type LightboxZoomButton, Pagination, Popover, Progress, Radio, ScrollArea, Select, Separator, Sidebar, Spinner, Switch, Table, Tabs, Textarea, TimePicker, Toaster as ToastProvider, Tooltip, cn, createAlertDialogHandle, createComboboxItems, createDialogHandle, createDrawerHandle, cva, mergeProps, toast, useCopyToClipboard, useIsMobile, type useLightbox, useMediaQuery, useSidebar };
|
package/dist/index.mjs
CHANGED
|
@@ -2,8 +2,12 @@ import { useCopyToClipboard } from "./vendor/coss/hooks/use-copy-to-clipboard.mj
|
|
|
2
2
|
import { useIsMobile, useMediaQuery } from "./vendor/coss/hooks/use-media-query.mjs";
|
|
3
3
|
import { Spinner } from "./vendor/shadcn/spinner.mjs";
|
|
4
4
|
import { Button } from "./vendor/shadcn/button.mjs";
|
|
5
|
+
import { createAlertDialogHandle } from "./vendor/shadcn/alert-dialog.mjs";
|
|
5
6
|
import { Input } from "./vendor/shadcn/input.mjs";
|
|
6
7
|
import { Textarea } from "./vendor/shadcn/textarea.mjs";
|
|
8
|
+
import { createComboboxItems } from "./vendor/shadcn/combobox.mjs";
|
|
9
|
+
import { createDialogHandle } from "./vendor/shadcn/dialog.mjs";
|
|
10
|
+
import { createDrawerHandle } from "./vendor/shadcn/drawer.mjs";
|
|
7
11
|
import { Label } from "./vendor/shadcn/label.mjs";
|
|
8
12
|
import { Separator } from "./vendor/shadcn/separator.mjs";
|
|
9
13
|
import { Toaster, toast } from "./vendor/shadcn/toast.mjs";
|
|
@@ -11,7 +15,7 @@ import { useSidebar } from "./vendor/shadcn/sidebar.mjs";
|
|
|
11
15
|
import { Sidebar } from "./widgets/sidebar.mjs";
|
|
12
16
|
import { Breadcrumb } from "./widgets/breadcrumb.mjs";
|
|
13
17
|
import { Pagination } from "./widgets/pagination.mjs";
|
|
14
|
-
import { Carousel,
|
|
18
|
+
import { Carousel, Image, Lightbox } from "./widgets/multimedia.mjs";
|
|
15
19
|
import { DatePicker, DateRangePicker, TimePicker } from "./widgets/datetime-picker.mjs";
|
|
16
20
|
import { Form } from "./vendor/coss/form.mjs";
|
|
17
21
|
import { Badge } from "./vendor/shadcn/badge.mjs";
|
|
@@ -21,4 +25,4 @@ import { AlertDialog, Card, Combobox, Dialog, Drawer, Dropdown, Empty, Field, In
|
|
|
21
25
|
import { cn } from "cn";
|
|
22
26
|
import { cva } from "class-variance-authority";
|
|
23
27
|
import { mergeProps } from "@base-ui/react/merge-props";
|
|
24
|
-
export { AlertDialog, Badge, Breadcrumb, Button, Card, Carousel, Combobox, DatePicker, DateRangePicker, Dialog, Drawer, Dropdown, Empty,
|
|
28
|
+
export { AlertDialog, Badge, Breadcrumb, Button, Card, Carousel, Combobox, DatePicker, DateRangePicker, Dialog, Drawer, Dropdown, Empty, Field, Form, Image, Input, InputGroup, Kbd, Label, Lightbox, Pagination, Popover, Progress, Radio, ScrollArea, Select, Separator, Sidebar, Spinner, Switch, Table, Tabs, Textarea, TimePicker, Toaster as ToastProvider, Tooltip, cn, createAlertDialogHandle, createComboboxItems, createDialogHandle, createDrawerHandle, cva, mergeProps, toast, useCopyToClipboard, useIsMobile, useMediaQuery, useSidebar };
|
package/dist/styles.css
CHANGED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# Vendor
|
|
2
|
+
|
|
3
|
+
使用以下命令查看上游源码及依赖,对比本地后手动选择性更新,保留必要的本地调整。
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
cd packages/react
|
|
7
|
+
bunx shadcn view <ID>
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
shadcn 组件使用 `components.json` 中的 `base-vega` 风格和 Lucide 图标。表中仅简要记录额外的本地修改,不包含 CLI 根据配置生成的导入路径、图标和样式转换。
|
|
11
|
+
|
|
12
|
+
| ID | File | Docs | Modifications |
|
|
13
|
+
| --- | --- | --- | --- |
|
|
14
|
+
| `@coss/form` | [coss/form.tsx](coss/form.tsx) | [Form](https://coss.com/ui/docs/components/form) | — |
|
|
15
|
+
| `@coss/scroll-area` | [coss/scroll-area.tsx](coss/scroll-area.tsx) | [Scroll Area](https://coss.com/ui/docs/components/scroll-area) | — |
|
|
16
|
+
| `@coss/use-copy-to-clipboard` | [coss/hooks/use-copy-to-clipboard.ts](coss/hooks/use-copy-to-clipboard.ts) | [useCopyToClipboard](https://coss.com/ui/docs/hooks/use-copy-to-clipboard) | — |
|
|
17
|
+
| `@coss/use-media-query` | [coss/hooks/use-media-query.ts](coss/hooks/use-media-query.ts) | [useMediaQuery](https://coss.com/ui/docs/hooks/use-media-query) | 断点:`md` 设为 768px,与 Tailwind 默认值一致 |
|
|
18
|
+
| `alert-dialog` | [shadcn/alert-dialog.tsx](shadcn/alert-dialog.tsx) | [Alert Dialog](https://ui.shadcn.com/docs/components/base/alert-dialog) | 额外导出 `createAlertDialogHandle` 及其类型 |
|
|
19
|
+
| `badge` | [shadcn/badge.tsx](shadcn/badge.tsx) | [Badge](https://ui.shadcn.com/docs/components/base/badge) | 提供 `info`、`success`、`warning` 语义变体 |
|
|
20
|
+
| `breadcrumb` | [shadcn/breadcrumb.tsx](shadcn/breadcrumb.tsx) | [Breadcrumb](https://ui.shadcn.com/docs/components/base/breadcrumb) | — |
|
|
21
|
+
| `button` | [shadcn/button.tsx](shadcn/button.tsx) | [Button](https://ui.shadcn.com/docs/components/base/button) | `pill` 提供全圆角;`isPending` 提供居中 Spinner 加载态 |
|
|
22
|
+
| `button-group` | [shadcn/button-group.tsx](shadcn/button-group.tsx) | [Button Group](https://ui.shadcn.com/docs/components/base/button-group) | — |
|
|
23
|
+
| `calendar` | [shadcn/calendar.tsx](shadcn/calendar.tsx) | [Calendar](https://ui.shadcn.com/docs/components/base/calendar) | 将 `react-day-picker` 导入改为 `@daypicker/react` |
|
|
24
|
+
| `card` | [shadcn/card.tsx](shadcn/card.tsx) | [Card](https://ui.shadcn.com/docs/components/base/card) | — |
|
|
25
|
+
| `carousel` | [shadcn/carousel.tsx](shadcn/carousel.tsx) | [Carousel](https://ui.shadcn.com/docs/components/base/carousel) | — |
|
|
26
|
+
| `combobox` | [shadcn/combobox.tsx](shadcn/combobox.tsx) | [Combobox](https://ui.shadcn.com/docs/components/base/combobox) | 额外导出 `createComboboxItems` 及其类型 |
|
|
27
|
+
| `dialog` | [shadcn/dialog.tsx](shadcn/dialog.tsx) | [Dialog](https://ui.shadcn.com/docs/components/base/dialog) | 额外导出 `createDialogHandle` 及其类型 |
|
|
28
|
+
| `direction` | [shadcn/direction.tsx](shadcn/direction.tsx) | [Direction](https://ui.shadcn.com/docs/components/base/direction) | — |
|
|
29
|
+
| `drawer` | [shadcn/drawer.tsx](shadcn/drawer.tsx) | [Drawer](https://ui.shadcn.com/docs/components/base/drawer) | 额外导出 `createDrawerHandle` 及其类型 |
|
|
30
|
+
| `dropdown-menu` | [shadcn/dropdown-menu.tsx](shadcn/dropdown-menu.tsx) | [Dropdown Menu](https://ui.shadcn.com/docs/components/base/dropdown-menu) | — |
|
|
31
|
+
| `empty` | [shadcn/empty.tsx](shadcn/empty.tsx) | [Empty](https://ui.shadcn.com/docs/components/base/empty) | — |
|
|
32
|
+
| `field` | [shadcn/field.tsx](shadcn/field.tsx) | [Field](https://ui.shadcn.com/docs/components/base/field) | — |
|
|
33
|
+
| `input` | [shadcn/input.tsx](shadcn/input.tsx) | [Input](https://ui.shadcn.com/docs/components/base/input) | 参考 coss ui 处理自动填充的文字颜色,用背景色过渡抑制浏览器底色、内阴影绘制填充色 |
|
|
34
|
+
| `input-group` | [shadcn/input-group.tsx](shadcn/input-group.tsx) | [Input Group](https://ui.shadcn.com/docs/components/base/input-group) | — |
|
|
35
|
+
| `kbd` | [shadcn/kbd.tsx](shadcn/kbd.tsx) | [Kbd](https://ui.shadcn.com/docs/components/base/kbd) | — |
|
|
36
|
+
| `label` | [shadcn/label.tsx](shadcn/label.tsx) | [Label](https://ui.shadcn.com/docs/components/base/label) | — |
|
|
37
|
+
| `pagination` | [shadcn/pagination.tsx](shadcn/pagination.tsx) | [Pagination](https://ui.shadcn.com/docs/components/base/pagination) | — |
|
|
38
|
+
| `popover` | [shadcn/popover.tsx](shadcn/popover.tsx) | [Popover](https://ui.shadcn.com/docs/components/base/popover) | — |
|
|
39
|
+
| `progress` | [shadcn/progress.tsx](shadcn/progress.tsx) | [Progress](https://ui.shadcn.com/docs/components/base/progress) | — |
|
|
40
|
+
| `radio-group` | [shadcn/radio-group.tsx](shadcn/radio-group.tsx) | [Radio Group](https://ui.shadcn.com/docs/components/base/radio-group) | — |
|
|
41
|
+
| `select` | [shadcn/select.tsx](shadcn/select.tsx) | [Select](https://ui.shadcn.com/docs/components/base/select) | `alignItemWithTrigger` 改为默认 `false` |
|
|
42
|
+
| `separator` | [shadcn/separator.tsx](shadcn/separator.tsx) | [Separator](https://ui.shadcn.com/docs/components/base/separator) | — |
|
|
43
|
+
| `sheet` | [shadcn/sheet.tsx](shadcn/sheet.tsx) | [Sheet](https://ui.shadcn.com/docs/components/base/sheet) | — |
|
|
44
|
+
| `sidebar` | [shadcn/sidebar.tsx](shadcn/sidebar.tsx) | [Sidebar](https://ui.shadcn.com/docs/components/base/sidebar) | `useIsMobile` 改为从 `@/vendor/coss/hooks/use-media-query` 导入 |
|
|
45
|
+
| `skeleton` | [shadcn/skeleton.tsx](shadcn/skeleton.tsx) | [Skeleton](https://ui.shadcn.com/docs/components/base/skeleton) | — |
|
|
46
|
+
| `spinner` | [shadcn/spinner.tsx](shadcn/spinner.tsx) | [Spinner](https://ui.shadcn.com/docs/components/base/spinner) | — |
|
|
47
|
+
| `switch` | [shadcn/switch.tsx](shadcn/switch.tsx) | [Switch](https://ui.shadcn.com/docs/components/base/switch) | — |
|
|
48
|
+
| `table` | [shadcn/table.tsx](shadcn/table.tsx) | [Table](https://ui.shadcn.com/docs/components/base/table) | — |
|
|
49
|
+
| `tabs` | [shadcn/tabs.tsx](shadcn/tabs.tsx) | [Tabs](https://ui.shadcn.com/docs/components/base/tabs) | — |
|
|
50
|
+
| `textarea` | [shadcn/textarea.tsx](shadcn/textarea.tsx) | [Textarea](https://ui.shadcn.com/docs/components/base/textarea) | — |
|
|
51
|
+
| `toast` | [shadcn/toast.tsx](shadcn/toast.tsx) | [Toast](https://ui.shadcn.com/docs/components/base/toast) | — |
|
|
52
|
+
| `tooltip` | [shadcn/tooltip.tsx](shadcn/tooltip.tsx) | [Tooltip](https://ui.shadcn.com/docs/components/base/tooltip) | — |
|
|
53
|
+
|
|
54
|
+
## Tailored
|
|
55
|
+
|
|
56
|
+
`tailored/` 存放基于上游、需要较大结构或行为调整的单体组件。仅需导入路径、图标或少量样式适配的组件,仍放在对应的来源目录。
|
|
57
|
+
|
|
58
|
+
- 按本地需求维护,对比后选择性吸收上游修复,避免直接覆盖本地实现。
|
|
59
|
+
- 优先复用已有基础组件;仅供该组件使用的依赖可内联,分别记录其来源。
|
|
60
|
+
- 下表记录主组件及内联依赖的 registry ID、文档和主要修改;对外的组合封装放在 `widgets/`。
|
|
61
|
+
|
|
62
|
+
| ID | File | Docs | Modifications |
|
|
63
|
+
| --- | --- | --- | --- |
|
|
64
|
+
| `https://ui.iandefined.com/r/lightbox.json` | [tailored/lightbox.tsx](tailored/lightbox.tsx) | [Lightbox](https://ui.iandefined.com/docs/components/lightbox/) | 适配本地组件和尺寸;修正嵌套弹层层级与点击隔离;补充加载失败反馈 |
|
|
65
|
+
| `https://ui.iandefined.com/r/scroll-area.json` | [tailored/lightbox.tsx](tailored/lightbox.tsx) | [Scroll Area](https://ui.iandefined.com/docs/components/scroll-area/) | 作为 Lightbox 的私有依赖内联 |
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ScrollArea as ScrollAreaPrimitive } from "@base-ui/react/scroll-area";
|
|
3
|
-
|
|
3
|
+
declare function ScrollArea$1({ className, children, scrollFade, scrollbarGutter, fill, clampContentMinWidth, overscrollContain, ...props }: ScrollAreaPrimitive.Root.Props & {
|
|
4
4
|
scrollFade?: boolean;
|
|
5
5
|
scrollbarGutter?: boolean;
|
|
6
6
|
fill?: boolean;
|
|
7
7
|
clampContentMinWidth?: boolean;
|
|
8
8
|
overscrollContain?: boolean;
|
|
9
9
|
}): React.ReactElement;
|
|
10
|
-
export { ScrollAreaPrimitive };
|
|
10
|
+
export { ScrollArea$1 as ScrollArea, ScrollAreaPrimitive };
|
|
@@ -3,7 +3,7 @@ import { cn } from "../shadcn/lib/utils.mjs";
|
|
|
3
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
import { ScrollArea as ScrollAreaPrimitive } from "@base-ui/react/scroll-area";
|
|
5
5
|
// src/vendor/coss/scroll-area.tsx
|
|
6
|
-
function ScrollArea({ className, children, scrollFade = false, scrollbarGutter = false, fill = false, clampContentMinWidth = true, overscrollContain = false, ...props }) {
|
|
6
|
+
function ScrollArea$1({ className, children, scrollFade = false, scrollbarGutter = false, fill = false, clampContentMinWidth = true, overscrollContain = false, ...props }) {
|
|
7
7
|
return /* @__PURE__ */ jsxs(ScrollAreaPrimitive.Root, {
|
|
8
8
|
className: cn("size-full min-h-0", className),
|
|
9
9
|
...props,
|
|
@@ -36,4 +36,4 @@ function ScrollBar({ className, orientation = "vertical", ...props }) {
|
|
|
36
36
|
})
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
|
-
export { ScrollArea, ScrollAreaPrimitive, ScrollBar };
|
|
39
|
+
export { ScrollArea$1 as ScrollArea, ScrollAreaPrimitive, ScrollBar };
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { Button } from "./button.mjs";
|
|
2
2
|
import * as React$1 from "react";
|
|
3
|
-
import { AlertDialog
|
|
4
|
-
declare function AlertDialog({ ...props }:
|
|
5
|
-
declare function AlertDialogTrigger({ ...props }:
|
|
6
|
-
declare function AlertDialogContent({ className, size, ...props }:
|
|
3
|
+
import { AlertDialog } from "@base-ui/react/alert-dialog";
|
|
4
|
+
declare function AlertDialog$1({ ...props }: AlertDialog.Root.Props): React$1.JSX.Element;
|
|
5
|
+
declare function AlertDialogTrigger({ ...props }: AlertDialog.Trigger.Props): React$1.JSX.Element;
|
|
6
|
+
declare function AlertDialogContent({ className, size, ...props }: AlertDialog.Popup.Props & {
|
|
7
7
|
size?: "default" | "sm";
|
|
8
8
|
}): React$1.JSX.Element;
|
|
9
9
|
declare function AlertDialogHeader({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
10
10
|
declare function AlertDialogFooter({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
11
|
-
declare function AlertDialogTitle({ className, ...props }: React$1.ComponentProps<typeof
|
|
12
|
-
declare function AlertDialogDescription({ className, ...props }: React$1.ComponentProps<typeof
|
|
13
|
-
declare function AlertDialogCancel({ className, variant, size, ...props }:
|
|
14
|
-
export
|
|
11
|
+
declare function AlertDialogTitle({ className, ...props }: React$1.ComponentProps<typeof AlertDialog.Title>): React$1.JSX.Element;
|
|
12
|
+
declare function AlertDialogDescription({ className, ...props }: React$1.ComponentProps<typeof AlertDialog.Description>): React$1.JSX.Element;
|
|
13
|
+
declare function AlertDialogCancel({ className, variant, size, ...props }: AlertDialog.Close.Props & Pick<React$1.ComponentProps<typeof Button>, "variant" | "size">): React$1.JSX.Element;
|
|
14
|
+
export type AlertDialogHandle<Payload> = ReturnType<typeof AlertDialog.createHandle<Payload>>;
|
|
15
|
+
export declare function createAlertDialogHandle<Payload>(): AlertDialogHandle<Payload>;
|
|
16
|
+
export { AlertDialog$1 as AlertDialog, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger };
|
|
@@ -2,36 +2,36 @@
|
|
|
2
2
|
import { Button } from "./button.mjs";
|
|
3
3
|
import { cn } from "cn";
|
|
4
4
|
import "react";
|
|
5
|
-
import { AlertDialog
|
|
5
|
+
import { AlertDialog } from "@base-ui/react/alert-dialog";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
// src/vendor/shadcn/alert-dialog.tsx
|
|
8
|
-
function AlertDialog({ ...props }) {
|
|
9
|
-
return /* @__PURE__ */ jsx(
|
|
8
|
+
function AlertDialog$1({ ...props }) {
|
|
9
|
+
return /* @__PURE__ */ jsx(AlertDialog.Root, {
|
|
10
10
|
"data-slot": "alert-dialog",
|
|
11
11
|
...props
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
14
|
function AlertDialogTrigger({ ...props }) {
|
|
15
|
-
return /* @__PURE__ */ jsx(
|
|
15
|
+
return /* @__PURE__ */ jsx(AlertDialog.Trigger, {
|
|
16
16
|
"data-slot": "alert-dialog-trigger",
|
|
17
17
|
...props
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
20
|
function AlertDialogPortal({ ...props }) {
|
|
21
|
-
return /* @__PURE__ */ jsx(
|
|
21
|
+
return /* @__PURE__ */ jsx(AlertDialog.Portal, {
|
|
22
22
|
"data-slot": "alert-dialog-portal",
|
|
23
23
|
...props
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
26
|
function AlertDialogOverlay({ className, ...props }) {
|
|
27
|
-
return /* @__PURE__ */ jsx(
|
|
27
|
+
return /* @__PURE__ */ jsx(AlertDialog.Backdrop, {
|
|
28
28
|
"data-slot": "alert-dialog-overlay",
|
|
29
29
|
className: cn("fixed inset-0 isolate 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", className),
|
|
30
30
|
...props
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
33
|
function AlertDialogContent({ className, size = "default", ...props }) {
|
|
34
|
-
return /* @__PURE__ */ jsxs(AlertDialogPortal, { children: [/* @__PURE__ */ jsx(AlertDialogOverlay, {}), /* @__PURE__ */ jsx(
|
|
34
|
+
return /* @__PURE__ */ jsxs(AlertDialogPortal, { children: [/* @__PURE__ */ jsx(AlertDialogOverlay, {}), /* @__PURE__ */ jsx(AlertDialog.Popup, {
|
|
35
35
|
"data-slot": "alert-dialog-content",
|
|
36
36
|
"data-size": size,
|
|
37
37
|
className: cn("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-6 rounded-xl bg-popover p-6 text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-lg 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", className),
|
|
@@ -53,21 +53,21 @@ function AlertDialogFooter({ className, ...props }) {
|
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
55
|
function AlertDialogTitle({ className, ...props }) {
|
|
56
|
-
return /* @__PURE__ */ jsx(
|
|
56
|
+
return /* @__PURE__ */ jsx(AlertDialog.Title, {
|
|
57
57
|
"data-slot": "alert-dialog-title",
|
|
58
58
|
className: cn("text-lg font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2", className),
|
|
59
59
|
...props
|
|
60
60
|
});
|
|
61
61
|
}
|
|
62
62
|
function AlertDialogDescription({ className, ...props }) {
|
|
63
|
-
return /* @__PURE__ */ jsx(
|
|
63
|
+
return /* @__PURE__ */ jsx(AlertDialog.Description, {
|
|
64
64
|
"data-slot": "alert-dialog-description",
|
|
65
65
|
className: cn("text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground", className),
|
|
66
66
|
...props
|
|
67
67
|
});
|
|
68
68
|
}
|
|
69
69
|
function AlertDialogCancel({ className, variant = "outline", size = "default", ...props }) {
|
|
70
|
-
return /* @__PURE__ */ jsx(
|
|
70
|
+
return /* @__PURE__ */ jsx(AlertDialog.Close, {
|
|
71
71
|
"data-slot": "alert-dialog-cancel",
|
|
72
72
|
className: cn(className),
|
|
73
73
|
render: /* @__PURE__ */ jsx(Button, {
|
|
@@ -77,4 +77,7 @@ function AlertDialogCancel({ className, variant = "outline", size = "default", .
|
|
|
77
77
|
...props
|
|
78
78
|
});
|
|
79
79
|
}
|
|
80
|
-
|
|
80
|
+
function createAlertDialogHandle() {
|
|
81
|
+
return AlertDialog.createHandle();
|
|
82
|
+
}
|
|
83
|
+
export { AlertDialog$1 as AlertDialog, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, createAlertDialogHandle };
|
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
import * as React$1 from "react";
|
|
2
|
-
import { Combobox
|
|
3
|
-
|
|
4
|
-
declare function
|
|
2
|
+
import { Combobox } from "@base-ui/react";
|
|
3
|
+
import { ComboboxItemCollection, ComboboxPrimitiveValue, ComboboxPrimitiveValue as ComboboxPrimitiveValue$1, CreateComboboxItemsOptions } from "@base-ui/react/combobox";
|
|
4
|
+
declare function ComboboxValue({ ...props }: Combobox.Value.Props): React$1.JSX.Element;
|
|
5
|
+
declare function ComboboxInput({ className, children, disabled, showTrigger, showClear, ...props }: Combobox.Input.Props & {
|
|
5
6
|
showTrigger?: boolean;
|
|
6
7
|
showClear?: boolean;
|
|
7
8
|
}): React$1.JSX.Element;
|
|
8
|
-
declare function ComboboxContent({ className, side, sideOffset, align, alignOffset, anchor, ...props }:
|
|
9
|
-
declare function ComboboxList({ className, ...props }:
|
|
10
|
-
declare function ComboboxItem({ className, children, ...props }:
|
|
11
|
-
declare function ComboboxGroup({ className, ...props }:
|
|
12
|
-
declare function ComboboxLabel({ className, ...props }:
|
|
13
|
-
declare function ComboboxCollection({ ...props }:
|
|
14
|
-
declare function ComboboxEmpty({ className, ...props }:
|
|
15
|
-
declare function ComboboxChips({ className, ...props }: React$1.ComponentPropsWithRef<typeof
|
|
16
|
-
declare function ComboboxChip({ className, children, showRemove, ...props }:
|
|
9
|
+
declare function ComboboxContent({ className, side, sideOffset, align, alignOffset, anchor, ...props }: Combobox.Popup.Props & Pick<Combobox.Positioner.Props, "side" | "align" | "sideOffset" | "alignOffset" | "anchor">): React$1.JSX.Element;
|
|
10
|
+
declare function ComboboxList({ className, ...props }: Combobox.List.Props): React$1.JSX.Element;
|
|
11
|
+
declare function ComboboxItem({ className, children, ...props }: Combobox.Item.Props): React$1.JSX.Element;
|
|
12
|
+
declare function ComboboxGroup({ className, ...props }: Combobox.Group.Props): React$1.JSX.Element;
|
|
13
|
+
declare function ComboboxLabel({ className, ...props }: Combobox.GroupLabel.Props): React$1.JSX.Element;
|
|
14
|
+
declare function ComboboxCollection({ ...props }: Combobox.Collection.Props): React$1.JSX.Element;
|
|
15
|
+
declare function ComboboxEmpty({ className, ...props }: Combobox.Empty.Props): React$1.JSX.Element;
|
|
16
|
+
declare function ComboboxChips({ className, ...props }: React$1.ComponentPropsWithRef<typeof Combobox.Chips> & Combobox.Chips.Props): React$1.JSX.Element;
|
|
17
|
+
declare function ComboboxChip({ className, children, showRemove, ...props }: Combobox.Chip.Props & {
|
|
17
18
|
showRemove?: boolean;
|
|
18
19
|
}): React$1.JSX.Element;
|
|
19
|
-
declare function ComboboxChipsInput({ className, ...props }:
|
|
20
|
-
export
|
|
20
|
+
declare function ComboboxChipsInput({ className, ...props }: Combobox.Input.Props): React$1.JSX.Element;
|
|
21
|
+
export declare function createComboboxItems<Item, Value extends ComboboxPrimitiveValue>(...args: Parameters<typeof Combobox.createItems<Item, Value>>): ReturnType<typeof Combobox.createItems<Item, Value>>;
|
|
22
|
+
export { ComboboxChip, ComboboxChips, ComboboxChipsInput, ComboboxCollection, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxInput, ComboboxItem, type ComboboxItemCollection, ComboboxLabel, ComboboxList, type ComboboxPrimitiveValue$1 as ComboboxPrimitiveValue, ComboboxValue, type CreateComboboxItemsOptions };
|
|
@@ -5,17 +5,17 @@ import { cn } from "cn";
|
|
|
5
5
|
import "react";
|
|
6
6
|
import { CheckIcon, ChevronDownIcon, XIcon } from "lucide-react";
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
-
import { Combobox
|
|
8
|
+
import { Combobox } from "@base-ui/react";
|
|
9
9
|
// src/vendor/shadcn/combobox.tsx
|
|
10
|
-
const Combobox =
|
|
10
|
+
const Combobox$1 = Combobox.Root;
|
|
11
11
|
function ComboboxValue({ ...props }) {
|
|
12
|
-
return /* @__PURE__ */ jsx(
|
|
12
|
+
return /* @__PURE__ */ jsx(Combobox.Value, {
|
|
13
13
|
"data-slot": "combobox-value",
|
|
14
14
|
...props
|
|
15
15
|
});
|
|
16
16
|
}
|
|
17
17
|
function ComboboxTrigger({ className, children, ...props }) {
|
|
18
|
-
return /* @__PURE__ */ jsxs(
|
|
18
|
+
return /* @__PURE__ */ jsxs(Combobox.Trigger, {
|
|
19
19
|
"data-slot": "combobox-trigger",
|
|
20
20
|
className: cn("[&_svg:not([class*='size-'])]:size-4", className),
|
|
21
21
|
...props,
|
|
@@ -23,7 +23,7 @@ function ComboboxTrigger({ className, children, ...props }) {
|
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
25
|
function ComboboxClear({ className, ...props }) {
|
|
26
|
-
return /* @__PURE__ */ jsx(
|
|
26
|
+
return /* @__PURE__ */ jsx(Combobox.Clear, {
|
|
27
27
|
"data-slot": "combobox-clear",
|
|
28
28
|
render: /* @__PURE__ */ jsx(InputGroupButton, {
|
|
29
29
|
variant: "ghost",
|
|
@@ -38,7 +38,7 @@ function ComboboxInput({ className, children, disabled = false, showTrigger = tr
|
|
|
38
38
|
return /* @__PURE__ */ jsxs(InputGroup, {
|
|
39
39
|
className: cn("w-auto", className),
|
|
40
40
|
children: [
|
|
41
|
-
/* @__PURE__ */ jsx(
|
|
41
|
+
/* @__PURE__ */ jsx(Combobox.Input, {
|
|
42
42
|
render: /* @__PURE__ */ jsx(InputGroupInput, { disabled }),
|
|
43
43
|
...props
|
|
44
44
|
}),
|
|
@@ -58,14 +58,14 @@ function ComboboxInput({ className, children, disabled = false, showTrigger = tr
|
|
|
58
58
|
});
|
|
59
59
|
}
|
|
60
60
|
function ComboboxContent({ className, side = "bottom", sideOffset = 6, align = "start", alignOffset = 0, anchor, ...props }) {
|
|
61
|
-
return /* @__PURE__ */ jsx(
|
|
61
|
+
return /* @__PURE__ */ jsx(Combobox.Portal, { children: /* @__PURE__ */ jsx(Combobox.Positioner, {
|
|
62
62
|
side,
|
|
63
63
|
sideOffset,
|
|
64
64
|
align,
|
|
65
65
|
alignOffset,
|
|
66
66
|
anchor,
|
|
67
67
|
className: "isolate z-50",
|
|
68
|
-
children: /* @__PURE__ */ jsx(
|
|
68
|
+
children: /* @__PURE__ */ jsx(Combobox.Popup, {
|
|
69
69
|
"data-slot": "combobox-content",
|
|
70
70
|
"data-chips": !!anchor,
|
|
71
71
|
className: cn("group/combobox-content relative max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-[calc(var(--anchor-width)+--spacing(7))] origin-(--transform-origin) overflow-hidden rounded-md bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[chips=true]:min-w-(--anchor-width) data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 *:data-[slot=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-8 *:data-[slot=input-group]:border-input/30 *:data-[slot=input-group]:bg-input/30 *:data-[slot=input-group]:shadow-none 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", className),
|
|
@@ -74,63 +74,63 @@ function ComboboxContent({ className, side = "bottom", sideOffset = 6, align = "
|
|
|
74
74
|
}) });
|
|
75
75
|
}
|
|
76
76
|
function ComboboxList({ className, ...props }) {
|
|
77
|
-
return /* @__PURE__ */ jsx(
|
|
77
|
+
return /* @__PURE__ */ jsx(Combobox.List, {
|
|
78
78
|
"data-slot": "combobox-list",
|
|
79
79
|
className: cn("no-scrollbar max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] scroll-py-1 overflow-y-auto overscroll-contain p-1 data-empty:p-0", className),
|
|
80
80
|
...props
|
|
81
81
|
});
|
|
82
82
|
}
|
|
83
83
|
function ComboboxItem({ className, children, ...props }) {
|
|
84
|
-
return /* @__PURE__ */ jsxs(
|
|
84
|
+
return /* @__PURE__ */ jsxs(Combobox.Item, {
|
|
85
85
|
"data-slot": "combobox-item",
|
|
86
86
|
className: cn("relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-highlighted:bg-accent data-highlighted:text-accent-foreground not-data-[variant=destructive]:data-highlighted:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
87
87
|
...props,
|
|
88
|
-
children: [children, /* @__PURE__ */ jsx(
|
|
88
|
+
children: [children, /* @__PURE__ */ jsx(Combobox.ItemIndicator, {
|
|
89
89
|
render: /* @__PURE__ */ jsx("span", { className: "pointer-events-none absolute right-2 flex size-4 items-center justify-center" }),
|
|
90
90
|
children: /* @__PURE__ */ jsx(CheckIcon, { className: "pointer-events-none" })
|
|
91
91
|
})]
|
|
92
92
|
});
|
|
93
93
|
}
|
|
94
94
|
function ComboboxGroup({ className, ...props }) {
|
|
95
|
-
return /* @__PURE__ */ jsx(
|
|
95
|
+
return /* @__PURE__ */ jsx(Combobox.Group, {
|
|
96
96
|
"data-slot": "combobox-group",
|
|
97
97
|
className: cn(className),
|
|
98
98
|
...props
|
|
99
99
|
});
|
|
100
100
|
}
|
|
101
101
|
function ComboboxLabel({ className, ...props }) {
|
|
102
|
-
return /* @__PURE__ */ jsx(
|
|
102
|
+
return /* @__PURE__ */ jsx(Combobox.GroupLabel, {
|
|
103
103
|
"data-slot": "combobox-label",
|
|
104
104
|
className: cn("px-2 py-1.5 text-xs text-muted-foreground", className),
|
|
105
105
|
...props
|
|
106
106
|
});
|
|
107
107
|
}
|
|
108
108
|
function ComboboxCollection({ ...props }) {
|
|
109
|
-
return /* @__PURE__ */ jsx(
|
|
109
|
+
return /* @__PURE__ */ jsx(Combobox.Collection, {
|
|
110
110
|
"data-slot": "combobox-collection",
|
|
111
111
|
...props
|
|
112
112
|
});
|
|
113
113
|
}
|
|
114
114
|
function ComboboxEmpty({ className, ...props }) {
|
|
115
|
-
return /* @__PURE__ */ jsx(
|
|
115
|
+
return /* @__PURE__ */ jsx(Combobox.Empty, {
|
|
116
116
|
"data-slot": "combobox-empty",
|
|
117
117
|
className: cn("hidden w-full justify-center py-2 text-center text-sm text-muted-foreground group-data-empty/combobox-content:flex", className),
|
|
118
118
|
...props
|
|
119
119
|
});
|
|
120
120
|
}
|
|
121
121
|
function ComboboxChips({ className, ...props }) {
|
|
122
|
-
return /* @__PURE__ */ jsx(
|
|
122
|
+
return /* @__PURE__ */ jsx(Combobox.Chips, {
|
|
123
123
|
"data-slot": "combobox-chips",
|
|
124
124
|
className: cn("flex min-h-9 flex-wrap items-center gap-1.5 rounded-md border border-input bg-transparent bg-clip-padding px-2.5 py-1.5 text-sm shadow-xs transition-[color,box-shadow] focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50 has-aria-invalid:border-destructive has-aria-invalid:ring-3 has-aria-invalid:ring-destructive/20 has-data-[slot=combobox-chip]:px-1.5 dark:bg-input/30 dark:has-aria-invalid:border-destructive/50 dark:has-aria-invalid:ring-destructive/40", className),
|
|
125
125
|
...props
|
|
126
126
|
});
|
|
127
127
|
}
|
|
128
128
|
function ComboboxChip({ className, children, showRemove = true, ...props }) {
|
|
129
|
-
return /* @__PURE__ */ jsxs(
|
|
129
|
+
return /* @__PURE__ */ jsxs(Combobox.Chip, {
|
|
130
130
|
"data-slot": "combobox-chip",
|
|
131
131
|
className: cn("flex h-[calc(--spacing(5.5))] w-fit items-center justify-center gap-1 rounded-sm bg-muted px-1.5 text-xs font-medium whitespace-nowrap text-foreground has-disabled:pointer-events-none has-disabled:cursor-not-allowed has-disabled:opacity-50 has-data-[slot=combobox-chip-remove]:pr-0", className),
|
|
132
132
|
...props,
|
|
133
|
-
children: [children, showRemove && /* @__PURE__ */ jsx(
|
|
133
|
+
children: [children, showRemove && /* @__PURE__ */ jsx(Combobox.ChipRemove, {
|
|
134
134
|
render: /* @__PURE__ */ jsx(Button, {
|
|
135
135
|
variant: "ghost",
|
|
136
136
|
size: "icon-xs"
|
|
@@ -142,10 +142,13 @@ function ComboboxChip({ className, children, showRemove = true, ...props }) {
|
|
|
142
142
|
});
|
|
143
143
|
}
|
|
144
144
|
function ComboboxChipsInput({ className, ...props }) {
|
|
145
|
-
return /* @__PURE__ */ jsx(
|
|
145
|
+
return /* @__PURE__ */ jsx(Combobox.Input, {
|
|
146
146
|
"data-slot": "combobox-chip-input",
|
|
147
147
|
className: cn("min-w-16 flex-1 outline-none", className),
|
|
148
148
|
...props
|
|
149
149
|
});
|
|
150
150
|
}
|
|
151
|
-
|
|
151
|
+
function createComboboxItems(...args) {
|
|
152
|
+
return Combobox.createItems(...args);
|
|
153
|
+
}
|
|
154
|
+
export { Combobox$1 as Combobox, ComboboxChip, ComboboxChips, ComboboxChipsInput, ComboboxCollection, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxInput, ComboboxItem, ComboboxLabel, ComboboxList, ComboboxTrigger, ComboboxValue, createComboboxItems };
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import * as React$1 from "react";
|
|
2
|
-
import { Dialog
|
|
3
|
-
declare function Dialog$1({ ...props }:
|
|
4
|
-
declare function DialogTrigger({ ...props }:
|
|
5
|
-
declare function DialogClose({ ...props }:
|
|
6
|
-
declare function DialogContent({ className, children, showCloseButton, ...props }:
|
|
2
|
+
import { Dialog } from "@base-ui/react/dialog";
|
|
3
|
+
declare function Dialog$1({ ...props }: Dialog.Root.Props): React$1.JSX.Element;
|
|
4
|
+
declare function DialogTrigger({ ...props }: Dialog.Trigger.Props): React$1.JSX.Element;
|
|
5
|
+
declare function DialogClose({ ...props }: Dialog.Close.Props): React$1.JSX.Element;
|
|
6
|
+
declare function DialogContent({ className, children, showCloseButton, ...props }: Dialog.Popup.Props & {
|
|
7
7
|
showCloseButton?: boolean;
|
|
8
8
|
}): React$1.JSX.Element;
|
|
9
9
|
declare function DialogHeader({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
10
10
|
declare function DialogFooter({ className, showCloseButton, children, ...props }: React$1.ComponentProps<"div"> & {
|
|
11
11
|
showCloseButton?: boolean;
|
|
12
12
|
}): React$1.JSX.Element;
|
|
13
|
-
declare function DialogTitle({ className, ...props }:
|
|
14
|
-
declare function DialogDescription({ className, ...props }:
|
|
15
|
-
export
|
|
13
|
+
declare function DialogTitle({ className, ...props }: Dialog.Title.Props): React$1.JSX.Element;
|
|
14
|
+
declare function DialogDescription({ className, ...props }: Dialog.Description.Props): React$1.JSX.Element;
|
|
15
|
+
export type DialogHandle<Payload> = ReturnType<typeof Dialog.createHandle<Payload>>;
|
|
16
|
+
export declare function createDialogHandle<Payload>(): DialogHandle<Payload>;
|
|
17
|
+
export { Dialog$1 as Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger };
|
|
@@ -4,45 +4,45 @@ import { cn } from "cn";
|
|
|
4
4
|
import "react";
|
|
5
5
|
import { XIcon } from "lucide-react";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
-
import { Dialog
|
|
7
|
+
import { Dialog } from "@base-ui/react/dialog";
|
|
8
8
|
// src/vendor/shadcn/dialog.tsx
|
|
9
9
|
function Dialog$1({ ...props }) {
|
|
10
|
-
return /* @__PURE__ */ jsx(
|
|
10
|
+
return /* @__PURE__ */ jsx(Dialog.Root, {
|
|
11
11
|
"data-slot": "dialog",
|
|
12
12
|
...props
|
|
13
13
|
});
|
|
14
14
|
}
|
|
15
15
|
function DialogTrigger({ ...props }) {
|
|
16
|
-
return /* @__PURE__ */ jsx(
|
|
16
|
+
return /* @__PURE__ */ jsx(Dialog.Trigger, {
|
|
17
17
|
"data-slot": "dialog-trigger",
|
|
18
18
|
...props
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
21
|
function DialogPortal({ ...props }) {
|
|
22
|
-
return /* @__PURE__ */ jsx(
|
|
22
|
+
return /* @__PURE__ */ jsx(Dialog.Portal, {
|
|
23
23
|
"data-slot": "dialog-portal",
|
|
24
24
|
...props
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
27
|
function DialogClose({ ...props }) {
|
|
28
|
-
return /* @__PURE__ */ jsx(
|
|
28
|
+
return /* @__PURE__ */ jsx(Dialog.Close, {
|
|
29
29
|
"data-slot": "dialog-close",
|
|
30
30
|
...props
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
33
|
function DialogOverlay({ className, ...props }) {
|
|
34
|
-
return /* @__PURE__ */ jsx(
|
|
34
|
+
return /* @__PURE__ */ jsx(Dialog.Backdrop, {
|
|
35
35
|
"data-slot": "dialog-overlay",
|
|
36
36
|
className: cn("fixed inset-0 isolate 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", className),
|
|
37
37
|
...props
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
40
|
function DialogContent({ className, children, showCloseButton = true, ...props }) {
|
|
41
|
-
return /* @__PURE__ */ jsxs(DialogPortal, { children: [/* @__PURE__ */ jsx(DialogOverlay, {}), /* @__PURE__ */ jsxs(
|
|
41
|
+
return /* @__PURE__ */ jsxs(DialogPortal, { children: [/* @__PURE__ */ jsx(DialogOverlay, {}), /* @__PURE__ */ jsxs(Dialog.Popup, {
|
|
42
42
|
"data-slot": "dialog-content",
|
|
43
43
|
className: cn("fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-6 rounded-xl bg-popover p-6 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-md 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", className),
|
|
44
44
|
...props,
|
|
45
|
-
children: [children, showCloseButton && /* @__PURE__ */ jsxs(
|
|
45
|
+
children: [children, showCloseButton && /* @__PURE__ */ jsxs(Dialog.Close, {
|
|
46
46
|
"data-slot": "dialog-close",
|
|
47
47
|
render: /* @__PURE__ */ jsx(Button, {
|
|
48
48
|
variant: "ghost",
|
|
@@ -68,24 +68,27 @@ function DialogFooter({ className, showCloseButton = false, children, ...props }
|
|
|
68
68
|
"data-slot": "dialog-footer",
|
|
69
69
|
className: cn("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", className),
|
|
70
70
|
...props,
|
|
71
|
-
children: [children, showCloseButton && /* @__PURE__ */ jsx(
|
|
71
|
+
children: [children, showCloseButton && /* @__PURE__ */ jsx(Dialog.Close, {
|
|
72
72
|
render: /* @__PURE__ */ jsx(Button, { variant: "outline" }),
|
|
73
73
|
children: "Close"
|
|
74
74
|
})]
|
|
75
75
|
});
|
|
76
76
|
}
|
|
77
77
|
function DialogTitle({ className, ...props }) {
|
|
78
|
-
return /* @__PURE__ */ jsx(
|
|
78
|
+
return /* @__PURE__ */ jsx(Dialog.Title, {
|
|
79
79
|
"data-slot": "dialog-title",
|
|
80
80
|
className: cn("leading-none font-medium", className),
|
|
81
81
|
...props
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
84
|
function DialogDescription({ className, ...props }) {
|
|
85
|
-
return /* @__PURE__ */ jsx(
|
|
85
|
+
return /* @__PURE__ */ jsx(Dialog.Description, {
|
|
86
86
|
"data-slot": "dialog-description",
|
|
87
87
|
className: cn("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground", className),
|
|
88
88
|
...props
|
|
89
89
|
});
|
|
90
90
|
}
|
|
91
|
-
|
|
91
|
+
function createDialogHandle() {
|
|
92
|
+
return Dialog.createHandle();
|
|
93
|
+
}
|
|
94
|
+
export { Dialog$1 as Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, createDialogHandle };
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import * as React$1 from "react";
|
|
2
|
-
import { Drawer
|
|
3
|
-
declare function Drawer({ modal, showSwipeHandle, snapPoints, swipeDirection, ...props }:
|
|
2
|
+
import { Drawer } from "@base-ui/react/drawer";
|
|
3
|
+
declare function Drawer$1({ modal, showSwipeHandle, snapPoints, swipeDirection, ...props }: Drawer.Root.Props & {
|
|
4
4
|
showSwipeHandle?: boolean;
|
|
5
5
|
}): React$1.JSX.Element;
|
|
6
|
-
declare function DrawerTrigger({ ...props }:
|
|
7
|
-
declare function DrawerClose({ ...props }:
|
|
8
|
-
declare function DrawerContent({ className, children, ...props }:
|
|
6
|
+
declare function DrawerTrigger({ ...props }: Drawer.Trigger.Props): React$1.JSX.Element;
|
|
7
|
+
declare function DrawerClose({ ...props }: Drawer.Close.Props): React$1.JSX.Element;
|
|
8
|
+
declare function DrawerContent({ className, children, ...props }: Drawer.Popup.Props): React$1.JSX.Element;
|
|
9
9
|
declare function DrawerHeader({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
10
10
|
declare function DrawerFooter({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
11
|
-
declare function DrawerTitle({ className, ...props }:
|
|
12
|
-
declare function DrawerDescription({ className, ...props }:
|
|
13
|
-
export
|
|
11
|
+
declare function DrawerTitle({ className, ...props }: Drawer.Title.Props): React$1.JSX.Element;
|
|
12
|
+
declare function DrawerDescription({ className, ...props }: Drawer.Description.Props): React$1.JSX.Element;
|
|
13
|
+
export type DrawerHandle<Payload> = ReturnType<typeof Drawer.createHandle<Payload>>;
|
|
14
|
+
export declare function createDrawerHandle<Payload>(): DrawerHandle<Payload>;
|
|
15
|
+
export { Drawer$1 as Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerTitle, DrawerTrigger };
|