@onesaz/ui 0.3.16 → 0.3.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +38 -1
- package/dist/index.js +244 -74
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5593,6 +5593,7 @@ var ListDivider = React36.forwardRef(
|
|
|
5593
5593
|
ListDivider.displayName = "ListDivider";
|
|
5594
5594
|
|
|
5595
5595
|
// src/components/charts.tsx
|
|
5596
|
+
import * as React37 from "react";
|
|
5596
5597
|
import {
|
|
5597
5598
|
BarChart as RechartsBarChart,
|
|
5598
5599
|
Bar,
|
|
@@ -5660,7 +5661,7 @@ var BarChart = ({
|
|
|
5660
5661
|
name: keyConfig.name || keyConfig.dataKey,
|
|
5661
5662
|
radius: barProps.radius,
|
|
5662
5663
|
maxBarSize: barProps.maxBarSize,
|
|
5663
|
-
minPointSize: barProps.minPointSize,
|
|
5664
|
+
...barProps.minPointSize !== void 0 && { minPointSize: barProps.minPointSize },
|
|
5664
5665
|
children: labelList && /* @__PURE__ */ jsx37(
|
|
5665
5666
|
LabelList,
|
|
5666
5667
|
{
|
|
@@ -5680,7 +5681,7 @@ var BarChart = ({
|
|
|
5680
5681
|
name: name || dataKey,
|
|
5681
5682
|
radius: barProps.radius,
|
|
5682
5683
|
maxBarSize: barProps.maxBarSize,
|
|
5683
|
-
minPointSize: barProps.minPointSize,
|
|
5684
|
+
...barProps.minPointSize !== void 0 && { minPointSize: barProps.minPointSize },
|
|
5684
5685
|
children: [
|
|
5685
5686
|
labelList && /* @__PURE__ */ jsx37(
|
|
5686
5687
|
LabelList,
|
|
@@ -6554,11 +6555,179 @@ var MultiProgressDonut = ({
|
|
|
6554
6555
|
] }, index);
|
|
6555
6556
|
}) });
|
|
6556
6557
|
};
|
|
6558
|
+
var simulatePacking = (data, width, height, minRadius, maxRadius) => {
|
|
6559
|
+
if (data.length === 0) return [];
|
|
6560
|
+
const values = data.map((d) => d.value);
|
|
6561
|
+
const minValue = Math.min(...values);
|
|
6562
|
+
const maxValue = Math.max(...values);
|
|
6563
|
+
const valueRange = maxValue - minValue || 1;
|
|
6564
|
+
const nodes = data.map((item) => {
|
|
6565
|
+
const normalizedValue = (item.value - minValue) / valueRange;
|
|
6566
|
+
const radius = minRadius + normalizedValue * (maxRadius - minRadius);
|
|
6567
|
+
return {
|
|
6568
|
+
x: width / 2 + (Math.random() - 0.5) * width * 0.3,
|
|
6569
|
+
y: height / 2 + (Math.random() - 0.5) * height * 0.3,
|
|
6570
|
+
radius,
|
|
6571
|
+
data: item,
|
|
6572
|
+
vx: 0,
|
|
6573
|
+
vy: 0
|
|
6574
|
+
};
|
|
6575
|
+
});
|
|
6576
|
+
const centerX = width / 2;
|
|
6577
|
+
const centerY = height / 2;
|
|
6578
|
+
const iterations = 100;
|
|
6579
|
+
for (let i = 0; i < iterations; i++) {
|
|
6580
|
+
for (const node of nodes) {
|
|
6581
|
+
node.vx += (centerX - node.x) * 0.01;
|
|
6582
|
+
node.vy += (centerY - node.y) * 0.01;
|
|
6583
|
+
for (const other of nodes) {
|
|
6584
|
+
if (node === other) continue;
|
|
6585
|
+
const dx = node.x - other.x;
|
|
6586
|
+
const dy = node.y - other.y;
|
|
6587
|
+
const distance = Math.sqrt(dx * dx + dy * dy);
|
|
6588
|
+
const minDist = node.radius + other.radius + 2;
|
|
6589
|
+
if (distance < minDist && distance > 0) {
|
|
6590
|
+
const force = (minDist - distance) / distance * 0.5;
|
|
6591
|
+
node.vx += dx * force;
|
|
6592
|
+
node.vy += dy * force;
|
|
6593
|
+
}
|
|
6594
|
+
}
|
|
6595
|
+
}
|
|
6596
|
+
for (const node of nodes) {
|
|
6597
|
+
node.x += node.vx;
|
|
6598
|
+
node.y += node.vy;
|
|
6599
|
+
node.vx *= 0.8;
|
|
6600
|
+
node.vy *= 0.8;
|
|
6601
|
+
node.x = Math.max(node.radius, Math.min(width - node.radius, node.x));
|
|
6602
|
+
node.y = Math.max(node.radius, Math.min(height - node.radius, node.y));
|
|
6603
|
+
}
|
|
6604
|
+
}
|
|
6605
|
+
return nodes.map(({ x, y, radius, data: data2 }) => ({ x, y, radius, data: data2 }));
|
|
6606
|
+
};
|
|
6607
|
+
var PackedBubbleChart = ({
|
|
6608
|
+
data,
|
|
6609
|
+
title,
|
|
6610
|
+
height = 300,
|
|
6611
|
+
minSize = 30,
|
|
6612
|
+
maxSize = 70,
|
|
6613
|
+
defaultColor = "#3BBDED",
|
|
6614
|
+
colorByValue,
|
|
6615
|
+
showLabels = true,
|
|
6616
|
+
showValues = false,
|
|
6617
|
+
onBubbleClick,
|
|
6618
|
+
titleStyle,
|
|
6619
|
+
className
|
|
6620
|
+
}) => {
|
|
6621
|
+
const containerRef = React37.useRef(null);
|
|
6622
|
+
const [dimensions, setDimensions] = React37.useState({ width: 400, height: 300 });
|
|
6623
|
+
const [bubbles, setBubbles] = React37.useState([]);
|
|
6624
|
+
React37.useEffect(() => {
|
|
6625
|
+
const updateDimensions = () => {
|
|
6626
|
+
if (containerRef.current) {
|
|
6627
|
+
const rect = containerRef.current.getBoundingClientRect();
|
|
6628
|
+
setDimensions({
|
|
6629
|
+
width: rect.width || 400,
|
|
6630
|
+
height: typeof height === "number" ? height : 300
|
|
6631
|
+
});
|
|
6632
|
+
}
|
|
6633
|
+
};
|
|
6634
|
+
updateDimensions();
|
|
6635
|
+
window.addEventListener("resize", updateDimensions);
|
|
6636
|
+
return () => window.removeEventListener("resize", updateDimensions);
|
|
6637
|
+
}, [height]);
|
|
6638
|
+
React37.useEffect(() => {
|
|
6639
|
+
if (data.length === 0) {
|
|
6640
|
+
setBubbles([]);
|
|
6641
|
+
return;
|
|
6642
|
+
}
|
|
6643
|
+
const minRadius = Math.min(dimensions.width, dimensions.height) * minSize / 200;
|
|
6644
|
+
const maxRadius = Math.min(dimensions.width, dimensions.height) * maxSize / 200;
|
|
6645
|
+
const result = simulatePacking(data, dimensions.width, dimensions.height, minRadius, maxRadius);
|
|
6646
|
+
setBubbles(result);
|
|
6647
|
+
}, [data, dimensions, minSize, maxSize]);
|
|
6648
|
+
const getBubbleColor = (item) => {
|
|
6649
|
+
if (item.color) return item.color;
|
|
6650
|
+
if (colorByValue) return colorByValue(item.value);
|
|
6651
|
+
return defaultColor;
|
|
6652
|
+
};
|
|
6653
|
+
return /* @__PURE__ */ jsxs22(
|
|
6654
|
+
"div",
|
|
6655
|
+
{
|
|
6656
|
+
ref: containerRef,
|
|
6657
|
+
className: cn("relative w-full", className),
|
|
6658
|
+
style: { height: typeof height === "number" ? `${height}px` : height },
|
|
6659
|
+
children: [
|
|
6660
|
+
title && /* @__PURE__ */ jsx37(
|
|
6661
|
+
"div",
|
|
6662
|
+
{
|
|
6663
|
+
className: "text-center text-sm font-bold text-[#31456A] dark:text-slate-200",
|
|
6664
|
+
style: titleStyle,
|
|
6665
|
+
children: title
|
|
6666
|
+
}
|
|
6667
|
+
),
|
|
6668
|
+
/* @__PURE__ */ jsx37("svg", { width: "100%", height: "100%", className: "overflow-visible", children: bubbles.map((bubble, index) => /* @__PURE__ */ jsxs22(
|
|
6669
|
+
"g",
|
|
6670
|
+
{
|
|
6671
|
+
onClick: () => onBubbleClick?.(bubble.data),
|
|
6672
|
+
style: { cursor: onBubbleClick ? "pointer" : "default" },
|
|
6673
|
+
children: [
|
|
6674
|
+
/* @__PURE__ */ jsx37(
|
|
6675
|
+
"circle",
|
|
6676
|
+
{
|
|
6677
|
+
cx: bubble.x,
|
|
6678
|
+
cy: bubble.y,
|
|
6679
|
+
r: bubble.radius,
|
|
6680
|
+
fill: getBubbleColor(bubble.data),
|
|
6681
|
+
opacity: 0.85,
|
|
6682
|
+
className: "transition-all duration-200 hover:opacity-100"
|
|
6683
|
+
}
|
|
6684
|
+
),
|
|
6685
|
+
showLabels && /* @__PURE__ */ jsx37(
|
|
6686
|
+
"text",
|
|
6687
|
+
{
|
|
6688
|
+
x: bubble.x,
|
|
6689
|
+
y: showValues ? bubble.y - 6 : bubble.y,
|
|
6690
|
+
textAnchor: "middle",
|
|
6691
|
+
dominantBaseline: "middle",
|
|
6692
|
+
className: "fill-current text-black dark:text-white",
|
|
6693
|
+
style: {
|
|
6694
|
+
fontSize: Math.max(10, bubble.radius / 3),
|
|
6695
|
+
fontWeight: "normal",
|
|
6696
|
+
pointerEvents: "none"
|
|
6697
|
+
},
|
|
6698
|
+
children: bubble.data.name
|
|
6699
|
+
}
|
|
6700
|
+
),
|
|
6701
|
+
showValues && /* @__PURE__ */ jsx37(
|
|
6702
|
+
"text",
|
|
6703
|
+
{
|
|
6704
|
+
x: bubble.x,
|
|
6705
|
+
y: bubble.y + 8,
|
|
6706
|
+
textAnchor: "middle",
|
|
6707
|
+
dominantBaseline: "middle",
|
|
6708
|
+
className: "fill-current text-black dark:text-white",
|
|
6709
|
+
style: {
|
|
6710
|
+
fontSize: Math.max(8, bubble.radius / 4),
|
|
6711
|
+
fontWeight: "bold",
|
|
6712
|
+
pointerEvents: "none"
|
|
6713
|
+
},
|
|
6714
|
+
children: bubble.data.value
|
|
6715
|
+
}
|
|
6716
|
+
),
|
|
6717
|
+
/* @__PURE__ */ jsx37("title", { children: `${bubble.data.name}: ${bubble.data.value}` })
|
|
6718
|
+
]
|
|
6719
|
+
},
|
|
6720
|
+
`bubble-${index}-${bubble.data.name}`
|
|
6721
|
+
)) })
|
|
6722
|
+
]
|
|
6723
|
+
}
|
|
6724
|
+
);
|
|
6725
|
+
};
|
|
6557
6726
|
|
|
6558
6727
|
// src/components/breadcrumbs.tsx
|
|
6559
|
-
import * as
|
|
6728
|
+
import * as React38 from "react";
|
|
6560
6729
|
import { jsx as jsx38, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
6561
|
-
var Breadcrumbs =
|
|
6730
|
+
var Breadcrumbs = React38.forwardRef(
|
|
6562
6731
|
({
|
|
6563
6732
|
separator,
|
|
6564
6733
|
maxItems,
|
|
@@ -6568,7 +6737,7 @@ var Breadcrumbs = React37.forwardRef(
|
|
|
6568
6737
|
children,
|
|
6569
6738
|
...props
|
|
6570
6739
|
}, ref) => {
|
|
6571
|
-
const childArray =
|
|
6740
|
+
const childArray = React38.Children.toArray(children);
|
|
6572
6741
|
const totalItems = childArray.length;
|
|
6573
6742
|
const separatorElement = separator ?? /* @__PURE__ */ jsx38(
|
|
6574
6743
|
"svg",
|
|
@@ -6606,7 +6775,7 @@ var Breadcrumbs = React37.forwardRef(
|
|
|
6606
6775
|
}
|
|
6607
6776
|
);
|
|
6608
6777
|
Breadcrumbs.displayName = "Breadcrumbs";
|
|
6609
|
-
var BreadcrumbItem =
|
|
6778
|
+
var BreadcrumbItem = React38.forwardRef(
|
|
6610
6779
|
({ current = false, href, onClick, className, children, ...props }, ref) => {
|
|
6611
6780
|
const baseClasses = cn(
|
|
6612
6781
|
"text-sm transition-colors",
|
|
@@ -6658,7 +6827,7 @@ var BreadcrumbItem = React37.forwardRef(
|
|
|
6658
6827
|
}
|
|
6659
6828
|
);
|
|
6660
6829
|
BreadcrumbItem.displayName = "BreadcrumbItem";
|
|
6661
|
-
var BreadcrumbLink =
|
|
6830
|
+
var BreadcrumbLink = React38.forwardRef(
|
|
6662
6831
|
({ className, ...props }, ref) => /* @__PURE__ */ jsx38(
|
|
6663
6832
|
"a",
|
|
6664
6833
|
{
|
|
@@ -6672,7 +6841,7 @@ var BreadcrumbLink = React37.forwardRef(
|
|
|
6672
6841
|
)
|
|
6673
6842
|
);
|
|
6674
6843
|
BreadcrumbLink.displayName = "BreadcrumbLink";
|
|
6675
|
-
var BreadcrumbSeparator =
|
|
6844
|
+
var BreadcrumbSeparator = React38.forwardRef(
|
|
6676
6845
|
({ className, children, ...props }, ref) => /* @__PURE__ */ jsx38(
|
|
6677
6846
|
"span",
|
|
6678
6847
|
{
|
|
@@ -6700,7 +6869,7 @@ var BreadcrumbSeparator = React37.forwardRef(
|
|
|
6700
6869
|
)
|
|
6701
6870
|
);
|
|
6702
6871
|
BreadcrumbSeparator.displayName = "BreadcrumbSeparator";
|
|
6703
|
-
var BreadcrumbEllipsis =
|
|
6872
|
+
var BreadcrumbEllipsis = React38.forwardRef(
|
|
6704
6873
|
({ className, ...props }, ref) => /* @__PURE__ */ jsx38(
|
|
6705
6874
|
"span",
|
|
6706
6875
|
{
|
|
@@ -6732,7 +6901,7 @@ var BreadcrumbEllipsis = React37.forwardRef(
|
|
|
6732
6901
|
)
|
|
6733
6902
|
);
|
|
6734
6903
|
BreadcrumbEllipsis.displayName = "BreadcrumbEllipsis";
|
|
6735
|
-
var BreadcrumbPage =
|
|
6904
|
+
var BreadcrumbPage = React38.forwardRef(
|
|
6736
6905
|
({ className, ...props }, ref) => /* @__PURE__ */ jsx38(
|
|
6737
6906
|
"span",
|
|
6738
6907
|
{
|
|
@@ -6746,7 +6915,7 @@ var BreadcrumbPage = React37.forwardRef(
|
|
|
6746
6915
|
BreadcrumbPage.displayName = "BreadcrumbPage";
|
|
6747
6916
|
|
|
6748
6917
|
// src/components/dropdown-menu.tsx
|
|
6749
|
-
import * as
|
|
6918
|
+
import * as React39 from "react";
|
|
6750
6919
|
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
6751
6920
|
import { jsx as jsx39, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
6752
6921
|
var DropdownMenu = DropdownMenuPrimitive.Root;
|
|
@@ -6755,7 +6924,7 @@ var DropdownMenuGroup = DropdownMenuPrimitive.Group;
|
|
|
6755
6924
|
var DropdownMenuPortal = DropdownMenuPrimitive.Portal;
|
|
6756
6925
|
var DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
|
6757
6926
|
var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
|
6758
|
-
var DropdownMenuSubTrigger =
|
|
6927
|
+
var DropdownMenuSubTrigger = React39.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxs24(
|
|
6759
6928
|
DropdownMenuPrimitive.SubTrigger,
|
|
6760
6929
|
{
|
|
6761
6930
|
ref,
|
|
@@ -6787,7 +6956,7 @@ var DropdownMenuSubTrigger = React38.forwardRef(({ className, inset, children, .
|
|
|
6787
6956
|
}
|
|
6788
6957
|
));
|
|
6789
6958
|
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
|
6790
|
-
var DropdownMenuSubContent =
|
|
6959
|
+
var DropdownMenuSubContent = React39.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx39(
|
|
6791
6960
|
DropdownMenuPrimitive.SubContent,
|
|
6792
6961
|
{
|
|
6793
6962
|
ref,
|
|
@@ -6804,7 +6973,7 @@ var DropdownMenuSubContent = React38.forwardRef(({ className, ...props }, ref) =
|
|
|
6804
6973
|
}
|
|
6805
6974
|
));
|
|
6806
6975
|
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
6807
|
-
var DropdownMenuContent =
|
|
6976
|
+
var DropdownMenuContent = React39.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx39(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx39(
|
|
6808
6977
|
DropdownMenuPrimitive.Content,
|
|
6809
6978
|
{
|
|
6810
6979
|
ref,
|
|
@@ -6822,7 +6991,7 @@ var DropdownMenuContent = React38.forwardRef(({ className, sideOffset = 4, ...pr
|
|
|
6822
6991
|
}
|
|
6823
6992
|
) }));
|
|
6824
6993
|
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
6825
|
-
var DropdownMenuItem =
|
|
6994
|
+
var DropdownMenuItem = React39.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx39(
|
|
6826
6995
|
DropdownMenuPrimitive.Item,
|
|
6827
6996
|
{
|
|
6828
6997
|
ref,
|
|
@@ -6838,7 +7007,7 @@ var DropdownMenuItem = React38.forwardRef(({ className, inset, ...props }, ref)
|
|
|
6838
7007
|
}
|
|
6839
7008
|
));
|
|
6840
7009
|
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
6841
|
-
var DropdownMenuCheckboxItem =
|
|
7010
|
+
var DropdownMenuCheckboxItem = React39.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxs24(
|
|
6842
7011
|
DropdownMenuPrimitive.CheckboxItem,
|
|
6843
7012
|
{
|
|
6844
7013
|
ref,
|
|
@@ -6870,7 +7039,7 @@ var DropdownMenuCheckboxItem = React38.forwardRef(({ className, children, checke
|
|
|
6870
7039
|
}
|
|
6871
7040
|
));
|
|
6872
7041
|
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
6873
|
-
var DropdownMenuRadioItem =
|
|
7042
|
+
var DropdownMenuRadioItem = React39.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs24(
|
|
6874
7043
|
DropdownMenuPrimitive.RadioItem,
|
|
6875
7044
|
{
|
|
6876
7045
|
ref,
|
|
@@ -6896,7 +7065,7 @@ var DropdownMenuRadioItem = React38.forwardRef(({ className, children, ...props
|
|
|
6896
7065
|
}
|
|
6897
7066
|
));
|
|
6898
7067
|
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
6899
|
-
var DropdownMenuLabel =
|
|
7068
|
+
var DropdownMenuLabel = React39.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx39(
|
|
6900
7069
|
DropdownMenuPrimitive.Label,
|
|
6901
7070
|
{
|
|
6902
7071
|
ref,
|
|
@@ -6909,7 +7078,7 @@ var DropdownMenuLabel = React38.forwardRef(({ className, inset, ...props }, ref)
|
|
|
6909
7078
|
}
|
|
6910
7079
|
));
|
|
6911
7080
|
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
6912
|
-
var DropdownMenuSeparator =
|
|
7081
|
+
var DropdownMenuSeparator = React39.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx39(
|
|
6913
7082
|
DropdownMenuPrimitive.Separator,
|
|
6914
7083
|
{
|
|
6915
7084
|
ref,
|
|
@@ -6933,14 +7102,14 @@ var DropdownMenuShortcut = ({
|
|
|
6933
7102
|
DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
|
|
6934
7103
|
|
|
6935
7104
|
// src/components/drawer.tsx
|
|
6936
|
-
import * as
|
|
7105
|
+
import * as React40 from "react";
|
|
6937
7106
|
import * as DialogPrimitive2 from "@radix-ui/react-dialog";
|
|
6938
7107
|
import { jsx as jsx40, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
6939
7108
|
var Drawer = DialogPrimitive2.Root;
|
|
6940
7109
|
var DrawerTrigger = DialogPrimitive2.Trigger;
|
|
6941
7110
|
var DrawerClose = DialogPrimitive2.Close;
|
|
6942
7111
|
var DrawerPortal = DialogPrimitive2.Portal;
|
|
6943
|
-
var DrawerOverlay =
|
|
7112
|
+
var DrawerOverlay = React40.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx40(
|
|
6944
7113
|
DialogPrimitive2.Overlay,
|
|
6945
7114
|
{
|
|
6946
7115
|
ref,
|
|
@@ -6960,7 +7129,7 @@ var slideVariants = {
|
|
|
6960
7129
|
top: "inset-x-0 top-0 w-full data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",
|
|
6961
7130
|
bottom: "inset-x-0 bottom-0 w-full data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom"
|
|
6962
7131
|
};
|
|
6963
|
-
var DrawerContent =
|
|
7132
|
+
var DrawerContent = React40.forwardRef(({ side = "right", showClose = true, className, children, ...props }, ref) => /* @__PURE__ */ jsxs25(DrawerPortal, { children: [
|
|
6964
7133
|
/* @__PURE__ */ jsx40(DrawerOverlay, {}),
|
|
6965
7134
|
/* @__PURE__ */ jsxs25(
|
|
6966
7135
|
DialogPrimitive2.Content,
|
|
@@ -7011,7 +7180,7 @@ var DrawerContent = React39.forwardRef(({ side = "right", showClose = true, clas
|
|
|
7011
7180
|
)
|
|
7012
7181
|
] }));
|
|
7013
7182
|
DrawerContent.displayName = "DrawerContent";
|
|
7014
|
-
var DrawerHeader =
|
|
7183
|
+
var DrawerHeader = React40.forwardRef(
|
|
7015
7184
|
({ className, ...props }, ref) => /* @__PURE__ */ jsx40(
|
|
7016
7185
|
"div",
|
|
7017
7186
|
{
|
|
@@ -7022,7 +7191,7 @@ var DrawerHeader = React39.forwardRef(
|
|
|
7022
7191
|
)
|
|
7023
7192
|
);
|
|
7024
7193
|
DrawerHeader.displayName = "DrawerHeader";
|
|
7025
|
-
var DrawerTitle =
|
|
7194
|
+
var DrawerTitle = React40.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx40(
|
|
7026
7195
|
DialogPrimitive2.Title,
|
|
7027
7196
|
{
|
|
7028
7197
|
ref,
|
|
@@ -7031,7 +7200,7 @@ var DrawerTitle = React39.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
7031
7200
|
}
|
|
7032
7201
|
));
|
|
7033
7202
|
DrawerTitle.displayName = DialogPrimitive2.Title.displayName;
|
|
7034
|
-
var DrawerDescription =
|
|
7203
|
+
var DrawerDescription = React40.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx40(
|
|
7035
7204
|
DialogPrimitive2.Description,
|
|
7036
7205
|
{
|
|
7037
7206
|
ref,
|
|
@@ -7040,7 +7209,7 @@ var DrawerDescription = React39.forwardRef(({ className, ...props }, ref) => /*
|
|
|
7040
7209
|
}
|
|
7041
7210
|
));
|
|
7042
7211
|
DrawerDescription.displayName = DialogPrimitive2.Description.displayName;
|
|
7043
|
-
var DrawerBody =
|
|
7212
|
+
var DrawerBody = React40.forwardRef(
|
|
7044
7213
|
({ className, ...props }, ref) => /* @__PURE__ */ jsx40(
|
|
7045
7214
|
"div",
|
|
7046
7215
|
{
|
|
@@ -7051,7 +7220,7 @@ var DrawerBody = React39.forwardRef(
|
|
|
7051
7220
|
)
|
|
7052
7221
|
);
|
|
7053
7222
|
DrawerBody.displayName = "DrawerBody";
|
|
7054
|
-
var DrawerFooter =
|
|
7223
|
+
var DrawerFooter = React40.forwardRef(
|
|
7055
7224
|
({ className, ...props }, ref) => /* @__PURE__ */ jsx40(
|
|
7056
7225
|
"div",
|
|
7057
7226
|
{
|
|
@@ -7078,14 +7247,14 @@ var SheetBody = DrawerBody;
|
|
|
7078
7247
|
var SheetFooter = DrawerFooter;
|
|
7079
7248
|
|
|
7080
7249
|
// src/components/topbar.tsx
|
|
7081
|
-
import * as
|
|
7250
|
+
import * as React41 from "react";
|
|
7082
7251
|
import { Fragment as Fragment6, jsx as jsx41, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
7083
7252
|
var sizeClasses5 = {
|
|
7084
7253
|
sm: "h-12",
|
|
7085
7254
|
md: "h-14",
|
|
7086
7255
|
lg: "h-16"
|
|
7087
7256
|
};
|
|
7088
|
-
var TopBar =
|
|
7257
|
+
var TopBar = React41.forwardRef(
|
|
7089
7258
|
({ className, bordered = true, sticky = false, size = "md", children, ...props }, ref) => {
|
|
7090
7259
|
return /* @__PURE__ */ jsx41(
|
|
7091
7260
|
"header",
|
|
@@ -7105,7 +7274,7 @@ var TopBar = React40.forwardRef(
|
|
|
7105
7274
|
}
|
|
7106
7275
|
);
|
|
7107
7276
|
TopBar.displayName = "TopBar";
|
|
7108
|
-
var TopBarBrand =
|
|
7277
|
+
var TopBarBrand = React41.forwardRef(
|
|
7109
7278
|
({ className, logo, name, href, children, ...props }, ref) => {
|
|
7110
7279
|
const content = /* @__PURE__ */ jsxs26(Fragment6, { children: [
|
|
7111
7280
|
logo && /* @__PURE__ */ jsx41("span", { className: "shrink-0", children: logo }),
|
|
@@ -7119,7 +7288,7 @@ var TopBarBrand = React40.forwardRef(
|
|
|
7119
7288
|
}
|
|
7120
7289
|
);
|
|
7121
7290
|
TopBarBrand.displayName = "TopBarBrand";
|
|
7122
|
-
var TopBarNav =
|
|
7291
|
+
var TopBarNav = React41.forwardRef(
|
|
7123
7292
|
({ className, children, ...props }, ref) => {
|
|
7124
7293
|
return /* @__PURE__ */ jsx41(
|
|
7125
7294
|
"nav",
|
|
@@ -7133,7 +7302,7 @@ var TopBarNav = React40.forwardRef(
|
|
|
7133
7302
|
}
|
|
7134
7303
|
);
|
|
7135
7304
|
TopBarNav.displayName = "TopBarNav";
|
|
7136
|
-
var TopBarNavItem =
|
|
7305
|
+
var TopBarNavItem = React41.forwardRef(
|
|
7137
7306
|
({ className, active, children, ...props }, ref) => {
|
|
7138
7307
|
return /* @__PURE__ */ jsx41(
|
|
7139
7308
|
"a",
|
|
@@ -7151,7 +7320,7 @@ var TopBarNavItem = React40.forwardRef(
|
|
|
7151
7320
|
}
|
|
7152
7321
|
);
|
|
7153
7322
|
TopBarNavItem.displayName = "TopBarNavItem";
|
|
7154
|
-
var TopBarSection =
|
|
7323
|
+
var TopBarSection = React41.forwardRef(
|
|
7155
7324
|
({ className, align = "left", children, ...props }, ref) => {
|
|
7156
7325
|
return /* @__PURE__ */ jsx41(
|
|
7157
7326
|
"div",
|
|
@@ -7173,7 +7342,7 @@ var TopBarSection = React40.forwardRef(
|
|
|
7173
7342
|
}
|
|
7174
7343
|
);
|
|
7175
7344
|
TopBarSection.displayName = "TopBarSection";
|
|
7176
|
-
var TopBarDivider =
|
|
7345
|
+
var TopBarDivider = React41.forwardRef(
|
|
7177
7346
|
({ className, ...props }, ref) => {
|
|
7178
7347
|
return /* @__PURE__ */ jsx41(
|
|
7179
7348
|
"div",
|
|
@@ -7188,17 +7357,17 @@ var TopBarDivider = React40.forwardRef(
|
|
|
7188
7357
|
TopBarDivider.displayName = "TopBarDivider";
|
|
7189
7358
|
|
|
7190
7359
|
// src/components/sidebar.tsx
|
|
7191
|
-
import * as
|
|
7360
|
+
import * as React42 from "react";
|
|
7192
7361
|
import { Fragment as Fragment7, jsx as jsx42, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
7193
|
-
var SidebarContext =
|
|
7362
|
+
var SidebarContext = React42.createContext(void 0);
|
|
7194
7363
|
var useSidebar = () => {
|
|
7195
|
-
const context =
|
|
7364
|
+
const context = React42.useContext(SidebarContext);
|
|
7196
7365
|
if (!context) {
|
|
7197
7366
|
throw new Error("useSidebar must be used within a Sidebar");
|
|
7198
7367
|
}
|
|
7199
7368
|
return context;
|
|
7200
7369
|
};
|
|
7201
|
-
var Sidebar =
|
|
7370
|
+
var Sidebar = React42.forwardRef(
|
|
7202
7371
|
({
|
|
7203
7372
|
className,
|
|
7204
7373
|
collapsed: controlledCollapsed,
|
|
@@ -7210,10 +7379,10 @@ var Sidebar = React41.forwardRef(
|
|
|
7210
7379
|
children,
|
|
7211
7380
|
...props
|
|
7212
7381
|
}, ref) => {
|
|
7213
|
-
const [uncontrolledCollapsed, setUncontrolledCollapsed] =
|
|
7382
|
+
const [uncontrolledCollapsed, setUncontrolledCollapsed] = React42.useState(defaultCollapsed);
|
|
7214
7383
|
const isControlled = controlledCollapsed !== void 0;
|
|
7215
7384
|
const collapsed = isControlled ? controlledCollapsed : uncontrolledCollapsed;
|
|
7216
|
-
const setCollapsed =
|
|
7385
|
+
const setCollapsed = React42.useCallback(
|
|
7217
7386
|
(value) => {
|
|
7218
7387
|
if (!isControlled) {
|
|
7219
7388
|
setUncontrolledCollapsed(value);
|
|
@@ -7242,7 +7411,7 @@ var Sidebar = React41.forwardRef(
|
|
|
7242
7411
|
}
|
|
7243
7412
|
);
|
|
7244
7413
|
Sidebar.displayName = "Sidebar";
|
|
7245
|
-
var SidebarHeader =
|
|
7414
|
+
var SidebarHeader = React42.forwardRef(
|
|
7246
7415
|
({ className, children, ...props }, ref) => {
|
|
7247
7416
|
return /* @__PURE__ */ jsx42(
|
|
7248
7417
|
"div",
|
|
@@ -7256,7 +7425,7 @@ var SidebarHeader = React41.forwardRef(
|
|
|
7256
7425
|
}
|
|
7257
7426
|
);
|
|
7258
7427
|
SidebarHeader.displayName = "SidebarHeader";
|
|
7259
|
-
var SidebarContent =
|
|
7428
|
+
var SidebarContent = React42.forwardRef(
|
|
7260
7429
|
({ className, children, ...props }, ref) => {
|
|
7261
7430
|
return /* @__PURE__ */ jsx42(
|
|
7262
7431
|
"div",
|
|
@@ -7270,7 +7439,7 @@ var SidebarContent = React41.forwardRef(
|
|
|
7270
7439
|
}
|
|
7271
7440
|
);
|
|
7272
7441
|
SidebarContent.displayName = "SidebarContent";
|
|
7273
|
-
var SidebarFooter =
|
|
7442
|
+
var SidebarFooter = React42.forwardRef(
|
|
7274
7443
|
({ className, children, ...props }, ref) => {
|
|
7275
7444
|
return /* @__PURE__ */ jsx42(
|
|
7276
7445
|
"div",
|
|
@@ -7284,7 +7453,7 @@ var SidebarFooter = React41.forwardRef(
|
|
|
7284
7453
|
}
|
|
7285
7454
|
);
|
|
7286
7455
|
SidebarFooter.displayName = "SidebarFooter";
|
|
7287
|
-
var SidebarGroup =
|
|
7456
|
+
var SidebarGroup = React42.forwardRef(
|
|
7288
7457
|
({ className, label, children, ...props }, ref) => {
|
|
7289
7458
|
const { collapsed } = useSidebar();
|
|
7290
7459
|
return /* @__PURE__ */ jsxs27("div", { ref, className: cn("px-2 py-2", className), ...props, children: [
|
|
@@ -7295,7 +7464,7 @@ var SidebarGroup = React41.forwardRef(
|
|
|
7295
7464
|
}
|
|
7296
7465
|
);
|
|
7297
7466
|
SidebarGroup.displayName = "SidebarGroup";
|
|
7298
|
-
var SidebarItem =
|
|
7467
|
+
var SidebarItem = React42.forwardRef(
|
|
7299
7468
|
({ className, icon, active, disabled, badge, onClick, href, children, ...props }, ref) => {
|
|
7300
7469
|
const { collapsed } = useSidebar();
|
|
7301
7470
|
const content = /* @__PURE__ */ jsxs27(Fragment7, { children: [
|
|
@@ -7330,11 +7499,11 @@ var SidebarItem = React41.forwardRef(
|
|
|
7330
7499
|
}
|
|
7331
7500
|
);
|
|
7332
7501
|
SidebarItem.displayName = "SidebarItem";
|
|
7333
|
-
var SidebarSubMenu =
|
|
7502
|
+
var SidebarSubMenu = React42.forwardRef(
|
|
7334
7503
|
({ className, icon, label, defaultOpen = false, children, ...props }, ref) => {
|
|
7335
|
-
const [open, setOpen] =
|
|
7504
|
+
const [open, setOpen] = React42.useState(defaultOpen);
|
|
7336
7505
|
const { collapsed } = useSidebar();
|
|
7337
|
-
|
|
7506
|
+
React42.useEffect(() => {
|
|
7338
7507
|
if (collapsed) {
|
|
7339
7508
|
setOpen(false);
|
|
7340
7509
|
}
|
|
@@ -7378,7 +7547,7 @@ var SidebarSubMenu = React41.forwardRef(
|
|
|
7378
7547
|
}
|
|
7379
7548
|
);
|
|
7380
7549
|
SidebarSubMenu.displayName = "SidebarSubMenu";
|
|
7381
|
-
var SidebarToggle =
|
|
7550
|
+
var SidebarToggle = React42.forwardRef(
|
|
7382
7551
|
({ className, children, ...props }, ref) => {
|
|
7383
7552
|
const { collapsed, setCollapsed } = useSidebar();
|
|
7384
7553
|
return /* @__PURE__ */ jsx42(
|
|
@@ -7420,17 +7589,17 @@ var SidebarToggle = React41.forwardRef(
|
|
|
7420
7589
|
SidebarToggle.displayName = "SidebarToggle";
|
|
7421
7590
|
|
|
7422
7591
|
// src/components/sidebar-rail.tsx
|
|
7423
|
-
import * as
|
|
7592
|
+
import * as React43 from "react";
|
|
7424
7593
|
import { Fragment as Fragment8, jsx as jsx43, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
7425
|
-
var SidebarRailContext =
|
|
7594
|
+
var SidebarRailContext = React43.createContext(void 0);
|
|
7426
7595
|
var useSidebarRail = () => {
|
|
7427
|
-
const context =
|
|
7596
|
+
const context = React43.useContext(SidebarRailContext);
|
|
7428
7597
|
if (!context) {
|
|
7429
7598
|
throw new Error("useSidebarRail must be used within a SidebarRail");
|
|
7430
7599
|
}
|
|
7431
7600
|
return context;
|
|
7432
7601
|
};
|
|
7433
|
-
var SidebarRail =
|
|
7602
|
+
var SidebarRail = React43.forwardRef(
|
|
7434
7603
|
({
|
|
7435
7604
|
className,
|
|
7436
7605
|
defaultActiveRail = null,
|
|
@@ -7448,14 +7617,14 @@ var SidebarRail = React42.forwardRef(
|
|
|
7448
7617
|
children,
|
|
7449
7618
|
...props
|
|
7450
7619
|
}, ref) => {
|
|
7451
|
-
const [uncontrolledActiveRail, setUncontrolledActiveRail] =
|
|
7452
|
-
const [expanded, setExpanded] =
|
|
7453
|
-
const [uncontrolledRailExpanded, setUncontrolledRailExpanded] =
|
|
7620
|
+
const [uncontrolledActiveRail, setUncontrolledActiveRail] = React43.useState(defaultActiveRail);
|
|
7621
|
+
const [expanded, setExpanded] = React43.useState(!!defaultActiveRail);
|
|
7622
|
+
const [uncontrolledRailExpanded, setUncontrolledRailExpanded] = React43.useState(defaultRailExpanded);
|
|
7454
7623
|
const isControlled = controlledActiveRail !== void 0;
|
|
7455
7624
|
const activeRail = isControlled ? controlledActiveRail : uncontrolledActiveRail;
|
|
7456
7625
|
const isRailControlled = controlledRailExpanded !== void 0;
|
|
7457
7626
|
const railExpanded = isRailControlled ? controlledRailExpanded : uncontrolledRailExpanded;
|
|
7458
|
-
const setActiveRail =
|
|
7627
|
+
const setActiveRail = React43.useCallback(
|
|
7459
7628
|
(rail) => {
|
|
7460
7629
|
if (!isControlled) {
|
|
7461
7630
|
setUncontrolledActiveRail(rail);
|
|
@@ -7465,7 +7634,7 @@ var SidebarRail = React42.forwardRef(
|
|
|
7465
7634
|
},
|
|
7466
7635
|
[isControlled, onActiveRailChange]
|
|
7467
7636
|
);
|
|
7468
|
-
const setRailExpanded =
|
|
7637
|
+
const setRailExpanded = React43.useCallback(
|
|
7469
7638
|
(value) => {
|
|
7470
7639
|
if (!isRailControlled) {
|
|
7471
7640
|
setUncontrolledRailExpanded(value);
|
|
@@ -7511,7 +7680,7 @@ var SidebarRail = React42.forwardRef(
|
|
|
7511
7680
|
}
|
|
7512
7681
|
);
|
|
7513
7682
|
SidebarRail.displayName = "SidebarRail";
|
|
7514
|
-
var IconRail =
|
|
7683
|
+
var IconRail = React43.forwardRef(
|
|
7515
7684
|
({ className, children, ...props }, ref) => {
|
|
7516
7685
|
const { railExpanded, overlayRail, expandableRail } = useSidebarRail();
|
|
7517
7686
|
const isExpanded = expandableRail && railExpanded;
|
|
@@ -7541,7 +7710,7 @@ var IconRail = React42.forwardRef(
|
|
|
7541
7710
|
}
|
|
7542
7711
|
);
|
|
7543
7712
|
IconRail.displayName = "IconRail";
|
|
7544
|
-
var IconRailHeader =
|
|
7713
|
+
var IconRailHeader = React43.forwardRef(
|
|
7545
7714
|
({ className, children, ...props }, ref) => {
|
|
7546
7715
|
return /* @__PURE__ */ jsx43(
|
|
7547
7716
|
"div",
|
|
@@ -7558,7 +7727,7 @@ var IconRailHeader = React42.forwardRef(
|
|
|
7558
7727
|
}
|
|
7559
7728
|
);
|
|
7560
7729
|
IconRailHeader.displayName = "IconRailHeader";
|
|
7561
|
-
var IconRailContent =
|
|
7730
|
+
var IconRailContent = React43.forwardRef(
|
|
7562
7731
|
({ className, children, ...props }, ref) => {
|
|
7563
7732
|
return /* @__PURE__ */ jsx43(
|
|
7564
7733
|
"div",
|
|
@@ -7572,7 +7741,7 @@ var IconRailContent = React42.forwardRef(
|
|
|
7572
7741
|
}
|
|
7573
7742
|
);
|
|
7574
7743
|
IconRailContent.displayName = "IconRailContent";
|
|
7575
|
-
var IconRailFooter =
|
|
7744
|
+
var IconRailFooter = React43.forwardRef(
|
|
7576
7745
|
({ className, children, ...props }, ref) => {
|
|
7577
7746
|
return /* @__PURE__ */ jsx43(
|
|
7578
7747
|
"div",
|
|
@@ -7589,7 +7758,7 @@ var IconRailFooter = React42.forwardRef(
|
|
|
7589
7758
|
}
|
|
7590
7759
|
);
|
|
7591
7760
|
IconRailFooter.displayName = "IconRailFooter";
|
|
7592
|
-
var IconRailItem =
|
|
7761
|
+
var IconRailItem = React43.forwardRef(
|
|
7593
7762
|
({ className, railId, icon, label, asButton = false, toggleRail = false, onClick, ...props }, ref) => {
|
|
7594
7763
|
const {
|
|
7595
7764
|
activeRail,
|
|
@@ -7641,7 +7810,7 @@ var IconRailItem = React42.forwardRef(
|
|
|
7641
7810
|
}
|
|
7642
7811
|
);
|
|
7643
7812
|
IconRailItem.displayName = "IconRailItem";
|
|
7644
|
-
var RailPanel =
|
|
7813
|
+
var RailPanel = React43.forwardRef(
|
|
7645
7814
|
({ className, railId, title, children, ...props }, ref) => {
|
|
7646
7815
|
const { activeRail, setActiveRail, hoverExpand } = useSidebarRail();
|
|
7647
7816
|
const isVisible = activeRail === railId;
|
|
@@ -7700,7 +7869,7 @@ var RailPanel = React42.forwardRef(
|
|
|
7700
7869
|
}
|
|
7701
7870
|
);
|
|
7702
7871
|
RailPanel.displayName = "RailPanel";
|
|
7703
|
-
var RailPanelGroup =
|
|
7872
|
+
var RailPanelGroup = React43.forwardRef(
|
|
7704
7873
|
({ className, label, children, ...props }, ref) => {
|
|
7705
7874
|
return /* @__PURE__ */ jsxs28("div", { ref, className: cn("px-2 py-2", className), ...props, children: [
|
|
7706
7875
|
label && /* @__PURE__ */ jsx43("div", { className: "px-2 py-1.5 text-xs font-semibold text-muted-foreground uppercase tracking-wider", children: label }),
|
|
@@ -7709,7 +7878,7 @@ var RailPanelGroup = React42.forwardRef(
|
|
|
7709
7878
|
}
|
|
7710
7879
|
);
|
|
7711
7880
|
RailPanelGroup.displayName = "RailPanelGroup";
|
|
7712
|
-
var RailPanelItem =
|
|
7881
|
+
var RailPanelItem = React43.forwardRef(
|
|
7713
7882
|
({ className, icon, active, disabled, badge, href, children, onClick, ...props }, ref) => {
|
|
7714
7883
|
const content = /* @__PURE__ */ jsxs28(Fragment8, { children: [
|
|
7715
7884
|
icon && /* @__PURE__ */ jsx43("span", { className: "shrink-0", children: icon }),
|
|
@@ -7742,7 +7911,7 @@ var RailPanelItem = React42.forwardRef(
|
|
|
7742
7911
|
RailPanelItem.displayName = "RailPanelItem";
|
|
7743
7912
|
|
|
7744
7913
|
// src/playground.tsx
|
|
7745
|
-
import * as
|
|
7914
|
+
import * as React44 from "react";
|
|
7746
7915
|
import { jsx as jsx44, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
7747
7916
|
var Section = ({ title, children }) => /* @__PURE__ */ jsxs29("div", { className: "mb-8", children: [
|
|
7748
7917
|
/* @__PURE__ */ jsx44("h2", { className: "text-xl font-semibold mb-4 text-foreground", children: title }),
|
|
@@ -7763,13 +7932,13 @@ var ThemeToggle = () => {
|
|
|
7763
7932
|
] });
|
|
7764
7933
|
};
|
|
7765
7934
|
var PlaygroundContent = () => {
|
|
7766
|
-
const [dialogOpen, setDialogOpen] =
|
|
7767
|
-
const [checkboxChecked, setCheckboxChecked] =
|
|
7768
|
-
const [switchChecked, setSwitchChecked] =
|
|
7769
|
-
const [inputValue, setInputValue] =
|
|
7770
|
-
const [textareaValue, setTextareaValue] =
|
|
7771
|
-
const [selectValue, setSelectValue] =
|
|
7772
|
-
const [comboboxValue, setComboboxValue] =
|
|
7935
|
+
const [dialogOpen, setDialogOpen] = React44.useState(false);
|
|
7936
|
+
const [checkboxChecked, setCheckboxChecked] = React44.useState(false);
|
|
7937
|
+
const [switchChecked, setSwitchChecked] = React44.useState(false);
|
|
7938
|
+
const [inputValue, setInputValue] = React44.useState("");
|
|
7939
|
+
const [textareaValue, setTextareaValue] = React44.useState("");
|
|
7940
|
+
const [selectValue, setSelectValue] = React44.useState("");
|
|
7941
|
+
const [comboboxValue, setComboboxValue] = React44.useState(null);
|
|
7773
7942
|
const comboboxOptions = [
|
|
7774
7943
|
{ value: "react", label: "React" },
|
|
7775
7944
|
{ value: "vue", label: "Vue" },
|
|
@@ -8189,6 +8358,7 @@ export {
|
|
|
8189
8358
|
MultiProgressDonut,
|
|
8190
8359
|
NativeSelect,
|
|
8191
8360
|
NativeSelectOption,
|
|
8361
|
+
PackedBubbleChart,
|
|
8192
8362
|
PaginationNamespace as Pagination,
|
|
8193
8363
|
PaginationContent,
|
|
8194
8364
|
PaginationEllipsis,
|