@constructive-io/ui 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/card.d.ts +1 -1
- package/dist/components/checkbox.js +1 -1
- package/dist/components/checkbox.js.map +1 -1
- package/dist/components/combobox.js +1 -1
- package/dist/components/combobox.js.map +1 -1
- package/dist/components/dropdown-menu.js +3 -3
- package/dist/components/dropdown-menu.js.map +1 -1
- package/dist/components/input-group.js +1 -1
- package/dist/components/input-group.js.map +1 -1
- package/dist/components/org-chart/index.d.ts +54 -0
- package/dist/components/org-chart/index.js +861 -0
- package/dist/components/org-chart/index.js.map +1 -0
- package/dist/components/record-picker.js +2 -2
- package/dist/components/record-picker.js.map +1 -1
- package/dist/index.cjs +519 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +61 -1
- package/dist/index.d.ts +61 -1
- package/dist/index.js +511 -9
- package/dist/index.js.map +1 -1
- package/package.json +13 -2
package/dist/index.js
CHANGED
|
@@ -13,7 +13,7 @@ import { Radio as Radio$1 } from '@base-ui/react/radio';
|
|
|
13
13
|
import { RadioGroup as RadioGroup$1 } from '@base-ui/react/radio-group';
|
|
14
14
|
import { Switch as Switch$1 } from '@base-ui/react/switch';
|
|
15
15
|
import { Select as Select$1 } from '@base-ui/react/select';
|
|
16
|
-
import { ChevronsUpDownIcon, XCircle, XIcon, ChevronDown, SearchIcon, CheckIcon, ChevronRight, ChevronUpIcon, ChevronDownIcon, CircleIcon, ChevronRightIcon, X, GripVerticalIcon, ChevronLeftIcon, MoreHorizontalIcon, LoaderCircleIcon, PanelLeftIcon, WandSparkles, AlertCircleIcon, InfoIcon, CheckCircleIcon, AlertTriangleIcon, Loader2, CircleAlert, CheckCircle2 } from 'lucide-react';
|
|
16
|
+
import { ChevronsUpDownIcon, XCircle, XIcon, ChevronDown, SearchIcon, CheckIcon, Ellipsis, Pencil, Trash2, ChevronRight, ChevronUpIcon, ChevronDownIcon, CircleIcon, ChevronRightIcon, X, GripVerticalIcon, ChevronLeftIcon, MoreHorizontalIcon, LoaderCircleIcon, PanelLeftIcon, WandSparkles, AlertCircleIcon, InfoIcon, CheckCircleIcon, AlertTriangleIcon, Loader2, CircleAlert, CheckCircle2, Network, UserPlus } from 'lucide-react';
|
|
17
17
|
import { Progress as Progress$1 } from '@base-ui/react/progress';
|
|
18
18
|
import { FormProvider, Controller, useFormContext, useFormState } from 'react-hook-form';
|
|
19
19
|
import { Tooltip as Tooltip$1 } from '@base-ui/react/tooltip';
|
|
@@ -29,15 +29,17 @@ import { Collapsible as Collapsible$1 } from '@base-ui/react/collapsible';
|
|
|
29
29
|
import * as ResizablePrimitive from 'react-resizable-panels';
|
|
30
30
|
import { Avatar as Avatar$1 } from '@base-ui/react/avatar';
|
|
31
31
|
import { Autocomplete as Autocomplete$1 } from '@base-ui/react/autocomplete';
|
|
32
|
+
import { Handle, Position, useReactFlow, Panel, ReactFlowProvider, useNodesState, useEdgesState, ReactFlow, Background, BackgroundVariant, getSmoothStepPath, BaseEdge } from '@xyflow/react';
|
|
33
|
+
import { RiAddLine, RiSubtractLine, RiFocus3Line, RiSearchLine, RiLoader4Line, RiCheckLine, RiCloseLine } from '@remixicon/react';
|
|
32
34
|
import { Command as Command$1 } from 'cmdk';
|
|
33
35
|
import { Combobox as Combobox$1 } from '@base-ui/react/combobox';
|
|
34
|
-
import { RiSearchLine, RiLoader4Line, RiCheckLine, RiCloseLine } from '@remixicon/react';
|
|
35
36
|
import { matchSorter } from 'match-sorter';
|
|
36
37
|
import { today, getLocalTimeZone } from '@internationalized/date';
|
|
37
38
|
import { Calendar as Calendar$1, composeRenderProps, RangeCalendar as RangeCalendar$1, Button as Button$1, Heading, CalendarGrid, CalendarGridHeader, CalendarHeaderCell, CalendarGridBody, CalendarCell } from 'react-aria-components';
|
|
38
39
|
import { Toaster as Toaster$1, toast } from 'sonner';
|
|
39
40
|
import { createPortal } from 'react-dom';
|
|
40
41
|
import { useDrag } from '@use-gesture/react';
|
|
42
|
+
import '@xyflow/react/dist/style.css';
|
|
41
43
|
|
|
42
44
|
// src/lib/utils.ts
|
|
43
45
|
function cn(...inputs) {
|
|
@@ -564,7 +566,7 @@ var Checkbox = React19.forwardRef(({ className, ...props }, ref) => {
|
|
|
564
566
|
{
|
|
565
567
|
ref,
|
|
566
568
|
className: cn(
|
|
567
|
-
"relative inline-flex size-4.5 shrink-0 items-center justify-center rounded-[4px] border border-input bg-background bg-clip-padding
|
|
569
|
+
"relative inline-flex size-4.5 shrink-0 items-center justify-center rounded-[4px] border border-input bg-background bg-clip-padding outline-none ring-ring transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[3px] not-data-disabled:not-data-checked:not-aria-invalid:before:shadow-[0_1px_--theme(--color-black/4%)] focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:ring-offset-background aria-invalid:border-destructive/36 focus-visible:aria-invalid:border-destructive/64 focus-visible:aria-invalid:ring-destructive/48 data-disabled:opacity-64 sm:size-4 dark:not-data-checked:bg-input/32 dark:bg-clip-border dark:aria-invalid:ring-destructive/24 dark:not-data-disabled:not-data-checked:not-aria-invalid:before:shadow-[0_-1px_--theme(--color-white/8%)] [[data-disabled],[data-checked],[aria-invalid]]:shadow-none",
|
|
568
570
|
className
|
|
569
571
|
),
|
|
570
572
|
"data-slot": "checkbox",
|
|
@@ -1152,7 +1154,7 @@ function InputGroup({ className, ...props }) {
|
|
|
1152
1154
|
"div",
|
|
1153
1155
|
{
|
|
1154
1156
|
className: cn(
|
|
1155
|
-
"relative inline-flex w-full min-w-0 items-center rounded-lg border border-input bg-background bg-clip-padding text-base
|
|
1157
|
+
"relative inline-flex w-full min-w-0 items-center rounded-lg border border-input bg-background bg-clip-padding text-base transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] not-has-[input:disabled,textarea:disabled]:not-has-[input:focus-visible,textarea:focus-visible]:not-has-[input[aria-invalid],textarea[aria-invalid]]:before:shadow-[0_1px_--theme(--color-black/4%)] has-[input:focus-visible,textarea:focus-visible]:has-[input[aria-invalid],textarea[aria-invalid]]:border-destructive/64 has-[input:focus-visible,textarea:focus-visible]:has-[input[aria-invalid],textarea[aria-invalid]]:ring-destructive/16 has-[textarea]:h-auto has-data-[align=block-end]:h-auto has-data-[align=block-start]:h-auto has-data-[align=block-end]:flex-col has-data-[align=block-start]:flex-col has-[input:focus-visible,textarea:focus-visible]:border-primary/60 has-[input[aria-invalid],textarea[aria-invalid]]:border-destructive/36 has-[input:disabled,textarea:disabled]:opacity-64 has-[input:disabled,textarea:disabled,input:focus-visible,textarea:focus-visible,input[aria-invalid],textarea[aria-invalid]]:shadow-none has-[input:focus-visible,textarea:focus-visible]:ring-[3px] has-[input:focus-visible,textarea:focus-visible]:ring-primary/35 sm:text-sm dark:bg-input/32 dark:bg-clip-border dark:has-[input[aria-invalid],textarea[aria-invalid]]:ring-destructive/24 dark:not-has-[input:disabled,textarea:disabled]:not-has-[input:focus-visible,textarea:focus-visible]:not-has-[input[aria-invalid],textarea[aria-invalid]]:before:shadow-[0_-1px_--theme(--color-white/8%)] has-data-[align=inline-start]:**:[[data-size=sm]_input]:ps-1.5 has-data-[align=inline-end]:**:[[data-size=sm]_input]:pe-1.5 *:[[data-slot=input-control],[data-slot=textarea-control]]:contents *:[[data-slot=input-control],[data-slot=textarea-control]]:before:hidden has-[[data-align=block-start],[data-align=block-end]]:**:[input]:h-auto has-data-[align=inline-start]:**:[input]:ps-2 has-data-[align=inline-end]:**:[input]:pe-2 has-data-[align=block-end]:**:[input]:pt-1.5 has-data-[align=block-start]:**:[input]:pb-1.5 **:[textarea]:min-h-20.5 **:[textarea]:resize-none **:[textarea]:py-[calc(--spacing(3)-1px)] **:[textarea]:max-sm:min-h-23.5 **:[textarea_button]:rounded-[calc(var(--radius-md)-1px)]",
|
|
1156
1158
|
className
|
|
1157
1159
|
),
|
|
1158
1160
|
"data-slot": "input-group",
|
|
@@ -1884,10 +1886,10 @@ function DropdownMenuItem({
|
|
|
1884
1886
|
...props
|
|
1885
1887
|
}) {
|
|
1886
1888
|
const itemClassName = cn(
|
|
1887
|
-
`data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[variant=destructive]:text-destructive
|
|
1889
|
+
`data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[variant=destructive]:text-destructive
|
|
1888
1890
|
data-[variant=destructive]:data-[highlighted]:bg-destructive/10 dark:data-[variant=destructive]:data-[highlighted]:bg-destructive/40
|
|
1889
|
-
data-[variant=destructive]:data-[highlighted]:text-destructive
|
|
1890
|
-
data-[variant=destructive]:*:[svg]:!text-destructive
|
|
1891
|
+
data-[variant=destructive]:data-[highlighted]:text-destructive
|
|
1892
|
+
data-[variant=destructive]:*:[svg]:!text-destructive relative flex cursor-default items-center gap-2
|
|
1891
1893
|
rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none
|
|
1892
1894
|
data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0`,
|
|
1893
1895
|
className
|
|
@@ -3099,6 +3101,31 @@ function AutocompleteTrigger({
|
|
|
3099
3101
|
}
|
|
3100
3102
|
);
|
|
3101
3103
|
}
|
|
3104
|
+
var BUTTON_CLASS = "text-muted-foreground/80 hover:text-muted-foreground bg-card size-10 rounded-none shadow-none first:rounded-s-lg last:rounded-e-lg focus-visible:z-10";
|
|
3105
|
+
function FlowZoomPanel({
|
|
3106
|
+
className,
|
|
3107
|
+
position = "bottom-right",
|
|
3108
|
+
fitViewIcon = /* @__PURE__ */ jsx(RiFocus3Line, { className: "size-5", "aria-hidden": "true" }),
|
|
3109
|
+
fitViewOptions
|
|
3110
|
+
}) {
|
|
3111
|
+
const { zoomIn, zoomOut, fitView } = useReactFlow();
|
|
3112
|
+
const onFitView = useCallback(() => {
|
|
3113
|
+
fitView(fitViewOptions);
|
|
3114
|
+
}, [fitView, fitViewOptions]);
|
|
3115
|
+
return /* @__PURE__ */ jsxs(
|
|
3116
|
+
Panel,
|
|
3117
|
+
{
|
|
3118
|
+
"data-slot": "flow-zoom-panel",
|
|
3119
|
+
position,
|
|
3120
|
+
className: cn("inline-flex -space-x-px rounded-md shadow-xs rtl:space-x-reverse", className),
|
|
3121
|
+
children: [
|
|
3122
|
+
/* @__PURE__ */ jsx(Button, { variant: "outline", size: "icon", className: BUTTON_CLASS, onClick: () => zoomIn(), "aria-label": "Zoom in", children: /* @__PURE__ */ jsx(RiAddLine, { className: "size-5", "aria-hidden": "true" }) }),
|
|
3123
|
+
/* @__PURE__ */ jsx(Button, { variant: "outline", size: "icon", className: BUTTON_CLASS, onClick: () => zoomOut(), "aria-label": "Zoom out", children: /* @__PURE__ */ jsx(RiSubtractLine, { className: "size-5", "aria-hidden": "true" }) }),
|
|
3124
|
+
/* @__PURE__ */ jsx(Button, { variant: "outline", size: "icon", className: BUTTON_CLASS, onClick: onFitView, "aria-label": "Fit view", children: fitViewIcon })
|
|
3125
|
+
]
|
|
3126
|
+
}
|
|
3127
|
+
);
|
|
3128
|
+
}
|
|
3102
3129
|
function Command({
|
|
3103
3130
|
className,
|
|
3104
3131
|
...props
|
|
@@ -3248,7 +3275,7 @@ function ComboboxInput({
|
|
|
3248
3275
|
"div",
|
|
3249
3276
|
{
|
|
3250
3277
|
"aria-hidden": "true",
|
|
3251
|
-
className: "[&_svg]:-mx-0.5 pointer-events-none absolute inset-y-0 start-px z-10 flex items-center ps-[calc(--spacing(3)-1px)]
|
|
3278
|
+
className: "[&_svg]:-mx-0.5 pointer-events-none absolute inset-y-0 start-px z-10 flex items-center ps-[calc(--spacing(3)-1px)] has-[+[data-size=sm]]:ps-[calc(--spacing(2.5)-1px)] [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:opacity-80",
|
|
3252
3279
|
"data-slot": "combobox-start-addon",
|
|
3253
3280
|
children: startAddon
|
|
3254
3281
|
}
|
|
@@ -7355,6 +7382,481 @@ var toast5 = {
|
|
|
7355
7382
|
warning: showWarningToast
|
|
7356
7383
|
};
|
|
7357
7384
|
|
|
7358
|
-
|
|
7385
|
+
// src/components/org-chart/layout.ts
|
|
7386
|
+
var NODE_WIDTH = 260;
|
|
7387
|
+
var NODE_HEIGHT = 100;
|
|
7388
|
+
var RANK_SEP = 80;
|
|
7389
|
+
var NODE_SEP = 40;
|
|
7390
|
+
var ROOT_KEY = "__root__";
|
|
7391
|
+
function computeLayout(edges) {
|
|
7392
|
+
const edgeById = /* @__PURE__ */ new Map();
|
|
7393
|
+
const childCountMap = /* @__PURE__ */ new Map();
|
|
7394
|
+
const childrenMap = /* @__PURE__ */ new Map();
|
|
7395
|
+
for (const e of edges) {
|
|
7396
|
+
edgeById.set(e.id, e);
|
|
7397
|
+
if (e.parentId) {
|
|
7398
|
+
childCountMap.set(e.parentId, (childCountMap.get(e.parentId) ?? 0) + 1);
|
|
7399
|
+
}
|
|
7400
|
+
const parent = e.parentId ?? ROOT_KEY;
|
|
7401
|
+
const bucket = childrenMap.get(parent);
|
|
7402
|
+
if (bucket) bucket.push(e.id);
|
|
7403
|
+
else childrenMap.set(parent, [e.id]);
|
|
7404
|
+
}
|
|
7405
|
+
for (const children of childrenMap.values()) {
|
|
7406
|
+
children.sort((a, b) => {
|
|
7407
|
+
const nameA = edgeById.get(a)?.displayName?.toLowerCase() ?? "";
|
|
7408
|
+
const nameB = edgeById.get(b)?.displayName?.toLowerCase() ?? "";
|
|
7409
|
+
return nameA.localeCompare(nameB);
|
|
7410
|
+
});
|
|
7411
|
+
}
|
|
7412
|
+
const widthCache = /* @__PURE__ */ new Map();
|
|
7413
|
+
const subtreeWidth = (nodeId) => {
|
|
7414
|
+
if (widthCache.has(nodeId)) return widthCache.get(nodeId);
|
|
7415
|
+
const children = childrenMap.get(nodeId);
|
|
7416
|
+
if (!children || children.length === 0) {
|
|
7417
|
+
widthCache.set(nodeId, NODE_WIDTH);
|
|
7418
|
+
return NODE_WIDTH;
|
|
7419
|
+
}
|
|
7420
|
+
const totalChildWidth = children.reduce((sum, c) => sum + subtreeWidth(c), 0);
|
|
7421
|
+
const gaps = (children.length - 1) * NODE_SEP;
|
|
7422
|
+
const w = Math.max(NODE_WIDTH, totalChildWidth + gaps);
|
|
7423
|
+
widthCache.set(nodeId, w);
|
|
7424
|
+
return w;
|
|
7425
|
+
};
|
|
7426
|
+
const positions = /* @__PURE__ */ new Map();
|
|
7427
|
+
const positionSubtree = (nodeId, centerX, y) => {
|
|
7428
|
+
positions.set(nodeId, { x: centerX, y });
|
|
7429
|
+
const children = childrenMap.get(nodeId);
|
|
7430
|
+
if (!children || children.length === 0) return;
|
|
7431
|
+
const totalWidth = children.reduce((sum, c) => sum + subtreeWidth(c), 0) + (children.length - 1) * NODE_SEP;
|
|
7432
|
+
let currentX = centerX - totalWidth / 2;
|
|
7433
|
+
for (const childId of children) {
|
|
7434
|
+
const childW = subtreeWidth(childId);
|
|
7435
|
+
positionSubtree(childId, currentX + childW / 2, y + NODE_HEIGHT + RANK_SEP);
|
|
7436
|
+
currentX += childW + NODE_SEP;
|
|
7437
|
+
}
|
|
7438
|
+
};
|
|
7439
|
+
const roots = childrenMap.get(ROOT_KEY) ?? [];
|
|
7440
|
+
if (roots.length === 1) {
|
|
7441
|
+
positionSubtree(roots[0], 0, 0);
|
|
7442
|
+
} else {
|
|
7443
|
+
const totalWidth = roots.reduce((sum, r) => sum + subtreeWidth(r), 0) + (roots.length - 1) * NODE_SEP;
|
|
7444
|
+
let currentX = -totalWidth / 2;
|
|
7445
|
+
for (const rootId of roots) {
|
|
7446
|
+
const w = subtreeWidth(rootId);
|
|
7447
|
+
positionSubtree(rootId, currentX + w / 2, 0);
|
|
7448
|
+
currentX += w + NODE_SEP;
|
|
7449
|
+
}
|
|
7450
|
+
}
|
|
7451
|
+
const nodes = edges.map((e) => {
|
|
7452
|
+
const pos = positions.get(e.id);
|
|
7453
|
+
return {
|
|
7454
|
+
id: e.id,
|
|
7455
|
+
type: "orgChartNode",
|
|
7456
|
+
width: NODE_WIDTH,
|
|
7457
|
+
height: NODE_HEIGHT,
|
|
7458
|
+
position: {
|
|
7459
|
+
x: pos.x - NODE_WIDTH / 2,
|
|
7460
|
+
y: pos.y
|
|
7461
|
+
},
|
|
7462
|
+
data: {
|
|
7463
|
+
id: e.id,
|
|
7464
|
+
displayName: e.displayName,
|
|
7465
|
+
avatarUrl: e.avatarUrl,
|
|
7466
|
+
positionTitle: e.positionTitle,
|
|
7467
|
+
parentId: e.parentId,
|
|
7468
|
+
childCount: childCountMap.get(e.id) ?? 0,
|
|
7469
|
+
isRoot: !e.parentId
|
|
7470
|
+
}
|
|
7471
|
+
};
|
|
7472
|
+
});
|
|
7473
|
+
const flowEdges = edges.filter((e) => e.parentId).map((e) => ({
|
|
7474
|
+
id: `edge-${e.parentId}-${e.id}`,
|
|
7475
|
+
source: e.parentId,
|
|
7476
|
+
target: e.id,
|
|
7477
|
+
type: "orgChartEdge"
|
|
7478
|
+
}));
|
|
7479
|
+
return { nodes, edges: flowEdges };
|
|
7480
|
+
}
|
|
7481
|
+
var NodeActionsContext = createContext(null);
|
|
7482
|
+
var OrgChartContext = createContext(null);
|
|
7483
|
+
function OrgChartProvider({ children, editable }) {
|
|
7484
|
+
const [selectedNodeId, setSelectedNodeId] = useState(null);
|
|
7485
|
+
const [draggedNodeId, setDraggedNodeId] = useState(null);
|
|
7486
|
+
const [dropTargetNodeId, setDropTargetNodeId] = useState(null);
|
|
7487
|
+
const selectNode = useCallback((nodeId) => setSelectedNodeId(nodeId), []);
|
|
7488
|
+
const clearSelection = useCallback(() => setSelectedNodeId(null), []);
|
|
7489
|
+
const value = useMemo(
|
|
7490
|
+
() => ({
|
|
7491
|
+
selectedNodeId,
|
|
7492
|
+
selectNode,
|
|
7493
|
+
clearSelection,
|
|
7494
|
+
editable,
|
|
7495
|
+
draggedNodeId,
|
|
7496
|
+
setDraggedNodeId,
|
|
7497
|
+
dropTargetNodeId,
|
|
7498
|
+
setDropTargetNodeId
|
|
7499
|
+
}),
|
|
7500
|
+
[selectedNodeId, selectNode, clearSelection, editable, draggedNodeId, dropTargetNodeId]
|
|
7501
|
+
);
|
|
7502
|
+
return /* @__PURE__ */ jsx(OrgChartContext.Provider, { value, children });
|
|
7503
|
+
}
|
|
7504
|
+
function useOrgChartContext() {
|
|
7505
|
+
const ctx = useContext(OrgChartContext);
|
|
7506
|
+
if (!ctx) throw new Error("useOrgChartContext must be used within OrgChartProvider");
|
|
7507
|
+
return ctx;
|
|
7508
|
+
}
|
|
7509
|
+
function NodeActionsProvider({
|
|
7510
|
+
children,
|
|
7511
|
+
onEditNode,
|
|
7512
|
+
onRemoveNode
|
|
7513
|
+
}) {
|
|
7514
|
+
const value = useMemo(() => ({ onEditNode, onRemoveNode }), [onEditNode, onRemoveNode]);
|
|
7515
|
+
return /* @__PURE__ */ jsx(NodeActionsContext.Provider, { value, children });
|
|
7516
|
+
}
|
|
7517
|
+
function useNodeActions() {
|
|
7518
|
+
const ctx = useContext(NodeActionsContext);
|
|
7519
|
+
if (!ctx) throw new Error("useNodeActions must be used within NodeActionsProvider");
|
|
7520
|
+
return ctx;
|
|
7521
|
+
}
|
|
7522
|
+
function OrgChartEdge({
|
|
7523
|
+
sourceX,
|
|
7524
|
+
sourceY,
|
|
7525
|
+
targetX,
|
|
7526
|
+
targetY,
|
|
7527
|
+
sourcePosition,
|
|
7528
|
+
targetPosition,
|
|
7529
|
+
style = {}
|
|
7530
|
+
}) {
|
|
7531
|
+
const [edgePath] = getSmoothStepPath({
|
|
7532
|
+
sourceX,
|
|
7533
|
+
sourceY,
|
|
7534
|
+
sourcePosition,
|
|
7535
|
+
targetX,
|
|
7536
|
+
targetY,
|
|
7537
|
+
targetPosition,
|
|
7538
|
+
borderRadius: 12
|
|
7539
|
+
});
|
|
7540
|
+
return /* @__PURE__ */ jsx(BaseEdge, { path: edgePath, style });
|
|
7541
|
+
}
|
|
7542
|
+
function OrgChartEmpty({ editable, onAddRoot }) {
|
|
7543
|
+
return /* @__PURE__ */ jsxs("div", { className: "bg-card border-border/60 flex flex-col items-center justify-center rounded-xl border py-16", children: [
|
|
7544
|
+
/* @__PURE__ */ jsx("div", { className: "bg-muted mb-4 flex size-14 items-center justify-center rounded-2xl", children: /* @__PURE__ */ jsx(Network, { className: "text-muted-foreground size-7" }) }),
|
|
7545
|
+
/* @__PURE__ */ jsx("h3", { className: "text-foreground text-base font-semibold", children: "No Org Chart Yet" }),
|
|
7546
|
+
/* @__PURE__ */ jsx("p", { className: "text-muted-foreground mt-1.5 max-w-sm text-center text-sm", children: "Build your organization hierarchy by adding the first person." }),
|
|
7547
|
+
editable && /* @__PURE__ */ jsxs(Button, { className: "mt-5 gap-1.5", onClick: onAddRoot, children: [
|
|
7548
|
+
/* @__PURE__ */ jsx(UserPlus, { className: "size-3.5" }),
|
|
7549
|
+
"Add First Member"
|
|
7550
|
+
] })
|
|
7551
|
+
] });
|
|
7552
|
+
}
|
|
7553
|
+
|
|
7554
|
+
// src/components/org-chart/org-chart-utils.ts
|
|
7555
|
+
function getInitials(name) {
|
|
7556
|
+
if (!name) return "--";
|
|
7557
|
+
const parts = name.trim().split(/\s+/).filter(Boolean);
|
|
7558
|
+
if (parts.length === 0) return "--";
|
|
7559
|
+
if (parts.length === 1) return parts[0].slice(0, 2).toUpperCase();
|
|
7560
|
+
return (parts[0][0] + parts[1][0]).toUpperCase();
|
|
7561
|
+
}
|
|
7562
|
+
function OrgChartNodeComponent({ id, data }) {
|
|
7563
|
+
const { selectedNodeId, dropTargetNodeId, editable } = useOrgChartContext();
|
|
7564
|
+
const { onEditNode, onRemoveNode } = useNodeActions();
|
|
7565
|
+
const isSelected = selectedNodeId === id;
|
|
7566
|
+
const isDropTarget = dropTargetNodeId === id;
|
|
7567
|
+
const [isHovered, setIsHovered] = useState(false);
|
|
7568
|
+
const [isMenuOpen, setIsMenuOpen] = useState(false);
|
|
7569
|
+
return /* @__PURE__ */ jsxs(
|
|
7570
|
+
"div",
|
|
7571
|
+
{
|
|
7572
|
+
style: { width: NODE_WIDTH },
|
|
7573
|
+
className: cn(
|
|
7574
|
+
"bg-card dark:bg-muted relative rounded-xl border shadow-sm transition-all",
|
|
7575
|
+
"border-border/60",
|
|
7576
|
+
isSelected && "ring-primary ring-2 ring-offset-2 dark:ring-offset-zinc-900",
|
|
7577
|
+
isDropTarget && "ring-primary/50 border-primary scale-105 ring-2"
|
|
7578
|
+
),
|
|
7579
|
+
onMouseEnter: () => setIsHovered(true),
|
|
7580
|
+
onMouseLeave: () => setIsHovered(false),
|
|
7581
|
+
children: [
|
|
7582
|
+
!data.isRoot && /* @__PURE__ */ jsx(Handle, { type: "target", position: Position.Top, className: "!bg-border !size-2 !rounded-full !border-0" }),
|
|
7583
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 px-4 py-3", children: [
|
|
7584
|
+
/* @__PURE__ */ jsxs(Avatar, { className: "size-10 shrink-0", children: [
|
|
7585
|
+
data.avatarUrl && /* @__PURE__ */ jsx(AvatarImage, { src: data.avatarUrl, alt: data.displayName ?? "" }),
|
|
7586
|
+
/* @__PURE__ */ jsx(AvatarFallback, { className: "bg-primary/10 text-primary text-xs font-medium", children: getInitials(data.displayName) })
|
|
7587
|
+
] }),
|
|
7588
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
7589
|
+
/* @__PURE__ */ jsx("p", { className: "text-foreground truncate text-sm font-semibold", children: data.displayName ?? "Unknown" }),
|
|
7590
|
+
data.positionTitle && /* @__PURE__ */ jsx("p", { className: "text-muted-foreground truncate text-xs", children: data.positionTitle })
|
|
7591
|
+
] }),
|
|
7592
|
+
editable && (isHovered || isMenuOpen) ? /* @__PURE__ */ jsx("div", { className: "nodrag nopan shrink-0", children: /* @__PURE__ */ jsxs(DropdownMenu, { open: isMenuOpen, onOpenChange: setIsMenuOpen, children: [
|
|
7593
|
+
/* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
7594
|
+
Button,
|
|
7595
|
+
{
|
|
7596
|
+
variant: "ghost",
|
|
7597
|
+
size: "icon",
|
|
7598
|
+
className: "size-7 rounded-full",
|
|
7599
|
+
onClick: (e) => e.stopPropagation(),
|
|
7600
|
+
children: /* @__PURE__ */ jsx(Ellipsis, { className: "size-4" })
|
|
7601
|
+
}
|
|
7602
|
+
) }),
|
|
7603
|
+
/* @__PURE__ */ jsxs(DropdownMenuContent, { align: "start", side: "right", className: "translate-x-1 -translate-y-3.5", children: [
|
|
7604
|
+
/* @__PURE__ */ jsxs(
|
|
7605
|
+
DropdownMenuItem,
|
|
7606
|
+
{
|
|
7607
|
+
onClick: (e) => {
|
|
7608
|
+
e.stopPropagation();
|
|
7609
|
+
setIsMenuOpen(false);
|
|
7610
|
+
onEditNode(data);
|
|
7611
|
+
},
|
|
7612
|
+
children: [
|
|
7613
|
+
/* @__PURE__ */ jsx(Pencil, { className: "mr-2 size-3.5" }),
|
|
7614
|
+
"Edit Position"
|
|
7615
|
+
]
|
|
7616
|
+
}
|
|
7617
|
+
),
|
|
7618
|
+
/* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
|
|
7619
|
+
/* @__PURE__ */ jsxs(
|
|
7620
|
+
DropdownMenuItem,
|
|
7621
|
+
{
|
|
7622
|
+
className: "text-destructive hover:bg-destructive/10 focus:bg-destructive/10 hover:text-destructive\n focus:text-destructive data-[highlighted]:bg-destructive/10 data-[highlighted]:text-destructive",
|
|
7623
|
+
onClick: (e) => {
|
|
7624
|
+
e.stopPropagation();
|
|
7625
|
+
setIsMenuOpen(false);
|
|
7626
|
+
onRemoveNode(data);
|
|
7627
|
+
},
|
|
7628
|
+
children: [
|
|
7629
|
+
/* @__PURE__ */ jsx(Trash2, { className: "mr-2 size-3.5" }),
|
|
7630
|
+
"Remove from Chart"
|
|
7631
|
+
]
|
|
7632
|
+
}
|
|
7633
|
+
)
|
|
7634
|
+
] })
|
|
7635
|
+
] }) }) : data.childCount > 0 && /* @__PURE__ */ jsx(Badge, { variant: "secondary", className: "shrink-0 text-[10px]", children: data.childCount })
|
|
7636
|
+
] }),
|
|
7637
|
+
/* @__PURE__ */ jsx(Handle, { type: "source", position: Position.Bottom, className: "!bg-border !size-2 !rounded-full !border-0" })
|
|
7638
|
+
]
|
|
7639
|
+
}
|
|
7640
|
+
);
|
|
7641
|
+
}
|
|
7642
|
+
var OrgChartNodeMemo = memo(OrgChartNodeComponent);
|
|
7643
|
+
var FIT_VIEW_OPTIONS = { padding: 0.12 };
|
|
7644
|
+
function getDescendantIds(nodeId, nodes) {
|
|
7645
|
+
const descendants = /* @__PURE__ */ new Set();
|
|
7646
|
+
const queue = [nodeId];
|
|
7647
|
+
while (queue.length > 0) {
|
|
7648
|
+
const current = queue.pop();
|
|
7649
|
+
for (const n of nodes) {
|
|
7650
|
+
if (n.data.parentId === current && !descendants.has(n.id)) {
|
|
7651
|
+
descendants.add(n.id);
|
|
7652
|
+
queue.push(n.id);
|
|
7653
|
+
}
|
|
7654
|
+
}
|
|
7655
|
+
}
|
|
7656
|
+
return descendants;
|
|
7657
|
+
}
|
|
7658
|
+
function mergeWithMeasured(prev, layoutNodes) {
|
|
7659
|
+
const prevMap = new Map(prev.map((n) => [n.id, n]));
|
|
7660
|
+
return layoutNodes.map((n) => {
|
|
7661
|
+
const existing = prevMap.get(n.id);
|
|
7662
|
+
if (!existing) return n;
|
|
7663
|
+
return existing.data.isRoot !== n.data.isRoot ? n : { ...n, measured: existing.measured };
|
|
7664
|
+
});
|
|
7665
|
+
}
|
|
7666
|
+
function OrgChartInner({
|
|
7667
|
+
className,
|
|
7668
|
+
edges: controlledEdges,
|
|
7669
|
+
defaultEdges,
|
|
7670
|
+
isLoading = false,
|
|
7671
|
+
editable = true,
|
|
7672
|
+
onReparent,
|
|
7673
|
+
onAddToChart,
|
|
7674
|
+
onEditNode,
|
|
7675
|
+
onRemoveNode,
|
|
7676
|
+
onReparentSuccess,
|
|
7677
|
+
onReparentError
|
|
7678
|
+
}) {
|
|
7679
|
+
const isControlled = controlledEdges !== void 0;
|
|
7680
|
+
const {
|
|
7681
|
+
selectNode,
|
|
7682
|
+
clearSelection,
|
|
7683
|
+
setDraggedNodeId,
|
|
7684
|
+
setDropTargetNodeId
|
|
7685
|
+
} = useOrgChartContext();
|
|
7686
|
+
const [internalEdges, setInternalEdges] = useState(defaultEdges ?? []);
|
|
7687
|
+
const defaultEdgesHash = useMemo(
|
|
7688
|
+
() => defaultEdges?.map((e) => `${e.id}:${e.parentId}:${e.positionTitle ?? ""}:${e.displayName ?? ""}`).join(",") ?? "",
|
|
7689
|
+
[defaultEdges]
|
|
7690
|
+
);
|
|
7691
|
+
useEffect(() => {
|
|
7692
|
+
if (!isControlled && defaultEdges) {
|
|
7693
|
+
setInternalEdges(defaultEdges);
|
|
7694
|
+
}
|
|
7695
|
+
}, [defaultEdgesHash]);
|
|
7696
|
+
const apiEdges = controlledEdges ?? internalEdges;
|
|
7697
|
+
const layout = useMemo(() => apiEdges.length > 0 ? computeLayout(apiEdges) : null, [apiEdges]);
|
|
7698
|
+
const layoutNodes = layout?.nodes ?? [];
|
|
7699
|
+
const layoutEdges = layout?.edges ?? [];
|
|
7700
|
+
const isEmpty = apiEdges.length === 0 && !isLoading;
|
|
7701
|
+
const { fitView, getIntersectingNodes } = useReactFlow();
|
|
7702
|
+
const [nodes, setNodes, onNodesChange] = useNodesState([]);
|
|
7703
|
+
const [rfEdges, setRfEdges, onEdgesChange] = useEdgesState([]);
|
|
7704
|
+
const nodesHash = useMemo(
|
|
7705
|
+
() => layoutNodes.map((n) => `${n.id}:${n.data.parentId ?? ""}:${n.data.positionTitle ?? ""}:${n.data.displayName ?? ""}`).join(","),
|
|
7706
|
+
[layoutNodes]
|
|
7707
|
+
);
|
|
7708
|
+
const edgesHash = useMemo(() => layoutEdges.map((e) => `${e.id}:${e.source}:${e.target}`).join(","), [layoutEdges]);
|
|
7709
|
+
const fitViewRef = useRef(fitView);
|
|
7710
|
+
fitViewRef.current = fitView;
|
|
7711
|
+
useEffect(() => {
|
|
7712
|
+
setNodes((prev) => mergeWithMeasured(prev, layoutNodes));
|
|
7713
|
+
setRfEdges(layoutEdges);
|
|
7714
|
+
const raf = requestAnimationFrame(() => fitViewRef.current(FIT_VIEW_OPTIONS));
|
|
7715
|
+
return () => cancelAnimationFrame(raf);
|
|
7716
|
+
}, [nodesHash, edgesHash]);
|
|
7717
|
+
const draggedNodeRef = useRef(null);
|
|
7718
|
+
const dropTargetIdRef = useRef(null);
|
|
7719
|
+
const nodeTypes = useMemo(() => ({ orgChartNode: OrgChartNodeMemo }), []);
|
|
7720
|
+
const edgeTypes = useMemo(() => ({ orgChartEdge: OrgChartEdge }), []);
|
|
7721
|
+
const onNodeDragStart = useCallback(
|
|
7722
|
+
(_, node) => {
|
|
7723
|
+
if (!editable) return;
|
|
7724
|
+
draggedNodeRef.current = node.id;
|
|
7725
|
+
setDraggedNodeId(node.id);
|
|
7726
|
+
},
|
|
7727
|
+
[editable, setDraggedNodeId]
|
|
7728
|
+
);
|
|
7729
|
+
const onNodeDrag = useCallback(
|
|
7730
|
+
(_, node) => {
|
|
7731
|
+
if (!editable || !draggedNodeRef.current) return;
|
|
7732
|
+
const intersecting = getIntersectingNodes(node);
|
|
7733
|
+
const target = intersecting.find((n) => n.id !== node.id);
|
|
7734
|
+
const targetId = target?.id ?? null;
|
|
7735
|
+
if (targetId === dropTargetIdRef.current) return;
|
|
7736
|
+
dropTargetIdRef.current = targetId;
|
|
7737
|
+
setDropTargetNodeId(targetId);
|
|
7738
|
+
},
|
|
7739
|
+
[editable, getIntersectingNodes, setDropTargetNodeId]
|
|
7740
|
+
);
|
|
7741
|
+
const applyOptimisticReparent = useCallback((childId, newParentId) => {
|
|
7742
|
+
setInternalEdges(
|
|
7743
|
+
(prev) => prev.map((e) => e.id === childId ? { ...e, parentId: newParentId } : e)
|
|
7744
|
+
);
|
|
7745
|
+
}, []);
|
|
7746
|
+
const snapBack = useCallback(() => {
|
|
7747
|
+
setNodes((prev) => mergeWithMeasured(prev, layoutNodes));
|
|
7748
|
+
}, [layoutNodes, setNodes]);
|
|
7749
|
+
const onNodeDragStop = useCallback(
|
|
7750
|
+
async (_, _node) => {
|
|
7751
|
+
if (!editable || !draggedNodeRef.current) return;
|
|
7752
|
+
const childId = draggedNodeRef.current;
|
|
7753
|
+
const newParentId = dropTargetIdRef.current;
|
|
7754
|
+
draggedNodeRef.current = null;
|
|
7755
|
+
dropTargetIdRef.current = null;
|
|
7756
|
+
setDraggedNodeId(null);
|
|
7757
|
+
setDropTargetNodeId(null);
|
|
7758
|
+
if (!newParentId || newParentId === childId) {
|
|
7759
|
+
snapBack();
|
|
7760
|
+
return;
|
|
7761
|
+
}
|
|
7762
|
+
if (getDescendantIds(childId, layoutNodes).has(newParentId)) {
|
|
7763
|
+
onReparentError?.("Cannot create circular reporting chain");
|
|
7764
|
+
snapBack();
|
|
7765
|
+
return;
|
|
7766
|
+
}
|
|
7767
|
+
const draggedData = layoutNodes.find((n) => n.id === childId)?.data;
|
|
7768
|
+
if (!draggedData || newParentId === draggedData.parentId) {
|
|
7769
|
+
snapBack();
|
|
7770
|
+
return;
|
|
7771
|
+
}
|
|
7772
|
+
const targetName = layoutNodes.find((n) => n.id === newParentId)?.data.displayName;
|
|
7773
|
+
const preserve = { positionTitle: draggedData.positionTitle };
|
|
7774
|
+
if (!isControlled) {
|
|
7775
|
+
const snapshotEdges = internalEdges;
|
|
7776
|
+
applyOptimisticReparent(childId, newParentId);
|
|
7777
|
+
try {
|
|
7778
|
+
await onReparent?.(childId, newParentId, preserve);
|
|
7779
|
+
onReparentSuccess?.(draggedData.displayName ?? "Member", targetName ?? "new manager");
|
|
7780
|
+
} catch (err) {
|
|
7781
|
+
console.error("[OrgChart] reparent failed", err);
|
|
7782
|
+
setInternalEdges(snapshotEdges);
|
|
7783
|
+
onReparentError?.("Failed to update reporting line");
|
|
7784
|
+
}
|
|
7785
|
+
} else {
|
|
7786
|
+
snapBack();
|
|
7787
|
+
try {
|
|
7788
|
+
await onReparent?.(childId, newParentId, preserve);
|
|
7789
|
+
onReparentSuccess?.(draggedData.displayName ?? "Member", targetName ?? "new manager");
|
|
7790
|
+
} catch (err) {
|
|
7791
|
+
console.error("[OrgChart] reparent failed", err);
|
|
7792
|
+
onReparentError?.("Failed to update reporting line");
|
|
7793
|
+
}
|
|
7794
|
+
}
|
|
7795
|
+
},
|
|
7796
|
+
[editable, isControlled, internalEdges, layoutNodes, onReparent, onReparentSuccess, onReparentError, applyOptimisticReparent, snapBack, setDraggedNodeId, setDropTargetNodeId]
|
|
7797
|
+
);
|
|
7798
|
+
const onNodeClick = useCallback((_, node) => selectNode(node.id), [selectNode]);
|
|
7799
|
+
const onPaneClick = useCallback(() => clearSelection(), [clearSelection]);
|
|
7800
|
+
const handleEditNode = useCallback(
|
|
7801
|
+
(nodeData) => onEditNode?.(nodeData),
|
|
7802
|
+
[onEditNode]
|
|
7803
|
+
);
|
|
7804
|
+
const handleRemoveNode = useCallback(
|
|
7805
|
+
(nodeData) => onRemoveNode?.(nodeData),
|
|
7806
|
+
[onRemoveNode]
|
|
7807
|
+
);
|
|
7808
|
+
if (isLoading) {
|
|
7809
|
+
return /* @__PURE__ */ jsx("div", { className: "bg-card border-border/60 flex items-center justify-center rounded-xl border p-16", children: /* @__PURE__ */ jsx(Loader2, { className: "text-muted-foreground size-6 animate-spin" }) });
|
|
7810
|
+
}
|
|
7811
|
+
if (isEmpty) {
|
|
7812
|
+
return /* @__PURE__ */ jsx(OrgChartEmpty, { editable, onAddRoot: onAddToChart ?? (() => {
|
|
7813
|
+
}) });
|
|
7814
|
+
}
|
|
7815
|
+
return /* @__PURE__ */ jsx(NodeActionsProvider, { onEditNode: handleEditNode, onRemoveNode: handleRemoveNode, children: /* @__PURE__ */ jsx("div", { className: cn("border-border/60 h-[600px] overflow-hidden rounded-xl border", className), children: /* @__PURE__ */ jsxs(
|
|
7816
|
+
ReactFlow,
|
|
7817
|
+
{
|
|
7818
|
+
nodes,
|
|
7819
|
+
edges: rfEdges,
|
|
7820
|
+
onNodesChange,
|
|
7821
|
+
onEdgesChange,
|
|
7822
|
+
onNodeClick,
|
|
7823
|
+
proOptions: { hideAttribution: true },
|
|
7824
|
+
onPaneClick,
|
|
7825
|
+
onNodeDragStart,
|
|
7826
|
+
onNodeDrag,
|
|
7827
|
+
onNodeDragStop,
|
|
7828
|
+
nodeTypes,
|
|
7829
|
+
edgeTypes,
|
|
7830
|
+
fitView: true,
|
|
7831
|
+
fitViewOptions: FIT_VIEW_OPTIONS,
|
|
7832
|
+
minZoom: 0.3,
|
|
7833
|
+
maxZoom: 1.5,
|
|
7834
|
+
nodesDraggable: editable,
|
|
7835
|
+
nodesConnectable: false,
|
|
7836
|
+
elementsSelectable: true,
|
|
7837
|
+
selectNodesOnDrag: false,
|
|
7838
|
+
panOnDrag: true,
|
|
7839
|
+
zoomOnScroll: true,
|
|
7840
|
+
preventScrolling: true,
|
|
7841
|
+
style: {
|
|
7842
|
+
"--xy-background-pattern-dots-color-default": "var(--color-border)",
|
|
7843
|
+
"--xy-edge-stroke-width-default": 2,
|
|
7844
|
+
"--xy-edge-stroke-default": "var(--color-border)",
|
|
7845
|
+
"--xy-edge-stroke-selected-default": "var(--color-foreground)",
|
|
7846
|
+
"--xy-attribution-background-color-default": "transparent"
|
|
7847
|
+
},
|
|
7848
|
+
attributionPosition: "bottom-left",
|
|
7849
|
+
children: [
|
|
7850
|
+
/* @__PURE__ */ jsx(Background, { variant: BackgroundVariant.Dots, gap: 20, size: 2 }),
|
|
7851
|
+
/* @__PURE__ */ jsx(FlowZoomPanel, { fitViewOptions: FIT_VIEW_OPTIONS })
|
|
7852
|
+
]
|
|
7853
|
+
}
|
|
7854
|
+
) }) });
|
|
7855
|
+
}
|
|
7856
|
+
function OrgChart(props) {
|
|
7857
|
+
return /* @__PURE__ */ jsx(ReactFlowProvider, { children: /* @__PURE__ */ jsx(OrgChartProvider, { editable: props.editable ?? true, children: /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsx(OrgChartInner, { ...props }) }) }) });
|
|
7858
|
+
}
|
|
7859
|
+
|
|
7860
|
+
export { Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, Autocomplete, AutocompleteEmpty, AutocompleteInput, AutocompleteItem, AutocompletePopup, AutocompleteSeparator, Avatar, AvatarFallback, AvatarImage, Badge, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Calendar, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardStackProvider, CardStackViewport, CardTitle, Checkbox, CheckboxGroup, Collapsible, CollapsiblePanel as CollapsibleContent, CollapsibleTrigger, Combobox, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxInput, ComboboxItem, ComboboxList, ComboboxSeparator, ComboboxTrigger, Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, DEFAULT_ANIMATION_CONFIG, DeferredCardContent, Dialog, DialogBackdrop, DialogClose, DialogPopup as DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogPortal, DialogTitle, DialogTrigger, Dock, DockIcon, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Field, FieldRow, FlickeringGrid, FlowZoomPanel, Form, FormControl, FormControl2 as FormControlComponent, FormDescription, FormField, FormItem, FormLabel, FormMessage, Input, InputGroup, InputGroupAddon, InputGroupInput, InputGroupText, InputGroupTextarea, JsonEditor, JsonInput, Label, ModalPortalScope, MotionGrid, MultiSelect, OrgChart, PORTAL_ROOT_ID, PageHeader, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, PortalRoot, Progress, ProgressiveBlur, ProgressiveBlurScrollContainer, Radio, RadioGroup, Radio as RadioGroupItem, RangeCalendar, RecordPicker, ResizableHandle, ResizablePanel, ResizablePanelGroup, ResponsiveDiagram, ScrollArea, ScrollBar, Select, SelectPopup as SelectContent, SelectFieldItem, SelectGroup, SelectGroupLabel, SelectItem, SelectGroupLabel as SelectLabel, SelectPopup, SelectRichItem, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarSeparator, SidebarTrigger, Skeleton, Slot, Slottable, StackBackdrop, StackCard, StackHeader, StackHeaderSlot, Stepper, StepperDescription, StepperIndicator, StepperItem, StepperSeparator, StepperTitle, StepperTrigger, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Tags, TagsContent, TagsEmpty, TagsGroup, TagsInput, TagsItem, TagsList, TagsTrigger, TagsValue, Textarea, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, UnlinkButton, alertVariants, backdropVariants, badgeVariants, buttonVariants, calculateResponsiveOffset, cardVariants, cn, composeRefs, createCardVariants, createOffsetTransition, createReducedMotionVariants, dockVariants, durations, easings, getCardOffset, getCardZIndex, getCascadeOffset, getResponsiveCardOffset, getSideBySideOffset, getVisibleCardIndices, isCardVisible, mergeProps, normalizeWidth, parseWidthToPixels, peekDragSpring, peekHoverSpring, peekSlideSpring, reducedMotionBackdropVariants, showErrorToast, showInfoToast, showSuccessToast, showWarningToast, snapBackSpring, springs, swipeDismissTransition, toast5 as toast, transitions, useCardIndex, useCardInjectedProps, useCardReady, useCardStack, useControllableState, useFloatingOverlayPortalProps, useFormField, useInModalOverlay, useIsMobile2 as useIsMobile, useIsTopCard, usePeekGestures, usePortalContainer, usePortalContext, useRootPortalContainer, useSidebar, useStackCards, useStackContext, useStackGestures, useStackLayoutMode, useStackResponsive, validateJson, variants };
|
|
7359
7861
|
//# sourceMappingURL=index.js.map
|
|
7360
7862
|
//# sourceMappingURL=index.js.map
|