@allbluecn/ui 0.3.13 → 0.4.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.
Files changed (146) hide show
  1. package/dist/ai-command-button.d.ts +10 -0
  2. package/dist/ai-command-button.js +12 -0
  3. package/dist/ai-stream-text.d.ts +9 -0
  4. package/dist/ai-stream-text.js +12 -0
  5. package/dist/alert-dialog.d.ts +20 -0
  6. package/dist/alert-dialog.js +101 -0
  7. package/dist/animated-theme-toggler.d.ts +11 -0
  8. package/dist/animated-theme-toggler.js +169 -0
  9. package/dist/auth-client.d.ts +27 -0
  10. package/dist/auth-client.js +86 -0
  11. package/dist/auth-layout.d.ts +14 -0
  12. package/dist/auth-layout.js +43 -0
  13. package/dist/avatar.d.ts +13 -0
  14. package/dist/avatar.js +51 -0
  15. package/dist/badge.d.ts +11 -0
  16. package/dist/badge.js +28 -0
  17. package/dist/button.d.ts +12 -0
  18. package/dist/button.js +48 -0
  19. package/dist/card.d.ts +13 -0
  20. package/dist/card.js +56 -0
  21. package/dist/checkbox.d.ts +6 -0
  22. package/dist/checkbox.js +22 -0
  23. package/dist/context-menu.d.ts +33 -0
  24. package/dist/context-menu.js +125 -0
  25. package/dist/dialog.d.ts +19 -0
  26. package/dist/dialog.js +95 -0
  27. package/dist/dropdown-menu.d.ts +31 -0
  28. package/dist/dropdown-menu.js +128 -0
  29. package/dist/empty.d.ts +13 -0
  30. package/dist/empty.js +59 -0
  31. package/dist/grid-pattern.d.ts +14 -0
  32. package/dist/grid-pattern.js +47 -0
  33. package/dist/icon-packs/index.d.ts +2 -0
  34. package/dist/icon-packs/index.js +4 -0
  35. package/dist/icon-packs/knowledge.d.ts +2 -0
  36. package/dist/icon-packs/knowledge.js +70 -0
  37. package/dist/icon-packs/prd.d.ts +2 -0
  38. package/dist/icon-packs/prd.js +86 -0
  39. package/dist/icon-packs/project.d.ts +2 -0
  40. package/dist/icon-packs/project.js +74 -0
  41. package/dist/icon-picker.d.ts +11 -0
  42. package/dist/icon-picker.js +39 -0
  43. package/dist/index-CQsbeClc.d.ts +17 -0
  44. package/dist/index.d.ts +7 -0
  45. package/dist/index.js +7 -0
  46. package/dist/input.d.ts +5 -0
  47. package/dist/input.js +14 -0
  48. package/dist/item.d.ts +25 -0
  49. package/dist/item.js +118 -0
  50. package/dist/kbd.d.ts +4 -0
  51. package/dist/kbd.js +12 -0
  52. package/dist/label.d.ts +6 -0
  53. package/dist/label.js +14 -0
  54. package/dist/layout-panel-top.d.ts +12 -0
  55. package/dist/layout-panel-top.js +127 -0
  56. package/dist/name-confirm-dialog.d.ts +15 -0
  57. package/dist/name-confirm-dialog.js +105 -0
  58. package/dist/nav-float-button.d.ts +12 -0
  59. package/dist/nav-float-button.js +249 -0
  60. package/dist/notion-avatar.d.ts +13 -0
  61. package/dist/notion-avatar.js +83 -0
  62. package/dist/placeholder-page.d.ts +10 -0
  63. package/dist/placeholder-page.js +28 -0
  64. package/dist/popover.d.ts +12 -0
  65. package/dist/popover.js +56 -0
  66. package/dist/reference-inline.d.ts +10 -0
  67. package/dist/reference-inline.js +35 -0
  68. package/dist/reference-search.d.ts +12 -0
  69. package/dist/reference-search.js +26 -0
  70. package/dist/resizable.d.ts +9 -0
  71. package/dist/resizable.js +28 -0
  72. package/dist/select.d.ts +17 -0
  73. package/dist/select.js +99 -0
  74. package/dist/separator.d.ts +6 -0
  75. package/dist/separator.js +17 -0
  76. package/dist/sheet.d.ts +16 -0
  77. package/dist/sheet.js +90 -0
  78. package/dist/sidebar.d.ts +71 -0
  79. package/dist/sidebar.js +369 -0
  80. package/dist/skeleton.d.ts +4 -0
  81. package/dist/skeleton.js +12 -0
  82. package/dist/sonner.d.ts +5 -0
  83. package/dist/sonner.js +19 -0
  84. package/dist/switch.d.ts +8 -0
  85. package/dist/switch.js +19 -0
  86. package/dist/textarea.d.ts +5 -0
  87. package/dist/textarea.js +13 -0
  88. package/dist/timezone-provider.d.ts +18 -0
  89. package/dist/timezone-provider.js +29 -0
  90. package/dist/tooltip.d.ts +9 -0
  91. package/dist/tooltip.js +35 -0
  92. package/dist/use-mobile.d.ts +4 -0
  93. package/dist/use-mobile.js +18 -0
  94. package/dist/user-avatar.d.ts +14 -0
  95. package/dist/user-avatar.js +34 -0
  96. package/dist/utils.d.ts +5 -0
  97. package/dist/utils.js +8 -0
  98. package/package.json +178 -49
  99. package/src/ai-command-button.tsx +0 -36
  100. package/src/ai-stream-text.tsx +0 -37
  101. package/src/alert-dialog.tsx +0 -216
  102. package/src/animated-theme-toggler.tsx +0 -272
  103. package/src/auth-client.ts +0 -108
  104. package/src/auth-layout.tsx +0 -66
  105. package/src/avatar.tsx +0 -129
  106. package/src/badge.tsx +0 -66
  107. package/src/button.tsx +0 -84
  108. package/src/card.tsx +0 -120
  109. package/src/checkbox.tsx +0 -50
  110. package/src/context-menu.tsx +0 -280
  111. package/src/dialog.tsx +0 -183
  112. package/src/dropdown-menu.tsx +0 -286
  113. package/src/empty.tsx +0 -121
  114. package/src/grid-pattern.tsx +0 -87
  115. package/src/icon-packs/index.ts +0 -27
  116. package/src/icon-packs/knowledge.ts +0 -55
  117. package/src/icon-packs/prd.ts +0 -63
  118. package/src/icon-packs/project.ts +0 -59
  119. package/src/icon-picker.tsx +0 -68
  120. package/src/index.ts +0 -23
  121. package/src/input.tsx +0 -36
  122. package/src/item.tsx +0 -213
  123. package/src/kbd.tsx +0 -33
  124. package/src/label.tsx +0 -39
  125. package/src/layout-panel-top.tsx +0 -160
  126. package/src/name-confirm-dialog.tsx +0 -153
  127. package/src/nav-float-button.tsx +0 -301
  128. package/src/notion-avatar.tsx +0 -126
  129. package/src/placeholder-page.tsx +0 -42
  130. package/src/popover.tsx +0 -106
  131. package/src/reference-inline.tsx +0 -53
  132. package/src/reference-search.tsx +0 -52
  133. package/src/resizable.tsx +0 -67
  134. package/src/select.tsx +0 -207
  135. package/src/separator.tsx +0 -45
  136. package/src/sheet.tsx +0 -164
  137. package/src/sidebar.tsx +0 -708
  138. package/src/skeleton.tsx +0 -30
  139. package/src/sonner.tsx +0 -37
  140. package/src/switch.tsx +0 -48
  141. package/src/textarea.tsx +0 -35
  142. package/src/timezone-provider.tsx +0 -55
  143. package/src/tooltip.tsx +0 -72
  144. package/src/use-mobile.ts +0 -36
  145. package/src/user-avatar.tsx +0 -79
  146. package/src/utils.ts +0 -6
