@aaas-pro/library 0.0.0-stage → 0.1.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 (247) hide show
  1. package/README.md +107 -2
  2. package/dist/components/address-picker.d.ts +18 -0
  3. package/dist/components/address-picker.js +46 -0
  4. package/dist/components/card-date-filter.d.ts +12 -0
  5. package/dist/components/card-date-filter.js +95 -0
  6. package/dist/components/date-time-picker.d.ts +12 -0
  7. package/dist/components/date-time-picker.js +96 -0
  8. package/dist/components/detail-dialog.d.ts +48 -0
  9. package/dist/components/detail-dialog.js +97 -0
  10. package/dist/components/document-links.d.ts +13 -0
  11. package/dist/components/document-links.js +19 -0
  12. package/dist/components/draft-row-actions.d.ts +14 -0
  13. package/dist/components/draft-row-actions.js +70 -0
  14. package/dist/components/error-boundary.d.ts +14 -0
  15. package/dist/components/error-boundary.js +35 -0
  16. package/dist/components/glow-card.d.ts +13 -0
  17. package/dist/components/glow-card.js +48 -0
  18. package/dist/components/org-picker.d.ts +17 -0
  19. package/dist/components/org-picker.js +56 -0
  20. package/dist/components/overflow-row-actions.d.ts +29 -0
  21. package/dist/components/overflow-row-actions.js +135 -0
  22. package/dist/components/page-header.d.ts +21 -0
  23. package/dist/components/page-header.js +21 -0
  24. package/dist/components/permission-button.d.ts +4 -0
  25. package/dist/components/permission-button.js +17 -0
  26. package/dist/components/permission-context.d.ts +12 -0
  27. package/dist/components/permission-context.js +17 -0
  28. package/dist/components/person-picker.d.ts +20 -0
  29. package/dist/components/person-picker.js +38 -0
  30. package/dist/components/process-flow-bar.d.ts +15 -0
  31. package/dist/components/process-flow-bar.js +19 -0
  32. package/dist/components/product-picker.d.ts +19 -0
  33. package/dist/components/product-picker.js +155 -0
  34. package/dist/components/ref-doc-picker.d.ts +24 -0
  35. package/dist/components/ref-doc-picker.js +139 -0
  36. package/dist/components/scroll-to-top.d.ts +1 -0
  37. package/dist/components/scroll-to-top.js +20 -0
  38. package/dist/components/state-view.d.ts +26 -0
  39. package/dist/components/state-view.js +75 -0
  40. package/dist/components/theme-switcher.d.ts +27 -0
  41. package/dist/components/theme-switcher.js +77 -0
  42. package/dist/components/time-filter.d.ts +7 -0
  43. package/dist/components/time-filter.js +65 -0
  44. package/dist/components/ui/accordion.d.ts +7 -0
  45. package/dist/components/ui/accordion.js +64 -0
  46. package/dist/components/ui/alert-dialog.d.ts +15 -0
  47. package/dist/components/ui/alert-dialog.js +160 -0
  48. package/dist/components/ui/alert.d.ts +12 -0
  49. package/dist/components/ui/alert.js +66 -0
  50. package/dist/components/ui/aspect-ratio.d.ts +3 -0
  51. package/dist/components/ui/aspect-ratio.js +10 -0
  52. package/dist/components/ui/avatar.d.ts +6 -0
  53. package/dist/components/ui/avatar.js +53 -0
  54. package/dist/components/ui/badge.d.ts +12 -0
  55. package/dist/components/ui/badge.js +44 -0
  56. package/dist/components/ui/breadcrumb.d.ts +11 -0
  57. package/dist/components/ui/breadcrumb.js +103 -0
  58. package/dist/components/ui/button-group.d.ts +14 -0
  59. package/dist/components/ui/button-group.js +76 -0
  60. package/dist/components/ui/button.d.ts +20 -0
  61. package/dist/components/ui/button.js +93 -0
  62. package/dist/components/ui/calendar.d.ts +73 -0
  63. package/dist/components/ui/calendar.js +103 -0
  64. package/dist/components/ui/card.d.ts +9 -0
  65. package/dist/components/ui/card.js +90 -0
  66. package/dist/components/ui/carousel.d.ts +14 -0
  67. package/dist/components/ui/carousel.js +200 -0
  68. package/dist/components/ui/chart.d.ts +43 -0
  69. package/dist/components/ui/chart.js +252 -0
  70. package/dist/components/ui/checkbox.d.ts +4 -0
  71. package/dist/components/ui/checkbox.js +31 -0
  72. package/dist/components/ui/collapsible.d.ts +5 -0
  73. package/dist/components/ui/collapsible.js +34 -0
  74. package/dist/components/ui/command.d.ts +18 -0
  75. package/dist/components/ui/command.js +170 -0
  76. package/dist/components/ui/context-menu.d.ts +26 -0
  77. package/dist/components/ui/context-menu.js +237 -0
  78. package/dist/components/ui/dialog.d.ts +17 -0
  79. package/dist/components/ui/dialog.js +139 -0
  80. package/dist/components/ui/drawer.d.ts +13 -0
  81. package/dist/components/ui/drawer.js +129 -0
  82. package/dist/components/ui/dropdown-menu.d.ts +26 -0
  83. package/dist/components/ui/dropdown-menu.js +245 -0
  84. package/dist/components/ui/empty.d.ts +14 -0
  85. package/dist/components/ui/empty.js +102 -0
  86. package/dist/components/ui/field.d.ts +27 -0
  87. package/dist/components/ui/field.js +229 -0
  88. package/dist/components/ui/form.d.ts +26 -0
  89. package/dist/components/ui/form.js +118 -0
  90. package/dist/components/ui/hover-card.d.ts +6 -0
  91. package/dist/components/ui/hover-card.js +39 -0
  92. package/dist/components/ui/input-group.d.ts +22 -0
  93. package/dist/components/ui/input-group.js +156 -0
  94. package/dist/components/ui/input-otp.d.ts +11 -0
  95. package/dist/components/ui/input-otp.js +66 -0
  96. package/dist/components/ui/input.d.ts +3 -0
  97. package/dist/components/ui/input.js +21 -0
  98. package/dist/components/ui/item.d.ts +29 -0
  99. package/dist/components/ui/item.js +187 -0
  100. package/dist/components/ui/kbd.d.ts +3 -0
  101. package/dist/components/ui/kbd.js +31 -0
  102. package/dist/components/ui/label.d.ts +4 -0
  103. package/dist/components/ui/label.js +22 -0
  104. package/dist/components/ui/menubar.d.ts +26 -0
  105. package/dist/components/ui/menubar.js +252 -0
  106. package/dist/components/ui/navigation-menu.d.ts +17 -0
  107. package/dist/components/ui/navigation-menu.js +170 -0
  108. package/dist/components/ui/pagination.d.ts +13 -0
  109. package/dist/components/ui/pagination.js +118 -0
  110. package/dist/components/ui/popover.d.ts +8 -0
  111. package/dist/components/ui/popover.js +47 -0
  112. package/dist/components/ui/progress.d.ts +4 -0
  113. package/dist/components/ui/progress.js +34 -0
  114. package/dist/components/ui/radio-group.d.ts +5 -0
  115. package/dist/components/ui/radio-group.js +45 -0
  116. package/dist/components/ui/resizable.d.ts +7 -0
  117. package/dist/components/ui/resizable.js +49 -0
  118. package/dist/components/ui/scroll-area.d.ts +5 -0
  119. package/dist/components/ui/scroll-area.js +60 -0
  120. package/dist/components/ui/select.d.ts +17 -0
  121. package/dist/components/ui/select.js +215 -0
  122. package/dist/components/ui/separator.d.ts +4 -0
  123. package/dist/components/ui/separator.js +26 -0
  124. package/dist/components/ui/sheet.d.ts +13 -0
  125. package/dist/components/ui/sheet.js +127 -0
  126. package/dist/components/ui/sidebar.d.ts +72 -0
  127. package/dist/components/ui/sidebar.js +656 -0
  128. package/dist/components/ui/skeleton.d.ts +2 -0
  129. package/dist/components/ui/skeleton.js +15 -0
  130. package/dist/components/ui/slider.d.ts +4 -0
  131. package/dist/components/ui/slider.js +63 -0
  132. package/dist/components/ui/sonner.d.ts +4 -0
  133. package/dist/components/ui/sonner.js +34 -0
  134. package/dist/components/ui/spinner.d.ts +2 -0
  135. package/dist/components/ui/spinner.js +17 -0
  136. package/dist/components/ui/switch.d.ts +4 -0
  137. package/dist/components/ui/switch.js +31 -0
  138. package/dist/components/ui/table.d.ts +10 -0
  139. package/dist/components/ui/table.js +114 -0
  140. package/dist/components/ui/tabs.d.ts +7 -0
  141. package/dist/components/ui/tabs.js +67 -0
  142. package/dist/components/ui/textarea.d.ts +3 -0
  143. package/dist/components/ui/textarea.js +18 -0
  144. package/dist/components/ui/toggle-group.d.ts +9 -0
  145. package/dist/components/ui/toggle-group.js +68 -0
  146. package/dist/components/ui/toggle.d.ts +12 -0
  147. package/dist/components/ui/toggle.js +43 -0
  148. package/dist/components/ui/tooltip.d.ts +7 -0
  149. package/dist/components/ui/tooltip.js +56 -0
  150. package/dist/hooks/use-mobile.d.ts +1 -0
  151. package/dist/hooks/use-mobile.js +18 -0
  152. package/dist/icons/index.d.ts +57 -0
  153. package/dist/icons/index.js +115 -0
  154. package/dist/icons/paths.d.ts +556 -0
  155. package/dist/icons/paths.js +231 -0
  156. package/dist/index.d.ts +68 -0
  157. package/dist/index.js +399 -0
  158. package/dist/internal/selection-base.d.ts +37 -0
  159. package/dist/internal/selection-base.js +40 -0
  160. package/dist/lib/class-names.d.ts +6 -0
  161. package/dist/lib/class-names.js +159 -0
  162. package/dist/lib/utils.d.ts +3 -0
  163. package/dist/lib/utils.js +7 -0
  164. package/dist/lib/variants.d.ts +21 -0
  165. package/dist/lib/variants.js +21 -0
  166. package/dist/primitives/accordion.d.ts +29 -0
  167. package/dist/primitives/accordion.js +49 -0
  168. package/dist/primitives/alert-dialog.d.ts +10 -0
  169. package/dist/primitives/alert-dialog.js +22 -0
  170. package/dist/primitives/aspect-ratio.d.ts +4 -0
  171. package/dist/primitives/aspect-ratio.js +7 -0
  172. package/dist/primitives/avatar.d.ts +8 -0
  173. package/dist/primitives/avatar.js +45 -0
  174. package/dist/primitives/carousel.d.ts +22 -0
  175. package/dist/primitives/carousel.js +78 -0
  176. package/dist/primitives/chart.d.ts +71 -0
  177. package/dist/primitives/chart.js +125 -0
  178. package/dist/primitives/checkbox.d.ts +13 -0
  179. package/dist/primitives/checkbox.js +24 -0
  180. package/dist/primitives/collapsible.d.ts +14 -0
  181. package/dist/primitives/collapsible.js +29 -0
  182. package/dist/primitives/command.d.ts +43 -0
  183. package/dist/primitives/command.js +98 -0
  184. package/dist/primitives/context-menu.d.ts +24 -0
  185. package/dist/primitives/context-menu.js +19 -0
  186. package/dist/primitives/core.d.ts +25 -0
  187. package/dist/primitives/core.js +89 -0
  188. package/dist/primitives/dialog.d.ts +7 -0
  189. package/dist/primitives/dialog.js +15 -0
  190. package/dist/primitives/drawer.d.ts +30 -0
  191. package/dist/primitives/drawer.js +39 -0
  192. package/dist/primitives/dropdown-menu.d.ts +24 -0
  193. package/dist/primitives/dropdown-menu.js +19 -0
  194. package/dist/primitives/form.d.ts +154 -0
  195. package/dist/primitives/form.js +139 -0
  196. package/dist/primitives/hover-card.d.ts +4 -0
  197. package/dist/primitives/hover-card.js +8 -0
  198. package/dist/primitives/input-otp.d.ts +21 -0
  199. package/dist/primitives/input-otp.js +78 -0
  200. package/dist/primitives/label.d.ts +2 -0
  201. package/dist/primitives/label.js +7 -0
  202. package/dist/primitives/layer.d.ts +84 -0
  203. package/dist/primitives/layer.js +300 -0
  204. package/dist/primitives/menu.d.ts +56 -0
  205. package/dist/primitives/menu.js +126 -0
  206. package/dist/primitives/menubar.d.ts +91 -0
  207. package/dist/primitives/menubar.js +44 -0
  208. package/dist/primitives/navigation-menu.d.ts +32 -0
  209. package/dist/primitives/navigation-menu.js +121 -0
  210. package/dist/primitives/popover.d.ts +4 -0
  211. package/dist/primitives/popover.js +12 -0
  212. package/dist/primitives/progress.d.ts +7 -0
  213. package/dist/primitives/progress.js +13 -0
  214. package/dist/primitives/radio-group.d.ts +18 -0
  215. package/dist/primitives/radio-group.js +36 -0
  216. package/dist/primitives/resizable.d.ts +19 -0
  217. package/dist/primitives/resizable.js +91 -0
  218. package/dist/primitives/scroll-area.d.ts +12 -0
  219. package/dist/primitives/scroll-area.js +26 -0
  220. package/dist/primitives/select.d.ts +42 -0
  221. package/dist/primitives/select.js +167 -0
  222. package/dist/primitives/separator.d.ts +5 -0
  223. package/dist/primitives/separator.js +7 -0
  224. package/dist/primitives/slider.d.ts +25 -0
  225. package/dist/primitives/slider.js +98 -0
  226. package/dist/primitives/slot.d.ts +1 -0
  227. package/dist/primitives/slot.js +4 -0
  228. package/dist/primitives/switch.d.ts +11 -0
  229. package/dist/primitives/switch.js +22 -0
  230. package/dist/primitives/tabs.d.ts +23 -0
  231. package/dist/primitives/tabs.js +38 -0
  232. package/dist/primitives/toast.d.ts +55 -0
  233. package/dist/primitives/toast.js +86 -0
  234. package/dist/primitives/toggle-group.d.ts +24 -0
  235. package/dist/primitives/toggle-group.js +33 -0
  236. package/dist/primitives/toggle.d.ts +7 -0
  237. package/dist/primitives/toggle.js +13 -0
  238. package/dist/primitives/tooltip.d.ts +7 -0
  239. package/dist/primitives/tooltip.js +10 -0
  240. package/dist/style-entry.d.ts +1 -0
  241. package/dist/style-entry.js +1 -0
  242. package/dist/styles.css +7016 -0
  243. package/dist/styles.js +1 -0
  244. package/dist/theme/index.d.ts +110 -0
  245. package/dist/theme/index.js +199 -0
  246. package/licenses/Lucide.txt +15 -0
  247. package/package.json +67 -4
