@sustaina/shared-ui 1.60.0 → 1.61.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/index.d.mts +33 -3
- package/dist/index.d.ts +33 -3
- package/dist/index.js +172 -35
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +169 -36
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -19,7 +19,7 @@ var LabelPrimitive = require('@radix-ui/react-label');
|
|
|
19
19
|
var dateFns = require('date-fns');
|
|
20
20
|
var PopoverPrimitive = require('@radix-ui/react-popover');
|
|
21
21
|
var cmdk = require('cmdk');
|
|
22
|
-
var
|
|
22
|
+
var DialogPrimitive2 = require('@radix-ui/react-dialog');
|
|
23
23
|
var reactVirtual = require('@tanstack/react-virtual');
|
|
24
24
|
var TooltipPrimitive = require('@radix-ui/react-tooltip');
|
|
25
25
|
var CheckboxPrimitive = require('@radix-ui/react-checkbox');
|
|
@@ -96,7 +96,7 @@ var Autoplay__default = /*#__PURE__*/_interopDefault(Autoplay);
|
|
|
96
96
|
var SelectPrimitive__namespace = /*#__PURE__*/_interopNamespace(SelectPrimitive);
|
|
97
97
|
var LabelPrimitive__namespace = /*#__PURE__*/_interopNamespace(LabelPrimitive);
|
|
98
98
|
var PopoverPrimitive__namespace = /*#__PURE__*/_interopNamespace(PopoverPrimitive);
|
|
99
|
-
var
|
|
99
|
+
var DialogPrimitive2__namespace = /*#__PURE__*/_interopNamespace(DialogPrimitive2);
|
|
100
100
|
var TooltipPrimitive__namespace = /*#__PURE__*/_interopNamespace(TooltipPrimitive);
|
|
101
101
|
var CheckboxPrimitive__namespace = /*#__PURE__*/_interopNamespace(CheckboxPrimitive);
|
|
102
102
|
var CollapsiblePrimitive__namespace = /*#__PURE__*/_interopNamespace(CollapsiblePrimitive);
|
|
@@ -6106,14 +6106,14 @@ var ConditionMonthInput = ({ row, control, onClear }) => {
|
|
|
6106
6106
|
return renderPicker(`value_${row.id}`, "value");
|
|
6107
6107
|
};
|
|
6108
6108
|
function Dialog({ ...props }) {
|
|
6109
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6109
|
+
return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive2__namespace.Root, { "data-slot": "dialog", ...props });
|
|
6110
6110
|
}
|
|
6111
6111
|
function DialogPortal({ ...props }) {
|
|
6112
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6112
|
+
return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive2__namespace.Portal, { "data-slot": "dialog-portal", ...props });
|
|
6113
6113
|
}
|
|
6114
6114
|
function DialogOverlay({ className, ...props }) {
|
|
6115
6115
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6116
|
-
|
|
6116
|
+
DialogPrimitive2__namespace.Overlay,
|
|
6117
6117
|
{
|
|
6118
6118
|
"data-slot": "dialog-overlay",
|
|
6119
6119
|
className: cn(
|
|
@@ -6133,7 +6133,7 @@ function DialogContent({
|
|
|
6133
6133
|
return /* @__PURE__ */ jsxRuntime.jsxs(DialogPortal, { "data-slot": "dialog-portal", children: [
|
|
6134
6134
|
/* @__PURE__ */ jsxRuntime.jsx(DialogOverlay, {}),
|
|
6135
6135
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
6136
|
-
|
|
6136
|
+
DialogPrimitive2__namespace.Content,
|
|
6137
6137
|
{
|
|
6138
6138
|
"data-slot": "dialog-content",
|
|
6139
6139
|
className: cn(
|
|
@@ -6144,7 +6144,7 @@ function DialogContent({
|
|
|
6144
6144
|
children: [
|
|
6145
6145
|
children,
|
|
6146
6146
|
showCloseButton && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6147
|
-
|
|
6147
|
+
DialogPrimitive2__namespace.Close,
|
|
6148
6148
|
{
|
|
6149
6149
|
"data-slot": "dialog-close",
|
|
6150
6150
|
className: "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
@@ -6171,7 +6171,7 @@ function DialogHeader({ className, ...props }) {
|
|
|
6171
6171
|
}
|
|
6172
6172
|
function DialogTitle({ className, ...props }) {
|
|
6173
6173
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6174
|
-
|
|
6174
|
+
DialogPrimitive2__namespace.Title,
|
|
6175
6175
|
{
|
|
6176
6176
|
"data-slot": "dialog-title",
|
|
6177
6177
|
className: cn("text-lg leading-none font-semibold", className),
|
|
@@ -6184,7 +6184,7 @@ function DialogDescription({
|
|
|
6184
6184
|
...props
|
|
6185
6185
|
}) {
|
|
6186
6186
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6187
|
-
|
|
6187
|
+
DialogPrimitive2__namespace.Description,
|
|
6188
6188
|
{
|
|
6189
6189
|
"data-slot": "dialog-description",
|
|
6190
6190
|
className: cn("text-muted-foreground text-sm", className),
|
|
@@ -9938,17 +9938,17 @@ var DataTable = ({
|
|
|
9938
9938
|
};
|
|
9939
9939
|
var DataTable_default = DataTable;
|
|
9940
9940
|
function Dialog2(props) {
|
|
9941
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
9941
|
+
return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive2__namespace.Root, { "data-slot": "dialog", ...props });
|
|
9942
9942
|
}
|
|
9943
9943
|
function DialogTrigger(props) {
|
|
9944
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
9944
|
+
return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive2__namespace.Trigger, { "data-slot": "dialog-trigger", ...props });
|
|
9945
9945
|
}
|
|
9946
9946
|
function DialogPortal2(props) {
|
|
9947
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
9947
|
+
return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive2__namespace.Portal, { "data-slot": "dialog-portal", ...props });
|
|
9948
9948
|
}
|
|
9949
9949
|
function DialogOverlay2({ className, ...props }) {
|
|
9950
9950
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
9951
|
-
|
|
9951
|
+
DialogPrimitive2__namespace.Overlay,
|
|
9952
9952
|
{
|
|
9953
9953
|
"data-slot": "dialog-overlay",
|
|
9954
9954
|
className: cn(
|
|
@@ -9959,7 +9959,7 @@ function DialogOverlay2({ className, ...props }) {
|
|
|
9959
9959
|
}
|
|
9960
9960
|
);
|
|
9961
9961
|
}
|
|
9962
|
-
function
|
|
9962
|
+
function InternalDialogHeader({ className, children, ...props }) {
|
|
9963
9963
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
9964
9964
|
"div",
|
|
9965
9965
|
{
|
|
@@ -9972,7 +9972,7 @@ function DialogHeader2({ className, children, ...props }) {
|
|
|
9972
9972
|
children: [
|
|
9973
9973
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-lg font-semibold", children }),
|
|
9974
9974
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
9975
|
-
|
|
9975
|
+
DialogPrimitive2__namespace.Close,
|
|
9976
9976
|
{
|
|
9977
9977
|
"data-slot": "dialog-close",
|
|
9978
9978
|
className: "absolute right-4 top-4 rounded-xs opacity-80 hover:opacity-100 transition-opacity focus:outline-hidden",
|
|
@@ -9996,7 +9996,7 @@ function DialogContent2({
|
|
|
9996
9996
|
return /* @__PURE__ */ jsxRuntime.jsxs(DialogPortal2, { children: [
|
|
9997
9997
|
showOverlay && /* @__PURE__ */ jsxRuntime.jsx(DialogOverlay2, {}),
|
|
9998
9998
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
9999
|
-
|
|
9999
|
+
DialogPrimitive2__namespace.Content,
|
|
10000
10000
|
{
|
|
10001
10001
|
"data-slot": "dialog-content",
|
|
10002
10002
|
className: cn(
|
|
@@ -10005,7 +10005,7 @@ function DialogContent2({
|
|
|
10005
10005
|
),
|
|
10006
10006
|
...props,
|
|
10007
10007
|
children: [
|
|
10008
|
-
header && /* @__PURE__ */ jsxRuntime.jsx(
|
|
10008
|
+
header && /* @__PURE__ */ jsxRuntime.jsx(InternalDialogHeader, { children: header }),
|
|
10009
10009
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 overflow-auto", children })
|
|
10010
10010
|
]
|
|
10011
10011
|
}
|
|
@@ -10027,7 +10027,7 @@ function DialogFooter({ className, ...props }) {
|
|
|
10027
10027
|
}
|
|
10028
10028
|
function DialogTitle2({ className, ...props }) {
|
|
10029
10029
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10030
|
-
|
|
10030
|
+
DialogPrimitive2__namespace.Title,
|
|
10031
10031
|
{
|
|
10032
10032
|
"data-slot": "dialog-title",
|
|
10033
10033
|
className: cn("text-lg font-semibold leading-none", className),
|
|
@@ -10040,7 +10040,7 @@ function DialogDescription2({
|
|
|
10040
10040
|
...props
|
|
10041
10041
|
}) {
|
|
10042
10042
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10043
|
-
|
|
10043
|
+
DialogPrimitive2__namespace.Description,
|
|
10044
10044
|
{
|
|
10045
10045
|
"data-slot": "dialog-description",
|
|
10046
10046
|
className: cn("text-sm text-muted-foreground", className),
|
|
@@ -10048,18 +10048,50 @@ function DialogDescription2({
|
|
|
10048
10048
|
}
|
|
10049
10049
|
);
|
|
10050
10050
|
}
|
|
10051
|
+
function DialogCloseButton(props) {
|
|
10052
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10053
|
+
"button",
|
|
10054
|
+
{
|
|
10055
|
+
...props,
|
|
10056
|
+
type: "button",
|
|
10057
|
+
"aria-label": "Close",
|
|
10058
|
+
className: cn("absolute top-4 right-4", props.className),
|
|
10059
|
+
style: {
|
|
10060
|
+
background: "none",
|
|
10061
|
+
border: "none",
|
|
10062
|
+
padding: 0,
|
|
10063
|
+
cursor: "pointer",
|
|
10064
|
+
...props?.style
|
|
10065
|
+
},
|
|
10066
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "w-6 h-6 text-white" })
|
|
10067
|
+
}
|
|
10068
|
+
);
|
|
10069
|
+
}
|
|
10070
|
+
function DialogClose({ ...props }) {
|
|
10071
|
+
return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive2__namespace.Close, { "data-slot": "dialog-close", ...props });
|
|
10072
|
+
}
|
|
10073
|
+
function DialogHeader2({ className, ...props }) {
|
|
10074
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10075
|
+
"div",
|
|
10076
|
+
{
|
|
10077
|
+
"data-slot": "dialog-header",
|
|
10078
|
+
className: cn("flex flex-col gap-2 text-center sm:text-left", className),
|
|
10079
|
+
...props
|
|
10080
|
+
}
|
|
10081
|
+
);
|
|
10082
|
+
}
|
|
10051
10083
|
function cn2(...inputs) {
|
|
10052
10084
|
return tailwindMerge.twMerge(clsx2.clsx(inputs));
|
|
10053
10085
|
}
|
|
10054
10086
|
function Dialog3({ ...props }) {
|
|
10055
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10087
|
+
return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive2__namespace.Root, { "data-slot": "dialog", ...props });
|
|
10056
10088
|
}
|
|
10057
10089
|
function DialogPortal3({ ...props }) {
|
|
10058
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10090
|
+
return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive2__namespace.Portal, { "data-slot": "dialog-portal", ...props });
|
|
10059
10091
|
}
|
|
10060
10092
|
function DialogOverlay3({ className, ...props }) {
|
|
10061
10093
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10062
|
-
|
|
10094
|
+
DialogPrimitive2__namespace.Overlay,
|
|
10063
10095
|
{
|
|
10064
10096
|
"data-slot": "dialog-overlay",
|
|
10065
10097
|
className: cn2(
|
|
@@ -10079,7 +10111,7 @@ function DialogContent3({
|
|
|
10079
10111
|
return /* @__PURE__ */ jsxRuntime.jsxs(DialogPortal3, { "data-slot": "dialog-portal", children: [
|
|
10080
10112
|
/* @__PURE__ */ jsxRuntime.jsx(DialogOverlay3, { className: "z-99" }),
|
|
10081
10113
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
10082
|
-
|
|
10114
|
+
DialogPrimitive2__namespace.Content,
|
|
10083
10115
|
{
|
|
10084
10116
|
"data-slot": "dialog-content",
|
|
10085
10117
|
className: cn2(
|
|
@@ -10090,7 +10122,7 @@ function DialogContent3({
|
|
|
10090
10122
|
children: [
|
|
10091
10123
|
children,
|
|
10092
10124
|
showCloseButton && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10093
|
-
|
|
10125
|
+
DialogPrimitive2__namespace.Close,
|
|
10094
10126
|
{
|
|
10095
10127
|
"data-slot": "dialog-close",
|
|
10096
10128
|
className: "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
@@ -10117,7 +10149,7 @@ function DialogHeader3({ className, ...props }) {
|
|
|
10117
10149
|
}
|
|
10118
10150
|
function DialogTitle3({ className, ...props }) {
|
|
10119
10151
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10120
|
-
|
|
10152
|
+
DialogPrimitive2__namespace.Title,
|
|
10121
10153
|
{
|
|
10122
10154
|
"data-slot": "dialog-title",
|
|
10123
10155
|
className: cn2("text-lg leading-none font-semibold", className),
|
|
@@ -10130,7 +10162,7 @@ function DialogDescription3({
|
|
|
10130
10162
|
...props
|
|
10131
10163
|
}) {
|
|
10132
10164
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10133
|
-
|
|
10165
|
+
DialogPrimitive2__namespace.Description,
|
|
10134
10166
|
{
|
|
10135
10167
|
"data-slot": "dialog-description",
|
|
10136
10168
|
className: cn2("text-muted-foreground text-sm", className),
|
|
@@ -11403,9 +11435,12 @@ __export(ui_exports, {
|
|
|
11403
11435
|
CollapsibleTrigger: () => CollapsibleTrigger2,
|
|
11404
11436
|
DatePicker: () => DatePicker,
|
|
11405
11437
|
Dialog: () => Dialog2,
|
|
11438
|
+
DialogClose: () => DialogClose,
|
|
11439
|
+
DialogCloseButton: () => DialogCloseButton,
|
|
11406
11440
|
DialogContent: () => DialogContent2,
|
|
11407
11441
|
DialogDescription: () => DialogDescription2,
|
|
11408
11442
|
DialogFooter: () => DialogFooter,
|
|
11443
|
+
DialogHeader: () => DialogHeader2,
|
|
11409
11444
|
DialogTitle: () => DialogTitle2,
|
|
11410
11445
|
DialogTrigger: () => DialogTrigger,
|
|
11411
11446
|
DropdownMenu: () => DropdownMenu,
|
|
@@ -11852,20 +11887,20 @@ function Separator3({
|
|
|
11852
11887
|
);
|
|
11853
11888
|
}
|
|
11854
11889
|
function Sheet({ ...props }) {
|
|
11855
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
11890
|
+
return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive2__namespace.Root, { "data-slot": "sheet", ...props });
|
|
11856
11891
|
}
|
|
11857
11892
|
function SheetTrigger({ ...props }) {
|
|
11858
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
11893
|
+
return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive2__namespace.Trigger, { "data-slot": "sheet-trigger", ...props });
|
|
11859
11894
|
}
|
|
11860
11895
|
function SheetClose({ ...props }) {
|
|
11861
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
11896
|
+
return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive2__namespace.Close, { "data-slot": "sheet-close", ...props });
|
|
11862
11897
|
}
|
|
11863
11898
|
function SheetPortal({ ...props }) {
|
|
11864
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
11899
|
+
return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive2__namespace.Portal, { "data-slot": "sheet-portal", ...props });
|
|
11865
11900
|
}
|
|
11866
11901
|
function SheetOverlay({ className, ...props }) {
|
|
11867
11902
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
11868
|
-
|
|
11903
|
+
DialogPrimitive2__namespace.Overlay,
|
|
11869
11904
|
{
|
|
11870
11905
|
"data-slot": "sheet-overlay",
|
|
11871
11906
|
className: cn(
|
|
@@ -11885,7 +11920,7 @@ function SheetContent({
|
|
|
11885
11920
|
return /* @__PURE__ */ jsxRuntime.jsxs(SheetPortal, { children: [
|
|
11886
11921
|
/* @__PURE__ */ jsxRuntime.jsx(SheetOverlay, {}),
|
|
11887
11922
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
11888
|
-
|
|
11923
|
+
DialogPrimitive2__namespace.Content,
|
|
11889
11924
|
{
|
|
11890
11925
|
"data-slot": "sheet-content",
|
|
11891
11926
|
className: cn(
|
|
@@ -11899,7 +11934,7 @@ function SheetContent({
|
|
|
11899
11934
|
...props,
|
|
11900
11935
|
children: [
|
|
11901
11936
|
children,
|
|
11902
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
11937
|
+
/* @__PURE__ */ jsxRuntime.jsxs(DialogPrimitive2__namespace.Close, { className: "ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none", children: [
|
|
11903
11938
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.XIcon, { className: "size-4" }),
|
|
11904
11939
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Close" })
|
|
11905
11940
|
] })
|
|
@@ -11923,7 +11958,7 @@ function SheetFooter({ className, ...props }) {
|
|
|
11923
11958
|
}
|
|
11924
11959
|
function SheetTitle({ className, ...props }) {
|
|
11925
11960
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
11926
|
-
|
|
11961
|
+
DialogPrimitive2__namespace.Title,
|
|
11927
11962
|
{
|
|
11928
11963
|
"data-slot": "sheet-title",
|
|
11929
11964
|
className: cn("text-foreground font-semibold", className),
|
|
@@ -11936,7 +11971,7 @@ function SheetDescription({
|
|
|
11936
11971
|
...props
|
|
11937
11972
|
}) {
|
|
11938
11973
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
11939
|
-
|
|
11974
|
+
DialogPrimitive2__namespace.Description,
|
|
11940
11975
|
{
|
|
11941
11976
|
"data-slot": "sheet-description",
|
|
11942
11977
|
className: cn("text-muted-foreground text-sm", className),
|
|
@@ -17590,6 +17625,104 @@ var ActionDropdown = ({
|
|
|
17590
17625
|
] });
|
|
17591
17626
|
};
|
|
17592
17627
|
var dropdownMenu_default = ActionDropdown;
|
|
17628
|
+
var sizeMap = {
|
|
17629
|
+
sm: "h-1",
|
|
17630
|
+
md: "h-2",
|
|
17631
|
+
lg: "h-3"
|
|
17632
|
+
};
|
|
17633
|
+
var resolveSize = (size) => typeof size === "number" ? { style: { height: size } } : { className: sizeMap[size] };
|
|
17634
|
+
var linecapMap = {
|
|
17635
|
+
round: "rounded-full",
|
|
17636
|
+
butt: "rounded-none",
|
|
17637
|
+
square: "rounded-none"
|
|
17638
|
+
};
|
|
17639
|
+
var alignClassMap = {
|
|
17640
|
+
start: "justify-start",
|
|
17641
|
+
center: "justify-center",
|
|
17642
|
+
end: "justify-end"
|
|
17643
|
+
};
|
|
17644
|
+
var ProgressBar = ({
|
|
17645
|
+
percent = 0,
|
|
17646
|
+
size = "md",
|
|
17647
|
+
showInfo = true,
|
|
17648
|
+
format: format6,
|
|
17649
|
+
precision = 0,
|
|
17650
|
+
success,
|
|
17651
|
+
strokeLinecap = "round",
|
|
17652
|
+
percentPosition = { align: "end", type: "outer" },
|
|
17653
|
+
barClassName,
|
|
17654
|
+
trailClassName,
|
|
17655
|
+
className
|
|
17656
|
+
}) => {
|
|
17657
|
+
const clamped = React.useMemo(() => Math.min(100, Math.max(0, percent)), [percent]);
|
|
17658
|
+
const displayValue = React.useMemo(() => parseFloat(clamped.toFixed(precision)), [clamped, precision]);
|
|
17659
|
+
const successClamped = React.useMemo(
|
|
17660
|
+
() => success ? Math.min(100, Math.max(0, success.percent)) : 0,
|
|
17661
|
+
[success]
|
|
17662
|
+
);
|
|
17663
|
+
const linecapClass = linecapMap[strokeLinecap];
|
|
17664
|
+
const posType = percentPosition?.type ?? "outer";
|
|
17665
|
+
const posAlign = percentPosition?.align ?? "end";
|
|
17666
|
+
const isInner = posType === "inner";
|
|
17667
|
+
const { className: sizeClass, style: sizeStyle } = resolveSize(size);
|
|
17668
|
+
const info = React.useMemo(() => {
|
|
17669
|
+
if (!showInfo) return null;
|
|
17670
|
+
if (format6) return format6(displayValue);
|
|
17671
|
+
return `${displayValue}%`;
|
|
17672
|
+
}, [showInfo, format6, displayValue]);
|
|
17673
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
17674
|
+
"div",
|
|
17675
|
+
{
|
|
17676
|
+
className: cn(
|
|
17677
|
+
"flex w-full items-center gap-2 min-w-0",
|
|
17678
|
+
posAlign === "start" && !isInner && "flex-row-reverse",
|
|
17679
|
+
className
|
|
17680
|
+
),
|
|
17681
|
+
children: [
|
|
17682
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
17683
|
+
"div",
|
|
17684
|
+
{
|
|
17685
|
+
className: cn(
|
|
17686
|
+
"relative flex-1 overflow-hidden",
|
|
17687
|
+
trailClassName ?? "bg-muted",
|
|
17688
|
+
linecapClass,
|
|
17689
|
+
isInner ? "min-h-4" : sizeClass
|
|
17690
|
+
),
|
|
17691
|
+
style: isInner ? void 0 : sizeStyle,
|
|
17692
|
+
children: [
|
|
17693
|
+
success && /* @__PURE__ */ jsxRuntime.jsx(
|
|
17694
|
+
"div",
|
|
17695
|
+
{
|
|
17696
|
+
className: cn(
|
|
17697
|
+
"absolute left-0 top-0 h-full transition-all duration-300",
|
|
17698
|
+
success.className ?? "bg-sus-green-1",
|
|
17699
|
+
linecapClass
|
|
17700
|
+
),
|
|
17701
|
+
style: { width: `${successClamped}%` }
|
|
17702
|
+
}
|
|
17703
|
+
),
|
|
17704
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
17705
|
+
"div",
|
|
17706
|
+
{
|
|
17707
|
+
className: cn(
|
|
17708
|
+
"relative transition-all duration-300",
|
|
17709
|
+
barClassName ?? "bg-sus-primary-green-9",
|
|
17710
|
+
linecapClass,
|
|
17711
|
+
isInner ? cn("min-h-4 flex items-center px-1", alignClassMap[posAlign]) : cn("h-full", sizeClass)
|
|
17712
|
+
),
|
|
17713
|
+
style: { width: `${clamped}%`, ...!isInner ? sizeStyle : void 0 },
|
|
17714
|
+
children: isInner && info && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] leading-none text-primary-foreground whitespace-nowrap tabular-nums", children: info })
|
|
17715
|
+
}
|
|
17716
|
+
)
|
|
17717
|
+
]
|
|
17718
|
+
}
|
|
17719
|
+
),
|
|
17720
|
+
!isInner && info && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs shrink-0 tabular-nums", children: info })
|
|
17721
|
+
]
|
|
17722
|
+
}
|
|
17723
|
+
);
|
|
17724
|
+
};
|
|
17725
|
+
var ProgressBar_default = React.memo(ProgressBar);
|
|
17593
17726
|
var TruncatedMouseEnterDiv = ({
|
|
17594
17727
|
value,
|
|
17595
17728
|
className,
|
|
@@ -18525,9 +18658,12 @@ exports.DecreaseIcon = DecreaseIcon;
|
|
|
18525
18658
|
exports.Dialog = Dialog2;
|
|
18526
18659
|
exports.DialogAlert = DialogAlert;
|
|
18527
18660
|
exports.DialogAlertProvider = DialogAlertProvider;
|
|
18661
|
+
exports.DialogClose = DialogClose;
|
|
18662
|
+
exports.DialogCloseButton = DialogCloseButton;
|
|
18528
18663
|
exports.DialogContent = DialogContent2;
|
|
18529
18664
|
exports.DialogDescription = DialogDescription2;
|
|
18530
18665
|
exports.DialogFooter = DialogFooter;
|
|
18666
|
+
exports.DialogHeader = DialogHeader2;
|
|
18531
18667
|
exports.DialogTitle = DialogTitle2;
|
|
18532
18668
|
exports.DialogTrigger = DialogTrigger;
|
|
18533
18669
|
exports.DropdownMenu = DropdownMenu;
|
|
@@ -18603,6 +18739,7 @@ exports.PopoverContent = PopoverContent;
|
|
|
18603
18739
|
exports.PopoverTrigger = PopoverTrigger;
|
|
18604
18740
|
exports.PowerIcon = PowerIcon;
|
|
18605
18741
|
exports.PreventPageLeave = PreventPageLeave_default;
|
|
18742
|
+
exports.ProgressBar = ProgressBar_default;
|
|
18606
18743
|
exports.QuestionIcon = QuestionIcon;
|
|
18607
18744
|
exports.RadioGroupItem = RadioGroupItem;
|
|
18608
18745
|
exports.RadioGroupRoot = RadioGroupRoot;
|