@deftui/react 0.2.5 → 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 CHANGED
@@ -32,9 +32,9 @@ export function Example() {
32
32
  <Card.Description>Compose your UI using Compound Component API</Card.Description>
33
33
  </Card.Header>
34
34
 
35
- <Card.Content>
35
+ <Card.Panel>
36
36
  <Button>Get started</Button>
37
- </Card.Content>
37
+ </Card.Panel>
38
38
  </Card>
39
39
  );
40
40
  }
package/dist/index.d.mts CHANGED
@@ -1,31 +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
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, Calendar, Card, Combobox, Dialog, Drawer, Dropdown, Empty, Field, InputGroup, Kbd, Popover, Progress, Radio, Select, Table, Tabs, Tooltip } from "./widgets/index.mjs";
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 * from "react-dropzone";
31
- 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, formatBytes, mergeProps, toast, useCopyToClipboard, useDropzone, useIsMobile, type useLightbox, useMediaQuery, useSidebar };
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,19 +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
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, Calendar, Card, Combobox, Dialog, Drawer, Dropdown, Empty, Field, InputGroup, Kbd, Popover, Progress, Radio, Select, Table, Tabs, Tooltip } from "./widgets/index.mjs";
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
- 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, formatBytes, 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
@@ -65,6 +65,9 @@
65
65
  --radius-2xl: calc(var(--radius) * 1.8);
66
66
  --radius-3xl: calc(var(--radius) * 2.2);
67
67
  --radius-4xl: calc(var(--radius) * 2.6);
68
+
69
+ --card-gap: calc(var(--spacing) * 4);
70
+ --card-spacing: calc(var(--spacing) * 6);
68
71
  }
69
72
 
70
73
  @layer base {
@@ -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` 换为 `font-semibold text-lg`;用 `@starting-style` 支持初始打开时的入场动画 |
15
- | `@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` 支持初始打开时的入场动画 |
16
- | `@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` 支持初始打开时的入场动画 |
17
- | `@coss/empty` | [coss/empty.tsx](coss/empty.tsx) | [Empty](https://coss.com/ui/docs/components/empty) | `font-bold text-xl` 换为 `font-semibold text-lg` |
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` 系列样式变体,`destructive-soft` 保留 shadcn 的浅色危险样式 |
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;
@@ -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 };
@@ -1,7 +1,7 @@
1
1
  import { Button } from "../shadcn/button.mjs";
2
2
  import * as React$1 from "react";
3
- import { Dialog } from "@base-ui/react/dialog";
4
3
  import { useRender } from "@base-ui/react/use-render";
4
+ import { Dialog } from "@base-ui/react/dialog";
5
5
  type LightboxOverlay = "blur" | "brightness";
6
6
  type LightboxDirection = "ltr" | "rtl";
7
7
  type LightboxChangeReason = "trigger-press" | "previous-press" | "next-press" | "thumbnail-press" | "swipe" | "keyboard" | "programmatic" | "items-change";
@@ -7,8 +7,8 @@ import { cn } from "cn";
7
7
  import { mergeProps } from "@base-ui/react/merge-props";
8
8
  import * as React$1 from "react";
9
9
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
10
- import { Dialog } from "@base-ui/react/dialog";
11
10
  import { useRender } from "@base-ui/react/use-render";
11
+ import { Dialog } from "@base-ui/react/dialog";
12
12
  import { ChevronLeftIcon, ChevronRightIcon, DownloadIcon, EllipsisIcon, ImageOffIcon, XIcon, ZoomInIcon, ZoomOutIcon } from "lucide-react";
13
13
  import { ScrollArea } from "@base-ui/react/scroll-area";
14
14
  import { Menu } from "@base-ui/react/menu";
@@ -1,5 +1,5 @@
1
+ import { Calendar } from "../vendor/coss/calendar.mjs";
1
2
  import { Button } from "../vendor/shadcn/button.mjs";
2
- import { Calendar } from "../vendor/shadcn/calendar.mjs";
3
3
  import { Input } from "../vendor/shadcn/input.mjs";
4
4
  import { ComponentProps } from "react";
5
5
  import { DateRange } from "@daypicker/react";
@@ -1,11 +1,12 @@
1
+ import { Calendar } from "../vendor/coss/calendar.mjs";
1
2
  import { Button } from "../vendor/shadcn/button.mjs";
2
- import { Calendar } from "../vendor/shadcn/calendar.mjs";
3
3
  import { Input } from "../vendor/shadcn/input.mjs";
4
4
  import { Popover, PopoverContent, PopoverTrigger } from "../vendor/shadcn/popover.mjs";
5
5
  import { cn } from "cn";
6
6
  import { useState } from "react";
7
7
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
8
8
  import { CalendarIcon } from "lucide-react";
