@deftui/react 0.2.4 → 0.3.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 +2 -4
- package/dist/index.d.mts +7 -7
- package/dist/index.mjs +5 -5
- package/dist/styles.css +3 -0
- package/dist/vendor/README.md +8 -8
- package/dist/vendor/coss/calendar.d.mts +4 -0
- package/dist/vendor/coss/calendar.mjs +70 -0
- package/dist/vendor/coss/card.d.mts +23 -0
- package/dist/vendor/coss/card.mjs +160 -0
- package/dist/vendor/coss/dialog.d.mts +1 -1
- package/dist/vendor/coss/dialog.mjs +1 -1
- package/dist/vendor/coss/form.d.mts +1 -0
- package/dist/vendor/coss/form.mjs +1 -0
- package/dist/vendor/coss/scroll-area.d.mts +1 -0
- package/dist/vendor/coss/scroll-area.mjs +1 -0
- package/dist/vendor/coss/table.d.mts +15 -0
- package/dist/vendor/coss/table.mjs +73 -0
- package/dist/vendor/shadcn/badge.d.mts +1 -0
- package/dist/vendor/shadcn/badge.mjs +1 -0
- package/dist/vendor/shadcn/button.d.mts +1 -0
- package/dist/vendor/shadcn/button.mjs +1 -0
- package/dist/vendor/shadcn/checkbox.d.mts +1 -0
- package/dist/vendor/shadcn/checkbox.mjs +1 -0
- package/dist/vendor/shadcn/input.d.mts +1 -0
- package/dist/vendor/shadcn/input.mjs +1 -0
- package/dist/vendor/shadcn/label.d.mts +1 -0
- package/dist/vendor/shadcn/label.mjs +1 -0
- package/dist/vendor/shadcn/separator.d.mts +1 -0
- package/dist/vendor/shadcn/separator.mjs +1 -0
- package/dist/vendor/shadcn/skeleton.d.mts +1 -0
- package/dist/vendor/shadcn/skeleton.mjs +1 -0
- package/dist/vendor/shadcn/spinner.d.mts +1 -0
- package/dist/vendor/shadcn/spinner.mjs +1 -0
- package/dist/vendor/shadcn/switch.d.mts +1 -0
- package/dist/vendor/shadcn/switch.mjs +1 -0
- package/dist/vendor/shadcn/textarea.d.mts +1 -0
- package/dist/vendor/shadcn/textarea.mjs +1 -0
- package/dist/vendor/tailored/file-tree.d.mts +1 -0
- package/dist/vendor/tailored/file-tree.mjs +1 -0
- package/dist/vendor/tailored/icon-swap.d.mts +1 -0
- package/dist/vendor/tailored/icon-swap.mjs +1 -0
- package/dist/vendor/tailored/json-viewer.d.mts +1 -0
- package/dist/vendor/tailored/json-viewer.mjs +1 -0
- package/dist/vendor/tailored/lightbox.d.mts +1 -1
- package/dist/vendor/tailored/lightbox.mjs +1 -1
- package/dist/widgets/datetime.d.mts +1 -1
- package/dist/widgets/datetime.mjs +6 -1
- package/dist/widgets/dropzone.d.mts +5 -3
- package/dist/widgets/dropzone.mjs +11 -7
- package/dist/widgets/index.d.mts +38 -12
- package/dist/widgets/index.mjs +35 -8
- package/dist/widgets/multimedia.d.mts +2 -0
- package/dist/widgets/multimedia.mjs +2 -0
- package/dist/widgets/pagination.d.mts +1 -0
- package/dist/widgets/pagination.mjs +1 -0
- package/dist/widgets/sidebar.d.mts +1 -0
- package/dist/widgets/sidebar.mjs +1 -0
- package/package.json +1 -1
- package/dist/vendor/shadcn/calendar.d.mts +0 -10
- package/dist/vendor/shadcn/calendar.mjs +0 -107
- package/dist/vendor/shadcn/card.d.mts +0 -11
- package/dist/vendor/shadcn/card.mjs +0 -55
- package/dist/vendor/shadcn/table.d.mts +0 -9
- package/dist/vendor/shadcn/table.mjs +0 -59
package/README.md
CHANGED
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
A React component library built on Base UI, shadcn/ui, and their open-source registry ecosystem, offering easy-to-use compound component APIs.
|
|
4
4
|
|
|
5
|
-
[Upstream documentation](./dist/vendor/README.md): To look up component usage, check the local exports first, then consult the upstream.
|
|
6
|
-
|
|
7
5
|
> Most basic components expose exactly the same APIs as their shadcn/ui counterparts backed by Base UI.
|
|
8
6
|
|
|
9
7
|
## Installation
|
|
@@ -34,9 +32,9 @@ export function Example() {
|
|
|
34
32
|
<Card.Description>Compose your UI using Compound Component API</Card.Description>
|
|
35
33
|
</Card.Header>
|
|
36
34
|
|
|
37
|
-
<Card.
|
|
35
|
+
<Card.Panel>
|
|
38
36
|
<Button>Get started</Button>
|
|
39
|
-
</Card.
|
|
37
|
+
</Card.Panel>
|
|
40
38
|
</Card>
|
|
41
39
|
);
|
|
42
40
|
}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
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 { Separator } from "./vendor/shadcn/separator.mjs";
|
|
4
|
-
import { Button } from "./vendor/shadcn/button.mjs";
|
|
5
4
|
import { Label } from "./vendor/shadcn/label.mjs";
|
|
5
|
+
import { Button } from "./vendor/shadcn/button.mjs";
|
|
6
6
|
import { Toaster, toast } from "./vendor/shadcn/toast.mjs";
|
|
7
7
|
import { Input } from "./vendor/shadcn/input.mjs";
|
|
8
8
|
import { useSidebar } from "./vendor/shadcn/sidebar.mjs";
|
|
9
9
|
import { Sidebar } from "./widgets/sidebar.mjs";
|
|
10
|
+
import { Calendar } from "./vendor/coss/calendar.mjs";
|
|
10
11
|
import { DatePicker, DateRange, DateRangePicker, TimePicker } from "./widgets/datetime.mjs";
|
|
11
|
-
import { Dropzone,
|
|
12
|
+
import { Dropzone, formatBytes, useDropzone } from "./widgets/dropzone.mjs";
|
|
12
13
|
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";
|
|
13
14
|
import { Carousel, Image, ImageProps, Lightbox } from "./widgets/multimedia.mjs";
|
|
14
15
|
import { Pagination } from "./widgets/pagination.mjs";
|
|
15
|
-
import { Form } from "./vendor/coss/form.mjs";
|
|
16
16
|
import { Badge } from "./vendor/shadcn/badge.mjs";
|
|
17
17
|
import { Switch } from "./vendor/shadcn/switch.mjs";
|
|
18
18
|
import { Spinner } from "./vendor/shadcn/spinner.mjs";
|
|
19
19
|
import { Skeleton } from "./vendor/shadcn/skeleton.mjs";
|
|
20
20
|
import { Checkbox } from "./vendor/shadcn/checkbox.mjs";
|
|
21
21
|
import { Textarea } from "./vendor/shadcn/textarea.mjs";
|
|
22
|
+
import { Form } from "./vendor/coss/form.mjs";
|
|
22
23
|
import { ScrollArea } from "./vendor/coss/scroll-area.mjs";
|
|
23
24
|
import { IconSwap } from "./vendor/tailored/icon-swap.mjs";
|
|
24
25
|
import { JsonViewer } from "./vendor/tailored/json-viewer.mjs";
|
|
25
26
|
import { FileTree, FileTreeNode } from "./vendor/tailored/file-tree.mjs";
|
|
26
|
-
import { AlertDialog, Breadcrumb, ButtonGroup,
|
|
27
|
+
import { AlertDialog, Breadcrumb, ButtonGroup, Card, Combobox, Dialog, Drawer, Dropdown, Empty, Field, Frame, InputGroup, Kbd, Popover, Progress, Radio, Select, Table, Tabs, Tooltip } from "./widgets/index.mjs";
|
|
27
28
|
import { cn } from "cn";
|
|
28
29
|
import { cva } from "class-variance-authority";
|
|
29
30
|
import { mergeProps } from "@base-ui/react/merge-props";
|
|
30
|
-
|
|
31
|
-
export type
|
|
32
|
-
export { AlertDialog, Badge, Breadcrumb, Button, ButtonGroup, Calendar, Card, Carousel, Checkbox, Combobox, DatePicker, type DateRange, DateRangePicker, Dialog, Drawer, Dropdown, Dropzone, Empty, Field, FileTree, type FileTreeNode, Form, IconSwap, Image, ImageProps, Input, InputGroup, JsonViewer, 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, Skeleton, Spinner, Switch, Table, Tabs, Textarea, TimePicker, Toaster as ToastProvider, Tooltip, cn, cva, formatSize, mergeProps, toast, useCopyToClipboard, useDropzone, useIsMobile, type useLightbox, useMediaQuery, useSidebar };
|
|
31
|
+
export * from "react-dropzone";
|
|
32
|
+
export { AlertDialog, Badge, Breadcrumb, Button, ButtonGroup, Calendar, Card, Carousel, Checkbox, Combobox, DatePicker, type DateRange, DateRangePicker, Dialog, Drawer, Dropdown, Dropzone, Empty, Field, FileTree, type FileTreeNode, Form, Frame, IconSwap, Image, ImageProps, Input, InputGroup, JsonViewer, 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, Skeleton, Spinner, Switch, Table, Tabs, Textarea, TimePicker, Toaster as ToastProvider, Tooltip, cn, cva, formatBytes, mergeProps, toast, useCopyToClipboard, useDropzone, useIsMobile, type useLightbox, useMediaQuery, useSidebar };
|
package/dist/index.mjs
CHANGED
|
@@ -11,20 +11,20 @@ import { Toaster, toast } from "./vendor/shadcn/toast.mjs";
|
|
|
11
11
|
import { Skeleton } from "./vendor/shadcn/skeleton.mjs";
|
|
12
12
|
import { useSidebar } from "./vendor/shadcn/sidebar.mjs";
|
|
13
13
|
import { Sidebar } from "./widgets/sidebar.mjs";
|
|
14
|
+
import { Calendar } from "./vendor/coss/calendar.mjs";
|
|
14
15
|
import { DatePicker, DateRangePicker, TimePicker } from "./widgets/datetime.mjs";
|
|
15
|
-
import { Dropzone,
|
|
16
|
+
import { Dropzone, formatBytes, useDropzone } from "./widgets/dropzone.mjs";
|
|
16
17
|
import { Carousel, Image, Lightbox } from "./widgets/multimedia.mjs";
|
|
17
18
|
import { Pagination } from "./widgets/pagination.mjs";
|
|
18
|
-
import { Form } from "./vendor/coss/form.mjs";
|
|
19
19
|
import { Badge } from "./vendor/shadcn/badge.mjs";
|
|
20
20
|
import { Switch } from "./vendor/shadcn/switch.mjs";
|
|
21
21
|
import { Checkbox } from "./vendor/shadcn/checkbox.mjs";
|
|
22
|
+
import { Form } from "./vendor/coss/form.mjs";
|
|
22
23
|
import { IconSwap } from "./vendor/tailored/icon-swap.mjs";
|
|
23
24
|
import { JsonViewer } from "./vendor/tailored/json-viewer.mjs";
|
|
24
25
|
import { FileTree } from "./vendor/tailored/file-tree.mjs";
|
|
25
|
-
import { AlertDialog, Breadcrumb, ButtonGroup,
|
|
26
|
+
import { AlertDialog, Breadcrumb, ButtonGroup, Card, Combobox, Dialog, Drawer, Dropdown, Empty, Field, Frame, InputGroup, Kbd, Popover, Progress, Radio, Select, Table, Tabs, Tooltip } from "./widgets/index.mjs";
|
|
26
27
|
import { cn } from "cn";
|
|
27
28
|
import { cva } from "class-variance-authority";
|
|
28
29
|
import { mergeProps } from "@base-ui/react/merge-props";
|
|
29
|
-
|
|
30
|
-
export { AlertDialog, Badge, Breadcrumb, Button, ButtonGroup, Calendar, Card, Carousel, Checkbox, Combobox, DatePicker, DateRangePicker, Dialog, Drawer, Dropdown, Dropzone, Empty, Field, FileTree, Form, IconSwap, Image, Input, InputGroup, JsonViewer, Kbd, Label, Lightbox, Pagination, Popover, Progress, Radio, ScrollArea, Select, Separator, Sidebar, Skeleton, Spinner, Switch, Table, Tabs, Textarea, TimePicker, Toaster as ToastProvider, Tooltip, cn, cva, formatSize, mergeProps, toast, useCopyToClipboard, useDropzone, useIsMobile, useMediaQuery, useSidebar };
|
|
30
|
+
export { AlertDialog, Badge, Breadcrumb, Button, ButtonGroup, Calendar, Card, Carousel, Checkbox, Combobox, DatePicker, DateRangePicker, Dialog, Drawer, Dropdown, Dropzone, Empty, Field, FileTree, Form, Frame, IconSwap, Image, Input, InputGroup, JsonViewer, Kbd, Label, Lightbox, Pagination, Popover, Progress, Radio, ScrollArea, Select, Separator, Sidebar, Skeleton, Spinner, Switch, Table, Tabs, Textarea, TimePicker, Toaster as ToastProvider, Tooltip, cn, cva, formatBytes, mergeProps, toast, useCopyToClipboard, useDropzone, useIsMobile, useMediaQuery, useSidebar };
|
package/dist/styles.css
CHANGED
package/dist/vendor/README.md
CHANGED
|
@@ -11,20 +11,21 @@ shadcn 组件使用 `components.json` 中的 `base-vega` 风格和 Lucide 图标
|
|
|
11
11
|
|
|
12
12
|
| ID | File | Docs | Modifications |
|
|
13
13
|
| --- | --- | --- | --- |
|
|
14
|
-
| `@coss/alert-dialog` | [coss/alert-dialog.tsx](coss/alert-dialog.tsx) | [Alert Dialog](https://coss.com/ui/docs/components/alert-dialog) | `font-bold text-xl`
|
|
15
|
-
| `@coss/
|
|
16
|
-
| `@coss/
|
|
17
|
-
| `@coss/
|
|
14
|
+
| `@coss/alert-dialog` | [coss/alert-dialog.tsx](coss/alert-dialog.tsx) | [Alert Dialog](https://coss.com/ui/docs/components/alert-dialog) | `font-bold text-xl` 替换为 `font-semibold text-lg`;用 `@starting-style` 支持初始打开时的入场动画 |
|
|
15
|
+
| `@coss/calendar` | [coss/calendar.tsx](coss/calendar.tsx) | [Calendar](https://coss.com/ui/docs/components/calendar) | — |
|
|
16
|
+
| `@coss/card` | [coss/card.tsx](coss/card.tsx) | [Card](https://coss.com/ui/docs/components/card) | 用 `--card-spacing` 与 `--card-gap` 替代分段 padding;新增 `spacing`、`gap` 属性写入对应变量;标题改为 `text-base font-semibold leading-normal`;首尾图片贴边并补圆角 |
|
|
17
|
+
| `@coss/dialog` | [coss/dialog.tsx](coss/dialog.tsx) | [Dialog](https://coss.com/ui/docs/components/dialog) | `font-bold text-xl` 替换为 `font-semibold text-lg`;用 `@starting-style` 支持初始打开时的入场动画 |
|
|
18
|
+
| `@coss/drawer` | [coss/drawer.tsx](coss/drawer.tsx) | [Drawer](https://coss.com/ui/docs/components/drawer) | `font-bold text-xl` 替换为 `font-semibold text-lg`;用 `@starting-style` 支持初始打开时的入场动画 |
|
|
19
|
+
| `@coss/empty` | [coss/empty.tsx](coss/empty.tsx) | [Empty](https://coss.com/ui/docs/components/empty) | `font-bold text-xl` 替换为 `font-semibold text-lg` |
|
|
18
20
|
| `@coss/form` | [coss/form.tsx](coss/form.tsx) | [Form](https://coss.com/ui/docs/components/form) | — |
|
|
19
21
|
| `@coss/scroll-area` | [coss/scroll-area.tsx](coss/scroll-area.tsx) | [Scroll Area](https://coss.com/ui/docs/components/scroll-area) | — |
|
|
22
|
+
| `@coss/table` | [coss/table.tsx](coss/table.tsx) | [Table](https://coss.com/ui/docs/components/table) | 默认变体的 `TableFooter` 移除底色,与 `card` 变体一样保持透明 |
|
|
20
23
|
| `@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) | — |
|
|
21
24
|
| `@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 默认值一致 |
|
|
22
25
|
| `badge` | [shadcn/badge.tsx](shadcn/badge.tsx) | [Badge](https://ui.shadcn.com/docs/components/base/badge) | 提供 `info`、`success`、`warning` 语义变体 |
|
|
23
26
|
| `breadcrumb` | [shadcn/breadcrumb.tsx](shadcn/breadcrumb.tsx) | [Breadcrumb](https://ui.shadcn.com/docs/components/base/breadcrumb) | 未显式指定 `BreadcrumbList` 则自动包裹 |
|
|
24
|
-
| `button` | [shadcn/button.tsx](shadcn/button.tsx) | [Button](https://ui.shadcn.com/docs/components/base/button) | `pill` 提供全圆角;`isPending` 提供加载态;提供额外 `destructive`
|
|
27
|
+
| `button` | [shadcn/button.tsx](shadcn/button.tsx) | [Button](https://ui.shadcn.com/docs/components/base/button) | `pill` 提供全圆角;`isPending` 提供加载态;提供额外 `destructive` 系列样式变体 |
|
|
25
28
|
| `button-group` | [shadcn/button-group.tsx](shadcn/button-group.tsx) | [Button Group](https://ui.shadcn.com/docs/components/base/button-group) | — |
|
|
26
|
-
| `calendar` | [shadcn/calendar.tsx](shadcn/calendar.tsx) | [Calendar](https://ui.shadcn.com/docs/components/base/calendar) | 将 `react-day-picker` 导入改为 `@daypicker/react` |
|
|
27
|
-
| `card` | [shadcn/card.tsx](shadcn/card.tsx) | [Card](https://ui.shadcn.com/docs/components/base/card) | — |
|
|
28
29
|
| `carousel` | [shadcn/carousel.tsx](shadcn/carousel.tsx) | [Carousel](https://ui.shadcn.com/docs/components/base/carousel) | — |
|
|
29
30
|
| `checkbox` | [shadcn/checkbox.tsx](shadcn/checkbox.tsx) | [Checkbox](https://ui.shadcn.com/docs/components/base/checkbox) | — |
|
|
30
31
|
| `combobox` | [shadcn/combobox.tsx](shadcn/combobox.tsx) | [Combobox](https://ui.shadcn.com/docs/components/base/combobox) | 将选中标记移至左侧 |
|
|
@@ -46,7 +47,6 @@ shadcn 组件使用 `components.json` 中的 `base-vega` 风格和 Lucide 图标
|
|
|
46
47
|
| `skeleton` | [shadcn/skeleton.tsx](shadcn/skeleton.tsx) | [Skeleton](https://ui.shadcn.com/docs/components/base/skeleton) | — |
|
|
47
48
|
| `spinner` | [shadcn/spinner.tsx](shadcn/spinner.tsx) | [Spinner](https://ui.shadcn.com/docs/components/base/spinner) | — |
|
|
48
49
|
| `switch` | [shadcn/switch.tsx](shadcn/switch.tsx) | [Switch](https://ui.shadcn.com/docs/components/base/switch) | — |
|
|
49
|
-
| `table` | [shadcn/table.tsx](shadcn/table.tsx) | [Table](https://ui.shadcn.com/docs/components/base/table) | — |
|
|
50
50
|
| `tabs` | [shadcn/tabs.tsx](shadcn/tabs.tsx) | [Tabs](https://ui.shadcn.com/docs/components/base/tabs) | — |
|
|
51
51
|
| `textarea` | [shadcn/textarea.tsx](shadcn/textarea.tsx) | [Textarea](https://ui.shadcn.com/docs/components/base/textarea) | — |
|
|
52
52
|
| `toast` | [shadcn/toast.tsx](shadcn/toast.tsx) | [Toast](https://ui.shadcn.com/docs/components/base/toast) | — |
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
import { DayPicker } from "@daypicker/react";
|
|
3
|
+
/** https://coss.com/ui/docs/components/calendar */
|
|
4
|
+
export declare function Calendar({ className, classNames, showOutsideDays, components: userComponents, mode, ...props }: React$1.ComponentProps<typeof DayPicker>): React$1.ReactElement;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../shadcn/lib/utils.mjs";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { ChevronLeftIcon, ChevronRightIcon, ChevronsUpDownIcon } from "lucide-react";
|
|
5
|
+
import { DayPicker } from "@daypicker/react";
|
|
6
|
+
// src/vendor/coss/calendar.tsx
|
|
7
|
+
const buttonClassNames = "relative flex size-(--cell-size) text-base sm:text-sm items-center justify-center rounded-lg text-foreground not-in-data-selected:hover:bg-accent disabled:pointer-events-none disabled:opacity-64 [&_svg:not([class*='opacity-'])]:opacity-80 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0";
|
|
8
|
+
/** https://coss.com/ui/docs/components/calendar */
|
|
9
|
+
function Calendar({ className, classNames, showOutsideDays = true, components: userComponents, mode = "single", ...props }) {
|
|
10
|
+
const defaultClassNames = {
|
|
11
|
+
button_next: buttonClassNames,
|
|
12
|
+
button_previous: buttonClassNames,
|
|
13
|
+
caption_label: "text-base sm:text-sm font-medium flex items-center gap-2 h-full",
|
|
14
|
+
day: "size-(--cell-size) text-sm py-px",
|
|
15
|
+
day_button: cn(buttonClassNames, "in-data-disabled:pointer-events-none in-[.range-middle]:rounded-none in-[.range-end:not(.range-start)]:rounded-s-none in-[.range-start:not(.range-end)]:rounded-e-none in-[.range-middle]:in-data-selected:bg-accent in-data-selected:bg-primary in-[.range-middle]:in-data-selected:text-foreground in-data-disabled:text-muted-foreground/72 in-data-outside:text-muted-foreground/72 in-data-selected:in-data-outside:text-primary-foreground in-data-selected:text-primary-foreground in-data-disabled:line-through outline-none in-[[data-selected]:not(.range-middle)]:transition-[border-radius,box-shadow] focus-visible:z-1 focus-visible:ring-[3px] focus-visible:ring-ring/50"),
|
|
16
|
+
dropdown: "absolute bg-popover inset-0 opacity-0",
|
|
17
|
+
dropdown_root: "relative has-focus:border-ring has-focus:ring-ring/50 has-focus:ring-[3px] border border-input shadow-xs/5 rounded-lg px-[calc(--spacing(3)-1px)] h-9 sm:h-8 [&_svg:not([class*='opacity-'])]:opacity-80 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:-me-1",
|
|
18
|
+
dropdowns: "w-full flex items-center text-base sm:text-sm justify-center h-(--cell-size) gap-1.5 *:[span]:font-medium",
|
|
19
|
+
hidden: "invisible",
|
|
20
|
+
month: "w-full",
|
|
21
|
+
month_caption: "relative mx-(--cell-size) px-1 mb-1 flex h-(--cell-size) items-center justify-center z-2",
|
|
22
|
+
months: "relative flex flex-col sm:flex-row gap-2",
|
|
23
|
+
nav: "absolute top-0 flex w-full justify-between z-1",
|
|
24
|
+
outside: "text-muted-foreground data-selected:bg-accent/50 data-selected:text-muted-foreground",
|
|
25
|
+
range_end: "range-end",
|
|
26
|
+
range_middle: "range-middle",
|
|
27
|
+
range_start: "range-start",
|
|
28
|
+
today: "*:after:pointer-events-none *:after:absolute *:after:bottom-1 *:after:start-1/2 *:after:z-1 *:after:size-[3px] *:after:-translate-x-1/2 *:after:rounded-full *:after:bg-primary [&[data-selected]:not(.range-middle)>*]:after:bg-background [&[data-disabled]>*]:after:bg-foreground/30",
|
|
29
|
+
week_number: "size-(--cell-size) p-0 text-xs font-medium text-muted-foreground/72",
|
|
30
|
+
weekday: "size-(--cell-size) p-0 text-xs font-medium text-muted-foreground/72"
|
|
31
|
+
};
|
|
32
|
+
const mergedClassNames = Object.keys(defaultClassNames).reduce((acc, key) => {
|
|
33
|
+
const userClass = classNames?.[key];
|
|
34
|
+
const baseClass = defaultClassNames[key];
|
|
35
|
+
acc[key] = userClass ? cn(baseClass, userClass) : baseClass;
|
|
36
|
+
return acc;
|
|
37
|
+
}, { ...defaultClassNames });
|
|
38
|
+
const mergedComponents = {
|
|
39
|
+
Chevron: ({ className, orientation, ...props }) => {
|
|
40
|
+
if (orientation === "left") return /* @__PURE__ */ jsx(ChevronLeftIcon, {
|
|
41
|
+
className: cn(className, "rtl:rotate-180"),
|
|
42
|
+
...props,
|
|
43
|
+
"aria-hidden": "true"
|
|
44
|
+
});
|
|
45
|
+
if (orientation === "right") return /* @__PURE__ */ jsx(ChevronRightIcon, {
|
|
46
|
+
className: cn(className, "rtl:rotate-180"),
|
|
47
|
+
...props,
|
|
48
|
+
"aria-hidden": "true"
|
|
49
|
+
});
|
|
50
|
+
return /* @__PURE__ */ jsx(ChevronsUpDownIcon, {
|
|
51
|
+
className,
|
|
52
|
+
...props,
|
|
53
|
+
"aria-hidden": "true"
|
|
54
|
+
});
|
|
55
|
+
},
|
|
56
|
+
...userComponents
|
|
57
|
+
};
|
|
58
|
+
const dayPickerProps = {
|
|
59
|
+
className: cn("w-fit [--cell-size:--spacing(10)] sm:[--cell-size:--spacing(9)]", className),
|
|
60
|
+
classNames: mergedClassNames,
|
|
61
|
+
components: mergedComponents,
|
|
62
|
+
"data-slot": "calendar",
|
|
63
|
+
formatters: { formatMonthDropdown: (month, dateLib) => dateLib.format(month, "LLL") },
|
|
64
|
+
mode,
|
|
65
|
+
showOutsideDays,
|
|
66
|
+
...props
|
|
67
|
+
};
|
|
68
|
+
return /* @__PURE__ */ jsx(DayPicker, { ...dayPickerProps });
|
|
69
|
+
}
|
|
70
|
+
export { Calendar };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
3
|
+
type SpacingProps = {
|
|
4
|
+
/** Gap between card sections. Numbers use the spacing scale. */
|
|
5
|
+
gap?: CardSpacing;
|
|
6
|
+
/** Outer inset and horizontal section padding. Numbers use the spacing scale. */
|
|
7
|
+
spacing?: CardSpacing;
|
|
8
|
+
};
|
|
9
|
+
type CardSpacing = number | (string & {});
|
|
10
|
+
export declare function Card({ className, render, gap, spacing, ...props }: useRender.ComponentProps<"div"> & SpacingProps): React.ReactElement;
|
|
11
|
+
export declare function CardFrame({ className, render, gap, spacing, ...props }: useRender.ComponentProps<"div"> & SpacingProps): React.ReactElement;
|
|
12
|
+
export declare function CardFrameHeader({ className, render, ...props }: useRender.ComponentProps<"div">): React.ReactElement;
|
|
13
|
+
export declare function CardFrameTitle({ className, render, ...props }: useRender.ComponentProps<"div">): React.ReactElement;
|
|
14
|
+
export declare function CardFrameDescription({ className, render, ...props }: useRender.ComponentProps<"div">): React.ReactElement;
|
|
15
|
+
export declare function CardFrameAction({ className, render, ...props }: useRender.ComponentProps<"div">): React.ReactElement;
|
|
16
|
+
export declare function CardFrameFooter({ className, render, ...props }: useRender.ComponentProps<"div">): React.ReactElement;
|
|
17
|
+
export declare function CardHeader({ className, render, ...props }: useRender.ComponentProps<"div">): React.ReactElement;
|
|
18
|
+
export declare function CardTitle({ className, render, ...props }: useRender.ComponentProps<"div">): React.ReactElement;
|
|
19
|
+
export declare function CardDescription({ className, render, ...props }: useRender.ComponentProps<"div">): React.ReactElement;
|
|
20
|
+
export declare function CardAction({ className, render, ...props }: useRender.ComponentProps<"div">): React.ReactElement;
|
|
21
|
+
export declare function CardPanel({ className, render, ...props }: useRender.ComponentProps<"div">): React.ReactElement;
|
|
22
|
+
export declare function CardFooter({ className, render, ...props }: useRender.ComponentProps<"div">): React.ReactElement;
|
|
23
|
+
export { CardPanel as CardContent };
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../shadcn/lib/utils.mjs";
|
|
3
|
+
import { mergeProps } from "@base-ui/react/merge-props";
|
|
4
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
5
|
+
// src/vendor/coss/card.tsx
|
|
6
|
+
function resolveSpacing(value) {
|
|
7
|
+
return typeof value === "number" ? `calc(var(--spacing) * ${value})` : value;
|
|
8
|
+
}
|
|
9
|
+
function getCardStyle(spacing, gap) {
|
|
10
|
+
return {
|
|
11
|
+
...spacing !== void 0 && { "--card-spacing": resolveSpacing(spacing) },
|
|
12
|
+
...gap !== void 0 && { "--card-gap": resolveSpacing(gap) }
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
function Card({ className, render, gap, spacing, ...props }) {
|
|
16
|
+
const defaultProps = {
|
|
17
|
+
className: cn("relative flex flex-col gap-(--card-gap) rounded-2xl border bg-card not-dark:bg-clip-padding py-(--card-spacing) text-card-foreground text-sm shadow-xs/5 before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-2xl)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] has-[>img:first-child]:pt-0 has-[>img:last-child]:pb-0 *:[img:first-child]:rounded-t-2xl *:[img:last-child]:rounded-b-2xl dark:before:shadow-[0_-1px_--theme(--color-white/6%)]", className),
|
|
18
|
+
"data-slot": "card",
|
|
19
|
+
style: getCardStyle(spacing, gap)
|
|
20
|
+
};
|
|
21
|
+
return useRender({
|
|
22
|
+
defaultTagName: "div",
|
|
23
|
+
props: mergeProps(defaultProps, props),
|
|
24
|
+
render
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
function CardFrame({ className, render, gap, spacing, ...props }) {
|
|
28
|
+
const defaultProps = {
|
|
29
|
+
className: cn("relative flex flex-col rounded-2xl border bg-card not-dark:bg-clip-padding text-card-foreground shadow-xs/5 [--clip-bottom:-1rem] [--clip-top:-1rem] before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-2xl)-1px)] before:bg-muted/72 before:shadow-[0_1px_--theme(--color-black/4%)] has-data-[slot=table-container]:overflow-hidden *:data-[slot=card]:-m-px *:data-[slot=table-container]:-m-px *:data-[slot=table-container]:w-[calc(100%+2px)] *:not-first:data-[slot=card]:rounded-t-xl *:not-last:data-[slot=card]:rounded-b-xl *:data-[slot=card]:bg-clip-padding *:data-[slot=card]:shadow-none *:data-[slot=card]:before:hidden *:not-first:data-[slot=card]:before:rounded-t-[calc(var(--radius-xl)-1px)] *:not-last:data-[slot=card]:before:rounded-b-[calc(var(--radius-xl)-1px)] dark:before:shadow-[0_-1px_--theme(--color-white/6%)] *:data-[slot=card]:[clip-path:inset(var(--clip-top)_1px_var(--clip-bottom)_1px_round_calc(var(--radius-2xl)-1px))] *:data-[slot=card]:last:[--clip-bottom:1px] *:data-[slot=card]:first:[--clip-top:1px]", className),
|
|
30
|
+
"data-slot": "card-frame",
|
|
31
|
+
style: getCardStyle(spacing, gap)
|
|
32
|
+
};
|
|
33
|
+
return useRender({
|
|
34
|
+
defaultTagName: "div",
|
|
35
|
+
props: mergeProps(defaultProps, props),
|
|
36
|
+
render
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
function CardFrameHeader({ className, render, ...props }) {
|
|
40
|
+
const defaultProps = {
|
|
41
|
+
className: cn("relative flex grid auto-rows-min grid-rows-[auto_auto] flex-col items-start gap-x-4 px-(--card-spacing) py-(--card-gap) has-data-[slot=card-frame-action]:grid-cols-[1fr_auto]", className),
|
|
42
|
+
"data-slot": "card-frame-header"
|
|
43
|
+
};
|
|
44
|
+
return useRender({
|
|
45
|
+
defaultTagName: "div",
|
|
46
|
+
props: mergeProps(defaultProps, props),
|
|
47
|
+
render
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
function CardFrameTitle({ className, render, ...props }) {
|
|
51
|
+
const defaultProps = {
|
|
52
|
+
className: cn("self-center font-semibold text-sm", className),
|
|
53
|
+
"data-slot": "card-frame-title"
|
|
54
|
+
};
|
|
55
|
+
return useRender({
|
|
56
|
+
defaultTagName: "div",
|
|
57
|
+
props: mergeProps(defaultProps, props),
|
|
58
|
+
render
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
function CardFrameDescription({ className, render, ...props }) {
|
|
62
|
+
const defaultProps = {
|
|
63
|
+
className: cn("self-center text-muted-foreground text-sm", className),
|
|
64
|
+
"data-slot": "card-frame-description"
|
|
65
|
+
};
|
|
66
|
+
return useRender({
|
|
67
|
+
defaultTagName: "div",
|
|
68
|
+
props: mergeProps(defaultProps, props),
|
|
69
|
+
render
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
function CardFrameAction({ className, render, ...props }) {
|
|
73
|
+
const defaultProps = {
|
|
74
|
+
className: cn("col-start-2 nth-3:row-span-2 nth-3:row-start-1 inline-flex self-center justify-self-end", className),
|
|
75
|
+
"data-slot": "card-frame-action"
|
|
76
|
+
};
|
|
77
|
+
return useRender({
|
|
78
|
+
defaultTagName: "div",
|
|
79
|
+
props: mergeProps(defaultProps, props),
|
|
80
|
+
render
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
function CardFrameFooter({ className, render, ...props }) {
|
|
84
|
+
const defaultProps = {
|
|
85
|
+
className: cn("px-(--card-spacing) py-(--card-gap)", className),
|
|
86
|
+
"data-slot": "card-frame-footer"
|
|
87
|
+
};
|
|
88
|
+
return useRender({
|
|
89
|
+
defaultTagName: "div",
|
|
90
|
+
props: mergeProps(defaultProps, props),
|
|
91
|
+
render
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
function CardHeader({ className, render, ...props }) {
|
|
95
|
+
const defaultProps = {
|
|
96
|
+
className: cn("grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-(--card-spacing) [.border-b]:pb-(--card-gap) has-data-[slot=card-action]:grid-cols-[1fr_auto]", className),
|
|
97
|
+
"data-slot": "card-header"
|
|
98
|
+
};
|
|
99
|
+
return useRender({
|
|
100
|
+
defaultTagName: "div",
|
|
101
|
+
props: mergeProps(defaultProps, props),
|
|
102
|
+
render
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
function CardTitle({ className, render, ...props }) {
|
|
106
|
+
const defaultProps = {
|
|
107
|
+
className: cn("font-heading font-semibold text-base leading-normal", className),
|
|
108
|
+
"data-slot": "card-title"
|
|
109
|
+
};
|
|
110
|
+
return useRender({
|
|
111
|
+
defaultTagName: "div",
|
|
112
|
+
props: mergeProps(defaultProps, props),
|
|
113
|
+
render
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
function CardDescription({ className, render, ...props }) {
|
|
117
|
+
const defaultProps = {
|
|
118
|
+
className: cn("text-muted-foreground text-sm", className),
|
|
119
|
+
"data-slot": "card-description"
|
|
120
|
+
};
|
|
121
|
+
return useRender({
|
|
122
|
+
defaultTagName: "div",
|
|
123
|
+
props: mergeProps(defaultProps, props),
|
|
124
|
+
render
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
function CardAction({ className, render, ...props }) {
|
|
128
|
+
const defaultProps = {
|
|
129
|
+
className: cn("col-start-2 row-span-2 row-start-1 inline-flex self-start justify-self-end", className),
|
|
130
|
+
"data-slot": "card-action"
|
|
131
|
+
};
|
|
132
|
+
return useRender({
|
|
133
|
+
defaultTagName: "div",
|
|
134
|
+
props: mergeProps(defaultProps, props),
|
|
135
|
+
render
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
function CardPanel({ className, render, ...props }) {
|
|
139
|
+
const defaultProps = {
|
|
140
|
+
className: cn("flex-1 px-(--card-spacing)", className),
|
|
141
|
+
"data-slot": "card-panel"
|
|
142
|
+
};
|
|
143
|
+
return useRender({
|
|
144
|
+
defaultTagName: "div",
|
|
145
|
+
props: mergeProps(defaultProps, props),
|
|
146
|
+
render
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
function CardFooter({ className, render, ...props }) {
|
|
150
|
+
const defaultProps = {
|
|
151
|
+
className: cn("flex items-center px-(--card-spacing) [.border-t]:pt-(--card-gap)", className),
|
|
152
|
+
"data-slot": "card-footer"
|
|
153
|
+
};
|
|
154
|
+
return useRender({
|
|
155
|
+
defaultTagName: "div",
|
|
156
|
+
props: mergeProps(defaultProps, props),
|
|
157
|
+
render
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
export { Card, CardAction, CardPanel as CardContent, CardPanel, CardDescription, CardFooter, CardFrame, CardFrameAction, CardFrameDescription, CardFrameFooter, CardFrameHeader, CardFrameTitle, CardHeader, CardTitle };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { Dialog as DialogPrimitive } from "@base-ui/react/dialog";
|
|
3
2
|
import { useRender } from "@base-ui/react/use-render";
|
|
3
|
+
import { Dialog as DialogPrimitive } from "@base-ui/react/dialog";
|
|
4
4
|
export declare function DialogTrigger(props: DialogPrimitive.Trigger.Props): React.ReactElement;
|
|
5
5
|
export declare function DialogClose(props: DialogPrimitive.Close.Props): React.ReactElement;
|
|
6
6
|
export declare function DialogPopup({ className, children, showCloseButton, bottomStickOnMobile, closeProps, portalProps, ...props }: DialogPrimitive.Popup.Props & {
|
|
@@ -4,8 +4,8 @@ import { Button } from "../shadcn/button.mjs";
|
|
|
4
4
|
import { ScrollArea } from "./scroll-area.mjs";
|
|
5
5
|
import { mergeProps } from "@base-ui/react/merge-props";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
-
import { Dialog as DialogPrimitive } from "@base-ui/react/dialog";
|
|
8
7
|
import { useRender } from "@base-ui/react/use-render";
|
|
8
|
+
import { Dialog as DialogPrimitive } from "@base-ui/react/dialog";
|
|
9
9
|
import { XIcon } from "lucide-react";
|
|
10
10
|
DialogPrimitive.createHandle;
|
|
11
11
|
const Dialog$1 = DialogPrimitive.Root;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { Form as FormPrimitive } from "@base-ui/react/form";
|
|
4
4
|
// src/vendor/coss/form.tsx
|
|
5
|
+
/** https://coss.com/ui/docs/components/form */
|
|
5
6
|
function Form({ className, ...props }) {
|
|
6
7
|
return /* @__PURE__ */ jsx(FormPrimitive, {
|
|
7
8
|
className,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ScrollArea as ScrollAreaPrimitive } from "@base-ui/react/scroll-area";
|
|
3
|
+
/** https://coss.com/ui/docs/components/scroll-area */
|
|
3
4
|
declare function ScrollArea$1({ className, children, scrollFade, scrollbarGutter, fill, clampContentMinWidth, overscrollContain, ...props }: ScrollAreaPrimitive.Root.Props & {
|
|
4
5
|
scrollFade?: boolean;
|
|
5
6
|
scrollbarGutter?: boolean;
|
|
@@ -3,6 +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
|
+
/** https://coss.com/ui/docs/components/scroll-area */
|
|
6
7
|
function ScrollArea$1({ className, children, scrollFade = false, scrollbarGutter = false, fill = false, clampContentMinWidth = true, overscrollContain = false, ...props }) {
|
|
7
8
|
return /* @__PURE__ */ jsxs(ScrollAreaPrimitive.Root, {
|
|
8
9
|
className: cn("size-full min-h-0", className),
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
3
|
+
export type TableVariant = "default" | "card";
|
|
4
|
+
export type TableProps = React.ComponentProps<"table"> & {
|
|
5
|
+
variant?: TableVariant;
|
|
6
|
+
render?: useRender.ComponentProps<"div">["render"];
|
|
7
|
+
};
|
|
8
|
+
export declare function Table({ className, variant, render, ...props }: TableProps): React.ReactElement;
|
|
9
|
+
export declare function TableHeader({ className, ...props }: React.ComponentProps<"thead">): React.ReactElement;
|
|
10
|
+
export declare function TableBody({ className, ...props }: React.ComponentProps<"tbody">): React.ReactElement;
|
|
11
|
+
export declare function TableFooter({ className, ...props }: React.ComponentProps<"tfoot">): React.ReactElement;
|
|
12
|
+
export declare function TableRow({ className, ...props }: React.ComponentProps<"tr">): React.ReactElement;
|
|
13
|
+
export declare function TableHead({ className, ...props }: React.ComponentProps<"th">): React.ReactElement;
|
|
14
|
+
export declare function TableCell({ className, ...props }: React.ComponentProps<"td">): React.ReactElement;
|
|
15
|
+
export declare function TableCaption({ className, ...props }: React.ComponentProps<"caption">): React.ReactElement;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../shadcn/lib/utils.mjs";
|
|
3
|
+
import { mergeProps } from "@base-ui/react/merge-props";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
6
|
+
// src/vendor/coss/table.tsx
|
|
7
|
+
function Table({ className, variant = "default", render, ...props }) {
|
|
8
|
+
const defaultProps = {
|
|
9
|
+
children: /* @__PURE__ */ jsx("table", {
|
|
10
|
+
className: cn("w-full caption-bottom in-data-[variant=card]:border-separate in-data-[variant=card]:border-spacing-0 text-sm", className),
|
|
11
|
+
"data-slot": "table",
|
|
12
|
+
...props
|
|
13
|
+
}),
|
|
14
|
+
className: "relative w-full overflow-x-auto",
|
|
15
|
+
"data-slot": "table-container",
|
|
16
|
+
"data-variant": variant
|
|
17
|
+
};
|
|
18
|
+
return useRender({
|
|
19
|
+
defaultTagName: "div",
|
|
20
|
+
props: mergeProps(defaultProps, {}),
|
|
21
|
+
render
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
function TableHeader({ className, ...props }) {
|
|
25
|
+
return /* @__PURE__ */ jsx("thead", {
|
|
26
|
+
className: cn("[&_tr]:border-b", className),
|
|
27
|
+
"data-slot": "table-header",
|
|
28
|
+
...props
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
function TableBody({ className, ...props }) {
|
|
32
|
+
return /* @__PURE__ */ jsx("tbody", {
|
|
33
|
+
className: cn("relative in-data-[variant=card]:rounded-xl in-data-[variant=card]:shadow-xs/5 before:pointer-events-none before:absolute before:inset-px not-in-data-[variant=card]:before:hidden before:rounded-[calc(var(--radius-xl)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] dark:before:shadow-[0_-1px_--theme(--color-white/8%)] [&_tr:last-child]:border-0 in-data-[variant=card]:*:[tr]:border-0 in-data-[variant=card]:*:[tr]:*:[td]:border-b in-data-[variant=card]:*:[tr]:*:[td]:bg-card in-data-[variant=card]:*:[tr]:first:*:[td]:first:rounded-ss-xl in-data-[variant=card]:*:[tr]:*:[td]:first:border-s in-data-[variant=card]:*:[tr]:first:*:[td]:border-t in-data-[variant=card]:*:[tr]:last:*:[td]:last:rounded-ee-xl in-data-[variant=card]:*:[tr]:*:[td]:last:border-e in-data-[variant=card]:*:[tr]:first:*:[td]:last:rounded-se-xl in-data-[variant=card]:*:[tr]:last:*:[td]:first:rounded-es-xl in-data-[variant=card]:*:[tr]:hover:*:[td]:bg-[color-mix(in_srgb,var(--card),var(--color-black)_2%)] in-data-[variant=card]:*:[tr]:data-[state=selected]:*:[td]:bg-[color-mix(in_srgb,var(--card),var(--color-black)_4%)] dark:in-data-[variant=card]:*:[tr]:data-[state=selected]:*:[td]:bg-[color-mix(in_srgb,var(--card),var(--color-white)_4%)] dark:in-data-[variant=card]:*:[tr]:hover:*:[td]:bg-[color-mix(in_srgb,var(--card),var(--color-white)_2%)]", className),
|
|
34
|
+
"data-slot": "table-body",
|
|
35
|
+
...props
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
function TableFooter({ className, ...props }) {
|
|
39
|
+
return /* @__PURE__ */ jsx("tfoot", {
|
|
40
|
+
className: cn("border-t in-data-[variant=card]:border-none bg-transparent font-medium [&>tr]:last:border-b-0", className),
|
|
41
|
+
"data-slot": "table-footer",
|
|
42
|
+
...props
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
function TableRow({ className, ...props }) {
|
|
46
|
+
return /* @__PURE__ */ jsx("tr", {
|
|
47
|
+
className: cn("relative border-b not-in-data-[variant=card]:hover:bg-[color-mix(in_srgb,var(--background),var(--color-black)_2%)] not-in-data-[variant=card]:data-[state=selected]:bg-[color-mix(in_srgb,var(--background),var(--color-black)_4%)] dark:not-in-data-[variant=card]:data-[state=selected]:bg-[color-mix(in_srgb,var(--background),var(--color-white)_4%)] dark:not-in-data-[variant=card]:hover:bg-[color-mix(in_srgb,var(--background),var(--color-white)_2%)]", className),
|
|
48
|
+
"data-slot": "table-row",
|
|
49
|
+
...props
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
function TableHead({ className, ...props }) {
|
|
53
|
+
return /* @__PURE__ */ jsx("th", {
|
|
54
|
+
className: cn("h-10 whitespace-nowrap px-2.5 text-left align-middle font-medium text-muted-foreground leading-none has-[[role=checkbox]]:w-px last:has-[[role=checkbox]]:ps-0 first:has-[[role=checkbox]]:pe-0", className),
|
|
55
|
+
"data-slot": "table-head",
|
|
56
|
+
...props
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
function TableCell({ className, ...props }) {
|
|
60
|
+
return /* @__PURE__ */ jsx("td", {
|
|
61
|
+
className: cn("whitespace-nowrap bg-clip-padding p-2.5 in-data-[slot=table-footer]:py-3.5 align-middle leading-none in-data-[variant=card]:first:ps-[calc(--spacing(2.5)-1px)] in-data-[variant=card]:last:pe-[calc(--spacing(2.5)-1px)] has-[[role=checkbox]]:w-px last:has-[[role=checkbox]]:ps-0 first:has-[[role=checkbox]]:pe-0", className),
|
|
62
|
+
"data-slot": "table-cell",
|
|
63
|
+
...props
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
function TableCaption({ className, ...props }) {
|
|
67
|
+
return /* @__PURE__ */ jsx("caption", {
|
|
68
|
+
className: cn("in-data-[variant=card]:my-4 mt-4 text-muted-foreground text-sm", className),
|
|
69
|
+
"data-slot": "table-caption",
|
|
70
|
+
...props
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow };
|
|
@@ -3,5 +3,6 @@ import { useRender } from "@base-ui/react/use-render";
|
|
|
3
3
|
declare const badgeVariants: (props?: ({
|
|
4
4
|
variant?: "default" | "destructive" | "ghost" | "info" | "link" | "outline" | "secondary" | "success" | "warning" | null | undefined;
|
|
5
5
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
|
+
/** https://ui.shadcn.com/docs/components/base/badge */
|
|
6
7
|
declare function Badge({ className, variant, render, ...props }: useRender.ComponentProps<"span"> & VariantProps<typeof badgeVariants>): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
7
8
|
export { Badge, badgeVariants };
|
|
@@ -17,6 +17,7 @@ const badgeVariants = cva("group/badge inline-flex h-5 w-fit shrink-0 items-cent
|
|
|
17
17
|
} },
|
|
18
18
|
defaultVariants: { variant: "default" }
|
|
19
19
|
});
|
|
20
|
+
/** https://ui.shadcn.com/docs/components/base/badge */
|
|
20
21
|
function Badge({ className, variant = "default", render, ...props }) {
|
|
21
22
|
return useRender({
|
|
22
23
|
defaultTagName: "span",
|
|
@@ -5,6 +5,7 @@ declare const buttonVariants: (props?: ({
|
|
|
5
5
|
size?: "default" | "icon" | "icon-lg" | "icon-sm" | "icon-xs" | "lg" | "sm" | "xs" | null | undefined;
|
|
6
6
|
pill?: boolean | null | undefined;
|
|
7
7
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
|
+
/** https://ui.shadcn.com/docs/components/base/button */
|
|
8
9
|
declare function Button$1({ className, variant, size, pill, isPending, disabled, children, ...props }: Button.Props & VariantProps<typeof buttonVariants> & {
|
|
9
10
|
isPending?: boolean;
|
|
10
11
|
}): import("react").JSX.Element;
|
|
@@ -34,6 +34,7 @@ const buttonVariants = cva("group/button inline-flex shrink-0 items-center justi
|
|
|
34
34
|
size: "default"
|
|
35
35
|
}
|
|
36
36
|
});
|
|
37
|
+
/** https://ui.shadcn.com/docs/components/base/button */
|
|
37
38
|
function Button$1({ className, variant = "default", size = "default", pill = false, isPending = false, disabled, children, ...props }) {
|
|
38
39
|
return /* @__PURE__ */ jsx(Button, {
|
|
39
40
|
"data-slot": "button",
|
|
@@ -4,6 +4,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
4
4
|
import { CheckIcon } from "lucide-react";
|
|
5
5
|
import { Checkbox } from "@base-ui/react/checkbox";
|
|
6
6
|
// src/vendor/shadcn/checkbox.tsx
|
|
7
|
+
/** https://ui.shadcn.com/docs/components/base/checkbox */
|
|
7
8
|
function Checkbox$1({ className, ...props }) {
|
|
8
9
|
return /* @__PURE__ */ jsx(Checkbox.Root, {
|
|
9
10
|
"data-slot": "checkbox",
|
|
@@ -3,6 +3,7 @@ import "react";
|
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
import { Input } from "@base-ui/react/input";
|
|
5
5
|
// src/vendor/shadcn/input.tsx
|
|
6
|
+
/** https://ui.shadcn.com/docs/components/base/input */
|
|
6
7
|
function Input$1({ className, type, ...props }) {
|
|
7
8
|
return /* @__PURE__ */ jsx(Input, {
|
|
8
9
|
type,
|