@sustaina/shared-ui 1.33.2 → 1.35.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 +61 -5
- package/dist/index.d.ts +61 -5
- package/dist/index.js +259 -33
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +256 -33
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var AccordionPrimitive = require('@radix-ui/react-accordion');
|
|
4
3
|
var clsx2 = require('clsx');
|
|
5
4
|
var tailwindMerge = require('tailwind-merge');
|
|
6
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
var AccordionPrimitive = require('@radix-ui/react-accordion');
|
|
7
7
|
var React26 = require('react');
|
|
8
8
|
var lucideReact = require('lucide-react');
|
|
9
9
|
var reactDom = require('react-dom');
|
|
@@ -82,8 +82,8 @@ function _interopNamespace(e) {
|
|
|
82
82
|
return Object.freeze(n);
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
var AccordionPrimitive__namespace = /*#__PURE__*/_interopNamespace(AccordionPrimitive);
|
|
86
85
|
var clsx2__default = /*#__PURE__*/_interopDefault(clsx2);
|
|
86
|
+
var AccordionPrimitive__namespace = /*#__PURE__*/_interopNamespace(AccordionPrimitive);
|
|
87
87
|
var React26__namespace = /*#__PURE__*/_interopNamespace(React26);
|
|
88
88
|
var SelectPrimitive__namespace = /*#__PURE__*/_interopNamespace(SelectPrimitive);
|
|
89
89
|
var LabelPrimitive__namespace = /*#__PURE__*/_interopNamespace(LabelPrimitive);
|
|
@@ -777,6 +777,120 @@ var SuiWarningIcon = (props) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
|
777
777
|
}
|
|
778
778
|
);
|
|
779
779
|
var warning_default = SuiWarningIcon;
|
|
780
|
+
var TrashIcon = ({
|
|
781
|
+
size = 16,
|
|
782
|
+
color = "currentColor",
|
|
783
|
+
className,
|
|
784
|
+
...props
|
|
785
|
+
}) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
786
|
+
"svg",
|
|
787
|
+
{
|
|
788
|
+
viewBox: "0 0 17 15",
|
|
789
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
790
|
+
width: size,
|
|
791
|
+
height: size,
|
|
792
|
+
fill: "none",
|
|
793
|
+
className,
|
|
794
|
+
...props,
|
|
795
|
+
children: [
|
|
796
|
+
/* @__PURE__ */ jsxRuntime.jsxs("g", { clipPath: "url(#clip0_336_302483)", children: [
|
|
797
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
798
|
+
"path",
|
|
799
|
+
{
|
|
800
|
+
d: "M3.49371 2.12043C3.38318 1.44249 3.66212 0.708651 4.43068 0.529533C4.94459 0.409578 7.77168 0.42749 8.38456 0.492081C9.25207 0.583811 9.64966 1.36813 9.5125 2.12097C10.3748 2.22627 11.9484 1.85067 12.6087 2.44664C13.1053 2.89498 13.1452 3.75638 12.64 4.21232C12.2707 4.54558 12.1422 4.28179 12.0664 4.92282C11.7412 7.68938 11.6509 10.4907 11.3494 13.2605C11.2452 13.9135 10.7718 14.3401 10.0646 14.3895C7.73175 14.5534 5.1836 14.2619 2.8276 14.3873C2.09203 14.2587 1.75116 13.8364 1.64178 13.1655L0.878435 4.54558C0.710025 4.38221 0.481427 4.33281 0.310702 4.15532C-0.221151 3.60006 -0.0434807 2.66593 0.639999 2.29358C0.702502 2.25938 0.998811 2.12043 1.03411 2.12043H3.49371ZM4.30394 2.12043H8.70228C8.71964 1.8333 8.70691 1.36813 8.32321 1.30951C7.19122 1.38116 5.90586 1.20367 4.79238 1.30246C4.28831 1.34696 4.29815 1.71931 4.30394 2.12043ZM12.0415 3.0589C12.0172 3.03068 11.8812 2.9574 11.8419 2.94926L1.26329 2.93243C0.749379 2.95794 0.749379 3.72598 1.26329 3.75149H11.7429C12.1029 3.75312 12.2429 3.29338 12.0415 3.0589ZM11.2487 4.56295H1.75753L2.51508 13.1612C2.5608 13.4597 2.68754 13.5498 2.9989 13.5759C5.22817 13.762 7.7468 13.4293 10.0073 13.5759L10.3823 13.4391L11.2487 4.56295Z",
|
|
801
|
+
fill: color
|
|
802
|
+
}
|
|
803
|
+
),
|
|
804
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
805
|
+
"path",
|
|
806
|
+
{
|
|
807
|
+
d: "M4.22952 5.50209C4.41761 5.72137 4.34006 6.27067 4.36263 6.54477C4.51599 8.36961 4.73649 10.3719 4.77121 12.1892C4.78568 12.9404 3.98125 12.8953 3.90254 12.4047C3.84698 10.417 3.54836 8.42443 3.49164 6.43947C3.48586 6.23159 3.45576 5.67469 3.54894 5.52542C3.66411 5.34088 4.08426 5.33274 4.22952 5.50263V5.50209Z",
|
|
808
|
+
fill: color
|
|
809
|
+
}
|
|
810
|
+
),
|
|
811
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
812
|
+
"path",
|
|
813
|
+
{
|
|
814
|
+
d: "M9.43711 5.50146C9.55575 5.63933 9.52045 6.22879 9.51466 6.43776C9.45852 8.42272 9.15932 10.4153 9.10376 12.4029C9.02447 12.8936 8.21946 12.9381 8.23509 12.1875C8.27213 10.3681 8.48973 8.37007 8.64367 6.54306C8.67492 6.17234 8.50941 5.28598 9.18941 5.37771C9.24497 5.38531 9.40412 5.46238 9.43711 5.50092V5.50146Z",
|
|
815
|
+
fill: color
|
|
816
|
+
}
|
|
817
|
+
),
|
|
818
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
819
|
+
"path",
|
|
820
|
+
{
|
|
821
|
+
d: "M6.83313 5.50252C6.90547 5.58611 6.90142 5.68218 6.91068 5.78314C7.10224 7.89891 6.76253 10.266 6.90837 12.4083C6.88985 12.8822 6.11551 12.8806 6.09814 12.4083L6.15312 5.52478C6.31575 5.34783 6.6734 5.31689 6.83313 5.50252Z",
|
|
822
|
+
fill: color
|
|
823
|
+
}
|
|
824
|
+
)
|
|
825
|
+
] }),
|
|
826
|
+
/* @__PURE__ */ jsxRuntime.jsx("defs", { children: /* @__PURE__ */ jsxRuntime.jsx("clipPath", { id: "clip0_3678_200811", children: /* @__PURE__ */ jsxRuntime.jsx("rect", { width: "17", height: "15", fill: "white", transform: "translate(0.728516 0.726562)" }) }) })
|
|
827
|
+
]
|
|
828
|
+
}
|
|
829
|
+
);
|
|
830
|
+
var trash_default = TrashIcon;
|
|
831
|
+
var AuditFooter = ({
|
|
832
|
+
createdAt,
|
|
833
|
+
createdBy,
|
|
834
|
+
updatedAt,
|
|
835
|
+
updatedBy,
|
|
836
|
+
onDelete,
|
|
837
|
+
canDelete = true,
|
|
838
|
+
emptyValue = "-",
|
|
839
|
+
labels,
|
|
840
|
+
classNames,
|
|
841
|
+
formatters,
|
|
842
|
+
deleteAriaLabel = "Delete",
|
|
843
|
+
deleteIcon
|
|
844
|
+
}) => {
|
|
845
|
+
const resolvedLabels = {
|
|
846
|
+
createdOn: "Created on :",
|
|
847
|
+
createdAtTime: "at Time :",
|
|
848
|
+
createdBy: "by :",
|
|
849
|
+
updatedOn: "Last Update :",
|
|
850
|
+
updatedAtTime: "at Time :",
|
|
851
|
+
updatedBy: "by :",
|
|
852
|
+
...labels
|
|
853
|
+
};
|
|
854
|
+
const dateFormatter = formatters?.date ?? ((value) => formatISODate(value, "DD/MM/YYYY"));
|
|
855
|
+
const timeFormatter = formatters?.time ?? ((value) => formatISODate(value, "H:i"));
|
|
856
|
+
const userFormatter = formatters?.user ?? ((value) => value ?? emptyValue);
|
|
857
|
+
const resolvedDeleteIcon = deleteIcon ?? /* @__PURE__ */ jsxRuntime.jsx(trash_default, { className: "w-5 h-5" });
|
|
858
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("flex w-full h-14 mt-12 justify-between items-end px-3", classNames?.root), children: [
|
|
859
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
860
|
+
"div",
|
|
861
|
+
{
|
|
862
|
+
className: cn(
|
|
863
|
+
"grid grid-cols-[auto_1fr_auto_1fr] gap-x-3 gap-y-1 text-[10px]",
|
|
864
|
+
classNames?.grid
|
|
865
|
+
),
|
|
866
|
+
children: [
|
|
867
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: cn("font-bold italic text-[#3B4256]", classNames?.label), children: resolvedLabels.createdOn }),
|
|
868
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: classNames?.value, children: createdAt ? dateFormatter(createdAt) : emptyValue }),
|
|
869
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: cn("font-bold italic text-[#3B4256]", classNames?.label), children: resolvedLabels.createdAtTime }),
|
|
870
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: classNames?.value, children: createdAt ? timeFormatter(createdAt) : emptyValue }),
|
|
871
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: cn("font-bold italic text-[#3B4256]", classNames?.label), children: resolvedLabels.createdBy }),
|
|
872
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: cn("col-span-3", classNames?.value), children: userFormatter(createdBy) }),
|
|
873
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: cn("font-bold italic text-[#3B4256]", classNames?.label), children: resolvedLabels.updatedOn }),
|
|
874
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: classNames?.value, children: updatedAt ? dateFormatter(updatedAt) : emptyValue }),
|
|
875
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: cn("font-bold italic text-[#3B4256]", classNames?.label), children: resolvedLabels.updatedAtTime }),
|
|
876
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: classNames?.value, children: updatedAt ? timeFormatter(updatedAt) : emptyValue }),
|
|
877
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: cn("font-bold italic text-[#3B4256]", classNames?.label), children: resolvedLabels.updatedBy }),
|
|
878
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: cn("col-span-3", classNames?.value), children: userFormatter(updatedBy) })
|
|
879
|
+
]
|
|
880
|
+
}
|
|
881
|
+
),
|
|
882
|
+
onDelete && /* @__PURE__ */ jsxRuntime.jsx(
|
|
883
|
+
"div",
|
|
884
|
+
{
|
|
885
|
+
className: canDelete ? cn("w-5 h-5 cursor-pointer text-red-500", classNames?.deleteButton) : cn("w-5 h-5 text-gray-300 cursor-not-allowed", classNames?.deleteButtonDisabled),
|
|
886
|
+
onClick: canDelete ? onDelete : void 0,
|
|
887
|
+
"aria-label": deleteAriaLabel,
|
|
888
|
+
role: "button",
|
|
889
|
+
children: resolvedDeleteIcon
|
|
890
|
+
}
|
|
891
|
+
)
|
|
892
|
+
] });
|
|
893
|
+
};
|
|
780
894
|
function Accordion({ ...props }) {
|
|
781
895
|
return /* @__PURE__ */ jsxRuntime.jsx(AccordionPrimitive__namespace.Root, { "data-slot": "accordion", ...props });
|
|
782
896
|
}
|
|
@@ -4257,18 +4371,25 @@ var useControllableState = ({
|
|
|
4257
4371
|
defaultValue,
|
|
4258
4372
|
value
|
|
4259
4373
|
}) => {
|
|
4260
|
-
const
|
|
4374
|
+
const isControlled = typeof value !== "undefined";
|
|
4375
|
+
const [internalValue, setInternalValue] = React26__namespace.useState(() => {
|
|
4376
|
+
return isControlled ? value : defaultValue;
|
|
4377
|
+
});
|
|
4261
4378
|
React26__namespace.useEffect(() => {
|
|
4262
|
-
if (
|
|
4263
|
-
|
|
4264
|
-
|
|
4265
|
-
|
|
4266
|
-
|
|
4267
|
-
|
|
4268
|
-
|
|
4379
|
+
if (!isControlled) return;
|
|
4380
|
+
setInternalValue(value);
|
|
4381
|
+
}, [isControlled, value]);
|
|
4382
|
+
const setValue = React26__namespace.useCallback(
|
|
4383
|
+
(nextValue) => {
|
|
4384
|
+
if (isControlled) return;
|
|
4385
|
+
setInternalValue(nextValue);
|
|
4386
|
+
},
|
|
4387
|
+
[isControlled]
|
|
4388
|
+
);
|
|
4269
4389
|
return {
|
|
4270
|
-
value: internalValue,
|
|
4271
|
-
|
|
4390
|
+
value: isControlled ? value : internalValue,
|
|
4391
|
+
setValue,
|
|
4392
|
+
isControlled
|
|
4272
4393
|
};
|
|
4273
4394
|
};
|
|
4274
4395
|
var useControllableState_default = useControllableState;
|
|
@@ -5428,6 +5549,11 @@ var defaultResource = {
|
|
|
5428
5549
|
description: "Unsaved changes. Do you want to leave this page?",
|
|
5429
5550
|
confirm_text: "Leave"
|
|
5430
5551
|
},
|
|
5552
|
+
"confirm.reset_form": {
|
|
5553
|
+
title: "Confirmation",
|
|
5554
|
+
description: "Unsaved changes. If you continue, all changes will be lost.",
|
|
5555
|
+
confirm_text: "Reset"
|
|
5556
|
+
},
|
|
5431
5557
|
"confirm.remove": {
|
|
5432
5558
|
title: "Confirmation",
|
|
5433
5559
|
description: "Are you sure you want to remove this item?",
|
|
@@ -5493,9 +5619,13 @@ function DialogAlert({
|
|
|
5493
5619
|
onOpenChange(false);
|
|
5494
5620
|
}, [onCancel, onOpenChange]);
|
|
5495
5621
|
const handleConfirm = React26.useCallback(() => {
|
|
5496
|
-
onConfirm
|
|
5622
|
+
let func = onConfirm;
|
|
5623
|
+
if (variant === "success" && showCancel === false) {
|
|
5624
|
+
func = onConfirm ?? onCancel;
|
|
5625
|
+
}
|
|
5626
|
+
func?.();
|
|
5497
5627
|
onOpenChange(false);
|
|
5498
|
-
}, [onConfirm, onOpenChange]);
|
|
5628
|
+
}, [onCancel, onConfirm, onOpenChange, showCancel, variant]);
|
|
5499
5629
|
return /* @__PURE__ */ jsxRuntime.jsx(Dialog2, { open, onOpenChange: persistent ? () => {
|
|
5500
5630
|
} : onOpenChange, children: /* @__PURE__ */ jsxRuntime.jsxs(DialogContent2, { className: "max-w-md", showCloseButton: !persistent, children: [
|
|
5501
5631
|
/* @__PURE__ */ jsxRuntime.jsxs(DialogHeader2, { children: [
|
|
@@ -5663,6 +5793,12 @@ var DIALOG_ALERT_TEMPLATES = {
|
|
|
5663
5793
|
description: "confirm.leave_page.description",
|
|
5664
5794
|
confirmText: "confirm.leave_page.confirm_text"
|
|
5665
5795
|
},
|
|
5796
|
+
"confirm.reset_form": {
|
|
5797
|
+
variant: "confirm",
|
|
5798
|
+
title: "confirm.reset_form.title",
|
|
5799
|
+
description: "confirm.reset_form.description",
|
|
5800
|
+
confirmText: "confirm.reset_form.confirm_text"
|
|
5801
|
+
},
|
|
5666
5802
|
"confirm.remove": {
|
|
5667
5803
|
variant: "confirm",
|
|
5668
5804
|
title: "confirm.remove.title",
|
|
@@ -10384,10 +10520,7 @@ var Truncated = ({
|
|
|
10384
10520
|
rows: lineClampLines ?? 1,
|
|
10385
10521
|
expanded: false,
|
|
10386
10522
|
miscDeps: [truncationClass],
|
|
10387
|
-
onEllipsis:
|
|
10388
|
-
console.log("\u{1F680} ~ Truncated ~ s:", s);
|
|
10389
|
-
setIsTruncated(s);
|
|
10390
|
-
},
|
|
10523
|
+
onEllipsis: setIsTruncated,
|
|
10391
10524
|
children: () => normalizedChildren
|
|
10392
10525
|
}
|
|
10393
10526
|
) });
|
|
@@ -10417,10 +10550,10 @@ var Truncated = ({
|
|
|
10417
10550
|
{
|
|
10418
10551
|
side: tooltipSide,
|
|
10419
10552
|
className: cn(
|
|
10420
|
-
"text-white bg-
|
|
10553
|
+
"text-white bg-sus-secondary-gray-10 max-w-xs sm:max-w-md wrap-break-word shadow-lg",
|
|
10421
10554
|
tooltipContentClassName
|
|
10422
10555
|
),
|
|
10423
|
-
arrowClassName: cn("bg-
|
|
10556
|
+
arrowClassName: cn("bg-sus-secondary-gray-10 fill-sus-secondary-gray-10", tooltipArrowClassName),
|
|
10424
10557
|
...tooltipContentRest,
|
|
10425
10558
|
children: tooltipContent
|
|
10426
10559
|
}
|
|
@@ -11123,40 +11256,71 @@ var ComboboxInner = ({
|
|
|
11123
11256
|
notFoundContent,
|
|
11124
11257
|
searchPlaceholder,
|
|
11125
11258
|
showSearch,
|
|
11259
|
+
open,
|
|
11260
|
+
showValueWhenNoMatch,
|
|
11261
|
+
onOpenChange,
|
|
11262
|
+
onClear,
|
|
11126
11263
|
...props
|
|
11127
11264
|
}, ref) => {
|
|
11128
11265
|
const { getLabelField, getValueField } = useFieldNames_default({ fieldNames });
|
|
11129
|
-
const
|
|
11130
|
-
|
|
11266
|
+
const { value: openPopover, setValue: setOpenPopover } = useControllableState_default({
|
|
11267
|
+
defaultValue: false,
|
|
11268
|
+
value: open
|
|
11269
|
+
});
|
|
11270
|
+
const { value: selectedValue, setValue: setSelectedValue } = useControllableState_default({
|
|
11131
11271
|
defaultValue,
|
|
11132
11272
|
value
|
|
11133
11273
|
});
|
|
11134
|
-
const
|
|
11135
|
-
|
|
11136
|
-
const selectedOptionFound = options?.find((option) => {
|
|
11274
|
+
const currentSelectedOption = React26__namespace.useMemo(() => {
|
|
11275
|
+
return options?.find((option) => {
|
|
11137
11276
|
const optionValue = getValueField(option);
|
|
11138
11277
|
return optionValue === selectedValue;
|
|
11139
11278
|
});
|
|
11140
|
-
|
|
11141
|
-
|
|
11279
|
+
}, [getValueField, options, selectedValue]);
|
|
11280
|
+
const renderValue = React26__namespace.useMemo(() => {
|
|
11281
|
+
if (!selectedValue) return placeholder2;
|
|
11282
|
+
if (currentSelectedOption) {
|
|
11283
|
+
return getLabelField(currentSelectedOption);
|
|
11284
|
+
}
|
|
11285
|
+
if (showValueWhenNoMatch) {
|
|
11286
|
+
return selectedValue;
|
|
11287
|
+
}
|
|
11288
|
+
return null;
|
|
11289
|
+
}, [currentSelectedOption, getLabelField, placeholder2, selectedValue, showValueWhenNoMatch]);
|
|
11142
11290
|
const handleSelect = React26__namespace.useCallback(
|
|
11143
11291
|
(selected, option) => {
|
|
11144
11292
|
setSelectedValue(selected);
|
|
11145
|
-
|
|
11293
|
+
setOpenPopover(false);
|
|
11146
11294
|
if (typeof onSelect === "function") {
|
|
11147
11295
|
onSelect(selected, option);
|
|
11148
11296
|
}
|
|
11297
|
+
if (typeof onOpenChange === "function") {
|
|
11298
|
+
onOpenChange(false);
|
|
11299
|
+
}
|
|
11149
11300
|
},
|
|
11150
|
-
[onSelect, setSelectedValue]
|
|
11301
|
+
[onOpenChange, onSelect, setOpenPopover, setSelectedValue]
|
|
11302
|
+
);
|
|
11303
|
+
const handleOpenPopover = React26__namespace.useCallback(
|
|
11304
|
+
(isOpen) => {
|
|
11305
|
+
if (disabled) return;
|
|
11306
|
+
setOpenPopover(isOpen);
|
|
11307
|
+
if (typeof onOpenChange === "function") {
|
|
11308
|
+
onOpenChange(isOpen);
|
|
11309
|
+
}
|
|
11310
|
+
},
|
|
11311
|
+
[disabled, onOpenChange, setOpenPopover]
|
|
11151
11312
|
);
|
|
11152
11313
|
const handleClear = React26__namespace.useCallback(
|
|
11153
11314
|
(event) => {
|
|
11154
11315
|
event.stopPropagation();
|
|
11155
11316
|
setSelectedValue(void 0);
|
|
11317
|
+
if (typeof onClear === "function") {
|
|
11318
|
+
onClear(selectedValue, currentSelectedOption);
|
|
11319
|
+
}
|
|
11156
11320
|
},
|
|
11157
|
-
[setSelectedValue]
|
|
11321
|
+
[currentSelectedOption, onClear, selectedValue, setSelectedValue]
|
|
11158
11322
|
);
|
|
11159
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(Popover, { open, onOpenChange:
|
|
11323
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Popover, { open: openPopover, onOpenChange: handleOpenPopover, children: [
|
|
11160
11324
|
/* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
11161
11325
|
"button",
|
|
11162
11326
|
{
|
|
@@ -11164,7 +11328,7 @@ var ComboboxInner = ({
|
|
|
11164
11328
|
name,
|
|
11165
11329
|
type: "button",
|
|
11166
11330
|
role: "combobox",
|
|
11167
|
-
"aria-expanded":
|
|
11331
|
+
"aria-expanded": openPopover,
|
|
11168
11332
|
className: cn(
|
|
11169
11333
|
"flex items-center justify-between gap-2 rounded-md border bg-white px-3 h-9 text-sm whitespace-nowrap shadow-xs outline-none border-input",
|
|
11170
11334
|
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
@@ -11174,7 +11338,7 @@ var ComboboxInner = ({
|
|
|
11174
11338
|
"transition-all",
|
|
11175
11339
|
className
|
|
11176
11340
|
),
|
|
11177
|
-
"data-state":
|
|
11341
|
+
"data-state": openPopover ? "open" : "closed",
|
|
11178
11342
|
disabled,
|
|
11179
11343
|
onFocus,
|
|
11180
11344
|
onBlur,
|
|
@@ -11237,6 +11401,65 @@ var ComboboxInner = ({
|
|
|
11237
11401
|
};
|
|
11238
11402
|
var Combobox = React26__namespace.forwardRef(ComboboxInner);
|
|
11239
11403
|
var Combobox_default = Combobox;
|
|
11404
|
+
var TruncatedMouseEnterDiv = ({
|
|
11405
|
+
value,
|
|
11406
|
+
className,
|
|
11407
|
+
tooltipProps,
|
|
11408
|
+
tooltipContentProps,
|
|
11409
|
+
arrowClassName
|
|
11410
|
+
}) => {
|
|
11411
|
+
const textRef = React26.useRef(null);
|
|
11412
|
+
const [isTruncated, setIsTruncated] = React26.useState(false);
|
|
11413
|
+
const checkTruncation = () => {
|
|
11414
|
+
if (textRef.current) {
|
|
11415
|
+
const { scrollWidth, clientWidth } = textRef.current;
|
|
11416
|
+
setIsTruncated(scrollWidth > clientWidth);
|
|
11417
|
+
}
|
|
11418
|
+
};
|
|
11419
|
+
const {
|
|
11420
|
+
className: tooltipContentClassName,
|
|
11421
|
+
side: tooltipContentSide,
|
|
11422
|
+
sideOffset: tooltipContentSideOffset,
|
|
11423
|
+
...tooltipContentRest
|
|
11424
|
+
} = tooltipContentProps ?? {};
|
|
11425
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Tooltip2, { open: isTruncated, ...tooltipProps, children: [
|
|
11426
|
+
/* @__PURE__ */ jsxRuntime.jsx(TooltipTrigger2, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
11427
|
+
"div",
|
|
11428
|
+
{
|
|
11429
|
+
ref: textRef,
|
|
11430
|
+
onMouseEnter: checkTruncation,
|
|
11431
|
+
onMouseLeave: () => setIsTruncated(false),
|
|
11432
|
+
className: cn("truncate", className),
|
|
11433
|
+
children: value
|
|
11434
|
+
}
|
|
11435
|
+
) }),
|
|
11436
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
11437
|
+
TooltipContent2,
|
|
11438
|
+
{
|
|
11439
|
+
side: tooltipContentSide ?? "bottom",
|
|
11440
|
+
className: cn(
|
|
11441
|
+
"text-white bg-sus-secondary-gray-10 max-w-xs sm:max-w-md wrap-break-word shadow-lg",
|
|
11442
|
+
tooltipContentClassName
|
|
11443
|
+
),
|
|
11444
|
+
sideOffset: tooltipContentSideOffset ?? 10,
|
|
11445
|
+
...tooltipContentRest,
|
|
11446
|
+
children: [
|
|
11447
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11448
|
+
TooltipArrow,
|
|
11449
|
+
{
|
|
11450
|
+
className: cn(
|
|
11451
|
+
"bg-sus-secondary-gray-10 fill-sus-secondary-gray-10 z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px]",
|
|
11452
|
+
arrowClassName
|
|
11453
|
+
)
|
|
11454
|
+
}
|
|
11455
|
+
),
|
|
11456
|
+
value
|
|
11457
|
+
]
|
|
11458
|
+
}
|
|
11459
|
+
)
|
|
11460
|
+
] });
|
|
11461
|
+
};
|
|
11462
|
+
var truncatedMouseEnterDiv_default = TruncatedMouseEnterDiv;
|
|
11240
11463
|
|
|
11241
11464
|
exports.Accordion = Accordion;
|
|
11242
11465
|
exports.AccordionContent = AccordionContent;
|
|
@@ -11245,6 +11468,7 @@ exports.AccordionTrigger = AccordionTrigger;
|
|
|
11245
11468
|
exports.ActionMenu = ActionMenu;
|
|
11246
11469
|
exports.AdvanceSearch = AdvanceSearch_default;
|
|
11247
11470
|
exports.ArrowIcon = arrow_default;
|
|
11471
|
+
exports.AuditFooter = AuditFooter;
|
|
11248
11472
|
exports.Button = Button;
|
|
11249
11473
|
exports.Checkbox = Checkbox;
|
|
11250
11474
|
exports.Collapsible = Collapsible;
|
|
@@ -11374,7 +11598,9 @@ exports.TooltipArrow = TooltipArrow;
|
|
|
11374
11598
|
exports.TooltipContent = TooltipContent2;
|
|
11375
11599
|
exports.TooltipProvider = TooltipProvider2;
|
|
11376
11600
|
exports.TooltipTrigger = TooltipTrigger2;
|
|
11601
|
+
exports.TrashIcon = trash_default;
|
|
11377
11602
|
exports.Truncated = truncated_default;
|
|
11603
|
+
exports.TruncatedMouseEnterDiv = truncatedMouseEnterDiv_default;
|
|
11378
11604
|
exports.UI = ui_exports;
|
|
11379
11605
|
exports.VirtualizedCommand = VirtualizedCommand_default;
|
|
11380
11606
|
exports.booleanToSelectValue = booleanToSelectValue;
|