9
+ import { enUS, zhCN } from "@daypicker/react/locale";
9
10
  import { format } from "date-fns";
10
11
  // src/widgets/datetime.tsx
11
12
  function TimePicker({ className, step = "1", ...props }) {
@@ -18,6 +19,7 @@ function TimePicker({ className, step = "1", ...props }) {
18
19
  }
19
20
  function DatePicker({ value, defaultValue = null, placeholder = "请选择日期", disabled, onChange, className, calendarProps, ...props }) {
20
21
  const [internalValue, setInternalValue] = useState(defaultValue);
22
+ const locale = navigator.language.startsWith("zh") ? zhCN : enUS;
21
23
  const date = value === void 0 ? internalValue : value;
22
24
  function handleSelect(selected) {
23
25
  const nextValue = selected ?? null;
@@ -34,6 +36,7 @@ function DatePicker({ value, defaultValue = null, placeholder = "请选择日期
34
36
  }),
35
37
  children: [/* @__PURE__ */ jsx(CalendarIcon, { "aria-hidden": "true" }), date ? format(date, "PPP") : placeholder]
36
38
  }), /* @__PURE__ */ jsx(PopoverContent, { children: /* @__PURE__ */ jsx(Calendar, {
39
+ locale,
37
40
  defaultMonth: date ?? void 0,
38
41
  ...calendarProps,
39
42
  disabled: disabled || calendarProps?.disabled,
@@ -44,6 +47,7 @@ function DatePicker({ value, defaultValue = null, placeholder = "请选择日期
44
47
  }
45
48
  function DateRangePicker({ value, defaultValue = null, placeholder = "请选择日期范围", disabled, onChange, className, calendarProps, ...props }) {
46
49
  const [internalValue, setInternalValue] = useState(defaultValue);
50
+ const locale = navigator.language.startsWith("zh") ? zhCN : enUS;
47
51
  const date = value === void 0 ? internalValue : value;
48
52
  function handleSelect(selected) {
49
53
  const nextValue = selected ?? null;
@@ -64,6 +68,7 @@ function DateRangePicker({ value, defaultValue = null, placeholder = "请选择
64
68
  date?.to && /* @__PURE__ */ jsxs(Fragment, { children: [" - ", format(date.to, "LLL dd, y")] })
65
69
  ]
66
70
  }), /* @__PURE__ */ jsx(PopoverContent, { children: /* @__PURE__ */ jsx(Calendar, {
71
+ locale,
67
72
  defaultMonth: date?.from,
68
73
  ...calendarProps,
69
74
  disabled: disabled || calendarProps?.disabled,
@@ -1,11 +1,11 @@
1
1
  import { AlertDialogClose, AlertDialogContent as AlertDialogPopup, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogPrimitive, AlertDialogTitle, AlertDialogTrigger } from "../vendor/coss/alert-dialog.mjs";
2
+ import { Card as Card$1, CardAction, CardContent as CardPanel, CardDescription, CardFooter, CardFrame, CardFrameAction, CardFrameDescription, CardFrameFooter, CardFrameHeader, CardFrameTitle, CardHeader, CardTitle } from "../vendor/coss/card.mjs";
2
3
  import { DialogClose, DialogContent as DialogPopup, DialogDescription, DialogFooter, DialogHeader, DialogPanel, DialogPrimitive, DialogTitle, DialogTrigger } from "../vendor/coss/dialog.mjs";
3
4
  import { Drawer as Drawer$1, DrawerClose, DrawerDescription, DrawerFooter, DrawerHeader, DrawerPanel, DrawerPopup, DrawerTitle, DrawerTrigger } from "../vendor/coss/drawer.mjs";
4
5
  import { Empty as Empty$1, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle } from "../vendor/coss/empty.mjs";
6
+ import { Table as Table$1, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow } from "../vendor/coss/table.mjs";
5
7
  import { Breadcrumb as Breadcrumb$1, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator } from "../vendor/shadcn/breadcrumb.mjs";
6
8
  import { ButtonGroup as ButtonGroup$1, ButtonGroupSeparator, ButtonGroupText } from "../vendor/shadcn/button-group.mjs";
7
- import { Calendar as Calendar$1, CalendarDayButton } from "../vendor/shadcn/calendar.mjs";
8
- import { Card as Card$1, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "../vendor/shadcn/card.mjs";
9
9
  import { ComboboxChip, ComboboxChips, ComboboxChipsInput, ComboboxCollection, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxInput, ComboboxItem, ComboboxLabel, ComboboxList, ComboboxSeparator, ComboboxValue } from "../vendor/shadcn/combobox.mjs";
10
10
  import { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger } from "../vendor/shadcn/dropdown-menu.mjs";
11
11
  import { Field as Field$1, FieldDescription, FieldError, FieldLabel } from "../vendor/shadcn/field.mjs";
@@ -15,7 +15,6 @@ import { Popover as Popover$1, PopoverContent, PopoverDescription, PopoverTitle,
15
15
  import { Progress as Progress$1, ProgressIndicator, ProgressLabel, ProgressTrack, ProgressValue } from "../vendor/shadcn/progress.mjs";
16
16
  import { RadioGroup, RadioGroupItem } from "../vendor/shadcn/radio-group.mjs";
17
17
  import { SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue } from "../vendor/shadcn/select.mjs";
18
- import { Table as Table$1, TableBody, TableCell, TableFooter, TableHead, TableHeader, TableRow } from "../vendor/shadcn/table.mjs";
19
18
  import { Tabs as Tabs$1, TabsContent, TabsList, TabsTrigger } from "../vendor/shadcn/tabs.mjs";
20
19
  import { Tooltip as Tooltip$1, TooltipContent, TooltipProvider, TooltipTrigger } from "../vendor/shadcn/tooltip.mjs";
21
20
  import "./toast.mjs";
@@ -26,11 +25,10 @@ import { Dropzone, formatBytes, useDropzone } from "./dropzone.mjs";
26
25
  import { Carousel, Image, ImageProps, Lightbox } from "./multimedia.mjs";
27
26
  import { useSidebar } from "../vendor/shadcn/sidebar.mjs";
28
27
  import { Pagination } from "./pagination.mjs";
29
- import { Form } from "../vendor/coss/form.mjs";
30
28
  import { Label } from "../vendor/shadcn/label.mjs";
31
- 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";
32
29
  import { Input } from "../vendor/shadcn/input.mjs";
33
30
  import { Badge } from "../vendor/shadcn/badge.mjs";
31
+ 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";
34
32
  import { Button } from "../vendor/shadcn/button.mjs";
35
33
  import { Switch } from "../vendor/shadcn/switch.mjs";
36
34
  import { Spinner } from "../vendor/shadcn/spinner.mjs";
@@ -38,6 +36,8 @@ import { Skeleton } from "../vendor/shadcn/skeleton.mjs";
38
36
  import { Checkbox } from "../vendor/shadcn/checkbox.mjs";
39
37
  import { Textarea } from "../vendor/shadcn/textarea.mjs";
40
38
  import { Separator } from "../vendor/shadcn/separator.mjs";
39
+ import { Form } from "../vendor/coss/form.mjs";
40
+ import { Calendar } from "../vendor/coss/calendar.mjs";
41
41
  import { ScrollArea } from "../vendor/coss/scroll-area.mjs";
42
42
  import { IconSwap } from "../vendor/tailored/icon-swap.mjs";
43
43
  import { JsonViewer } from "../vendor/tailored/json-viewer.mjs";
@@ -53,15 +53,23 @@ export declare const Tabs: typeof Tabs$1 & {
53
53
  Trigger: typeof TabsTrigger;
54
54
  Content: typeof TabsContent;
55
55
  };
56
- /** https://ui.shadcn.com/docs/components/base/card */
56
+ /** https://coss.com/ui/docs/components/card */
57
57
  export declare const Card: typeof Card$1 & {
58
58
  Header: typeof CardHeader;
59
- Content: typeof CardContent;
59
+ Panel: typeof CardPanel;
60
60
  Footer: typeof CardFooter;
61
61
  Title: typeof CardTitle;
62
62
  Action: typeof CardAction;
63
63
  Description: typeof CardDescription;
64
64
  };
65
+ /** https://coss.com/ui/docs/components/card#cardframe */
66
+ export declare const Frame: typeof CardFrame & {
67
+ Header: typeof CardFrameHeader;
68
+ Footer: typeof CardFrameFooter;
69
+ Title: typeof CardFrameTitle;
70
+ Description: typeof CardFrameDescription;
71
+ Action: typeof CardFrameAction;
72
+ };
65
73
  /** https://ui.shadcn.com/docs/components/base/field */
66
74
  export declare const Field: typeof Field$1 & {
67
75
  Label: typeof FieldLabel;
@@ -76,11 +84,12 @@ export declare const Empty: typeof Empty$1 & {
76
84
  Title: typeof EmptyTitle;
77
85
  Description: typeof EmptyDescription;
78
86
  };
79
- /** https://ui.shadcn.com/docs/components/base/table */
87
+ /** https://coss.com/ui/docs/components/table */
80
88
  export declare const Table: typeof Table$1 & {
81
89
  Header: typeof TableHeader;
82
90
  Body: typeof TableBody;
83
91
  Footer: typeof TableFooter;
92
+ Caption: typeof TableCaption;
84
93
  Row: typeof TableRow;
85
94
  Head: typeof TableHead;
86
95
  Cell: typeof TableCell;
@@ -173,10 +182,6 @@ export declare const Progress: typeof Progress$1 & {
173
182
  Track: typeof ProgressTrack;
174
183
  Indicator: typeof ProgressIndicator;
175
184
  };
176
- /** https://ui.shadcn.com/docs/components/base/calendar */
177
- export declare const Calendar: typeof Calendar$1 & {
178
- DayButton: typeof CalendarDayButton;
179
- };
180
185
  /** https://ui.shadcn.com/docs/components/base/breadcrumb */
181
186
  export declare const Breadcrumb: typeof Breadcrumb$1 & {
182
187
  List: typeof BreadcrumbList;
@@ -209,4 +214,4 @@ export declare const InputGroup: typeof InputGroup$1 & {
209
214
  Textarea: typeof InputGroupTextarea;
210
215
  Button: typeof InputGroupButton;
211
216
  };
212
- export { Badge, Button, Carousel, Checkbox, DatePicker, type DateRange, DateRangePicker, Dropzone, FileTree, type FileTreeNode, Form, IconSwap, Image, ImageProps, Input, JsonViewer, 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, ScrollArea, Separator, Sidebar, Skeleton, Spinner, Switch, Textarea, TimePicker, Toaster as ToastProvider, formatBytes, toast, useDropzone, type useLightbox, useSidebar };
217
+ export { Badge, Button, Calendar, Carousel, Checkbox, DatePicker, type DateRange, DateRangePicker, Dropzone, FileTree, type FileTreeNode, Form, IconSwap, Image, ImageProps, Input, JsonViewer, 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, ScrollArea, Separator, Sidebar, Skeleton, Spinner, Switch, Textarea, TimePicker, Toaster as ToastProvider, formatBytes, toast, useDropzone, type useLightbox, useSidebar };
@@ -1,15 +1,15 @@
1
1
  import { AlertDialog as AlertDialog$1, AlertDialogClose, AlertDialogContent as AlertDialogPopup, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger } from "../vendor/coss/alert-dialog.mjs";
2
+ import { Card as Card$1, CardAction, CardContent as CardPanel, CardDescription, CardFooter, CardFrame, CardFrameAction, CardFrameDescription, CardFrameFooter, CardFrameHeader, CardFrameTitle, CardHeader, CardTitle } from "../vendor/coss/card.mjs";
2
3
  import { Spinner } from "../vendor/shadcn/spinner.mjs";
3
4
  import { Button } from "../vendor/shadcn/button.mjs";
4
5
  import { ScrollArea } from "../vendor/coss/scroll-area.mjs";
5
6
  import { Dialog as Dialog$1, DialogClose, DialogContent as DialogPopup, DialogDescription, DialogFooter, DialogHeader, DialogPanel, DialogTitle, DialogTrigger } from "../vendor/coss/dialog.mjs";
6
7
  import { Drawer as Drawer$1, DrawerClose, DrawerDescription, DrawerFooter, DrawerHeader, DrawerPanel, DrawerPopup, DrawerTitle, DrawerTrigger } from "../vendor/coss/drawer.mjs";
7
8
  import { Empty as Empty$1, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle } from "../vendor/coss/empty.mjs";
9
+ import { Table as Table$1, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow } from "../vendor/coss/table.mjs";
8
10
  import { Breadcrumb as Breadcrumb$1, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator } from "../vendor/shadcn/breadcrumb.mjs";
9
11
  import { Separator } from "../vendor/shadcn/separator.mjs";
10
12
  import { ButtonGroup as ButtonGroup$1, ButtonGroupSeparator, ButtonGroupText } from "../vendor/shadcn/button-group.mjs";
11
- import { Calendar as Calendar$1, CalendarDayButton } from "../vendor/shadcn/calendar.mjs";
12
- import { Card as Card$1, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "../vendor/shadcn/card.mjs";
13
13
  import { Input } from "../vendor/shadcn/input.mjs";
14
14
  import { Textarea } from "../vendor/shadcn/textarea.mjs";
15
15
  import { Combobox as Combobox$1, ComboboxChip, ComboboxChips, ComboboxChipsInput, ComboboxCollection, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxInput, ComboboxItem, ComboboxLabel, ComboboxList, ComboboxSeparator, ComboboxValue } from "../vendor/shadcn/combobox.mjs";
@@ -22,21 +22,21 @@ import { Popover as Popover$1, PopoverContent, PopoverDescription, PopoverTitle,
22
22
  import { Progress as Progress$1, ProgressIndicator, ProgressLabel, ProgressTrack, ProgressValue } from "../vendor/shadcn/progress.mjs";
23
23
  import { RadioGroup, RadioGroupItem } from "../vendor/shadcn/radio-group.mjs";
24
24
  import { Select as Select$1, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue } from "../vendor/shadcn/select.mjs";
25
- import { Table as Table$1, TableBody, TableCell, TableFooter, TableHead, TableHeader, TableRow } from "../vendor/shadcn/table.mjs";
26
25
  import { Tabs as Tabs$1, TabsContent, TabsList, TabsTrigger } from "../vendor/shadcn/tabs.mjs";
27
26
  import { Tooltip as Tooltip$1, TooltipContent, TooltipProvider, TooltipTrigger } from "../vendor/shadcn/tooltip.mjs";
28
27
  import { Toaster, toast } from "../vendor/shadcn/toast.mjs";
29
28
  import { Skeleton } from "../vendor/shadcn/skeleton.mjs";
30
29
  import { useSidebar } from "../vendor/shadcn/sidebar.mjs";
31
30
  import { Sidebar } from "./sidebar.mjs";
31
+ import { Calendar } from "../vendor/coss/calendar.mjs";
32
32
  import { DatePicker, DateRangePicker, TimePicker } from "./datetime.mjs";
33
33
  import { Dropzone, formatBytes, useDropzone } from "./dropzone.mjs";
34
34
  import { Carousel, Image, Lightbox } from "./multimedia.mjs";
35
35
  import { Pagination } from "./pagination.mjs";
36
- import { Form } from "../vendor/coss/form.mjs";
37
36
  import { Badge } from "../vendor/shadcn/badge.mjs";
38
37
  import { Switch } from "../vendor/shadcn/switch.mjs";
39
38
  import { Checkbox } from "../vendor/shadcn/checkbox.mjs";
39
+ import { Form } from "../vendor/coss/form.mjs";
40
40
  import { IconSwap } from "../vendor/tailored/icon-swap.mjs";
41
41
  import { JsonViewer } from "../vendor/tailored/json-viewer.mjs";
42
42
  import { FileTree } from "../vendor/tailored/file-tree.mjs";
@@ -49,15 +49,23 @@ const Tabs = /* @__PURE__ */ Object.assign(Tabs$1, {
49
49
  Trigger: TabsTrigger,
50
50
  Content: TabsContent
51
51
  });
52
- /** https://ui.shadcn.com/docs/components/base/card */
52
+ /** https://coss.com/ui/docs/components/card */
53
53
  const Card = /* @__PURE__ */ Object.assign(Card$1, {
54
54
  Header: CardHeader,
55
- Content: CardContent,
55
+ Panel: CardPanel,
56
56
  Footer: CardFooter,
57
57
  Title: CardTitle,
58
58
  Action: CardAction,
59
59
  Description: CardDescription
60
60
  });
61
+ /** https://coss.com/ui/docs/components/card#cardframe */
62
+ const Frame = /* @__PURE__ */ Object.assign(CardFrame, {
63
+ Header: CardFrameHeader,
64
+ Footer: CardFrameFooter,
65
+ Title: CardFrameTitle,
66
+ Description: CardFrameDescription,
67
+ Action: CardFrameAction
68
+ });
61
69
  /** https://ui.shadcn.com/docs/components/base/field */
62
70
  const Field = /* @__PURE__ */ Object.assign(Field$1, {
63
71
  Label: FieldLabel,
@@ -72,11 +80,12 @@ const Empty = /* @__PURE__ */ Object.assign(Empty$1, {
72
80
  Title: EmptyTitle,
73
81
  Description: EmptyDescription
74
82
  });
75
- /** https://ui.shadcn.com/docs/components/base/table */
83
+ /** https://coss.com/ui/docs/components/table */
76
84
  const Table = /* @__PURE__ */ Object.assign(Table$1, {
77
85
  Header: TableHeader,
78
86
  Body: TableBody,
79
87
  Footer: TableFooter,
88
+ Caption: TableCaption,
80
89
  Row: TableRow,
81
90
  Head: TableHead,
82
91
  Cell: TableCell
@@ -167,8 +176,6 @@ const Progress = /* @__PURE__ */ Object.assign(Progress$1, {
167
176
  Track: ProgressTrack,
168
177
  Indicator: ProgressIndicator
169
178
  });
170
- /** https://ui.shadcn.com/docs/components/base/calendar */
171
- const Calendar = /* @__PURE__ */ Object.assign(Calendar$1, { DayButton: CalendarDayButton });
172
179
  /** https://ui.shadcn.com/docs/components/base/breadcrumb */
173
180
  const Breadcrumb = /* @__PURE__ */ Object.assign(Breadcrumb$1, {
174
181
  List: BreadcrumbList,
@@ -201,4 +208,4 @@ const InputGroup = /* @__PURE__ */ Object.assign(InputGroup$1, {
201
208
  Textarea: InputGroupTextarea,
202
209
  Button: InputGroupButton
203
210
  });
204
- 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, formatBytes, toast, useDropzone, useSidebar };
211
+ 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, formatBytes, toast, useDropzone, useSidebar };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deftui/react",
3
- "version": "0.2.5",
3
+ "version": "0.3.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/KiriRainCat/deftui.git",
@@ -1,10 +0,0 @@
1
- import { Button } from "./button.mjs";
2
- import * as React$1 from "react";
3
- import { DayButton, DayPicker, Locale } from "@daypicker/react";
4
- declare function Calendar({ className, classNames, showOutsideDays, captionLayout, buttonVariant, locale, formatters, components, ...props }: React$1.ComponentProps<typeof DayPicker> & {
5
- buttonVariant?: React$1.ComponentProps<typeof Button>["variant"];
6
- }): React$1.JSX.Element;
7
- declare function CalendarDayButton({ className, day, modifiers, locale, ...props }: React$1.ComponentProps<typeof DayButton> & {
8
- locale?: Partial<Locale>;
9
- }): React$1.JSX.Element;
10
- export { Calendar, CalendarDayButton };
@@ -1,107 +0,0 @@
1
- "use client";
2
- import { Button, buttonVariants } from "./button.mjs";
3
- import { cn } from "cn";
4
- import * as React$1 from "react";
5
- import { jsx } from "react/jsx-runtime";
6
- import { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon } from "lucide-react";
7
- import { DayPicker, getDefaultClassNames } from "@daypicker/react";
8
- // src/vendor/shadcn/calendar.tsx
9
- function Calendar({ className, classNames, showOutsideDays = true, captionLayout = "label", buttonVariant = "ghost", locale, formatters, components, ...props }) {
10
- const defaultClassNames = getDefaultClassNames();
11
- return /* @__PURE__ */ jsx(DayPicker, {
12
- showOutsideDays,
13
- className: cn("group/calendar bg-background p-3 [--cell-radius:var(--radius-md)] [--cell-size:--spacing(8)] in-data-[slot=card-content]:bg-transparent in-data-[slot=popover-content]:bg-transparent", String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`, String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`, className),
14
- captionLayout,
15
- locale,
16
- formatters: {
17
- formatMonthDropdown: (date) => date.toLocaleString(locale?.code, { month: "short" }),
18
- ...formatters
19
- },
20
- classNames: {
21
- root: cn("w-fit", defaultClassNames.root),
22
- months: cn("relative flex flex-col gap-4 md:flex-row", defaultClassNames.months),
23
- month: cn("flex w-full flex-col gap-4", defaultClassNames.month),
24
- nav: cn("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1", defaultClassNames.nav),
25
- button_previous: cn(buttonVariants({ variant: buttonVariant }), "size-(--cell-size) p-0 select-none aria-disabled:opacity-50", defaultClassNames.button_previous),
26
- button_next: cn(buttonVariants({ variant: buttonVariant }), "size-(--cell-size) p-0 select-none aria-disabled:opacity-50", defaultClassNames.button_next),
27
- month_caption: cn("flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)", defaultClassNames.month_caption),
28
- dropdowns: cn("flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium", defaultClassNames.dropdowns),
29
- dropdown_root: cn("relative rounded-(--cell-radius)", defaultClassNames.dropdown_root),
30
- dropdown: cn("absolute inset-0 bg-popover opacity-0", defaultClassNames.dropdown),
31
- caption_label: cn("font-medium select-none", captionLayout === "label" ? "text-sm" : "flex items-center gap-1 rounded-(--cell-radius) text-sm [&>svg]:size-3.5 [&>svg]:text-muted-foreground", defaultClassNames.caption_label),
32
- month_grid: cn("w-full border-collapse", defaultClassNames.month_grid),
33
- weekdays: cn("flex", defaultClassNames.weekdays),
34
- weekday: cn("flex-1 rounded-(--cell-radius) text-[0.8rem] font-normal text-muted-foreground select-none", defaultClassNames.weekday),
35
- week: cn("mt-2 flex w-full", defaultClassNames.week),
36
- week_number_header: cn("w-(--cell-size) select-none", defaultClassNames.week_number_header),
37
- week_number: cn("text-[0.8rem] text-muted-foreground select-none", defaultClassNames.week_number),
38
- day: cn("group/day relative aspect-square h-full w-full rounded-(--cell-radius) p-0 text-center select-none [&:last-child[data-selected=true]_button]:rounded-r-(--cell-radius)", props.showWeekNumber ? "[&:nth-child(2)[data-selected=true]_button]:rounded-l-(--cell-radius)" : "[&:first-child[data-selected=true]_button]:rounded-l-(--cell-radius)", defaultClassNames.day),
39
- range_start: cn("relative isolate z-0 rounded-l-(--cell-radius) bg-muted after:absolute after:inset-y-0 after:right-0 after:w-4 after:bg-muted", defaultClassNames.range_start),
40
- range_middle: cn("rounded-none", defaultClassNames.range_middle),
41
- range_end: cn("relative isolate z-0 rounded-r-(--cell-radius) bg-muted after:absolute after:inset-y-0 after:left-0 after:w-4 after:bg-muted", defaultClassNames.range_end),
42
- today: cn("rounded-(--cell-radius) bg-muted text-foreground data-[selected=true]:rounded-none", defaultClassNames.today),
43
- outside: cn("text-muted-foreground aria-selected:text-muted-foreground", defaultClassNames.outside),
44
- disabled: cn("text-muted-foreground opacity-50", defaultClassNames.disabled),
45
- hidden: cn("invisible", defaultClassNames.hidden),
46
- ...classNames
47
- },
48
- components: {
49
- Root: ({ className, rootRef, ...props }) => {
50
- return /* @__PURE__ */ jsx("div", {
51
- "data-slot": "calendar",
52
- ref: rootRef,
53
- className: cn(className),
54
- ...props
55
- });
56
- },
57
- Chevron: ({ className, orientation, ...props }) => {
58
- if (orientation === "left") return /* @__PURE__ */ jsx(ChevronLeftIcon, {
59
- className: cn("size-4", className),
60
- ...props
61
- });
62
- if (orientation === "right") return /* @__PURE__ */ jsx(ChevronRightIcon, {
63
- className: cn("size-4", className),
64
- ...props
65
- });
66
- return /* @__PURE__ */ jsx(ChevronDownIcon, {
67
- className: cn("size-4", className),
68
- ...props
69
- });
70
- },
71
- DayButton: ({ ...props }) => /* @__PURE__ */ jsx(CalendarDayButton, {
72
- locale,
73
- ...props
74
- }),
75
- WeekNumber: ({ children, ...props }) => {
76
- return /* @__PURE__ */ jsx("td", {
77
- ...props,
78
- children: /* @__PURE__ */ jsx("div", {
79
- className: "flex size-(--cell-size) items-center justify-center text-center",
80
- children
81
- })
82
- });
83
- },
84
- ...components
85
- },
86
- ...props
87
- });
88
- }
89
- function CalendarDayButton({ className, day, modifiers, locale, ...props }) {
90
- const defaultClassNames = getDefaultClassNames();
91
- const ref = React$1.useRef(null);
92
- React$1.useEffect(() => {
93
- if (modifiers.focused) ref.current?.focus();
94
- }, [modifiers.focused]);
95
- return /* @__PURE__ */ jsx(Button, {
96
- variant: "ghost",
97
- size: "icon",
98
- "data-day": day.date.toLocaleDateString(locale?.code),
99
- "data-selected-single": modifiers.selected && !modifiers.range_start && !modifiers.range_end && !modifiers.range_middle,
100
- "data-range-start": modifiers.range_start,
101
- "data-range-end": modifiers.range_end,
102
- "data-range-middle": modifiers.range_middle,
103
- className: cn("relative isolate z-10 flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 border-0 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-[3px] group-data-[focused=true]/day:ring-ring/50 data-[range-end=true]:rounded-(--cell-radius) data-[range-end=true]:rounded-r-(--cell-radius) data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-muted data-[range-middle=true]:text-foreground data-[range-start=true]:rounded-(--cell-radius) data-[range-start=true]:rounded-l-(--cell-radius) data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground dark:hover:text-foreground [&>span]:text-xs [&>span]:opacity-70", defaultClassNames.day, className),
104
- ...props
105
- });
106
- }
107
- export { Calendar, CalendarDayButton };
@@ -1,11 +0,0 @@
1
- import * as React$1 from "react";
2
- declare function Card({ className, size, ...props }: React$1.ComponentProps<"div"> & {
3
- size?: "default" | "sm";
4
- }): React$1.JSX.Element;
5
- declare function CardHeader({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
6
- declare function CardTitle({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
7
- declare function CardDescription({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
8
- declare function CardAction({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
9
- declare function CardContent({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
10
- declare function CardFooter({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
11
- export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle };
@@ -1,55 +0,0 @@
1
- import { cn } from "cn";
2
- import "react";
3
- import { jsx } from "react/jsx-runtime";
4
- // src/vendor/shadcn/card.tsx
5
- function Card({ className, size = "default", ...props }) {
6
- return /* @__PURE__ */ jsx("div", {
7
- "data-slot": "card",
8
- "data-size": size,
9
- className: cn("group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground shadow-xs ring-1 ring-foreground/10 [--card-spacing:--spacing(6)] has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(4)] *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl", className),
10
- ...props
11
- });
12
- }
13
- function CardHeader({ className, ...props }) {
14
- return /* @__PURE__ */ jsx("div", {
15
- "data-slot": "card-header",
16
- className: cn("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)", className),
17
- ...props
18
- });
19
- }
20
- function CardTitle({ className, ...props }) {
21
- return /* @__PURE__ */ jsx("div", {
22
- "data-slot": "card-title",
23
- className: cn("text-base leading-normal font-medium group-data-[size=sm]/card:text-sm", className),
24
- ...props
25
- });
26
- }
27
- function CardDescription({ className, ...props }) {
28
- return /* @__PURE__ */ jsx("div", {
29
- "data-slot": "card-description",
30
- className: cn("text-sm text-muted-foreground", className),
31
- ...props
32
- });
33
- }
34
- function CardAction({ className, ...props }) {
35
- return /* @__PURE__ */ jsx("div", {
36
- "data-slot": "card-action",
37
- className: cn("col-start-2 row-span-2 row-start-1 self-start justify-self-end", className),
38
- ...props
39
- });
40
- }
41
- function CardContent({ className, ...props }) {
42
- return /* @__PURE__ */ jsx("div", {
43
- "data-slot": "card-content",
44
- className: cn("flex flex-col gap-3 px-(--card-spacing)", className),
45
- ...props
46
- });
47
- }
48
- function CardFooter({ className, ...props }) {
49
- return /* @__PURE__ */ jsx("div", {
50
- "data-slot": "card-footer",
51
- className: cn("flex items-center rounded-b-xl px-(--card-spacing) [.border-t]:pt-(--card-spacing)", className),
52
- ...props
53
- });
54
- }
55
- export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle };
@@ -1,9 +0,0 @@
1
- import * as React$1 from "react";
2
- declare function Table({ className, ...props }: React$1.ComponentProps<"table">): React$1.JSX.Element;
3
- declare function TableHeader({ className, ...props }: React$1.ComponentProps<"thead">): React$1.JSX.Element;
4
- declare function TableBody({ className, ...props }: React$1.ComponentProps<"tbody">): React$1.JSX.Element;
5
- declare function TableFooter({ className, ...props }: React$1.ComponentProps<"tfoot">): React$1.JSX.Element;
6
- declare function TableRow({ className, ...props }: React$1.ComponentProps<"tr">): React$1.JSX.Element;
7
- declare function TableHead({ className, ...props }: React$1.ComponentProps<"th">): React$1.JSX.Element;
8
- declare function TableCell({ className, ...props }: React$1.ComponentProps<"td">): React$1.JSX.Element;
9
- export { Table, TableBody, TableCell, TableFooter, TableHead, TableHeader, TableRow };
@@ -1,59 +0,0 @@
1
- "use client";
2
- import { cn } from "cn";
3
- import "react";
4
- import { jsx } from "react/jsx-runtime";
5
- // src/vendor/shadcn/table.tsx
6
- function Table({ className, ...props }) {
7
- return /* @__PURE__ */ jsx("div", {
8
- "data-slot": "table-container",
9
- className: "relative w-full overflow-x-auto",
10
- children: /* @__PURE__ */ jsx("table", {
11
- "data-slot": "table",
12
- className: cn("w-full caption-bottom text-sm", className),
13
- ...props
14
- })
15
- });
16
- }
17
- function TableHeader({ className, ...props }) {
18
- return /* @__PURE__ */ jsx("thead", {
19
- "data-slot": "table-header",
20
- className: cn("[&_tr]:border-b", className),
21
- ...props
22
- });
23
- }
24
- function TableBody({ className, ...props }) {
25
- return /* @__PURE__ */ jsx("tbody", {
26
- "data-slot": "table-body",
27
- className: cn("[&_tr:last-child]:border-0", className),
28
- ...props
29
- });
30
- }
31
- function TableFooter({ className, ...props }) {
32
- return /* @__PURE__ */ jsx("tfoot", {
33
- "data-slot": "table-footer",
34
- className: cn("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0", className),
35
- ...props
36
- });
37
- }
38
- function TableRow({ className, ...props }) {
39
- return /* @__PURE__ */ jsx("tr", {
40
- "data-slot": "table-row",
41
- className: cn("border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted", className),
42
- ...props
43
- });
44
- }
45
- function TableHead({ className, ...props }) {
46
- return /* @__PURE__ */ jsx("th", {
47
- "data-slot": "table-head",
48
- className: cn("h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0", className),
49
- ...props
50
- });
51
- }
52
- function TableCell({ className, ...props }) {
53
- return /* @__PURE__ */ jsx("td", {
54
- "data-slot": "table-cell",
55
- className: cn("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0", className),
56
- ...props
57
- });
58
- }
59
- export { Table, TableBody, TableCell, TableFooter, TableHead, TableHeader, TableRow };