@@ -0,0 +1,65 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { useState, useId } from "react";
3
+ import { CalendarDays, ChevronDown } from "../icons/index.js";
4
+ import { Button } from "./ui/button.js";
5
+ import { DateTimePicker } from "./date-time-picker.js";
6
+ import { Popover, PopoverTrigger, PopoverContent } from "./ui/popover.js";
7
+ import { cn } from "../lib/utils.js";
8
+ const options = [
9
+ { value: "today", label: "今日" },
10
+ { value: "week", label: "本周" },
11
+ { value: "month", label: "本月" },
12
+ { value: "quarter", label: "本季" },
13
+ { value: "year", label: "本年" }
14
+ ];
15
+ function TimeFilter({ value, onChange }) {
16
+ const [open, setOpen] = useState(false), id = useId();
17
+ const [from, setFrom] = useState(""), [to, setTo] = useState("");
18
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
19
+ /* @__PURE__ */ jsx("div", { role: "group", "aria-label": "快捷时间范围", className: "flex flex-wrap gap-1 rounded-lg border border-border bg-card p-1", children: options.map((option) => /* @__PURE__ */ jsx(
20
+ "button",
21
+ {
22
+ type: "button",
23
+ "aria-pressed": value === option.value,
24
+ onClick: () => {
25
+ onChange(option.value);
26
+ setOpen(false);
27
+ },
28
+ className: cn(
29
+ "min-h-8 rounded-md px-3 text-xs font-medium outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring/15",
30
+ value === option.value ? "bg-primary text-primary-foreground" : "text-muted-foreground hover:bg-accent hover:text-foreground"
31
+ ),
32
+ children: option.label
33
+ },
34
+ option.value
35
+ )) }),
36
+ /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, children: [
37
+ /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(Button, { type: "button", size: "sm", variant: value === "custom" ? "default" : "outline", color: value === "custom" ? "primary" : "default", children: [
38
+ /* @__PURE__ */ jsx(CalendarDays, { className: "size-3.5" }),
39
+ "自定义",
40
+ /* @__PURE__ */ jsx(ChevronDown, { className: cn("size-3 transition-transform", open && "rotate-180") })
41
+ ] }) }),
42
+ /* @__PURE__ */ jsxs(PopoverContent, { align: "end", className: "w-72 max-w-[calc(100vw-32px)] space-y-3", "aria-label": "自定义时间范围", children: [
43
+ /* @__PURE__ */ jsx("p", { className: "text-sm font-medium", children: "选择时间范围" }),
44
+ /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
45
+ /* @__PURE__ */ jsx("label", { htmlFor: `${id}-from`, className: "text-xs text-muted-foreground", children: "开始日期" }),
46
+ /* @__PURE__ */ jsx(DateTimePicker, { id: `${id}-from`, "aria-label": "开始日期", placeholder: "开始日期", locale: "zh-CN", value: from, onValueChange: setFrom, max: to || void 0 })
47
+ ] }),
48
+ /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
49
+ /* @__PURE__ */ jsx("label", { htmlFor: `${id}-to`, className: "text-xs text-muted-foreground", children: "结束日期" }),
50
+ /* @__PURE__ */ jsx(DateTimePicker, { id: `${id}-to`, "aria-label": "结束日期", placeholder: "结束日期", locale: "zh-CN", value: to, onValueChange: setTo, min: from || void 0 })
51
+ ] }),
52
+ /* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-2", children: [
53
+ /* @__PURE__ */ jsx(Button, { type: "button", size: "sm", variant: "outline", color: "default", onClick: () => setOpen(false), children: "取消" }),
54
+ /* @__PURE__ */ jsx(Button, { type: "button", size: "sm", onClick: () => {
55
+ onChange("custom");
56
+ setOpen(false);
57
+ }, children: "确定" })
58
+ ] })
59
+ ] })
60
+ ] })
61
+ ] });
62
+ }
63
+ export {
64
+ TimeFilter
65
+ };
@@ -0,0 +1,7 @@
1
+ import * as React from "react";
2
+ import * as AccordionPrimitive from "../../primitives/accordion";
3
+ declare function Accordion({ ...props }: React.ComponentProps<typeof AccordionPrimitive.Root>): React.JSX.Element;
4
+ declare function AccordionItem({ className, ...props }: React.ComponentProps<typeof AccordionPrimitive.Item>): React.JSX.Element;
5
+ declare function AccordionTrigger({ className, children, ...props }: React.ComponentProps<typeof AccordionPrimitive.Trigger>): React.JSX.Element;
6
+ declare function AccordionContent({ className, children, ...props }: React.ComponentProps<typeof AccordionPrimitive.Content>): React.JSX.Element;
7
+ export { Accordion, AccordionItem, AccordionTrigger, AccordionContent };
@@ -0,0 +1,64 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { Root, Content, Item, Header, Trigger } from "../../primitives/accordion.js";
3
+ import { ChevronDownIcon } from "../../icons/index.js";
4
+ import { cn } from "../../lib/utils.js";
5
+ function Accordion({
6
+ ...props
7
+ }) {
8
+ return /* @__PURE__ */ jsx(Root, { "data-slot": "accordion", ...props });
9
+ }
10
+ function AccordionItem({
11
+ className,
12
+ ...props
13
+ }) {
14
+ return /* @__PURE__ */ jsx(
15
+ Item,
16
+ {
17
+ "data-slot": "accordion-item",
18
+ className: cn("border-b last:border-b-0", className),
19
+ ...props
20
+ }
21
+ );
22
+ }
23
+ function AccordionTrigger({
24
+ className,
25
+ children,
26
+ ...props
27
+ }) {
28
+ return /* @__PURE__ */ jsx(Header, { className: "flex", children: /* @__PURE__ */ jsxs(
29
+ Trigger,
30
+ {
31
+ "data-slot": "accordion-trigger",
32
+ className: cn(
33
+ "focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",
34
+ className
35
+ ),
36
+ ...props,
37
+ children: [
38
+ children,
39
+ /* @__PURE__ */ jsx(ChevronDownIcon, { className: "text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200" })
40
+ ]
41
+ }
42
+ ) });
43
+ }
44
+ function AccordionContent({
45
+ className,
46
+ children,
47
+ ...props
48
+ }) {
49
+ return /* @__PURE__ */ jsx(
50
+ Content,
51
+ {
52
+ "data-slot": "accordion-content",
53
+ className: "data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm",
54
+ ...props,
55
+ children: /* @__PURE__ */ jsx("div", { className: cn("pt-0 pb-4", className), children })
56
+ }
57
+ );
58
+ }
59
+ export {
60
+ Accordion,
61
+ AccordionContent,
62
+ AccordionItem,
63
+ AccordionTrigger
64
+ };
@@ -0,0 +1,15 @@
1
+ import { type PermissionProps } from '../permission-context';
2
+ import * as React from "react";
3
+ import * as AlertDialogPrimitive from "../../primitives/alert-dialog";
4
+ declare function AlertDialog({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Root>): React.JSX.Element;
5
+ declare function AlertDialogTrigger({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Trigger>): React.JSX.Element;
6
+ declare function AlertDialogPortal({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Portal>): React.JSX.Element;
7
+ declare function AlertDialogOverlay({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Overlay>): React.JSX.Element;
8
+ declare function AlertDialogContent({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Content>): React.JSX.Element;
9
+ declare function AlertDialogHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
10
+ declare function AlertDialogFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
11
+ declare function AlertDialogTitle({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Title>): React.JSX.Element;
12
+ declare function AlertDialogDescription({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Description>): React.JSX.Element;
13
+ declare function AlertDialogAction({ className, permissionAction, permissionResource, permissionCommand, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Action> & PermissionProps): React.JSX.Element | null;
14
+ declare function AlertDialogCancel({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Cancel>): React.JSX.Element;
15
+ export { AlertDialog, AlertDialogPortal, AlertDialogOverlay, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogFooter, AlertDialogTitle, AlertDialogDescription, AlertDialogAction, AlertDialogCancel, };
@@ -0,0 +1,160 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { usePermissionCheck } from "../permission-context.js";
3
+ import { useThemePortalContainer } from "../../theme/index.js";
4
+ import { Root, Action, Cancel, Content, Description, Overlay, Portal, Title, Trigger } from "../../primitives/alert-dialog.js";
5
+ import { cn } from "../../lib/utils.js";
6
+ import { buttonVariants } from "./button.js";
7
+ function AlertDialog({
8
+ ...props
9
+ }) {
10
+ return /* @__PURE__ */ jsx(Root, { "data-slot": "alert-dialog", ...props });
11
+ }
12
+ function AlertDialogTrigger({
13
+ ...props
14
+ }) {
15
+ return /* @__PURE__ */ jsx(Trigger, { "data-slot": "alert-dialog-trigger", ...props });
16
+ }
17
+ function AlertDialogPortal({
18
+ ...props
19
+ }) {
20
+ return /* @__PURE__ */ jsx(Portal, { container: useThemePortalContainer(), "data-slot": "alert-dialog-portal", ...props });
21
+ }
22
+ function AlertDialogOverlay({
23
+ className,
24
+ ...props
25
+ }) {
26
+ return /* @__PURE__ */ jsx(
27
+ Overlay,
28
+ {
29
+ "data-slot": "alert-dialog-overlay",
30
+ className: cn(
31
+ "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-[60] bg-[rgb(12_22_18/0.45)] backdrop-blur-[2px]",
32
+ className
33
+ ),
34
+ ...props
35
+ }
36
+ );
37
+ }
38
+ function AlertDialogContent({
39
+ className,
40
+ ...props
41
+ }) {
42
+ return /* @__PURE__ */ jsxs(AlertDialogPortal, { children: [
43
+ /* @__PURE__ */ jsx(AlertDialogOverlay, {}),
44
+ /* @__PURE__ */ jsx(
45
+ Content,
46
+ {
47
+ "data-slot": "alert-dialog-content",
48
+ className: cn(
49
+ "bg-card text-card-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-[60] grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-5 rounded-xl border p-6 shadow-xl duration-200 sm:max-w-lg",
50
+ className
51
+ ),
52
+ ...props
53
+ }
54
+ )
55
+ ] });
56
+ }
57
+ function AlertDialogHeader({
58
+ className,
59
+ ...props
60
+ }) {
61
+ return /* @__PURE__ */ jsx(
62
+ "div",
63
+ {
64
+ "data-slot": "alert-dialog-header",
65
+ className: cn("flex flex-col gap-2 text-center sm:text-left", className),
66
+ ...props
67
+ }
68
+ );
69
+ }
70
+ function AlertDialogFooter({
71
+ className,
72
+ ...props
73
+ }) {
74
+ return /* @__PURE__ */ jsx(
75
+ "div",
76
+ {
77
+ "data-slot": "alert-dialog-footer",
78
+ className: cn(
79
+ "flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
80
+ className
81
+ ),
82
+ ...props
83
+ }
84
+ );
85
+ }
86
+ function AlertDialogTitle({
87
+ className,
88
+ ...props
89
+ }) {
90
+ return /* @__PURE__ */ jsx(
91
+ Title,
92
+ {
93
+ "data-slot": "alert-dialog-title",
94
+ className: cn("text-lg font-semibold", className),
95
+ ...props
96
+ }
97
+ );
98
+ }
99
+ function AlertDialogDescription({
100
+ className,
101
+ ...props
102
+ }) {
103
+ return /* @__PURE__ */ jsx(
104
+ Description,
105
+ {
106
+ "data-slot": "alert-dialog-description",
107
+ className: cn("text-muted-foreground text-sm", className),
108
+ ...props
109
+ }
110
+ );
111
+ }
112
+ function AlertDialogAction({
113
+ className,
114
+ permissionAction,
115
+ permissionResource,
116
+ permissionCommand,
117
+ ...props
118
+ }) {
119
+ const permitted = usePermissionCheck({ permissionAction, permissionResource, permissionCommand });
120
+ if (!permitted()) return null;
121
+ return /* @__PURE__ */ jsx(
122
+ Action,
123
+ {
124
+ className: cn(buttonVariants(), className),
125
+ ...props,
126
+ onClick: (event) => {
127
+ if (!permitted()) {
128
+ event.preventDefault();
129
+ return;
130
+ }
131
+ props.onClick?.(event);
132
+ }
133
+ }
134
+ );
135
+ }
136
+ function AlertDialogCancel({
137
+ className,
138
+ ...props
139
+ }) {
140
+ return /* @__PURE__ */ jsx(
141
+ Cancel,
142
+ {
143
+ className: cn(buttonVariants({ variant: "outline" }), className),
144
+ ...props
145
+ }
146
+ );
147
+ }
148
+ export {
149
+ AlertDialog,
150
+ AlertDialogAction,
151
+ AlertDialogCancel,
152
+ AlertDialogContent,
153
+ AlertDialogDescription,
154
+ AlertDialogFooter,
155
+ AlertDialogHeader,
156
+ AlertDialogOverlay,
157
+ AlertDialogPortal,
158
+ AlertDialogTitle,
159
+ AlertDialogTrigger
160
+ };
@@ -0,0 +1,12 @@
1
+ import * as React from "react";
2
+ import { type VariantProps } from "../../lib/variants";
3
+ declare const alertVariants: (props?: ({
4
+ variant?: "default" | "destructive" | null | undefined;
5
+ } & {
6
+ class?: import("../../lib/class-names").ClassValue;
7
+ className?: import("../../lib/class-names").ClassValue;
8
+ }) | undefined) => string;
9
+ declare function Alert({ className, variant, ...props }: React.ComponentProps<"div"> & VariantProps<typeof alertVariants>): React.JSX.Element;
10
+ declare function AlertTitle({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
11
+ declare function AlertDescription({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
12
+ export { Alert, AlertTitle, AlertDescription };
@@ -0,0 +1,66 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { cva } from "../../lib/variants.js";
3
+ import { cn } from "../../lib/utils.js";
4
+ const alertVariants = cva(
5
+ "relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",
6
+ {
7
+ variants: {
8
+ variant: {
9
+ default: "bg-card text-card-foreground",
10
+ destructive: "text-destructive border-destructive/20 bg-destructive/5 [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90"
11
+ }
12
+ },
13
+ defaultVariants: {
14
+ variant: "default"
15
+ }
16
+ }
17
+ );
18
+ function Alert({
19
+ className,
20
+ variant,
21
+ ...props
22
+ }) {
23
+ return /* @__PURE__ */ jsx(
24
+ "div",
25
+ {
26
+ "data-slot": "alert",
27
+ role: "alert",
28
+ className: cn(alertVariants({ variant }), className),
29
+ ...props
30
+ }
31
+ );
32
+ }
33
+ function AlertTitle({ className, ...props }) {
34
+ return /* @__PURE__ */ jsx(
35
+ "div",
36
+ {
37
+ "data-slot": "alert-title",
38
+ className: cn(
39
+ "col-start-2 min-h-4 font-medium leading-6",
40
+ className
41
+ ),
42
+ ...props
43
+ }
44
+ );
45
+ }
46
+ function AlertDescription({
47
+ className,
48
+ ...props
49
+ }) {
50
+ return /* @__PURE__ */ jsx(
51
+ "div",
52
+ {
53
+ "data-slot": "alert-description",
54
+ className: cn(
55
+ "text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",
56
+ className
57
+ ),
58
+ ...props
59
+ }
60
+ );
61
+ }
62
+ export {
63
+ Alert,
64
+ AlertDescription,
65
+ AlertTitle
66
+ };
@@ -0,0 +1,3 @@
1
+ import * as AspectRatioPrimitive from "../../primitives/aspect-ratio";
2
+ declare function AspectRatio({ ...props }: React.ComponentProps<typeof AspectRatioPrimitive.Root>): import("react").JSX.Element;
3
+ export { AspectRatio };
@@ -0,0 +1,10 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { Root } from "../../primitives/aspect-ratio.js";
3
+ function AspectRatio({
4
+ ...props
5
+ }) {
6
+ return /* @__PURE__ */ jsx(Root, { "data-slot": "aspect-ratio", ...props });
7
+ }
8
+ export {
9
+ AspectRatio
10
+ };
@@ -0,0 +1,6 @@
1
+ import * as React from "react";
2
+ import * as AvatarPrimitive from "../../primitives/avatar";
3
+ declare function Avatar({ className, ...props }: React.ComponentProps<typeof AvatarPrimitive.Root>): React.JSX.Element;
4
+ declare function AvatarImage({ className, ...props }: React.ComponentProps<typeof AvatarPrimitive.Image>): React.JSX.Element;
5
+ declare function AvatarFallback({ className, ...props }: React.ComponentProps<typeof AvatarPrimitive.Fallback>): React.JSX.Element;
6
+ export { Avatar, AvatarImage, AvatarFallback };
@@ -0,0 +1,53 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { Root, Fallback, Image } from "../../primitives/avatar.js";
3
+ import { cn } from "../../lib/utils.js";
4
+ function Avatar({
5
+ className,
6
+ ...props
7
+ }) {
8
+ return /* @__PURE__ */ jsx(
9
+ Root,
10
+ {
11
+ "data-slot": "avatar",
12
+ className: cn(
13
+ "relative flex size-8 shrink-0 overflow-hidden rounded-full",
14
+ className
15
+ ),
16
+ ...props
17
+ }
18
+ );
19
+ }
20
+ function AvatarImage({
21
+ className,
22
+ ...props
23
+ }) {
24
+ return /* @__PURE__ */ jsx(
25
+ Image,
26
+ {
27
+ "data-slot": "avatar-image",
28
+ className: cn("aspect-square size-full", className),
29
+ ...props
30
+ }
31
+ );
32
+ }
33
+ function AvatarFallback({
34
+ className,
35
+ ...props
36
+ }) {
37
+ return /* @__PURE__ */ jsx(
38
+ Fallback,
39
+ {
40
+ "data-slot": "avatar-fallback",
41
+ className: cn(
42
+ "bg-muted flex size-full items-center justify-center rounded-full",
43
+ className
44
+ ),
45
+ ...props
46
+ }
47
+ );
48
+ }
49
+ export {
50
+ Avatar,
51
+ AvatarFallback,
52
+ AvatarImage
53
+ };
@@ -0,0 +1,12 @@
1
+ import * as React from "react";
2
+ import { type VariantProps } from "../../lib/variants";
3
+ declare const badgeVariants: (props?: ({
4
+ variant?: "outline" | "default" | "success" | "warning" | "destructive" | "secondary" | "info" | "muted" | null | undefined;
5
+ } & {
6
+ class?: import("../../lib/class-names").ClassValue;
7
+ className?: import("../../lib/class-names").ClassValue;
8
+ }) | undefined) => string;
9
+ declare function Badge({ className, variant, asChild, ...props }: React.ComponentProps<"span"> & VariantProps<typeof badgeVariants> & {
10
+ asChild?: boolean;
11
+ }): React.JSX.Element;
12
+ export { Badge, badgeVariants };
@@ -0,0 +1,44 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { cva } from "../../lib/variants.js";
3
+ import { cn } from "../../lib/utils.js";
4
+ import { Slot } from "../../primitives/core.js";
5
+ const badgeVariants = cva(
6
+ "inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs leading-4 font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",
7
+ {
8
+ variants: {
9
+ variant: {
10
+ default: "border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
11
+ secondary: "border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",
12
+ destructive: "border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
13
+ outline: "text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
14
+ success: "border-[color-mix(in_srgb,var(--success)_25%,transparent)] bg-[color-mix(in_srgb,var(--success)_10%,var(--card))] text-success",
15
+ warning: "border-[color-mix(in_srgb,var(--warning)_25%,transparent)] bg-[color-mix(in_srgb,var(--warning)_10%,var(--card))] text-warning",
16
+ info: "border-[color-mix(in_srgb,var(--info)_25%,transparent)] bg-[color-mix(in_srgb,var(--info)_10%,var(--card))] text-info",
17
+ muted: "border-transparent bg-muted text-muted-foreground"
18
+ }
19
+ },
20
+ defaultVariants: {
21
+ variant: "default"
22
+ }
23
+ }
24
+ );
25
+ function Badge({
26
+ className,
27
+ variant,
28
+ asChild = false,
29
+ ...props
30
+ }) {
31
+ const Comp = asChild ? Slot : "span";
32
+ return /* @__PURE__ */ jsx(
33
+ Comp,
34
+ {
35
+ "data-slot": "badge",
36
+ className: cn(badgeVariants({ variant }), className),
37
+ ...props
38
+ }
39
+ );
40
+ }
41
+ export {
42
+ Badge,
43
+ badgeVariants
44
+ };
@@ -0,0 +1,11 @@
1
+ import * as React from "react";
2
+ declare function Breadcrumb({ ...props }: React.ComponentProps<"nav">): React.JSX.Element;
3
+ declare function BreadcrumbList({ className, ...props }: React.ComponentProps<"ol">): React.JSX.Element;
4
+ declare function BreadcrumbItem({ className, ...props }: React.ComponentProps<"li">): React.JSX.Element;
5
+ declare function BreadcrumbLink({ asChild, className, ...props }: React.ComponentProps<"a"> & {
6
+ asChild?: boolean;
7
+ }): React.JSX.Element;
8
+ declare function BreadcrumbPage({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
9
+ declare function BreadcrumbSeparator({ children, className, ...props }: React.ComponentProps<"li">): React.JSX.Element;
10
+ declare function BreadcrumbEllipsis({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
11
+ export { Breadcrumb, BreadcrumbList, BreadcrumbItem, BreadcrumbLink, BreadcrumbPage, BreadcrumbSeparator, BreadcrumbEllipsis, };
@@ -0,0 +1,103 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { MoreHorizontal, ChevronRight } from "../../icons/index.js";
3
+ import { cn } from "../../lib/utils.js";
4
+ import { Slot } from "../../primitives/core.js";
5
+ function Breadcrumb({ ...props }) {
6
+ return /* @__PURE__ */ jsx("nav", { "aria-label": "breadcrumb", "data-slot": "breadcrumb", ...props });
7
+ }
8
+ function BreadcrumbList({ className, ...props }) {
9
+ return /* @__PURE__ */ jsx(
10
+ "ol",
11
+ {
12
+ "data-slot": "breadcrumb-list",
13
+ className: cn(
14
+ "text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",
15
+ className
16
+ ),
17
+ ...props
18
+ }
19
+ );
20
+ }
21
+ function BreadcrumbItem({ className, ...props }) {
22
+ return /* @__PURE__ */ jsx(
23
+ "li",
24
+ {
25
+ "data-slot": "breadcrumb-item",
26
+ className: cn("inline-flex items-center gap-1.5", className),
27
+ ...props
28
+ }
29
+ );
30
+ }
31
+ function BreadcrumbLink({
32
+ asChild,
33
+ className,
34
+ ...props
35
+ }) {
36
+ const Comp = asChild ? Slot : "a";
37
+ return /* @__PURE__ */ jsx(
38
+ Comp,
39
+ {
40
+ "data-slot": "breadcrumb-link",
41
+ className: cn("hover:text-foreground transition-colors", className),
42
+ ...props
43
+ }
44
+ );
45
+ }
46
+ function BreadcrumbPage({ className, ...props }) {
47
+ return /* @__PURE__ */ jsx(
48
+ "span",
49
+ {
50
+ "data-slot": "breadcrumb-page",
51
+ role: "link",
52
+ "aria-disabled": "true",
53
+ "aria-current": "page",
54
+ className: cn("text-foreground font-normal", className),
55
+ ...props
56
+ }
57
+ );
58
+ }
59
+ function BreadcrumbSeparator({
60
+ children,
61
+ className,
62
+ ...props
63
+ }) {
64
+ return /* @__PURE__ */ jsx(
65
+ "li",
66
+ {
67
+ "data-slot": "breadcrumb-separator",
68
+ role: "presentation",
69
+ "aria-hidden": "true",
70
+ className: cn("[&>svg]:size-3.5", className),
71
+ ...props,
72
+ children: children ?? /* @__PURE__ */ jsx(ChevronRight, {})
73
+ }
74
+ );
75
+ }
76
+ function BreadcrumbEllipsis({
77
+ className,
78
+ ...props
79
+ }) {
80
+ return /* @__PURE__ */ jsxs(
81
+ "span",
82
+ {
83
+ "data-slot": "breadcrumb-ellipsis",
84
+ role: "presentation",
85
+ "aria-hidden": "true",
86
+ className: cn("flex size-9 items-center justify-center", className),
87
+ ...props,
88
+ children: [
89
+ /* @__PURE__ */ jsx(MoreHorizontal, { className: "size-4" }),
90
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: "More" })
91
+ ]
92
+ }
93
+ );
94
+ }
95
+ export {
96
+ Breadcrumb,
97
+ BreadcrumbEllipsis,
98
+ BreadcrumbItem,
99
+ BreadcrumbLink,
100
+ BreadcrumbList,
101
+ BreadcrumbPage,
102
+ BreadcrumbSeparator
103
+ };
@@ -0,0 +1,14 @@
1
+ import { type VariantProps } from "../../lib/variants";
2
+ import { Separator } from "./separator";
3
+ declare const buttonGroupVariants: (props?: ({
4
+ orientation?: "horizontal" | "vertical" | null | undefined;
5
+ } & {
6
+ class?: import("../../lib/class-names").ClassValue;
7
+ className?: import("../../lib/class-names").ClassValue;
8
+ }) | undefined) => string;
9
+ declare function ButtonGroup({ className, orientation, ...props }: React.ComponentProps<"div"> & VariantProps<typeof buttonGroupVariants>): import("react").JSX.Element;
10
+ declare function ButtonGroupText({ className, asChild, ...props }: React.ComponentProps<"div"> & {
11
+ asChild?: boolean;
12
+ }): import("react").JSX.Element;
13
+ declare function ButtonGroupSeparator({ className, orientation, ...props }: React.ComponentProps<typeof Separator>): import("react").JSX.Element;
14
+ export { ButtonGroup, ButtonGroupSeparator, ButtonGroupText, buttonGroupVariants, };