@@ -0,0 +1,56 @@
1
+ "use client";
2
+ import { cn } from "./utils.js";
3
+ import { jsx } from "react/jsx-runtime";
4
+ import "react";
5
+ import { Popover as Popover$1 } from "radix-ui";
6
+ //#region src/popover.tsx
7
+ function Popover({ ...props }) {
8
+ return /* @__PURE__ */ jsx(Popover$1.Root, {
9
+ "data-slot": "popover",
10
+ ...props
11
+ });
12
+ }
13
+ function PopoverTrigger({ ...props }) {
14
+ return /* @__PURE__ */ jsx(Popover$1.Trigger, {
15
+ "data-slot": "popover-trigger",
16
+ ...props
17
+ });
18
+ }
19
+ function PopoverContent({ className, align = "center", sideOffset = 4, ...props }) {
20
+ return /* @__PURE__ */ jsx(Popover$1.Portal, { children: /* @__PURE__ */ jsx(Popover$1.Content, {
21
+ "data-slot": "popover-content",
22
+ align,
23
+ sideOffset,
24
+ className: cn("z-50 flex w-72 origin-(--radix-popover-content-transform-origin) flex-col gap-2.5 rounded-lg dark:border dark:border-primary/15 bg-popover p-2.5 text-sm text-popover-foreground shadow-md outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className),
25
+ ...props
26
+ }) });
27
+ }
28
+ function PopoverAnchor({ ...props }) {
29
+ return /* @__PURE__ */ jsx(Popover$1.Anchor, {
30
+ "data-slot": "popover-anchor",
31
+ ...props
32
+ });
33
+ }
34
+ function PopoverHeader({ className, ...props }) {
35
+ return /* @__PURE__ */ jsx("div", {
36
+ "data-slot": "popover-header",
37
+ className: cn("flex flex-col gap-0.5 text-sm", className),
38
+ ...props
39
+ });
40
+ }
41
+ function PopoverTitle({ className, ...props }) {
42
+ return /* @__PURE__ */ jsx("div", {
43
+ "data-slot": "popover-title",
44
+ className: cn("font-medium", className),
45
+ ...props
46
+ });
47
+ }
48
+ function PopoverDescription({ className, ...props }) {
49
+ return /* @__PURE__ */ jsx("p", {
50
+ "data-slot": "popover-description",
51
+ className: cn("text-muted-foreground", className),
52
+ ...props
53
+ });
54
+ }
55
+ //#endregion
56
+ export { Popover, PopoverAnchor, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger };
@@ -0,0 +1,10 @@
1
+ import { EntityUpdateEvent, RefDisplay } from "@allbluecn/shared";
2
+ //#region src/reference-inline.d.ts
3
+ interface ReferenceInlineProps {
4
+ display: RefDisplay;
5
+ entityId?: string;
6
+ updateEvent?: EntityUpdateEvent | null;
7
+ }
8
+ declare function ReferenceInline({ display, entityId, updateEvent }: ReferenceInlineProps): import("react/jsx-runtime").JSX.Element;
9
+ //#endregion
10
+ export { ReferenceInline };
@@ -0,0 +1,35 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { useEffect, useState } from "react";
4
+ //#region src/reference-inline.tsx
5
+ function ReferenceInline({ display, entityId, updateEvent }) {
6
+ const [currentDisplay, setCurrentDisplay] = useState(display);
7
+ useEffect(() => {
8
+ if (updateEvent && entityId && updateEvent.id === entityId) setCurrentDisplay((prev) => ({
9
+ ...prev,
10
+ ...updateEvent.fields
11
+ }));
12
+ }, [updateEvent, entityId]);
13
+ useEffect(() => {
14
+ setCurrentDisplay(display);
15
+ }, [display]);
16
+ return /* @__PURE__ */ jsxs("span", {
17
+ className: "inline-flex items-center gap-1.5 px-1.5 py-0.5 rounded bg-muted text-sm",
18
+ children: [
19
+ /* @__PURE__ */ jsx("span", {
20
+ className: "font-medium",
21
+ children: currentDisplay.title
22
+ }),
23
+ currentDisplay.status && /* @__PURE__ */ jsx("span", {
24
+ className: "text-xs text-muted-foreground",
25
+ children: currentDisplay.status
26
+ }),
27
+ currentDisplay.priority && /* @__PURE__ */ jsx("span", {
28
+ className: "text-xs text-muted-foreground",
29
+ children: currentDisplay.priority
30
+ })
31
+ ]
32
+ });
33
+ }
34
+ //#endregion
35
+ export { ReferenceInline };
@@ -0,0 +1,12 @@
1
+ import { SearchResult } from "@allbluecn/shared";
2
+ //#region src/reference-search.d.ts
3
+ interface Props {
4
+ open: boolean;
5
+ query: string;
6
+ results: SearchResult[];
7
+ onSelect: (result: SearchResult) => void;
8
+ onClose: () => void;
9
+ }
10
+ declare function ReferenceSearch({ open, query, results, onSelect, onClose }: Props): import("react/jsx-runtime").JSX.Element | null;
11
+ //#endregion
12
+ export { ReferenceSearch };
@@ -0,0 +1,26 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ //#region src/reference-search.tsx
3
+ function ReferenceSearch({ open, query, results, onSelect, onClose }) {
4
+ if (!open) return null;
5
+ return /* @__PURE__ */ jsxs("div", {
6
+ className: "absolute z-50 w-80 rounded-md border bg-popover shadow-md",
7
+ children: [/* @__PURE__ */ jsx("div", {
8
+ className: "p-2 border-b",
9
+ children: /* @__PURE__ */ jsx("input", {
10
+ className: "w-full bg-transparent text-sm outline-none",
11
+ placeholder: "搜索需求、Bug、原型...",
12
+ defaultValue: query,
13
+ autoFocus: true
14
+ })
15
+ }), results.map((r) => /* @__PURE__ */ jsxs("button", {
16
+ className: "w-full px-3 py-2 text-left text-sm hover:bg-accent",
17
+ onClick: () => onSelect(r),
18
+ children: [/* @__PURE__ */ jsxs("span", {
19
+ className: "text-xs text-muted-foreground",
20
+ children: [r.module, "/"]
21
+ }), r.title]
22
+ }, r.id))]
23
+ });
24
+ }
25
+ //#endregion
26
+ export { ReferenceSearch };
@@ -0,0 +1,9 @@
1
+ import * as ResizablePrimitive from "react-resizable-panels";
2
+ //#region src/resizable.d.ts
3
+ declare function ResizablePanelGroup({ className, ...props }: ResizablePrimitive.GroupProps): import("react/jsx-runtime").JSX.Element;
4
+ declare function ResizablePanel({ ...props }: ResizablePrimitive.PanelProps): import("react/jsx-runtime").JSX.Element;
5
+ declare function ResizableHandle({ withHandle, className, ...props }: ResizablePrimitive.SeparatorProps & {
6
+ withHandle?: boolean;
7
+ }): import("react/jsx-runtime").JSX.Element;
8
+ //#endregion
9
+ export { ResizableHandle, ResizablePanel, ResizablePanelGroup };
@@ -0,0 +1,28 @@
1
+ "use client";
2
+ import { cn } from "./utils.js";
3
+ import { jsx } from "react/jsx-runtime";
4
+ import * as ResizablePrimitive from "react-resizable-panels";
5
+ //#region src/resizable.tsx
6
+ function ResizablePanelGroup({ className, ...props }) {
7
+ return /* @__PURE__ */ jsx(ResizablePrimitive.Group, {
8
+ "data-slot": "resizable-panel-group",
9
+ className: cn("flex h-full w-full aria-[orientation=vertical]:flex-col", className),
10
+ ...props
11
+ });
12
+ }
13
+ function ResizablePanel({ ...props }) {
14
+ return /* @__PURE__ */ jsx(ResizablePrimitive.Panel, {
15
+ "data-slot": "resizable-panel",
16
+ ...props
17
+ });
18
+ }
19
+ function ResizableHandle({ withHandle, className, ...props }) {
20
+ return /* @__PURE__ */ jsx(ResizablePrimitive.Separator, {
21
+ "data-slot": "resizable-handle",
22
+ className: cn("relative flex w-px items-center justify-center bg-border ring-offset-background after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-ring focus-visible:outline-hidden aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:left-0 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:translate-x-0 aria-[orientation=horizontal]:after:-translate-y-1/2 [&[aria-orientation=horizontal]>div]:rotate-90", className),
23
+ ...props,
24
+ children: withHandle && /* @__PURE__ */ jsx("div", { className: "z-10 flex h-6 w-1 shrink-0 rounded-full bg-muted-foreground/25" })
25
+ });
26
+ }
27
+ //#endregion
28
+ export { ResizableHandle, ResizablePanel, ResizablePanelGroup };
@@ -0,0 +1,17 @@
1
+ import * as React$1 from "react";
2
+ import { Select as Select$1 } from "radix-ui";
3
+ //#region src/select.d.ts
4
+ declare function Select({ ...props }: React$1.ComponentProps<typeof Select$1.Root>): import("react/jsx-runtime").JSX.Element;
5
+ declare function SelectGroup({ className, ...props }: React$1.ComponentProps<typeof Select$1.Group>): import("react/jsx-runtime").JSX.Element;
6
+ declare function SelectValue({ ...props }: React$1.ComponentProps<typeof Select$1.Value>): import("react/jsx-runtime").JSX.Element;
7
+ declare function SelectTrigger({ className, size, children, ...props }: React$1.ComponentProps<typeof Select$1.Trigger> & {
8
+ size?: "sm" | "default";
9
+ }): import("react/jsx-runtime").JSX.Element;
10
+ declare function SelectContent({ className, children, position, align, ...props }: React$1.ComponentProps<typeof Select$1.Content>): import("react/jsx-runtime").JSX.Element;
11
+ declare function SelectLabel({ className, ...props }: React$1.ComponentProps<typeof Select$1.Label>): import("react/jsx-runtime").JSX.Element;
12
+ declare function SelectItem({ className, children, ...props }: React$1.ComponentProps<typeof Select$1.Item>): import("react/jsx-runtime").JSX.Element;
13
+ declare function SelectSeparator({ className, ...props }: React$1.ComponentProps<typeof Select$1.Separator>): import("react/jsx-runtime").JSX.Element;
14
+ declare function SelectScrollUpButton({ className, ...props }: React$1.ComponentProps<typeof Select$1.ScrollUpButton>): import("react/jsx-runtime").JSX.Element;
15
+ declare function SelectScrollDownButton({ className, ...props }: React$1.ComponentProps<typeof Select$1.ScrollDownButton>): import("react/jsx-runtime").JSX.Element;
16
+ //#endregion
17
+ export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue };
package/dist/select.js ADDED
@@ -0,0 +1,99 @@
1
+ import { cn } from "./utils.js";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import "react";
4
+ import { Select as Select$1 } from "radix-ui";
5
+ import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react";
6
+ //#region src/select.tsx
7
+ function Select({ ...props }) {
8
+ return /* @__PURE__ */ jsx(Select$1.Root, {
9
+ "data-slot": "select",
10
+ ...props
11
+ });
12
+ }
13
+ function SelectGroup({ className, ...props }) {
14
+ return /* @__PURE__ */ jsx(Select$1.Group, {
15
+ "data-slot": "select-group",
16
+ className: cn("scroll-my-1 p-1", className),
17
+ ...props
18
+ });
19
+ }
20
+ function SelectValue({ ...props }) {
21
+ return /* @__PURE__ */ jsx(Select$1.Value, {
22
+ "data-slot": "select-value",
23
+ ...props
24
+ });
25
+ }
26
+ function SelectTrigger({ className, size = "default", children, ...props }) {
27
+ return /* @__PURE__ */ jsxs(Select$1.Trigger, {
28
+ "data-slot": "select-trigger",
29
+ "data-size": size,
30
+ className: cn("flex w-fit items-center justify-between gap-1.5 rounded-lg border border-input bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 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", className),
31
+ ...props,
32
+ children: [children, /* @__PURE__ */ jsx(Select$1.Icon, {
33
+ asChild: true,
34
+ children: /* @__PURE__ */ jsx(ChevronDownIcon, { className: "pointer-events-none size-4 text-muted-foreground" })
35
+ })]
36
+ });
37
+ }
38
+ function SelectContent({ className, children, position = "item-aligned", align = "center", ...props }) {
39
+ return /* @__PURE__ */ jsx(Select$1.Portal, { children: /* @__PURE__ */ jsxs(Select$1.Content, {
40
+ "data-slot": "select-content",
41
+ "data-align-trigger": position === "item-aligned",
42
+ className: cn("relative z-50 max-h-(--radix-select-content-available-height) min-w-36 origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1", className),
43
+ position,
44
+ align,
45
+ ...props,
46
+ children: [
47
+ /* @__PURE__ */ jsx(SelectScrollUpButton, {}),
48
+ /* @__PURE__ */ jsx(Select$1.Viewport, {
49
+ "data-position": position,
50
+ className: cn("data-[position=popper]:h-(--radix-select-trigger-height) data-[position=popper]:w-full data-[position=popper]:min-w-(--radix-select-trigger-width)", position === "popper" && ""),
51
+ children
52
+ }),
53
+ /* @__PURE__ */ jsx(SelectScrollDownButton, {})
54
+ ]
55
+ }) });
56
+ }
57
+ function SelectLabel({ className, ...props }) {
58
+ return /* @__PURE__ */ jsx(Select$1.Label, {
59
+ "data-slot": "select-label",
60
+ className: cn("px-1.5 py-1 text-xs text-muted-foreground", className),
61
+ ...props
62
+ });
63
+ }
64
+ function SelectItem({ className, children, ...props }) {
65
+ return /* @__PURE__ */ jsxs(Select$1.Item, {
66
+ "data-slot": "select-item",
67
+ className: cn("relative flex w-full cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:*:[svg]:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2", className),
68
+ ...props,
69
+ children: [/* @__PURE__ */ jsx("span", {
70
+ className: "pointer-events-none absolute right-2 flex size-4 items-center justify-center",
71
+ children: /* @__PURE__ */ jsx(Select$1.ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, { className: "pointer-events-none" }) })
72
+ }), /* @__PURE__ */ jsx(Select$1.ItemText, { children })]
73
+ });
74
+ }
75
+ function SelectSeparator({ className, ...props }) {
76
+ return /* @__PURE__ */ jsx(Select$1.Separator, {
77
+ "data-slot": "select-separator",
78
+ className: cn("pointer-events-none -mx-1 my-1 h-px bg-border", className),
79
+ ...props
80
+ });
81
+ }
82
+ function SelectScrollUpButton({ className, ...props }) {
83
+ return /* @__PURE__ */ jsx(Select$1.ScrollUpButton, {
84
+ "data-slot": "select-scroll-up-button",
85
+ className: cn("z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4", className),
86
+ ...props,
87
+ children: /* @__PURE__ */ jsx(ChevronUpIcon, {})
88
+ });
89
+ }
90
+ function SelectScrollDownButton({ className, ...props }) {
91
+ return /* @__PURE__ */ jsx(Select$1.ScrollDownButton, {
92
+ "data-slot": "select-scroll-down-button",
93
+ className: cn("z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4", className),
94
+ ...props,
95
+ children: /* @__PURE__ */ jsx(ChevronDownIcon, {})
96
+ });
97
+ }
98
+ //#endregion
99
+ export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue };
@@ -0,0 +1,6 @@
1
+ import * as React$1 from "react";
2
+ import { Separator as Separator$1 } from "radix-ui";
3
+ //#region src/separator.d.ts
4
+ declare function Separator({ className, orientation, decorative, ...props }: React$1.ComponentProps<typeof Separator$1.Root>): import("react/jsx-runtime").JSX.Element;
5
+ //#endregion
6
+ export { Separator };
@@ -0,0 +1,17 @@
1
+ "use client";
2
+ import { cn } from "./utils.js";
3
+ import { jsx } from "react/jsx-runtime";
4
+ import "react";
5
+ import { Separator as Separator$1 } from "radix-ui";
6
+ //#region src/separator.tsx
7
+ function Separator({ className, orientation = "horizontal", decorative = true, ...props }) {
8
+ return /* @__PURE__ */ jsx(Separator$1.Root, {
9
+ "data-slot": "separator",
10
+ decorative,
11
+ orientation,
12
+ className: cn("shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch", className),
13
+ ...props
14
+ });
15
+ }
16
+ //#endregion
17
+ export { Separator };
@@ -0,0 +1,16 @@
1
+ import * as React$1 from "react";
2
+ import { Dialog } from "radix-ui";
3
+ //#region src/sheet.d.ts
4
+ declare function Sheet({ ...props }: React$1.ComponentProps<typeof Dialog.Root>): import("react/jsx-runtime").JSX.Element;
5
+ declare function SheetTrigger({ ...props }: React$1.ComponentProps<typeof Dialog.Trigger>): import("react/jsx-runtime").JSX.Element;
6
+ declare function SheetClose({ ...props }: React$1.ComponentProps<typeof Dialog.Close>): import("react/jsx-runtime").JSX.Element;
7
+ declare function SheetContent({ className, children, side, showCloseButton, ...props }: React$1.ComponentProps<typeof Dialog.Content> & {
8
+ side?: "top" | "right" | "bottom" | "left";
9
+ showCloseButton?: boolean;
10
+ }): import("react/jsx-runtime").JSX.Element;
11
+ declare function SheetHeader({ className, ...props }: React$1.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
12
+ declare function SheetFooter({ className, ...props }: React$1.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
13
+ declare function SheetTitle({ className, ...props }: React$1.ComponentProps<typeof Dialog.Title>): import("react/jsx-runtime").JSX.Element;
14
+ declare function SheetDescription({ className, ...props }: React$1.ComponentProps<typeof Dialog.Description>): import("react/jsx-runtime").JSX.Element;
15
+ //#endregion
16
+ export { Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger };
package/dist/sheet.js ADDED
@@ -0,0 +1,90 @@
1
+ "use client";
2
+ import { cn } from "./utils.js";
3
+ import { Button } from "./button.js";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ import "react";
6
+ import { Dialog } from "radix-ui";
7
+ import { XIcon } from "lucide-react";
8
+ //#region src/sheet.tsx
9
+ function Sheet({ ...props }) {
10
+ return /* @__PURE__ */ jsx(Dialog.Root, {
11
+ "data-slot": "sheet",
12
+ ...props
13
+ });
14
+ }
15
+ function SheetTrigger({ ...props }) {
16
+ return /* @__PURE__ */ jsx(Dialog.Trigger, {
17
+ "data-slot": "sheet-trigger",
18
+ ...props
19
+ });
20
+ }
21
+ function SheetClose({ ...props }) {
22
+ return /* @__PURE__ */ jsx(Dialog.Close, {
23
+ "data-slot": "sheet-close",
24
+ ...props
25
+ });
26
+ }
27
+ function SheetPortal({ ...props }) {
28
+ return /* @__PURE__ */ jsx(Dialog.Portal, {
29
+ "data-slot": "sheet-portal",
30
+ ...props
31
+ });
32
+ }
33
+ function SheetOverlay({ className, ...props }) {
34
+ return /* @__PURE__ */ jsx(Dialog.Overlay, {
35
+ "data-slot": "sheet-overlay",
36
+ className: cn("fixed inset-0 z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0", className),
37
+ ...props
38
+ });
39
+ }
40
+ function SheetContent({ className, children, side = "right", showCloseButton = true, ...props }) {
41
+ return /* @__PURE__ */ jsxs(SheetPortal, { children: [/* @__PURE__ */ jsx(SheetOverlay, {}), /* @__PURE__ */ jsxs(Dialog.Content, {
42
+ "data-slot": "sheet-content",
43
+ "data-side": side,
44
+ className: cn("fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-[side=bottom]:data-open:slide-in-from-bottom-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=top]:data-open:slide-in-from-top-10 data-closed:animate-out data-closed:fade-out-0 data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=right]:data-closed:slide-out-to-right-10 data-[side=top]:data-closed:slide-out-to-top-10", className),
45
+ ...props,
46
+ children: [children, showCloseButton && /* @__PURE__ */ jsx(Dialog.Close, {
47
+ "data-slot": "sheet-close",
48
+ asChild: true,
49
+ children: /* @__PURE__ */ jsxs(Button, {
50
+ variant: "ghost",
51
+ className: "absolute top-3 right-3",
52
+ size: "icon-sm",
53
+ children: [/* @__PURE__ */ jsx(XIcon, {}), /* @__PURE__ */ jsx("span", {
54
+ className: "sr-only",
55
+ children: "Close"
56
+ })]
57
+ })
58
+ })]
59
+ })] });
60
+ }
61
+ function SheetHeader({ className, ...props }) {
62
+ return /* @__PURE__ */ jsx("div", {
63
+ "data-slot": "sheet-header",
64
+ className: cn("flex flex-col gap-0.5 p-4", className),
65
+ ...props
66
+ });
67
+ }
68
+ function SheetFooter({ className, ...props }) {
69
+ return /* @__PURE__ */ jsx("div", {
70
+ "data-slot": "sheet-footer",
71
+ className: cn("mt-auto flex flex-col gap-2 p-4", className),
72
+ ...props
73
+ });
74
+ }
75
+ function SheetTitle({ className, ...props }) {
76
+ return /* @__PURE__ */ jsx(Dialog.Title, {
77
+ "data-slot": "sheet-title",
78
+ className: cn("text-base font-medium text-foreground", className),
79
+ ...props
80
+ });
81
+ }
82
+ function SheetDescription({ className, ...props }) {
83
+ return /* @__PURE__ */ jsx(Dialog.Description, {
84
+ "data-slot": "sheet-description",
85
+ className: cn("text-sm text-muted-foreground", className),
86
+ ...props
87
+ });
88
+ }
89
+ //#endregion
90
+ export { Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger };
@@ -0,0 +1,71 @@
1
+ import { Button } from "./button.js";
2
+ import { Input } from "./input.js";
3
+ import { Separator } from "./separator.js";
4
+ import { TooltipContent } from "./tooltip.js";
5
+ import * as React$1 from "react";
6
+ import { VariantProps } from "class-variance-authority";
7
+ //#region src/sidebar.d.ts
8
+ type SidebarContextProps = {
9
+ state: "expanded" | "collapsed";
10
+ open: boolean;
11
+ setOpen: (open: boolean) => void;
12
+ openMobile: boolean;
13
+ setOpenMobile: (open: boolean) => void;
14
+ isMobile: boolean;
15
+ toggleSidebar: () => void;
16
+ };
17
+ declare function useSidebar(): SidebarContextProps;
18
+ declare function SidebarProvider({ defaultOpen, open: openProp, onOpenChange: setOpenProp, className, style, children, ...props }: React$1.ComponentProps<"div"> & {
19
+ defaultOpen?: boolean;
20
+ open?: boolean;
21
+ onOpenChange?: (open: boolean) => void;
22
+ }): import("react/jsx-runtime").JSX.Element;
23
+ declare function Sidebar({ side, variant, collapsible, className, children, dir, ...props }: React$1.ComponentProps<"div"> & {
24
+ side?: "left" | "right";
25
+ variant?: "sidebar" | "floating" | "inset";
26
+ collapsible?: "offcanvas" | "icon" | "none";
27
+ }): import("react/jsx-runtime").JSX.Element;
28
+ declare function SidebarTrigger({ className, onClick, ...props }: React$1.ComponentProps<typeof Button>): import("react/jsx-runtime").JSX.Element;
29
+ declare function SidebarRail({ className, ...props }: React$1.ComponentProps<"button">): import("react/jsx-runtime").JSX.Element;
30
+ declare function SidebarInset({ className, ...props }: React$1.ComponentProps<"main">): import("react/jsx-runtime").JSX.Element;
31
+ declare function SidebarInput({ className, ...props }: React$1.ComponentProps<typeof Input>): import("react/jsx-runtime").JSX.Element;
32
+ declare function SidebarHeader({ className, ...props }: React$1.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
33
+ declare function SidebarFooter({ className, ...props }: React$1.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
34
+ declare function SidebarSeparator({ className, ...props }: React$1.ComponentProps<typeof Separator>): import("react/jsx-runtime").JSX.Element;
35
+ declare function SidebarContent({ className, ...props }: React$1.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
36
+ declare function SidebarGroup({ className, ...props }: React$1.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
37
+ declare function SidebarGroupLabel({ className, asChild, ...props }: React$1.ComponentProps<"div"> & {
38
+ asChild?: boolean;
39
+ }): import("react/jsx-runtime").JSX.Element;
40
+ declare function SidebarGroupAction({ className, asChild, ...props }: React$1.ComponentProps<"button"> & {
41
+ asChild?: boolean;
42
+ }): import("react/jsx-runtime").JSX.Element;
43
+ declare function SidebarGroupContent({ className, ...props }: React$1.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
44
+ declare function SidebarMenu({ className, ...props }: React$1.ComponentProps<"ul">): import("react/jsx-runtime").JSX.Element;
45
+ declare function SidebarMenuItem({ className, ...props }: React$1.ComponentProps<"li">): import("react/jsx-runtime").JSX.Element;
46
+ declare const sidebarMenuButtonVariants: (props?: ({
47
+ variant?: "default" | "outline" | null | undefined;
48
+ size?: "default" | "lg" | "sm" | null | undefined;
49
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
50
+ declare function SidebarMenuButton({ asChild, isActive, variant, size, tooltip, className, ...props }: React$1.ComponentProps<"button"> & {
51
+ asChild?: boolean;
52
+ isActive?: boolean;
53
+ tooltip?: string | React$1.ComponentProps<typeof TooltipContent>;
54
+ } & VariantProps<typeof sidebarMenuButtonVariants>): import("react/jsx-runtime").JSX.Element;
55
+ declare function SidebarMenuAction({ className, asChild, showOnHover, ...props }: React$1.ComponentProps<"button"> & {
56
+ asChild?: boolean;
57
+ showOnHover?: boolean;
58
+ }): import("react/jsx-runtime").JSX.Element;
59
+ declare function SidebarMenuBadge({ className, ...props }: React$1.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
60
+ declare function SidebarMenuSkeleton({ className, showIcon, ...props }: React$1.ComponentProps<"div"> & {
61
+ showIcon?: boolean;
62
+ }): import("react/jsx-runtime").JSX.Element;
63
+ declare function SidebarMenuSub({ className, ...props }: React$1.ComponentProps<"ul">): import("react/jsx-runtime").JSX.Element;
64
+ declare function SidebarMenuSubItem({ className, ...props }: React$1.ComponentProps<"li">): import("react/jsx-runtime").JSX.Element;
65
+ declare function SidebarMenuSubButton({ asChild, size, isActive, className, ...props }: React$1.ComponentProps<"a"> & {
66
+ asChild?: boolean;
67
+ size?: "sm" | "md";
68
+ isActive?: boolean;
69
+ }): import("react/jsx-runtime").JSX.Element;
70
+ //#endregion
71
+ export { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, useSidebar };