@examplary/ui 1.56.0 → 1.58.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 (105) hide show
  1. package/dist/components/ai/ai-icon.js +2 -25
  2. package/dist/components/ai/ai-prompt-suggestion.js +3 -26
  3. package/dist/components/brand/tick-icon.js +2 -25
  4. package/dist/components/chat/chat-input.js +8 -31
  5. package/dist/components/chat/chat-typing-indicator.js +2 -2
  6. package/dist/components/chat/chat-view.js +6 -34
  7. package/dist/components/loading/ai-spinner.js +2 -13
  8. package/dist/components/loading/tick-loader.js +39 -104
  9. package/dist/components/print/answer-box.js +2 -25
  10. package/dist/components/question-types/fetch-component.js +65 -106
  11. package/dist/components/question-types/format-question-type.d.ts +41 -41
  12. package/dist/components/question-types/format-question-type.js +36 -37
  13. package/dist/components/rich-text/minimal-rich-text-field.d.ts +2 -2
  14. package/dist/components/rich-text/minimal-rich-text-field.js +47 -85
  15. package/dist/components/rich-text/rich-text-display.js +15 -33
  16. package/dist/components/rich-text/rich-text-field.js +2 -25
  17. package/dist/components/rich-text/rich-text-toolbar.d.ts +3 -2
  18. package/dist/components/rich-text/rich-text-toolbar.js +5 -6
  19. package/dist/components/rich-text/tiptap/collaboration-caret.js +24 -34
  20. package/dist/components/rich-text/tiptap/comments/comment-bubble.d.ts +1 -1
  21. package/dist/components/rich-text/tiptap/comments/comment-bubble.js +36 -41
  22. package/dist/components/rich-text/tiptap/content-reference.js +6 -7
  23. package/dist/components/rich-text/tiptap/crop-page-clipping-modal.d.ts +3 -3
  24. package/dist/components/rich-text/tiptap/crop-page-clipping-modal.js +20 -25
  25. package/dist/components/rich-text/tiptap/extensions.d.ts +2 -2
  26. package/dist/components/rich-text/tiptap/extensions.js +6 -16
  27. package/dist/components/rich-text/tiptap/file-attachment.js +9 -11
  28. package/dist/components/rich-text/tiptap/file-handler.d.ts +2 -2
  29. package/dist/components/rich-text/tiptap/file-handler.js +110 -185
  30. package/dist/components/rich-text/tiptap/image.js +18 -23
  31. package/dist/components/rich-text/tiptap/mathematics-component.js +25 -30
  32. package/dist/components/rich-text/tiptap/mathematics.js +56 -82
  33. package/dist/components/rich-text/tiptap/page-clipping.js +3 -4
  34. package/dist/components/rich-text/tiptap/png-scanner.js +63 -108
  35. package/dist/components/rich-text/tiptap/rich-text-formatting-menu.d.ts +1 -1
  36. package/dist/components/rich-text/tiptap/rich-text-formatting-menu.js +31 -46
  37. package/dist/components/ui/alert.d.ts +3 -3
  38. package/dist/components/ui/alert.js +7 -32
  39. package/dist/components/ui/avatar.js +18 -14
  40. package/dist/components/ui/badge.d.ts +3 -3
  41. package/dist/components/ui/badge.js +4 -27
  42. package/dist/components/ui/button.d.ts +4 -4
  43. package/dist/components/ui/button.js +4 -27
  44. package/dist/components/ui/card.js +6 -46
  45. package/dist/components/ui/checkbox.js +1 -26
  46. package/dist/components/ui/color-picker.js +11 -22
  47. package/dist/components/ui/command-palette.d.ts +2 -2
  48. package/dist/components/ui/command-palette.js +38 -72
  49. package/dist/components/ui/command.js +18 -49
  50. package/dist/components/ui/comments.js +37 -107
  51. package/dist/components/ui/context-menu.js +30 -67
  52. package/dist/components/ui/dialog.js +15 -61
  53. package/dist/components/ui/dropdown.js +17 -64
  54. package/dist/components/ui/floating-menu.js +2 -25
  55. package/dist/components/ui/floating-resizable.d.ts +5 -0
  56. package/dist/components/ui/floating-resizable.js +24 -0
  57. package/dist/components/ui/help-icon.js +1 -2
  58. package/dist/components/ui/icon-picker.js +50 -130
  59. package/dist/components/ui/index.d.ts +1 -0
  60. package/dist/components/ui/index.js +1 -0
  61. package/dist/components/ui/input.js +2 -25
  62. package/dist/components/ui/label.d.ts +1 -1
  63. package/dist/components/ui/label.js +2 -27
  64. package/dist/components/ui/popover.d.ts +2 -2
  65. package/dist/components/ui/popover.js +4 -32
  66. package/dist/components/ui/progress-bar.js +2 -3
  67. package/dist/components/ui/radio-group.js +4 -28
  68. package/dist/components/ui/resizable.d.ts +6 -9
  69. package/dist/components/ui/resizable.js +13 -60
  70. package/dist/components/ui/select.js +12 -55
  71. package/dist/components/ui/separator.js +1 -26
  72. package/dist/components/ui/sheet.d.ts +3 -3
  73. package/dist/components/ui/sheet.js +11 -51
  74. package/dist/components/ui/skeleton.js +2 -25
  75. package/dist/components/ui/slider.js +7 -32
  76. package/dist/components/ui/sortable.d.ts +1 -1
  77. package/dist/components/ui/sortable.js +131 -155
  78. package/dist/components/ui/switch.d.ts +3 -3
  79. package/dist/components/ui/switch.js +3 -28
  80. package/dist/components/ui/table.js +8 -54
  81. package/dist/components/ui/tabs.js +8 -34
  82. package/dist/components/ui/text-selection-menu.d.ts +1 -1
  83. package/dist/components/ui/text-selection-menu.js +19 -25
  84. package/dist/components/ui/textarea.js +7 -30
  85. package/dist/components/ui/tooltip.js +4 -29
  86. package/dist/components/web-components/content-reference.js +81 -106
  87. package/dist/components/web-components/file-attachment.js +9 -30
  88. package/dist/components/web-components/index.js +1 -1
  89. package/dist/components/web-components/inline-comment-reply.js +3 -24
  90. package/dist/components/web-components/inline-comment.js +3 -24
  91. package/dist/components/web-components/inline-math.js +14 -36
  92. package/dist/components/web-components/page-clipping.js +13 -34
  93. package/dist/lib/compose-refs.js +10 -18
  94. package/dist/lib/use-spin-loop.js +19 -69
  95. package/dist/src/global.css +2 -2
  96. package/dist/utils.js +1 -5
  97. package/package.json +5 -4
  98. package/dist/components/rich-text/tiptap/comments/comment-reply.d.ts +0 -21
  99. package/dist/components/rich-text/tiptap/comments/comment-reply.js +0 -230
  100. package/dist/components/rich-text/tiptap/comments/comment.d.ts +0 -22
  101. package/dist/components/rich-text/tiptap/comments/comment.js +0 -198
  102. package/dist/components/rich-text/tiptap/comments/helpers.d.ts +0 -19
  103. package/dist/components/rich-text/tiptap/comments/helpers.js +0 -95
  104. package/dist/components/rich-text/tiptap/comments/types.d.ts +0 -29
  105. package/dist/components/rich-text/tiptap/comments/types.js +0 -1
