@deftui/react 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,5 +1,6 @@
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
+ import { Spinner } from "./vendor/shadcn/spinner.mjs";
3
4
  import { Button } from "./vendor/shadcn/button.mjs";
4
5
  import { Input } from "./vendor/shadcn/input.mjs";
5
6
  import { Textarea } from "./vendor/shadcn/textarea.mjs";
@@ -15,7 +16,6 @@ import { DatePicker, DateRangePicker, TimePicker } from "./widgets/datetime-pick
15
16
  import { Form } from "./vendor/coss/form.mjs";
16
17
  import { Badge } from "./vendor/shadcn/badge.mjs";
17
18
  import { Switch } from "./vendor/shadcn/switch.mjs";
18
- import { Spinner } from "./vendor/shadcn/spinner.mjs";
19
19
  import { ScrollArea } from "./vendor/coss/scroll-area.mjs";
20
20
  import { AlertDialog, Card, Combobox, Dialog, Drawer, Dropdown, Empty, Field, InputGroup, Kbd, Popover, Progress, Radio, Select, Table, Tabs, Tooltip } from "./widgets/index.mjs";
21
21
  import { cn } from "cn";
@@ -1,7 +1,7 @@
1
1
  import { VariantProps } from "class-variance-authority";
2
2
  import { useRender } from "@base-ui/react/use-render";
3
3
  declare const badgeVariants: (props?: ({
4
- variant?: "default" | "destructive" | "ghost" | "link" | "outline" | "secondary" | null | undefined;
4
+ variant?: "default" | "destructive" | "ghost" | "info" | "link" | "outline" | "secondary" | "success" | "warning" | null | undefined;
5
5
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
6
  declare function Badge({ className, variant, render, ...props }: useRender.ComponentProps<"span"> & VariantProps<typeof badgeVariants>): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
7
7
  export { Badge, badgeVariants };
@@ -8,6 +8,9 @@ const badgeVariants = cva("group/badge inline-flex h-5 w-fit shrink-0 items-cent
8
8
  default: "bg-primary text-primary-foreground [a]:hover:bg-primary/80",
9
9
  secondary: "bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",
10
10
  destructive: "bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",
11
+ info: "bg-info/10 text-info focus-visible:ring-info/20 dark:bg-info/20 dark:focus-visible:ring-info/40 [a]:hover:bg-info/20",
12
+ success: "bg-success/10 text-success focus-visible:ring-success/20 dark:bg-success/20 dark:focus-visible:ring-success/40 [a]:hover:bg-success/20",
13
+ warning: "bg-warning/10 text-warning focus-visible:ring-warning/20 dark:bg-warning/20 dark:focus-visible:ring-warning/40 [a]:hover:bg-warning/20",
11
14
  outline: "border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",
12
15
  ghost: "hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",
13
16
  link: "text-primary underline-offset-4 hover:underline"
@@ -1,8 +1,8 @@
1
1
  import { cn } from "cn";
2
2
  import { mergeProps } from "@base-ui/react/merge-props";
3
3
  import "react";
4
- import { jsx, jsxs } from "react/jsx-runtime";
5
4
  import { ChevronRightIcon, MoreHorizontalIcon } from "lucide-react";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
6
  import { useRender } from "@base-ui/react/use-render";
7
7
  // src/vendor/shadcn/breadcrumb.tsx
8
8
  function Breadcrumb({ className, ...props }) {
@@ -3,6 +3,9 @@ import { Button } from "@base-ui/react/button";
3
3
  declare const buttonVariants: (props?: ({
4
4
  variant?: "default" | "destructive" | "ghost" | "link" | "outline" | "secondary" | null | undefined;
5
5
  size?: "default" | "icon" | "icon-lg" | "icon-sm" | "icon-xs" | "lg" | "sm" | "xs" | null | undefined;
6
+ pill?: boolean | null | undefined;
6
7
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
- declare function Button$1({ className, variant, size, ...props }: Button.Props & VariantProps<typeof buttonVariants>): import("react").JSX.Element;
8
+ declare function Button$1({ className, variant, size, pill, isPending, disabled, children, ...props }: Button.Props & VariantProps<typeof buttonVariants> & {
9
+ isPending?: boolean;
10
+ }): import("react").JSX.Element;
8
11
  export { Button$1 as Button, buttonVariants };
@@ -1,7 +1,8 @@
1
+ import { Spinner } from "./spinner.mjs";
1
2
  import { cn } from "cn";
2
3
  import { cva } from "class-variance-authority";
3
4
  import { Button } from "@base-ui/react/button";
4
- import { jsx } from "react/jsx-runtime";
5
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
5
6
  // src/vendor/shadcn/button.tsx
6
7
  const buttonVariants = cva("group/button inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
7
8
  variants: {
@@ -22,22 +23,33 @@ const buttonVariants = cva("group/button inline-flex shrink-0 items-center justi
22
23
  "icon-xs": "size-6 rounded-[min(var(--radius-md),8px)] in-data-[slot=button-group]:rounded-md [&_svg:not([class*='size-'])]:size-3",
23
24
  "icon-sm": "size-8 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-md",
24
25
  "icon-lg": "size-10"
25
- }
26
+ },
27
+ pill: { true: "rounded-full" }
26
28
  },
27
29
  defaultVariants: {
28
30
  variant: "default",
29
31
  size: "default"
30
32
  }
31
33
  });
32
- function Button$1({ className, variant = "default", size = "default", ...props }) {
34
+ function Button$1({ className, variant = "default", size = "default", pill = false, isPending = false, disabled, children, ...props }) {
33
35
  return /* @__PURE__ */ jsx(Button, {
34
36
  "data-slot": "button",
35
37
  className: cn(buttonVariants({
36
38
  variant,
37
39
  size,
40
+ pill,
38
41
  className
39
- })),
40
- ...props
42
+ }), isPending && "relative"),
43
+ ...props,
44
+ disabled: disabled || isPending,
45
+ "aria-busy": isPending || props["aria-busy"],
46
+ children: isPending ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
47
+ className: "inline-flex items-center justify-center opacity-0 [gap:inherit]",
48
+ children
49
+ }), /* @__PURE__ */ jsx(Spinner, {
50
+ "aria-hidden": "true",
51
+ className: "absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2"
52
+ })] }) : children
41
53
  });
