@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.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as AccordionPrimitive from '@radix-ui/react-accordion';
|
|
2
1
|
import clsx2, { clsx } from 'clsx';
|
|
3
2
|
import { twMerge } from 'tailwind-merge';
|
|
4
3
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
4
|
+
import * as AccordionPrimitive from '@radix-ui/react-accordion';
|
|
5
5
|
import * as React26 from 'react';
|
|
6
6
|
import React26__default, { forwardRef, useRef, useMemo, useCallback, useState, isValidElement, useEffect, useLayoutEffect, createElement } from 'react';
|
|
7
7
|
import { CircleX, Undo, Redo, Bold, Italic, Underline, Strikethrough, Code, Pilcrow, Heading1, Heading2, Heading3, List as List$1, ListOrdered, Quote, CodeSquare, Link, Link2Off, Image as Image$1, AlignLeft, AlignCenter, AlignRight, CircleHelp, ChevronDown, X, Check, XIcon, SearchIcon, ChevronRight, CheckIcon, Triangle, CalendarIcon, Search, ChevronUp, PanelLeftIcon, Minimize2, Maximize2, Plus, ChevronLeft, CircleUserRound, MoreVertical, Bug, GripVertical, Info, CircleMinus, Minus } from 'lucide-react';
|
|
@@ -737,6 +737,120 @@ var SuiWarningIcon = (props) => /* @__PURE__ */ jsxs(
|
|
|
737
737
|
}
|
|
738
738
|
);
|
|
739
739
|
var warning_default = SuiWarningIcon;
|
|
740
|
+
var TrashIcon = ({
|
|
741
|
+
size = 16,
|
|
742
|
+
color = "currentColor",
|
|
743
|
+
className,
|
|
744
|
+
...props
|
|
745
|
+
}) => /* @__PURE__ */ jsxs(
|
|
746
|
+
"svg",
|
|
747
|
+
{
|
|
748
|
+
viewBox: "0 0 17 15",
|
|
749
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
750
|
+
width: size,
|
|
751
|
+
height: size,
|
|
752
|
+
fill: "none",
|
|
753
|
+
className,
|
|
754
|
+
...props,
|
|
755
|
+
children: [
|
|
756
|
+
/* @__PURE__ */ jsxs("g", { clipPath: "url(#clip0_336_302483)", children: [
|
|
757
|
+
/* @__PURE__ */ jsx(
|
|
758
|
+
"path",
|
|
759
|
+
{
|
|
760
|
+
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",
|
|
761
|
+
fill: color
|
|
762
|
+
}
|
|
763
|
+
),
|
|
764
|
+
/* @__PURE__ */ jsx(
|
|
765
|
+
"path",
|
|
766
|
+
{
|
|
767
|
+
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",
|
|
768
|
+
fill: color
|
|
769
|
+
}
|
|
770
|
+
),
|
|
771
|
+
/* @__PURE__ */ jsx(
|
|
772
|
+
"path",
|
|
773
|
+
{
|
|
774
|
+
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",
|
|
775
|
+
fill: color
|
|
776
|
+
}
|
|
777
|
+
),
|
|
778
|
+
/* @__PURE__ */ jsx(
|
|
779
|
+
"path",
|
|
780
|
+
{
|
|
781
|
+
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",
|
|
782
|
+
fill: color
|
|
783
|
+
}
|
|
784
|
+
)
|
|
785
|
+
] }),
|
|
786
|
+
/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx("clipPath", { id: "clip0_3678_200811", children: /* @__PURE__ */ jsx("rect", { width: "17", height: "15", fill: "white", transform: "translate(0.728516 0.726562)" }) }) })
|
|
787
|
+
]
|
|
788
|
+
}
|
|
789
|
+
);
|
|
790
|
+
var trash_default = TrashIcon;
|
|
791
|
+
var AuditFooter = ({
|
|
792
|
+
createdAt,
|
|
793
|
+
createdBy,
|
|
794
|
+
updatedAt,
|
|
795
|
+
updatedBy,
|
|
796
|
+
onDelete,
|
|
797
|
+
canDelete = true,
|
|
798
|
+
emptyValue = "-",
|
|
799
|
+
labels,
|
|
800
|
+
classNames,
|
|
801
|
+
formatters,
|
|
802
|
+
deleteAriaLabel = "Delete",
|
|
803
|
+
deleteIcon
|
|
804
|
+
}) => {
|
|
805
|
+
const resolvedLabels = {
|
|
806
|
+
createdOn: "Created on :",
|
|
807
|
+
createdAtTime: "at Time :",
|
|
808
|
+
createdBy: "by :",
|
|
809
|
+
updatedOn: "Last Update :",
|
|
810
|
+
updatedAtTime: "at Time :",
|
|
811
|
+
updatedBy: "by :",
|
|
812
|
+
...labels
|
|
813
|
+
};
|
|
814
|
+
const dateFormatter = formatters?.date ?? ((value) => formatISODate(value, "DD/MM/YYYY"));
|
|
815
|
+
const timeFormatter = formatters?.time ?? ((value) => formatISODate(value, "H:i"));
|
|
816
|
+
const userFormatter = formatters?.user ?? ((value) => value ?? emptyValue);
|
|
817
|
+
const resolvedDeleteIcon = deleteIcon ?? /* @__PURE__ */ jsx(trash_default, { className: "w-5 h-5" });
|
|
818
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("flex w-full h-14 mt-12 justify-between items-end px-3", classNames?.root), children: [
|
|
819
|
+
/* @__PURE__ */ jsxs(
|
|
820
|
+
"div",
|
|
821
|
+
{
|
|
822
|
+
className: cn(
|
|
823
|
+
"grid grid-cols-[auto_1fr_auto_1fr] gap-x-3 gap-y-1 text-[10px]",
|
|
824
|
+
classNames?.grid
|
|
825
|
+
),
|
|
826
|
+
children: [
|
|
827
|
+
/* @__PURE__ */ jsx("p", { className: cn("font-bold italic text-[#3B4256]", classNames?.label), children: resolvedLabels.createdOn }),
|
|
828
|
+
/* @__PURE__ */ jsx("p", { className: classNames?.value, children: createdAt ? dateFormatter(createdAt) : emptyValue }),
|
|
829
|
+
/* @__PURE__ */ jsx("p", { className: cn("font-bold italic text-[#3B4256]", classNames?.label), children: resolvedLabels.createdAtTime }),
|
|
830
|
+
/* @__PURE__ */ jsx("p", { className: classNames?.value, children: createdAt ? timeFormatter(createdAt) : emptyValue }),
|
|
831
|
+
/* @__PURE__ */ jsx("p", { className: cn("font-bold italic text-[#3B4256]", classNames?.label), children: resolvedLabels.createdBy }),
|
|
832
|
+
/* @__PURE__ */ jsx("p", { className: cn("col-span-3", classNames?.value), children: userFormatter(createdBy) }),
|
|
833
|
+
/* @__PURE__ */ jsx("p", { className: cn("font-bold italic text-[#3B4256]", classNames?.label), children: resolvedLabels.updatedOn }),
|
|
834
|
+
/* @__PURE__ */ jsx("p", { className: classNames?.value, children: updatedAt ? dateFormatter(updatedAt) : emptyValue }),
|
|
835
|
+
/* @__PURE__ */ jsx("p", { className: cn("font-bold italic text-[#3B4256]", classNames?.label), children: resolvedLabels.updatedAtTime }),
|
|
836
|
+
/* @__PURE__ */ jsx("p", { className: classNames?.value, children: updatedAt ? timeFormatter(updatedAt) : emptyValue }),
|
|
837
|
+
/* @__PURE__ */ jsx("p", { className: cn("font-bold italic text-[#3B4256]", classNames?.label), children: resolvedLabels.updatedBy }),
|
|
838
|
+
/* @__PURE__ */ jsx("p", { className: cn("col-span-3", classNames?.value), children: userFormatter(updatedBy) })
|
|
839
|
+
]
|
|
840
|
+
}
|
|
841
|
+
),
|
|
842
|
+
onDelete && /* @__PURE__ */ jsx(
|
|
843
|
+
"div",
|
|
844
|
+
{
|
|
845
|
+
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),
|
|
846
|
+
onClick: canDelete ? onDelete : void 0,
|
|
847
|
+
"aria-label": deleteAriaLabel,
|
|
848
|
+
role: "button",
|
|
849
|
+
children: resolvedDeleteIcon
|
|
850
|
+
}
|
|
851
|
+
)
|
|
852
|
+
] });
|
|
853
|
+
};
|
|
740
854
|
function Accordion({ ...props }) {
|
|
741
855
|
return /* @__PURE__ */ jsx(AccordionPrimitive.Root, { "data-slot": "accordion", ...props });
|
|
742
856
|
}
|
|
@@ -4217,18 +4331,25 @@ var useControllableState = ({
|
|
|
4217
4331
|
defaultValue,
|
|
4218
4332
|
value
|
|
4219
4333
|
}) => {
|
|
4220
|
-
const
|
|
4334
|
+
const isControlled = typeof value !== "undefined";
|
|
4335
|
+
const [internalValue, setInternalValue] = React26.useState(() => {
|
|
4336
|
+
return isControlled ? value : defaultValue;
|
|
4337
|
+
});
|
|
4221
4338
|
React26.useEffect(() => {
|
|
4222
|
-
if (
|
|
4223
|
-
|
|
4224
|
-
|
|
4225
|
-
|
|
4226
|
-
|
|
4227
|
-
|
|
4228
|
-
|
|
4339
|
+
if (!isControlled) return;
|
|
4340
|
+
setInternalValue(value);
|
|
4341
|
+
}, [isControlled, value]);
|
|
4342
|
+
const setValue = React26.useCallback(
|
|
4343
|
+
(nextValue) => {
|
|
4344
|
+
if (isControlled) return;
|
|
4345
|
+
setInternalValue(nextValue);
|
|
4346
|
+
},
|
|
4347
|
+
[isControlled]
|
|
4348
|
+
);
|
|
4229
4349
|
return {
|
|
4230
|
-
value: internalValue,
|
|
4231
|
-
|
|
4350
|
+
value: isControlled ? value : internalValue,
|
|
4351
|
+
setValue,
|
|
4352
|
+
isControlled
|
|
4232
4353
|
};
|
|
4233
4354
|
};
|
|
4234
4355
|
var useControllableState_default = useControllableState;
|
|
@@ -5388,6 +5509,11 @@ var defaultResource = {
|
|
|
5388
5509
|
description: "Unsaved changes. Do you want to leave this page?",
|
|
5389
5510
|
confirm_text: "Leave"
|
|
5390
5511
|
},
|
|
5512
|
+
"confirm.reset_form": {
|
|
5513
|
+
title: "Confirmation",
|
|
5514
|
+
description: "Unsaved changes. If you continue, all changes will be lost.",
|
|
5515
|
+
confirm_text: "Reset"
|
|
5516
|
+
},
|
|
5391
5517
|
"confirm.remove": {
|
|
5392
5518
|
title: "Confirmation",
|
|
5393
5519
|
description: "Are you sure you want to remove this item?",
|
|
@@ -5453,9 +5579,13 @@ function DialogAlert({
|
|
|
5453
5579
|
onOpenChange(false);
|
|
5454
5580
|
}, [onCancel, onOpenChange]);
|
|
5455
5581
|
const handleConfirm = useCallback(() => {
|
|
5456
|
-
onConfirm
|
|
5582
|
+
let func = onConfirm;
|
|
5583
|
+
if (variant === "success" && showCancel === false) {
|
|
5584
|
+
func = onConfirm ?? onCancel;
|
|
5585
|
+
}
|
|
5586
|
+
func?.();
|
|
5457
5587
|
onOpenChange(false);
|
|
5458
|
-
}, [onConfirm, onOpenChange]);
|
|
5588
|
+
}, [onCancel, onConfirm, onOpenChange, showCancel, variant]);
|
|
5459
5589
|
return /* @__PURE__ */ jsx(Dialog2, { open, onOpenChange: persistent ? () => {
|
|
5460
5590
|
} : onOpenChange, children: /* @__PURE__ */ jsxs(DialogContent2, { className: "max-w-md", showCloseButton: !persistent, children: [
|
|
5461
5591
|
/* @__PURE__ */ jsxs(DialogHeader2, { children: [
|
|
@@ -5623,6 +5753,12 @@ var DIALOG_ALERT_TEMPLATES = {
|
|
|
5623
5753
|
description: "confirm.leave_page.description",
|
|
5624
5754
|
confirmText: "confirm.leave_page.confirm_text"
|
|
5625
5755
|
},
|
|
5756
|
+
"confirm.reset_form": {
|
|
5757
|
+
variant: "confirm",
|
|
5758
|
+
title: "confirm.reset_form.title",
|
|
5759
|
+
description: "confirm.reset_form.description",
|
|
5760
|
+
confirmText: "confirm.reset_form.confirm_text"
|
|
5761
|
+
},
|
|
5626
5762
|
"confirm.remove": {
|
|
5627
5763
|
variant: "confirm",
|
|
5628
5764
|
title: "confirm.remove.title",
|
|
@@ -10344,10 +10480,7 @@ var Truncated = ({
|
|
|
10344
10480
|
rows: lineClampLines ?? 1,
|
|
10345
10481
|
expanded: false,
|
|
10346
10482
|
miscDeps: [truncationClass],
|
|
10347
|
-
onEllipsis:
|
|
10348
|
-
console.log("\u{1F680} ~ Truncated ~ s:", s);
|
|
10349
|
-
setIsTruncated(s);
|
|
10350
|
-
},
|
|
10483
|
+
onEllipsis: setIsTruncated,
|
|
10351
10484
|
children: () => normalizedChildren
|
|
10352
10485
|
}
|
|
10353
10486
|
) });
|
|
@@ -10377,10 +10510,10 @@ var Truncated = ({
|
|
|
10377
10510
|
{
|
|
10378
10511
|
side: tooltipSide,
|
|
10379
10512
|
className: cn(
|
|
10380
|
-
"text-white bg-
|
|
10513
|
+
"text-white bg-sus-secondary-gray-10 max-w-xs sm:max-w-md wrap-break-word shadow-lg",
|
|
10381
10514
|
tooltipContentClassName
|
|
10382
10515
|
),
|
|
10383
|
-
arrowClassName: cn("bg-
|
|
10516
|
+
arrowClassName: cn("bg-sus-secondary-gray-10 fill-sus-secondary-gray-10", tooltipArrowClassName),
|
|
10384
10517
|
...tooltipContentRest,
|
|
10385
10518
|
children: tooltipContent
|
|
10386
10519
|
}
|
|
@@ -11083,40 +11216,71 @@ var ComboboxInner = ({
|
|
|
11083
11216
|
notFoundContent,
|
|
11084
11217
|
searchPlaceholder,
|
|
11085
11218
|
showSearch,
|
|
11219
|
+
open,
|
|
11220
|
+
showValueWhenNoMatch,
|
|
11221
|
+
onOpenChange,
|
|
11222
|
+
onClear,
|
|
11086
11223
|
...props
|
|
11087
11224
|
}, ref) => {
|
|
11088
11225
|
const { getLabelField, getValueField } = useFieldNames_default({ fieldNames });
|
|
11089
|
-
const
|
|
11090
|
-
|
|
11226
|
+
const { value: openPopover, setValue: setOpenPopover } = useControllableState_default({
|
|
11227
|
+
defaultValue: false,
|
|
11228
|
+
value: open
|
|
11229
|
+
});
|
|
11230
|
+
const { value: selectedValue, setValue: setSelectedValue } = useControllableState_default({
|
|
11091
11231
|
defaultValue,
|
|
11092
11232
|
value
|
|
11093
11233
|
});
|
|
11094
|
-
const
|
|
11095
|
-
|
|
11096
|
-
const selectedOptionFound = options?.find((option) => {
|
|
11234
|
+
const currentSelectedOption = React26.useMemo(() => {
|
|
11235
|
+
return options?.find((option) => {
|
|
11097
11236
|
const optionValue = getValueField(option);
|
|
11098
11237
|
return optionValue === selectedValue;
|
|
11099
11238
|
});
|
|
11100
|
-
|
|
11101
|
-
|
|
11239
|
+
}, [getValueField, options, selectedValue]);
|
|
11240
|
+
const renderValue = React26.useMemo(() => {
|
|
11241
|
+
if (!selectedValue) return placeholder2;
|
|
11242
|
+
if (currentSelectedOption) {
|
|
11243
|
+
return getLabelField(currentSelectedOption);
|
|
11244
|
+
}
|
|
11245
|
+
if (showValueWhenNoMatch) {
|
|
11246
|
+
return selectedValue;
|
|
11247
|
+
}
|
|
11248
|
+
return null;
|
|
11249
|
+
}, [currentSelectedOption, getLabelField, placeholder2, selectedValue, showValueWhenNoMatch]);
|
|
11102
11250
|
const handleSelect = React26.useCallback(
|
|
11103
11251
|
(selected, option) => {
|
|
11104
11252
|
setSelectedValue(selected);
|
|
11105
|
-
|
|
11253
|
+
setOpenPopover(false);
|
|
11106
11254
|
if (typeof onSelect === "function") {
|
|
11107
11255
|
onSelect(selected, option);
|
|
11108
11256
|
}
|
|
11257
|
+
if (typeof onOpenChange === "function") {
|
|
11258
|
+
onOpenChange(false);
|
|
11259
|
+
}
|
|
11109
11260
|
},
|
|
11110
|
-
[onSelect, setSelectedValue]
|
|
11261
|
+
[onOpenChange, onSelect, setOpenPopover, setSelectedValue]
|
|
11262
|
+
);
|
|
11263
|
+
const handleOpenPopover = React26.useCallback(
|
|
11264
|
+
(isOpen) => {
|
|
11265
|
+
if (disabled) return;
|
|
11266
|
+
setOpenPopover(isOpen);
|
|
11267
|
+
if (typeof onOpenChange === "function") {
|
|
11268
|
+
onOpenChange(isOpen);
|
|
11269
|
+
}
|
|
11270
|
+
},
|
|
11271
|
+
[disabled, onOpenChange, setOpenPopover]
|
|
11111
11272
|
);
|
|
11112
11273
|
const handleClear = React26.useCallback(
|
|
11113
11274
|
(event) => {
|
|
11114
11275
|
event.stopPropagation();
|
|
11115
11276
|
setSelectedValue(void 0);
|
|
11277
|
+
if (typeof onClear === "function") {
|
|
11278
|
+
onClear(selectedValue, currentSelectedOption);
|
|
11279
|
+
}
|
|
11116
11280
|
},
|
|
11117
|
-
[setSelectedValue]
|
|
11281
|
+
[currentSelectedOption, onClear, selectedValue, setSelectedValue]
|
|
11118
11282
|
);
|
|
11119
|
-
return /* @__PURE__ */ jsxs(Popover, { open, onOpenChange:
|
|
11283
|
+
return /* @__PURE__ */ jsxs(Popover, { open: openPopover, onOpenChange: handleOpenPopover, children: [
|
|
11120
11284
|
/* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
11121
11285
|
"button",
|
|
11122
11286
|
{
|
|
@@ -11124,7 +11288,7 @@ var ComboboxInner = ({
|
|
|
11124
11288
|
name,
|
|
11125
11289
|
type: "button",
|
|
11126
11290
|
role: "combobox",
|
|
11127
|
-
"aria-expanded":
|
|
11291
|
+
"aria-expanded": openPopover,
|
|
11128
11292
|
className: cn(
|
|
11129
11293
|
"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",
|
|
11130
11294
|
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
@@ -11134,7 +11298,7 @@ var ComboboxInner = ({
|
|
|
11134
11298
|
"transition-all",
|
|
11135
11299
|
className
|
|
11136
11300
|
),
|
|
11137
|
-
"data-state":
|
|
11301
|
+
"data-state": openPopover ? "open" : "closed",
|
|
11138
11302
|
disabled,
|
|
11139
11303
|
onFocus,
|
|
11140
11304
|
onBlur,
|
|
@@ -11197,7 +11361,66 @@ var ComboboxInner = ({
|
|
|
11197
11361
|
};
|
|
11198
11362
|
var Combobox = React26.forwardRef(ComboboxInner);
|
|
11199
11363
|
var Combobox_default = Combobox;
|
|
11364
|
+
var TruncatedMouseEnterDiv = ({
|
|
11365
|
+
value,
|
|
11366
|
+
className,
|
|
11367
|
+
tooltipProps,
|
|
11368
|
+
tooltipContentProps,
|
|
11369
|
+
arrowClassName
|
|
11370
|
+
}) => {
|
|
11371
|
+
const textRef = useRef(null);
|
|
11372
|
+
const [isTruncated, setIsTruncated] = useState(false);
|
|
11373
|
+
const checkTruncation = () => {
|
|
11374
|
+
if (textRef.current) {
|
|
11375
|
+
const { scrollWidth, clientWidth } = textRef.current;
|
|
11376
|
+
setIsTruncated(scrollWidth > clientWidth);
|
|
11377
|
+
}
|
|
11378
|
+
};
|
|
11379
|
+
const {
|
|
11380
|
+
className: tooltipContentClassName,
|
|
11381
|
+
side: tooltipContentSide,
|
|
11382
|
+
sideOffset: tooltipContentSideOffset,
|
|
11383
|
+
...tooltipContentRest
|
|
11384
|
+
} = tooltipContentProps ?? {};
|
|
11385
|
+
return /* @__PURE__ */ jsxs(Tooltip2, { open: isTruncated, ...tooltipProps, children: [
|
|
11386
|
+
/* @__PURE__ */ jsx(TooltipTrigger2, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
11387
|
+
"div",
|
|
11388
|
+
{
|
|
11389
|
+
ref: textRef,
|
|
11390
|
+
onMouseEnter: checkTruncation,
|
|
11391
|
+
onMouseLeave: () => setIsTruncated(false),
|
|
11392
|
+
className: cn("truncate", className),
|
|
11393
|
+
children: value
|
|
11394
|
+
}
|
|
11395
|
+
) }),
|
|
11396
|
+
/* @__PURE__ */ jsxs(
|
|
11397
|
+
TooltipContent2,
|
|
11398
|
+
{
|
|
11399
|
+
side: tooltipContentSide ?? "bottom",
|
|
11400
|
+
className: cn(
|
|
11401
|
+
"text-white bg-sus-secondary-gray-10 max-w-xs sm:max-w-md wrap-break-word shadow-lg",
|
|
11402
|
+
tooltipContentClassName
|
|
11403
|
+
),
|
|
11404
|
+
sideOffset: tooltipContentSideOffset ?? 10,
|
|
11405
|
+
...tooltipContentRest,
|
|
11406
|
+
children: [
|
|
11407
|
+
/* @__PURE__ */ jsx(
|
|
11408
|
+
TooltipArrow,
|
|
11409
|
+
{
|
|
11410
|
+
className: cn(
|
|
11411
|
+
"bg-sus-secondary-gray-10 fill-sus-secondary-gray-10 z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px]",
|
|
11412
|
+
arrowClassName
|
|
11413
|
+
)
|
|
11414
|
+
}
|
|
11415
|
+
),
|
|
11416
|
+
value
|
|
11417
|
+
]
|
|
11418
|
+
}
|
|
11419
|
+
)
|
|
11420
|
+
] });
|
|
11421
|
+
};
|
|
11422
|
+
var truncatedMouseEnterDiv_default = TruncatedMouseEnterDiv;
|
|
11200
11423
|
|
|
11201
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, ActionMenu, AdvanceSearch_default as AdvanceSearch, arrow_default as ArrowIcon, Button, Checkbox, Collapsible, CollapsibleContent2 as CollapsibleContent, CollapsibleTrigger2 as CollapsibleTrigger, Combobox_default as Combobox, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, CropperModal, CropperModalError, DIALOG_ALERT_I18N_SUBNAMESPACE, DIALOG_ALERT_TEMPLATES, DataTable_default as DataTable, DatePicker2 as DatePicker, Dialog, DialogAlert, DialogAlertProvider, DialogContent, DialogDescription, DialogFooter, DialogTitle, DialogTrigger, ErrorCompression, ErrorCreateCanvas, ErrorGeneratingBlob, ErrorInvalidSVG, ErrorSVGExceedSize, filters_default as FiltersIcon, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, FormulaEditor, GridSettingsModal_default as GridSettingsModal, HeaderCell_default as HeaderCell, Image2 as Image, Input, InputNumber_default as InputNumber, Label2 as Label, List_default as List, container_default as ListContainer, header_default as ListHeader, table_default as ListTable, LookupSelect, MonthPicker2 as MonthPicker, navbar_default as Navbar, not_found_default as NotFoundIcon, Popover, PopoverAnchor, PopoverArrow, PopoverContent, PopoverTrigger, PreventPageLeave_default as PreventPageLeave, RadioGroupItem, RadioGroupRoot, RadioLabel, RichText, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator2 as Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarLayout, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Spinner, calendar_default as SuiCalendarIcon, calendar2_default as SuiCalendarIcon2, check_default as SuiCheckIcon, dots_vertical_default as SuiDotsVerticalIcon, empty_data_default as SuiEmptyDataIcon, expand_default as SuiExpandIcon, filter_default as SuiFilterIcon, setting_default as SuiSettingIcon, triangle_down_default as SuiTriangleDownIcon, warning_default as SuiWarningIcon, Switch, Textarea, Tooltip2 as Tooltip, TooltipArrow, TooltipContent2 as TooltipContent, TooltipProvider2 as TooltipProvider, TooltipTrigger2 as TooltipTrigger, truncated_default as Truncated, ui_exports as UI, VirtualizedCommand_default as VirtualizedCommand, booleanToSelectValue, buildPrefixMap, buttonVariants, cn, compareAlphanumeric, debounce, defaultOperatorShortcuts, defaultOperators, formatISODate, getDialogAlertControls, inputVariants, isDefined, isEmptyObject, isValidParentheses, mapTokensToOutput, parseFormula, parseFormulaToToken, resetVisibleTableState, selectValueToBoolean, spinnerVariants, splitOperators, stripNullishObject, throttle, tokenizeFormulaString, useControllableState_default as useControllableState, useFormField, useGridSettingsStore_default as useGridSettingsStore, useHover_default as useHover, useIntersectionObserver_default as useIntersectionObserver, useIsomorphicLayoutEffect, useMediaQuery_default as useMediaQuery, usePreventPageLeave_default as usePreventPageLeave, usePreventPageLeaveStore_default as usePreventPageLeaveStore, useScreenSize_default as useScreenSize, useSidebar, useTruncated_default as useTruncated, validateTokenPrefixes };
|
|
11424
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, ActionMenu, AdvanceSearch_default as AdvanceSearch, arrow_default as ArrowIcon, AuditFooter, Button, Checkbox, Collapsible, CollapsibleContent2 as CollapsibleContent, CollapsibleTrigger2 as CollapsibleTrigger, Combobox_default as Combobox, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, CropperModal, CropperModalError, DIALOG_ALERT_I18N_SUBNAMESPACE, DIALOG_ALERT_TEMPLATES, DataTable_default as DataTable, DatePicker2 as DatePicker, Dialog, DialogAlert, DialogAlertProvider, DialogContent, DialogDescription, DialogFooter, DialogTitle, DialogTrigger, ErrorCompression, ErrorCreateCanvas, ErrorGeneratingBlob, ErrorInvalidSVG, ErrorSVGExceedSize, filters_default as FiltersIcon, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, FormulaEditor, GridSettingsModal_default as GridSettingsModal, HeaderCell_default as HeaderCell, Image2 as Image, Input, InputNumber_default as InputNumber, Label2 as Label, List_default as List, container_default as ListContainer, header_default as ListHeader, table_default as ListTable, LookupSelect, MonthPicker2 as MonthPicker, navbar_default as Navbar, not_found_default as NotFoundIcon, Popover, PopoverAnchor, PopoverArrow, PopoverContent, PopoverTrigger, PreventPageLeave_default as PreventPageLeave, RadioGroupItem, RadioGroupRoot, RadioLabel, RichText, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator2 as Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarLayout, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Spinner, calendar_default as SuiCalendarIcon, calendar2_default as SuiCalendarIcon2, check_default as SuiCheckIcon, dots_vertical_default as SuiDotsVerticalIcon, empty_data_default as SuiEmptyDataIcon, expand_default as SuiExpandIcon, filter_default as SuiFilterIcon, setting_default as SuiSettingIcon, triangle_down_default as SuiTriangleDownIcon, warning_default as SuiWarningIcon, Switch, Textarea, Tooltip2 as Tooltip, TooltipArrow, TooltipContent2 as TooltipContent, TooltipProvider2 as TooltipProvider, TooltipTrigger2 as TooltipTrigger, trash_default as TrashIcon, truncated_default as Truncated, truncatedMouseEnterDiv_default as TruncatedMouseEnterDiv, ui_exports as UI, VirtualizedCommand_default as VirtualizedCommand, booleanToSelectValue, buildPrefixMap, buttonVariants, cn, compareAlphanumeric, debounce, defaultOperatorShortcuts, defaultOperators, formatISODate, getDialogAlertControls, inputVariants, isDefined, isEmptyObject, isValidParentheses, mapTokensToOutput, parseFormula, parseFormulaToToken, resetVisibleTableState, selectValueToBoolean, spinnerVariants, splitOperators, stripNullishObject, throttle, tokenizeFormulaString, useControllableState_default as useControllableState, useFormField, useGridSettingsStore_default as useGridSettingsStore, useHover_default as useHover, useIntersectionObserver_default as useIntersectionObserver, useIsomorphicLayoutEffect, useMediaQuery_default as useMediaQuery, usePreventPageLeave_default as usePreventPageLeave, usePreventPageLeaveStore_default as usePreventPageLeaveStore, useScreenSize_default as useScreenSize, useSidebar, useTruncated_default as useTruncated, validateTokenPrefixes };
|
|
11202
11425
|
//# sourceMappingURL=index.mjs.map
|
|
11203
11426
|
//# sourceMappingURL=index.mjs.map
|