@@ -1,81 +1,35 @@
1
1
  "use client";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- var __rest = (this && this.__rest) || function (s, e) {
14
- var t = {};
15
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
16
- t[p] = s[p];
17
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
18
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
19
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
20
- t[p[i]] = s[p[i]];
21
- }
22
- return t;
23
- };
24
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
25
3
  import * as React from "react";
26
4
  import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
27
5
  import { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react";
28
6
  import { cn } from "../../utils";
29
- var DropdownMenu = DropdownMenuPrimitive.Root;
30
- var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
31
- var DropdownMenuGroup = DropdownMenuPrimitive.Group;
32
- var DropdownMenuPortal = DropdownMenuPrimitive.Portal;
33
- var DropdownMenuSub = DropdownMenuPrimitive.Sub;
34
- var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
35
- var DropdownMenuSubTrigger = React.forwardRef(function (_a, ref) {
36
- var className = _a.className, inset = _a.inset, children = _a.children, props = __rest(_a, ["className", "inset", "children"]);
37
- return (_jsxs(DropdownMenuPrimitive.SubTrigger, __assign({ ref: ref, className: cn("flex cursor-default select-none items-center rounded-base bg-white px-2 py-1.5 text-sm font-base outline-none gap-2 [&_svg]:pointer-events-none [&_svg]:w-4 [&_svg]:h-4 [&_svg]:shrink-0", inset && "pl-8", className) }, props, { children: [children, _jsx(ChevronRightIcon, { className: "ml-auto" })] })));
38
- });
7
+ const DropdownMenu = DropdownMenuPrimitive.Root;
8
+ const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
9
+ const DropdownMenuGroup = DropdownMenuPrimitive.Group;
10
+ const DropdownMenuPortal = DropdownMenuPrimitive.Portal;
11
+ const DropdownMenuSub = DropdownMenuPrimitive.Sub;
12
+ const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
13
+ const DropdownMenuSubTrigger = React.forwardRef(({ className, inset, children, ...props }, ref) => (_jsxs(DropdownMenuPrimitive.SubTrigger, { ref: ref, className: cn("flex cursor-default select-none items-center rounded-base bg-white px-2 py-1.5 text-sm font-base outline-none gap-2 [&_svg]:pointer-events-none [&_svg]:w-4 [&_svg]:h-4 [&_svg]:shrink-0", inset && "pl-8", className), ...props, children: [children, _jsx(ChevronRightIcon, { className: "ml-auto" })] })));
39
14
  DropdownMenuSubTrigger.displayName =
40
15
  DropdownMenuPrimitive.SubTrigger.displayName;
41
- var DropdownMenuSubContent = React.forwardRef(function (_a, ref) {
42
- var className = _a.className, props = __rest(_a, ["className"]);
43
- return (_jsx(DropdownMenuPrimitive.SubContent, __assign({ ref: ref, className: cn("z-50 min-w-[8rem] overflow-hidden rounded-base border border-border-accent bg-white p-1 font-base text-text 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 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", className) }, props)));
44
- });
16
+ const DropdownMenuSubContent = React.forwardRef(({ className, ...props }, ref) => (_jsx(DropdownMenuPrimitive.SubContent, { ref: ref, className: cn("z-50 min-w-[8rem] overflow-hidden rounded-base border border-border-accent bg-white p-1 font-base text-text 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 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", className), ...props })));
45
17
  DropdownMenuSubContent.displayName =
46
18
  DropdownMenuPrimitive.SubContent.displayName;
47
- var DropdownMenuContent = React.forwardRef(function (_a, ref) {
48
- var className = _a.className, _b = _a.sideOffset, sideOffset = _b === void 0 ? 4 : _b, props = __rest(_a, ["className", "sideOffset"]);
49
- return (_jsx(DropdownMenuPrimitive.Portal, { children: _jsx(DropdownMenuPrimitive.Content, __assign({ ref: ref, sideOffset: sideOffset, className: cn("z-50 min-w-[8rem] overflow-hidden rounded-lg shadow-xl border border-border-accent bg-white p-1 font-base text-text 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 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", className) }, props)) }));
50
- });
19
+ const DropdownMenuContent = React.forwardRef(({ className, sideOffset = 4, ...props }, ref) => (_jsx(DropdownMenuPrimitive.Portal, { children: _jsx(DropdownMenuPrimitive.Content, { ref: ref, sideOffset: sideOffset, className: cn("z-50 min-w-[8rem] overflow-hidden rounded-lg shadow-xl border border-border-accent bg-white p-1 font-base text-text 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 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", className), ...props }) })));
51
20
  DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
52
- var DropdownMenuItem = React.forwardRef(function (_a, ref) {
53
- var className = _a.className, inset = _a.inset, props = __rest(_a, ["className", "inset"]);
54
- return (_jsx(DropdownMenuPrimitive.Item, __assign({ ref: ref, className: cn("relative gap-2 [&_svg]:pointer-events-none [&_svg]:w-4 [&_svg]:h-4 [&_svg]:shrink-0 flex select-none items-center rounded-base px-2 py-1.5 text-sm hover:bg-zinc-100 cursor-pointer font-base outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50", inset && "pl-8", className) }, props)));
55
- });
21
+ const DropdownMenuItem = React.forwardRef(({ className, inset, ...props }, ref) => (_jsx(DropdownMenuPrimitive.Item, { ref: ref, className: cn("relative gap-2 [&_svg]:pointer-events-none [&_svg]:w-4 [&_svg]:h-4 [&_svg]:shrink-0 flex select-none items-center rounded-base px-2 py-1.5 text-sm hover:bg-zinc-100 cursor-pointer font-base outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50", inset && "pl-8", className), ...props })));
56
22
  DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
57
- var DropdownMenuCheckboxItem = React.forwardRef(function (_a, ref) {
58
- var className = _a.className, children = _a.children, checked = _a.checked, props = __rest(_a, ["className", "children", "checked"]);
59
- return (_jsxs(DropdownMenuPrimitive.CheckboxItem, __assign({ ref: ref, className: cn("relative flex cursor-pointer select-none items-center rounded-base py-1.5 pl-8 pr-2 text-sm font-base text-text outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className), checked: checked }, props, { children: [_jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: _jsx(DropdownMenuPrimitive.ItemIndicator, { children: _jsx(CheckIcon, { className: "h-4 w-4" }) }) }), children] })));
60
- });
23
+ const DropdownMenuCheckboxItem = React.forwardRef(({ className, children, checked, ...props }, ref) => (_jsxs(DropdownMenuPrimitive.CheckboxItem, { ref: ref, className: cn("relative flex cursor-pointer select-none items-center rounded-base py-1.5 pl-8 pr-2 text-sm font-base text-text outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className), checked: checked, ...props, children: [_jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: _jsx(DropdownMenuPrimitive.ItemIndicator, { children: _jsx(CheckIcon, { className: "h-4 w-4" }) }) }), children] })));
61
24
  DropdownMenuCheckboxItem.displayName =
62
25
  DropdownMenuPrimitive.CheckboxItem.displayName;
63
- var DropdownMenuRadioItem = React.forwardRef(function (_a, ref) {
64
- var className = _a.className, children = _a.children, props = __rest(_a, ["className", "children"]);
65
- return (_jsxs(DropdownMenuPrimitive.RadioItem, __assign({ ref: ref, className: cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm font-base outline-none transition-colors focus:bg-white focus:text-text data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className) }, props, { children: [_jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: _jsx(DropdownMenuPrimitive.ItemIndicator, { children: _jsx(CircleIcon, { className: "h-2 w-2 fill-current" }) }) }), children] })));
66
- });
26
+ const DropdownMenuRadioItem = React.forwardRef(({ className, children, ...props }, ref) => (_jsxs(DropdownMenuPrimitive.RadioItem, { ref: ref, className: cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm font-base outline-none transition-colors focus:bg-white focus:text-text data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className), ...props, children: [_jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: _jsx(DropdownMenuPrimitive.ItemIndicator, { children: _jsx(CircleIcon, { className: "h-2 w-2 fill-current" }) }) }), children] })));
67
27
  DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
68
- var DropdownMenuLabel = React.forwardRef(function (_a, ref) {
69
- var className = _a.className, inset = _a.inset, props = __rest(_a, ["className", "inset"]);
70
- return (_jsx(DropdownMenuPrimitive.Label, __assign({ ref: ref, className: cn("px-2 py-1.5 text-sm font-heading font-semibold", inset && "pl-8", className) }, props)));
71
- });
28
+ const DropdownMenuLabel = React.forwardRef(({ className, inset, ...props }, ref) => (_jsx(DropdownMenuPrimitive.Label, { ref: ref, className: cn("px-2 py-1.5 text-sm font-heading font-semibold", inset && "pl-8", className), ...props })));
72
29
  DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
73
- var DropdownMenuSeparator = React.forwardRef(function (_a, ref) {
74
- var className = _a.className, props = __rest(_a, ["className"]);
75
- return (_jsx(DropdownMenuPrimitive.Separator, __assign({ ref: ref, className: cn("-mx-1 my-1 h-[1px] bg-border-accent", className) }, props)));
76
- });
30
+ const DropdownMenuSeparator = React.forwardRef(({ className, ...props }, ref) => (_jsx(DropdownMenuPrimitive.Separator, { ref: ref, className: cn("-mx-1 my-1 h-[1px] bg-border-accent", className), ...props })));
77
31
  DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
78
- export var replaceShortCut = function (text) {
32
+ export const replaceShortCut = (text) => {
79
33
  if (!text || typeof text !== "string")
80
34
  return text;
81
35
  if (navigator.userAgent.includes("Windows")) {
@@ -83,9 +37,8 @@ export var replaceShortCut = function (text) {
83
37
  }
84
38
  return text;
85
39
  };
86
- var DropdownMenuShortcut = function (_a) {
87
- var className = _a.className, props = __rest(_a, ["className"]);
88
- return (_jsx("span", __assign({ className: cn("ml-auto pl-1 text-xs font-medium text-zinc-400 tracking-widest opacity-100", className) }, props, { children: replaceShortCut(props.children) })));
40
+ const DropdownMenuShortcut = ({ className, ...props }) => {
41
+ return (_jsx("span", { className: cn("ml-auto pl-1 text-xs font-medium text-zinc-400 tracking-widest opacity-100", className), ...props, children: replaceShortCut(props.children) }));
89
42
  };
90
43
  DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
91
44
  export { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuGroup, DropdownMenuPortal, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuRadioGroup, };
@@ -1,28 +1,5 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
- var __rest = (this && this.__rest) || function (s, e) {
13
- var t = {};
14
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
- t[p] = s[p];
16
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
- t[p[i]] = s[p[i]];
20
- }
21
- return t;
22
- };
23
1
  import { jsx as _jsx } from "react/jsx-runtime";
24
2
  import { cn } from "../../utils";
25
- export var FloatingMenu = function (_a) {
26
- var children = _a.children, _b = _a.className, className = _b === void 0 ? "" : _b, props = __rest(_a, ["children", "className"]);
27
- return (_jsx("div", __assign({ className: cn("border border-zinc-600 p-0.5 bg-white rounded-lg shadow-md relative z-10 text-xs font-medium select-none", className) }, props, { children: children })));
3
+ export const FloatingMenu = ({ children, className = "", ...props }) => {
4
+ return (_jsx("div", { className: cn("border border-zinc-600 p-0.5 bg-white rounded-lg shadow-md relative z-10 text-xs font-medium select-none", className), ...props, children: children }));
28
5
  };
@@ -0,0 +1,5 @@
1
+ import * as ResizablePrimitive from "react-resizable-panels";
2
+ export declare const FloatingResizablePanel: ({ onResize, floatClassName, children, ...props }: React.ComponentProps<typeof ResizablePrimitive.Panel> & {
3
+ floatClassName?: string;
4
+ onResize?: (size: number, prevSize: number | string | undefined) => void;
5
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,24 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { useRef, useState, useEffect } from "react";
4
+ import * as ResizablePrimitive from "react-resizable-panels";
5
+ import { cn } from "../../utils";
6
+ export const FloatingResizablePanel = ({ onResize, floatClassName = "", children, ...props }) => {
7
+ const ref = useRef(null);
8
+ const [width, setWidth] = useState("auto");
9
+ const updateSize = () => {
10
+ if (ref.current) {
11
+ const rect = ref.current.getBoundingClientRect();
12
+ setWidth(rect.width);
13
+ }
14
+ };
15
+ useEffect(() => {
16
+ updateSize();
17
+ window.addEventListener("resize", updateSize);
18
+ return () => window.removeEventListener("resize", updateSize);
19
+ }, []);
20
+ return (_jsx(ResizablePrimitive.Panel, { onResize: (size, prevSize) => {
21
+ setTimeout(() => window.dispatchEvent(new Event("resize")), 1);
22
+ onResize?.(size.inPixels, prevSize);
23
+ }, ...props, children: _jsx("div", { ref: ref, className: "h-full", children: _jsx("div", { className: cn("fixed top-36 bottom-20 overflow-auto", floatClassName), style: { width }, children: children }) }) }));
24
+ };
@@ -3,7 +3,6 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { MessageCircleQuestionIcon } from "lucide-react";
4
4
  import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from "./tooltip";
5
5
  import { cn } from "../../utils";
6
- export var HelpIcon = function (_a) {
7
- var children = _a.children, _b = _a.className, className = _b === void 0 ? "" : _b, _c = _a.align, align = _c === void 0 ? "center" : _c, _d = _a.side, side = _d === void 0 ? "bottom" : _d, _e = _a.expanded, expanded = _e === void 0 ? false : _e;
6
+ export const HelpIcon = ({ children, className = "", align = "center", side = "bottom", expanded = false, }) => {
8
7
  return (_jsx(TooltipProvider, { children: _jsxs(Tooltip, { delayDuration: 50, children: [_jsx(TooltipTrigger, { children: _jsx(MessageCircleQuestionIcon, { className: cn("size-5 text-zinc-600 hover:text-black transition cursor-help", className) }) }), _jsx(TooltipContent, { className: cn("max-w-sm py-2 font-normal text-sm", align === "start" && "text-left", align === "center" && "text-center", align === "end" && "text-right", expanded && "text-left rounded-lg"), side: side, align: align, sideOffset: 10, children: _jsx("p", { children: children }) })] }) }));
9
8
  };
@@ -1,62 +1,4 @@
1
1
  "use client";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
14
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15
- return new (P || (P = Promise))(function (resolve, reject) {
16
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
17
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
18
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
19
- step((generator = generator.apply(thisArg, _arguments || [])).next());
20
- });
21
- };
22
- var __generator = (this && this.__generator) || function (thisArg, body) {
23
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
24
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
25
- function verb(n) { return function (v) { return step([n, v]); }; }
26
- function step(op) {
27
- if (f) throw new TypeError("Generator is already executing.");
28
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
29
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
30
- if (y = 0, t) op = [op[0] & 2, t.value];
31
- switch (op[0]) {
32
- case 0: case 1: t = op; break;
33
- case 4: _.label++; return { value: op[1], done: false };
34
- case 5: _.label++; y = op[1]; op = [0]; continue;
35
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
36
- default:
37
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
38
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
39
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
40
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
41
- if (t[2]) _.ops.pop();
42
- _.trys.pop(); continue;
43
- }
44
- op = body.call(thisArg, _);
45
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
46
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
47
- }
48
- };
49
- var __rest = (this && this.__rest) || function (s, e) {
50
- var t = {};
51
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
52
- t[p] = s[p];
53
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
54
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
55
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
56
- t[p[i]] = s[p[i]];
57
- }
58
- return t;
59
- };
60
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
61
3
  import * as React from "react";
62
4
  import { useState, useMemo, useCallback, useEffect } from "react";
@@ -67,79 +9,57 @@ import { Button } from "./button";
67
9
  import { Input } from "./input";
68
10
  import { Popover, PopoverContent, PopoverTrigger } from "./popover";
69
11
  import { Skeleton } from "./skeleton";
70
- var IconsColumnSkeleton = function () {
71
- return (_jsxs("div", { className: "flex flex-col gap-2 w-full", children: [_jsx(Skeleton, { className: "h-4 w-1/2 rounded-md" }), _jsx("div", { className: "grid grid-cols-5 gap-2 w-full", children: Array.from({ length: 40 }).map(function (_, i) { return (_jsx(Skeleton, { className: "h-10 w-10 rounded-md" }, i)); }) })] }));
12
+ const IconsColumnSkeleton = () => {
13
+ return (_jsxs("div", { className: "flex flex-col gap-2 w-full", children: [_jsx(Skeleton, { className: "h-4 w-1/2 rounded-md" }), _jsx("div", { className: "grid grid-cols-5 gap-2 w-full", children: Array.from({ length: 40 }).map((_, i) => (_jsx(Skeleton, { className: "h-10 w-10 rounded-md" }, i))) })] }));
72
14
  };
73
- export var DynamicIcon = React.memo(function (_a) {
74
- var name = _a.name, props = __rest(_a, ["name"]);
75
- var _b = useState([]), node = _b[0], setNode = _b[1];
76
- useEffect(function () {
77
- var isMounted = true;
78
- var loadIcon = function () { return __awaiter(void 0, void 0, void 0, function () {
79
- var response;
80
- return __generator(this, function (_a) {
81
- switch (_a.label) {
82
- case 0: return [4 /*yield*/, import("lucide-static/icon-nodes.json")];
83
- case 1:
84
- response = _a.sent();
85
- if (isMounted) {
86
- setNode(response.default[name]);
87
- }
88
- return [2 /*return*/];
89
- }
90
- });
91
- }); };
15
+ export const DynamicIcon = React.memo(({ name, ...props }) => {
16
+ const [node, setNode] = useState([]);
17
+ useEffect(() => {
18
+ let isMounted = true;
19
+ const loadIcon = async () => {
20
+ const response = await import("lucide-static/icon-nodes.json");
21
+ if (isMounted) {
22
+ setNode(response.default[name]);
23
+ }
24
+ };
92
25
  loadIcon();
93
- return function () {
26
+ return () => {
94
27
  isMounted = false;
95
28
  };
96
29
  }, [name]);
97
- return _jsx(Icon, __assign({}, props, { iconNode: node }));
30
+ return _jsx(Icon, { ...props, iconNode: node });
98
31
  });
99
32
  DynamicIcon.displayName = "DynamicIcon";
100
- var useIconsData = function () {
101
- var _a = useState([]), icons = _a[0], setIcons = _a[1];
102
- var _b = useState(true), isLoading = _b[0], setIsLoading = _b[1];
103
- useEffect(function () {
104
- var isMounted = true;
105
- var loadIcons = function () { return __awaiter(void 0, void 0, void 0, function () {
106
- var response;
107
- return __generator(this, function (_a) {
108
- switch (_a.label) {
109
- case 0:
110
- setIsLoading(true);
111
- return [4 /*yield*/, import("lucide-static/tags.json")];
112
- case 1:
113
- response = _a.sent();
114
- if (isMounted) {
115
- setIcons(Object.entries(response).map(function (_a) {
116
- var name = _a[0], tags = _a[1];
117
- return ({
118
- name: name,
119
- tags: tags,
120
- });
121
- }));
122
- setIsLoading(false);
123
- }
124
- return [2 /*return*/];
125
- }
126
- });
127
- }); };
33
+ const useIconsData = () => {
34
+ const [icons, setIcons] = useState([]);
35
+ const [isLoading, setIsLoading] = useState(true);
36
+ useEffect(() => {
37
+ let isMounted = true;
38
+ const loadIcons = async () => {
39
+ setIsLoading(true);
40
+ const response = await import("lucide-static/tags.json");
41
+ if (isMounted) {
42
+ setIcons(Object.entries(response).map(([name, tags]) => ({
43
+ name: name,
44
+ tags: tags,
45
+ })));
46
+ setIsLoading(false);
47
+ }
48
+ };
128
49
  loadIcons();
129
- return function () {
50
+ return () => {
130
51
  isMounted = false;
131
52
  };
132
53
  }, []);
133
- return { icons: icons, isLoading: isLoading };
54
+ return { icons, isLoading };
134
55
  };
135
- export var IconPicker = function (_a) {
136
- var value = _a.value, defaultValue = _a.defaultValue, onValueChange = _a.onValueChange, children = _a.children, chooseIconLabel = _a.chooseIconLabel, _b = _a.searchable, searchable = _b === void 0 ? true : _b, _c = _a.searchPlaceholder, searchPlaceholder = _c === void 0 ? "Search for an icon..." : _c, iconsList = _a.iconsList, className = _a.className, props = __rest(_a, ["value", "defaultValue", "onValueChange", "children", "chooseIconLabel", "searchable", "searchPlaceholder", "iconsList", "className"]);
137
- var _d = useState(defaultValue), selectedIcon = _d[0], setSelectedIcon = _d[1];
138
- var _e = useState(false), isOpen = _e[0], setIsOpen = _e[1];
139
- var _f = useDebounceValue("", 100), search = _f[0], setSearch = _f[1];
140
- var _g = useIconsData(), icons = _g.icons, isLoading = _g.isLoading;
141
- var iconsToUse = useMemo(function () { return iconsList || icons; }, [iconsList, icons]);
142
- var fuseInstance = useMemo(function () {
56
+ export const IconPicker = ({ value, defaultValue, onValueChange, children, chooseIconLabel, searchable = true, searchPlaceholder = "Search for an icon...", iconsList, className, ...props }) => {
57
+ const [selectedIcon, setSelectedIcon] = useState(defaultValue);
58
+ const [isOpen, setIsOpen] = useState(false);
59
+ const [search, setSearch] = useDebounceValue("", 100);
60
+ const { icons, isLoading } = useIconsData();
61
+ const iconsToUse = useMemo(() => iconsList || icons, [iconsList, icons]);
62
+ const fuseInstance = useMemo(() => {
143
63
  return new Fuse(iconsToUse, {
144
64
  keys: ["name", "tags"],
145
65
  threshold: 0.3,
@@ -147,37 +67,37 @@ export var IconPicker = function (_a) {
147
67
  includeScore: true,
148
68
  });
149
69
  }, [iconsToUse]);
150
- var filteredIcons = useMemo(function () {
70
+ const filteredIcons = useMemo(() => {
151
71
  if (search.trim() === "") {
152
72
  return iconsToUse.slice(0, 50);
153
73
  }
154
- var results = fuseInstance.search(search.toLowerCase().trim(), {
74
+ const results = fuseInstance.search(search.toLowerCase().trim(), {
155
75
  limit: 50,
156
76
  });
157
- return results.map(function (result) { return result.item; });
77
+ return results.map((result) => result.item);
158
78
  }, [search, iconsToUse, fuseInstance]);
159
- var parentRef = React.useRef(null);
160
- var handleValueChange = useCallback(function (icon) {
79
+ const parentRef = React.useRef(null);
80
+ const handleValueChange = useCallback((icon) => {
161
81
  if (value === undefined) {
162
82
  setSelectedIcon(icon);
163
83
  }
164
- onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange(icon);
84
+ onValueChange?.(icon);
165
85
  }, [value, onValueChange]);
166
- var handleIconClick = useCallback(function (iconName) {
86
+ const handleIconClick = useCallback((iconName) => {
167
87
  handleValueChange(iconName);
168
88
  setIsOpen(false);
169
89
  setSearch("");
170
90
  }, [handleValueChange, setSearch]);
171
- var handleSearchChange = useCallback(function (e) {
91
+ const handleSearchChange = useCallback((e) => {
172
92
  setSearch(e.target.value);
173
93
  if (parentRef.current) {
174
94
  parentRef.current.scrollTop = 0;
175
95
  }
176
96
  }, [setSearch]);
177
- var renderIcon = useCallback(function (icon) { return (_jsx(Button, { variant: "roundedWhite", size: "icon", onClick: function () { return handleIconClick(icon.name); }, children: _jsx(DynamicIcon, { name: icon.name }) }, icon.name)); }, [handleIconClick]);
178
- return (_jsxs(Popover, { open: isOpen, onOpenChange: setIsOpen, children: [_jsx(PopoverTrigger, __assign({ asChild: true }, props, { children: children || (_jsxs(Button, { variant: "white", className: className, children: [value || selectedIcon ? (_jsx(DynamicIcon, { name: (value || selectedIcon) })) : null, chooseIconLabel || "Select icon"] })) })), _jsxs(PopoverContent, { className: "w-64 h-70 flex flex-col overflow-hidden p-0", children: [searchable && (_jsx("div", { className: "m-4 mb-2", children: _jsx(Input, { placeholder: searchPlaceholder, onChange: handleSearchChange }) })), _jsx("div", { ref: parentRef, className: "overflow-auto flex-1 p-4 pt-2", style: { scrollbarWidth: "thin" }, onWheel: function (e) {
97
+ const renderIcon = useCallback((icon) => (_jsx(Button, { variant: "roundedWhite", size: "icon", onClick: () => handleIconClick(icon.name), children: _jsx(DynamicIcon, { name: icon.name }) }, icon.name)), [handleIconClick]);
98
+ return (_jsxs(Popover, { open: isOpen, onOpenChange: setIsOpen, children: [_jsx(PopoverTrigger, { asChild: true, ...props, children: children || (_jsxs(Button, { variant: "white", className: className, children: [value || selectedIcon ? (_jsx(DynamicIcon, { name: (value || selectedIcon) })) : null, chooseIconLabel || "Select icon"] })) }), _jsxs(PopoverContent, { className: "w-64 h-70 flex flex-col overflow-hidden p-0", children: [searchable && (_jsx("div", { className: "m-4 mb-2", children: _jsx(Input, { placeholder: searchPlaceholder, onChange: handleSearchChange }) })), _jsx("div", { ref: parentRef, className: "overflow-auto flex-1 p-4 pt-2", style: { scrollbarWidth: "thin" }, onWheel: (e) => {
179
99
  e.stopPropagation();
180
- }, onTouchMove: function (e) {
100
+ }, onTouchMove: (e) => {
181
101
  e.stopPropagation();
182
102
  }, children: isLoading ? (_jsx(IconsColumnSkeleton, {})) : (_jsx("div", { className: "grid grid-cols-5 gap-2 w-full", children: filteredIcons.map(renderIcon) })) })] })] }));
183
103
  };
@@ -30,4 +30,5 @@ export * from "./context-menu";
30
30
  export * from "./avatar";
31
31
  export * from "./text-selection-menu";
32
32
  export * from "./floating-menu";
33
+ export * from "./floating-resizable";
33
34
  export * from "./comments";
@@ -30,4 +30,5 @@ export * from "./context-menu";
30
30
  export * from "./avatar";
31
31
  export * from "./text-selection-menu";
32
32
  export * from "./floating-menu";
33
+ export * from "./floating-resizable";
33
34
  export * from "./comments";
@@ -1,31 +1,8 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
- var __rest = (this && this.__rest) || function (s, e) {
13
- var t = {};
14
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
- t[p] = s[p];
16
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
- t[p[i]] = s[p[i]];
20
- }
21
- return t;
22
- };
23
1
  import { jsx as _jsx } from "react/jsx-runtime";
24
2
  import * as React from "react";
25
3
  import { cn } from "../../utils";
26
- var Input = React.forwardRef(function (_a, ref) {
27
- var className = _a.className, type = _a.type, props = __rest(_a, ["className", "type"]);
28
- return (_jsx("input", __assign({ type: type, className: cn("flex h-10 w-full border rounded-4xl border-border focus:border-border-accent text-text placeholder:text-zinc-500 font-base selection:bg-main selection:text-text dark:border-darkBorder bg-white dark:bg-secondaryBlack px-4 py-2 text-sm ring-offset-white file:border-0 file:bg-transparent file:text-sm file:font-base focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-black/10 disabled:cursor-not-allowed disabled:opacity-50 transition", className), ref: ref }, props)));
4
+ const Input = React.forwardRef(({ className, type, ...props }, ref) => {
5
+ return (_jsx("input", { type: type, className: cn("flex h-10 w-full border rounded-4xl border-border focus:border-border-accent text-text placeholder:text-zinc-500 font-base selection:bg-main selection:text-text dark:border-darkBorder bg-white dark:bg-secondaryBlack px-4 py-2 text-sm ring-offset-white file:border-0 file:bg-transparent file:text-sm file:font-base focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-black/10 disabled:cursor-not-allowed disabled:opacity-50 transition", className), ref: ref, ...props }));
29
6
  });
30
7
  Input.displayName = "Input";
31
8
  export { Input };
@@ -1,7 +1,7 @@
1
1
  import * as React from "react";
2
2
  import * as LabelPrimitive from "@radix-ui/react-label";
3
3
  import { type VariantProps } from "class-variance-authority";
4
- declare const Label: React.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React.RefAttributes<HTMLLabelElement>, "ref"> & VariantProps<(props?: import("class-variance-authority/types").ClassProp) => string> & {
4
+ declare const Label: React.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React.RefAttributes<HTMLLabelElement>, "ref"> & VariantProps<(props?: import("class-variance-authority/types").ClassProp | undefined) => string> & {
5
5
  helpText?: React.ReactNode;
6
6
  } & React.RefAttributes<HTMLLabelElement>>;
7
7
  export { Label };
@@ -1,35 +1,10 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
- var __rest = (this && this.__rest) || function (s, e) {
13
- var t = {};
14
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
- t[p] = s[p];
16
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
- t[p[i]] = s[p[i]];
20
- }
21
- return t;
22
- };
23
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
24
2
  import * as React from "react";
25
3
  import * as LabelPrimitive from "@radix-ui/react-label";
26
4
  import { cva } from "class-variance-authority";
27
5
  import { HelpIcon } from "./help-icon";
28
6
  import { cn } from "../../utils";
29
- var labelVariants = cva("flex items-center gap-1 text-sm font-heading font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 mb-3");
30
- var Label = React.forwardRef(function (_a, ref) {
31
- var className = _a.className, children = _a.children, helpText = _a.helpText, props = __rest(_a, ["className", "children", "helpText"]);
32
- return (_jsxs(LabelPrimitive.Root, __assign({ ref: ref, className: cn(labelVariants(), className) }, props, { children: [children, helpText && _jsx(HelpIcon, { className: "size-3.5", children: helpText })] })));
33
- });
7
+ const labelVariants = cva("flex items-center gap-1 text-sm font-heading font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 mb-3");
8
+ const Label = React.forwardRef(({ className, children, helpText, ...props }, ref) => (_jsxs(LabelPrimitive.Root, { ref: ref, className: cn(labelVariants(), className), ...props, children: [children, helpText && _jsx(HelpIcon, { className: "size-3.5", children: helpText })] })));
34
9
  Label.displayName = LabelPrimitive.Root.displayName;
35
10
  export { Label };
@@ -5,6 +5,6 @@ export declare const PopoverTrigger: React.ForwardRefExoticComponent<PopoverPrim
5
5
  export declare const PopoverContent: React.ForwardRefExoticComponent<Omit<PopoverPrimitive.PopoverContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
6
6
  export declare const PopoverItem: ({ className, inset, ...props }: {
7
7
  [x: string]: any;
8
- className?: string;
9
- inset?: boolean;
8
+ className?: string | undefined;
9
+ inset?: boolean | undefined;
10
10
  }) => import("react/jsx-runtime").JSX.Element;
@@ -1,38 +1,10 @@
1
1
  "use client";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- var __rest = (this && this.__rest) || function (s, e) {
14
- var t = {};
15
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
16
- t[p] = s[p];
17
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
18
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
19
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
20
- t[p[i]] = s[p[i]];
21
- }
22
- return t;
23
- };
24
2
  import { jsx as _jsx } from "react/jsx-runtime";
25
3
  import * as React from "react";
26
4
  import * as PopoverPrimitive from "@radix-ui/react-popover";
27
5
  import { cn } from "../../utils.js";
28
- export var Popover = PopoverPrimitive.Root;
29
- export var PopoverTrigger = PopoverPrimitive.Trigger;
30
- export var PopoverContent = React.forwardRef(function (_a, ref) {
31
- var className = _a.className, _b = _a.align, align = _b === void 0 ? "center" : _b, _c = _a.sideOffset, sideOffset = _c === void 0 ? 4 : _c, props = __rest(_a, ["className", "align", "sideOffset"]);
32
- return (_jsx(PopoverPrimitive.Portal, { children: _jsx(PopoverPrimitive.Content, __assign({ ref: ref, align: align, sideOffset: sideOffset, collisionPadding: 8, className: cn("z-50 min-w-64 max-w-80 rounded-xl border shadow-xl border-border-accent bg-white p-4 font-base text-text outline-none 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 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", className) }, props)) }));
33
- });
6
+ export const Popover = PopoverPrimitive.Root;
7
+ export const PopoverTrigger = PopoverPrimitive.Trigger;
8
+ export const PopoverContent = React.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => (_jsx(PopoverPrimitive.Portal, { children: _jsx(PopoverPrimitive.Content, { ref: ref, align: align, sideOffset: sideOffset, collisionPadding: 8, className: cn("z-50 min-w-64 max-w-80 rounded-xl border shadow-xl border-border-accent bg-white p-4 font-base text-text outline-none 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 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", className), ...props }) })));
34
9
  PopoverContent.displayName = PopoverPrimitive.Content.displayName;
35
- export var PopoverItem = function (_a) {
36
- var _b = _a.className, className = _b === void 0 ? "" : _b, _c = _a.inset, inset = _c === void 0 ? false : _c, props = __rest(_a, ["className", "inset"]);
37
- return (_jsx("div", __assign({ className: cn("relative gap-2 [&_svg]:pointer-events-none [&_svg]:w-4 [&_svg]:h-4 [&_svg]:shrink-0 flex select-none items-center rounded-base border-2 border-transparent px-2 py-1.5 text-sm hover:bg-zinc-100 cursor-pointer font-base outline-none transition-colors focus:border-border data-[disabled]:pointer-events-none data-[disabled]:opacity-50 disabled:pointer-events-none disabled:opacity-50", inset && "pl-8", className) }, props)));
38
- };
10
+ export const PopoverItem = ({ className = "", inset = false, ...props }) => (_jsx("div", { className: cn("relative gap-2 [&_svg]:pointer-events-none [&_svg]:w-4 [&_svg]:h-4 [&_svg]:shrink-0 flex select-none items-center rounded-base border-2 border-transparent px-2 py-1.5 text-sm hover:bg-zinc-100 cursor-pointer font-base outline-none transition-colors focus:border-border data-[disabled]:pointer-events-none data-[disabled]:opacity-50 disabled:pointer-events-none disabled:opacity-50", inset && "pl-8", className), ...props }));
@@ -1,6 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { cn } from "../../utils";
3
- export var ProgressBar = function (_a) {
4
- var value = _a.value, className = _a.className;
5
- return (_jsx("div", { role: "progressbar", "aria-valuenow": value, "aria-valuemin": 0, "aria-valuemax": 100, className: cn("w-full bg-zinc-200 rounded-full h-2 overflow-hidden", className), children: _jsx("div", { className: "bg-emerald-500 h-full rounded-full transition-all duration-300", style: { width: "".concat(value, "%") } }) }));
3
+ export const ProgressBar = ({ value, className, }) => {
4
+ return (_jsx("div", { role: "progressbar", "aria-valuenow": value, "aria-valuemin": 0, "aria-valuemax": 100, className: cn("w-full bg-zinc-200 rounded-full h-2 overflow-hidden", className), children: _jsx("div", { className: "bg-emerald-500 h-full rounded-full transition-all duration-300", style: { width: `${value}%` } }) }));
6
5
  };