42
54
  }
43
55
  export { Button$1 as Button, buttonVariants };
@@ -2,8 +2,8 @@
2
2
  import { Button, buttonVariants } from "./button.mjs";
3
3
  import { cn } from "cn";
4
4
  import * as React$1 from "react";
5
- import { jsx } from "react/jsx-runtime";
6
5
  import { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon } from "lucide-react";
6
+ import { jsx } from "react/jsx-runtime";
7
7
  import { DayPicker, getDefaultClassNames } from "@daypicker/react";
8
8
  // src/vendor/shadcn/calendar.tsx
9
9
  function Calendar({ className, classNames, showOutsideDays = true, captionLayout = "label", buttonVariant = "ghost", locale, formatters, components, ...props }) {
@@ -2,8 +2,8 @@
2
2
  import { Button } from "./button.mjs";
3
3
  import { cn } from "cn";
4
4
  import * as React$1 from "react";
5
- import { jsx, jsxs } from "react/jsx-runtime";
6
5
  import { ChevronLeftIcon, ChevronRightIcon } from "lucide-react";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
7
  import useEmblaCarousel from "embla-carousel-react";
8
8
  // src/vendor/shadcn/carousel.tsx
9
9
  const CarouselContext = React$1.createContext(null);
@@ -3,9 +3,9 @@ import { Button } from "./button.mjs";
3
3
  import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput } from "./input-group.mjs";
4
4
  import { cn } from "cn";
5
5
  import "react";
6
+ import { CheckIcon, ChevronDownIcon, XIcon } from "lucide-react";
6
7
  import { jsx, jsxs } from "react/jsx-runtime";
7
8
  import { Combobox as ComboboxPrimitive } from "@base-ui/react";
8
- import { CheckIcon, ChevronDownIcon, XIcon } from "lucide-react";
9
9
  // src/vendor/shadcn/combobox.tsx
10
10
  const Combobox = ComboboxPrimitive.Root;
11
11
  function ComboboxValue({ ...props }) {
@@ -2,8 +2,8 @@
2
2
  import { Button } from "./button.mjs";
3
3
  import { cn } from "cn";
4
4
  import "react";
5
- import { jsx, jsxs } from "react/jsx-runtime";
6
5
  import { XIcon } from "lucide-react";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
7
  import { Dialog as DialogPrimitive } from "@base-ui/react/dialog";
8
8
  // src/vendor/shadcn/dialog.tsx
9
9
  function Dialog$1({ ...props }) {
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import { cn } from "cn";
3
3
  import "react";
4
- import { jsx, jsxs } from "react/jsx-runtime";
5
4
  import { CheckIcon, ChevronRightIcon } from "lucide-react";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
6
  import { Menu } from "@base-ui/react/menu";
7
7
  // src/vendor/shadcn/dropdown-menu.tsx
8
8
  function DropdownMenu({ ...props }) {
@@ -1,8 +1,8 @@
1
1
  import { Button } from "./button.mjs";
2
2
  import { cn } from "cn";
3
3
  import "react";
4
- import { jsx, jsxs } from "react/jsx-runtime";
5
4
  import { ChevronLeftIcon, ChevronRightIcon, MoreHorizontalIcon } from "lucide-react";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
6
  // src/vendor/shadcn/pagination.tsx
7
7
  function Pagination({ className, ...props }) {
8
8
  return /* @__PURE__ */ jsx("nav", {
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import { cn } from "cn";
3
3
  import "react";
4
- import { jsx, jsxs } from "react/jsx-runtime";
5
4
  import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
6
  import { Select } from "@base-ui/react/select";
7
7
  // src/vendor/shadcn/select.tsx
8
8
  const Select$1 = Select.Root;
@@ -2,8 +2,8 @@
2
2
  import { Button } from "./button.mjs";
3
3
  import { cn } from "cn";
4
4
  import "react";
5
- import { jsx, jsxs } from "react/jsx-runtime";
6
5
  import { XIcon } from "lucide-react";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
7
  import { Dialog } from "@base-ui/react/dialog";
8
8
  // src/vendor/shadcn/sheet.tsx
9
9
  function Sheet({ ...props }) {
@@ -10,8 +10,8 @@ import { cn } from "cn";
10
10
  import { cva } from "class-variance-authority";
11
11
  import { mergeProps } from "@base-ui/react/merge-props";
12
12
  import * as React$1 from "react";
13
- import { jsx, jsxs } from "react/jsx-runtime";
14
13
  import { PanelLeftIcon } from "lucide-react";
14
+ import { jsx, jsxs } from "react/jsx-runtime";
15
15
  import { useRender } from "@base-ui/react/use-render";
16
16
  // src/vendor/shadcn/sidebar.tsx
17
17
  const SIDEBAR_COOKIE_NAME = "sidebar_state";
@@ -1,6 +1,6 @@
1
1
  import { cn } from "cn";
2
- import { jsx } from "react/jsx-runtime";
3
2
  import { Loader2Icon } from "lucide-react";
3
+ import { jsx } from "react/jsx-runtime";
4
4
  // src/vendor/shadcn/spinner.tsx
5
5
  function Spinner({ className, ...props }) {
6
6
  return /* @__PURE__ */ jsx(Loader2Icon, {
@@ -2,8 +2,8 @@
2
2
  import { Button } from "./button.mjs";
3
3
  import { cn } from "cn";
4
4
  import "react";
5
- import { jsx, jsxs } from "react/jsx-runtime";
6
5
  import { CircleCheckIcon, InfoIcon, Loader2Icon, OctagonXIcon, TriangleAlertIcon, XIcon } from "lucide-react";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
7
  import { Toast } from "@base-ui/react/toast";
8
8
  // src/vendor/shadcn/toast.tsx
9
9
  const toast = Toast.createToastManager();
@@ -4,8 +4,8 @@ import { Popover, PopoverContent, PopoverTrigger } from "../vendor/shadcn/popove
4
4
  import { Calendar } from "../vendor/shadcn/calendar.mjs";
5
5
  import { cn } from "cn";
6
6
  import { useState } from "react";
7
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
8
7
  import { CalendarIcon } from "lucide-react";
8
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
9
9
  import { format } from "date-fns";
10
10
  // src/widgets/datetime-picker.tsx
11
11
  function TimePicker({ className, step = "1", ...props }) {
@@ -1,3 +1,4 @@
1
+ import { Spinner } from "../vendor/shadcn/spinner.mjs";
1
2
  import { Button } from "../vendor/shadcn/button.mjs";
2
3
  import { AlertDialog as AlertDialog$1, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogPrimitive, AlertDialogTitle, AlertDialogTrigger } from "../vendor/shadcn/alert-dialog.mjs";
3
4
  import { Card as Card$1, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "../vendor/shadcn/card.mjs";
@@ -31,7 +32,6 @@ import { DatePicker, DateRangePicker, TimePicker } from "./datetime-picker.mjs";
31
32
  import { Form } from "../vendor/coss/form.mjs";
32
33
  import { Badge } from "../vendor/shadcn/badge.mjs";
33
34
  import { Switch } from "../vendor/shadcn/switch.mjs";
34
- import { Spinner } from "../vendor/shadcn/spinner.mjs";
35
35
  import { ScrollArea } from "../vendor/coss/scroll-area.mjs";
36
36
  // src/widgets/index.ts
37
37
  const Kbd = Object.assign(Kbd$1, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deftui/react",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/KiriRainCat/deftui.git",