@candidhealth/react-vitals 1.0.0-alpha.13 → 1.0.0-alpha.14
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 +751 -60
- package/dist/index.d.ts +751 -60
- package/dist/index.js +257 -423
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +247 -405
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -521,7 +521,7 @@ var Card = React3.forwardRef(({ className, children, onClick }, ref) => /* @__PU
|
|
|
521
521
|
));
|
|
522
522
|
|
|
523
523
|
// src/core/checkbox/Checkbox.tsx
|
|
524
|
-
import { forwardRef as forwardRef4
|
|
524
|
+
import { forwardRef as forwardRef4 } from "react";
|
|
525
525
|
import { twJoin as twJoin6 } from "tailwind-merge";
|
|
526
526
|
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
527
527
|
var Checkbox = forwardRef4(({ className, hasError, ...rest }, ref) => /* @__PURE__ */ jsx12(
|
|
@@ -537,18 +537,6 @@ var Checkbox = forwardRef4(({ className, hasError, ...rest }, ref) => /* @__PURE
|
|
|
537
537
|
ref
|
|
538
538
|
}
|
|
539
539
|
));
|
|
540
|
-
var IndeterminateCheckbox = ({
|
|
541
|
-
indeterminate = false,
|
|
542
|
-
...rest
|
|
543
|
-
}) => {
|
|
544
|
-
const ref = useRef2(null);
|
|
545
|
-
useEffect2(() => {
|
|
546
|
-
if (ref.current) {
|
|
547
|
-
ref.current.indeterminate = indeterminate;
|
|
548
|
-
}
|
|
549
|
-
}, [indeterminate]);
|
|
550
|
-
return /* @__PURE__ */ jsx12(Checkbox, { ref, ...rest });
|
|
551
|
-
};
|
|
552
540
|
|
|
553
541
|
// src/core/collapsible/Collapsible.tsx
|
|
554
542
|
import { faChevronDown, faChevronRight } from "@fortawesome/sharp-solid-svg-icons";
|
|
@@ -1865,10 +1853,10 @@ function doesSelectItemMatch(option, query) {
|
|
|
1865
1853
|
|
|
1866
1854
|
// src/core/select/useAsyncMultiSelect.ts
|
|
1867
1855
|
import { useQuery } from "@tanstack/react-query";
|
|
1868
|
-
import { useEffect as
|
|
1856
|
+
import { useEffect as useEffect2, useMemo as useMemo4, useState as useState7 } from "react";
|
|
1869
1857
|
function useDebounce(value, delay) {
|
|
1870
1858
|
const [debouncedValue, setDebouncedValue] = useState7(value);
|
|
1871
|
-
|
|
1859
|
+
useEffect2(() => {
|
|
1872
1860
|
const handler = setTimeout(() => {
|
|
1873
1861
|
setDebouncedValue(value);
|
|
1874
1862
|
}, delay);
|
|
@@ -1957,7 +1945,7 @@ var useAsyncSelect = ({
|
|
|
1957
1945
|
import { DndContext, PointerSensor, useSensor, useSensors } from "@dnd-kit/core";
|
|
1958
1946
|
import { SortableContext, verticalListSortingStrategy } from "@dnd-kit/sortable";
|
|
1959
1947
|
import { faArrowTurnDownLeft, faCheck as faCheck2, faSearch, faTimes } from "@fortawesome/sharp-solid-svg-icons";
|
|
1960
|
-
import { useMemo as useMemo5, useRef as
|
|
1948
|
+
import { useMemo as useMemo5, useRef as useRef3, useState as useState8 } from "react";
|
|
1961
1949
|
import { twJoin as twJoin21 } from "tailwind-merge";
|
|
1962
1950
|
|
|
1963
1951
|
// src/core/dropdown-chevron/DropdownChevron.tsx
|
|
@@ -1972,7 +1960,7 @@ var DropdownChevron = () => {
|
|
|
1972
1960
|
import { useSortable } from "@dnd-kit/sortable";
|
|
1973
1961
|
import { CSS } from "@dnd-kit/utilities";
|
|
1974
1962
|
import { faGripDotsVertical } from "@fortawesome/sharp-solid-svg-icons";
|
|
1975
|
-
import { useEffect as
|
|
1963
|
+
import { useEffect as useEffect3, useRef as useRef2 } from "react";
|
|
1976
1964
|
import { twJoin as twJoin20 } from "tailwind-merge";
|
|
1977
1965
|
import { jsx as jsx47, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
1978
1966
|
var SelectListItem = ({
|
|
@@ -1983,8 +1971,8 @@ var SelectListItem = ({
|
|
|
1983
1971
|
focused = false
|
|
1984
1972
|
}) => {
|
|
1985
1973
|
const { setNodeRef, listeners, attributes, transform, transition } = useSortable({ id: sortableId ?? "" });
|
|
1986
|
-
const containerRef =
|
|
1987
|
-
|
|
1974
|
+
const containerRef = useRef2(null);
|
|
1975
|
+
useEffect3(() => {
|
|
1988
1976
|
if (focused && containerRef.current) {
|
|
1989
1977
|
containerRef.current.scrollIntoView({ block: "nearest", inline: "nearest", behavior: "smooth" });
|
|
1990
1978
|
}
|
|
@@ -2054,7 +2042,7 @@ var AsyncMultiSelect = ({
|
|
|
2054
2042
|
const [open, setOpen] = useState8(false);
|
|
2055
2043
|
const [search, setSearch] = useState8("");
|
|
2056
2044
|
const [focusIndex, setFocusIndex] = useState8(0);
|
|
2057
|
-
const inputRef =
|
|
2045
|
+
const inputRef = useRef3(null);
|
|
2058
2046
|
const unselectedOptions = useMemo5(() => items.filter((item) => !value.includes(item.value)), [items, value]);
|
|
2059
2047
|
const resetSearch = () => {
|
|
2060
2048
|
setSearch("");
|
|
@@ -2855,7 +2843,7 @@ var FormDatePicker = ({
|
|
|
2855
2843
|
};
|
|
2856
2844
|
|
|
2857
2845
|
// src/core/drawer/Drawer.tsx
|
|
2858
|
-
import { forwardRef as forwardRef18, Suspense, useEffect as
|
|
2846
|
+
import { forwardRef as forwardRef18, Suspense, useEffect as useEffect5, useRef as useRef5 } from "react";
|
|
2859
2847
|
import { twJoin as twJoin26 } from "tailwind-merge";
|
|
2860
2848
|
|
|
2861
2849
|
// src/core/loaders/Spinner.tsx
|
|
@@ -2944,7 +2932,7 @@ var useDrawer = () => {
|
|
|
2944
2932
|
};
|
|
2945
2933
|
|
|
2946
2934
|
// src/core/drawer/useDrawerResize.ts
|
|
2947
|
-
import { useCallback as useCallback8, useEffect as
|
|
2935
|
+
import { useCallback as useCallback8, useEffect as useEffect4, useRef as useRef4 } from "react";
|
|
2948
2936
|
var MIN_LEFT_SPACE = 240;
|
|
2949
2937
|
var MIN_WIDTH_PCT = 0.5;
|
|
2950
2938
|
var MIN_WIDTH_PX = 500;
|
|
@@ -2956,7 +2944,7 @@ var constrainedWidth = (width) => {
|
|
|
2956
2944
|
return Math.min(Math.max(width, minWidth), maxWidth);
|
|
2957
2945
|
};
|
|
2958
2946
|
var useDrawerResize = ({ slider, drawer, isOpen, defaultSizePct, persistWidth }) => {
|
|
2959
|
-
const widthPx =
|
|
2947
|
+
const widthPx = useRef4(computeWidth(defaultSizePct));
|
|
2960
2948
|
const toggleOpen = useCallback8(
|
|
2961
2949
|
(open) => {
|
|
2962
2950
|
if (slider.current && drawer.current) {
|
|
@@ -2983,7 +2971,7 @@ var useDrawerResize = ({ slider, drawer, isOpen, defaultSizePct, persistWidth })
|
|
|
2983
2971
|
},
|
|
2984
2972
|
[drawer, persistWidth, slider]
|
|
2985
2973
|
);
|
|
2986
|
-
|
|
2974
|
+
useEffect4(() => {
|
|
2987
2975
|
if (slider.current) {
|
|
2988
2976
|
const onPointerDown = (e) => {
|
|
2989
2977
|
document.body.style.userSelect = "none";
|
|
@@ -3018,12 +3006,12 @@ var useDrawerResize = ({ slider, drawer, isOpen, defaultSizePct, persistWidth })
|
|
|
3018
3006
|
toggleOpen(true);
|
|
3019
3007
|
}
|
|
3020
3008
|
}, [defaultSizePct, isOpen, toggleOpen, persistWidth, setWidth]);
|
|
3021
|
-
|
|
3009
|
+
useEffect4(() => {
|
|
3022
3010
|
if (slider.current && drawer.current) {
|
|
3023
3011
|
loadWidth();
|
|
3024
3012
|
}
|
|
3025
3013
|
}, [slider, drawer, loadWidth]);
|
|
3026
|
-
|
|
3014
|
+
useEffect4(() => {
|
|
3027
3015
|
window.addEventListener("resize", loadWidth);
|
|
3028
3016
|
return () => window.removeEventListener("resize", loadWidth);
|
|
3029
3017
|
}, [loadWidth]);
|
|
@@ -3032,7 +3020,7 @@ var useDrawerResize = ({ slider, drawer, isOpen, defaultSizePct, persistWidth })
|
|
|
3032
3020
|
// src/core/drawer/Drawer.tsx
|
|
3033
3021
|
import { jsx as jsx67, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
3034
3022
|
var useKeypress = (key, action) => {
|
|
3035
|
-
|
|
3023
|
+
useEffect5(() => {
|
|
3036
3024
|
const onKeyup = (e) => {
|
|
3037
3025
|
if (e.key === key) action();
|
|
3038
3026
|
};
|
|
@@ -3047,8 +3035,8 @@ var drawerSizes = {
|
|
|
3047
3035
|
};
|
|
3048
3036
|
var Drawer = forwardRef18(
|
|
3049
3037
|
({ isOpen, onClose, onClickOutside, blurredOverlay, children, width = "md", persistWidth }, ref) => {
|
|
3050
|
-
const slider =
|
|
3051
|
-
const drawer =
|
|
3038
|
+
const slider = useRef5(null);
|
|
3039
|
+
const drawer = useRef5(null);
|
|
3052
3040
|
useDrawerResize({
|
|
3053
3041
|
slider,
|
|
3054
3042
|
drawer,
|
|
@@ -3116,63 +3104,14 @@ var Drawer = forwardRef18(
|
|
|
3116
3104
|
|
|
3117
3105
|
// src/core/drawer/DrawerHeader.tsx
|
|
3118
3106
|
import { faBookmark, faChevronDown as faChevronDown4, faChevronUp, faClose } from "@fortawesome/sharp-solid-svg-icons";
|
|
3119
|
-
import { twJoin as
|
|
3107
|
+
import { twJoin as twJoin27 } from "tailwind-merge";
|
|
3120
3108
|
|
|
3121
3109
|
// src/core/skeleton/Skeleton.tsx
|
|
3122
3110
|
import { jsx as jsx68 } from "react/jsx-runtime";
|
|
3123
3111
|
var Skeleton = ({ className }) => /* @__PURE__ */ jsx68("div", { className: twMerge("animate-skeleton-pulse rounded-lg bg-surface-dark", className) });
|
|
3124
3112
|
|
|
3125
|
-
// src/core/skeleton/TabsSkeleton/TabsSkeleton.tsx
|
|
3126
|
-
import { jsx as jsx69 } from "react/jsx-runtime";
|
|
3127
|
-
var TabsSkeleton = ({ numTabs = 3, className, tabClassName = "h-8 w-32" }) => {
|
|
3128
|
-
return /* @__PURE__ */ jsx69("div", { className: twMerge("flex gap-4", className), children: Array.from({ length: numTabs }).map((_, index) => /* @__PURE__ */ jsx69(Skeleton, { className: tabClassName }, index)) });
|
|
3129
|
-
};
|
|
3130
|
-
|
|
3131
|
-
// src/core/skeleton/TableSkeleton/TableSkeleton.tsx
|
|
3132
|
-
import { twJoin as twJoin27 } from "tailwind-merge";
|
|
3133
|
-
import { jsx as jsx70 } from "react/jsx-runtime";
|
|
3134
|
-
var TableSkeleton = ({
|
|
3135
|
-
numTableCols = 4,
|
|
3136
|
-
numTableRows = 3,
|
|
3137
|
-
className,
|
|
3138
|
-
rowHeight,
|
|
3139
|
-
hasBorder = false
|
|
3140
|
-
}) => {
|
|
3141
|
-
return /* @__PURE__ */ jsx70("table", { className: twJoin27("flex w-full flex-col gap-4", className), children: /* @__PURE__ */ jsx70("tbody", { className: twJoin27("flex flex-col", rowHeight === void 0 && "gap-4"), children: Array.from({ length: numTableRows }).map((_, index) => /* @__PURE__ */ jsx70(
|
|
3142
|
-
"tr",
|
|
3143
|
-
{
|
|
3144
|
-
className: twJoin27("flex gap-4", hasBorder && "px-2 not-last:border-b"),
|
|
3145
|
-
style: rowHeight ? { height: rowHeight } : void 0,
|
|
3146
|
-
children: Array.from({ length: numTableCols }).map((_2, index2) => {
|
|
3147
|
-
return /* @__PURE__ */ jsx70("td", { className: "flex grow items-center px-1", children: /* @__PURE__ */ jsx70(Skeleton, { className: twJoin27("w-full", rowHeight ? "h-3" : "h-6") }, index2) }, index2);
|
|
3148
|
-
})
|
|
3149
|
-
},
|
|
3150
|
-
index
|
|
3151
|
-
)) }) });
|
|
3152
|
-
};
|
|
3153
|
-
|
|
3154
|
-
// src/core/skeleton/TableSkeleton/TableCheckboxSkeleton.tsx
|
|
3155
|
-
import { twJoin as twJoin28 } from "tailwind-merge";
|
|
3156
|
-
import { jsx as jsx71 } from "react/jsx-runtime";
|
|
3157
|
-
var TableCheckboxSkeleton = ({
|
|
3158
|
-
numTableRows = 3,
|
|
3159
|
-
className,
|
|
3160
|
-
rowHeight,
|
|
3161
|
-
hasBorder = false
|
|
3162
|
-
}) => {
|
|
3163
|
-
return /* @__PURE__ */ jsx71("table", { className: twJoin28("flex w-full flex-col gap-4", className), children: /* @__PURE__ */ jsx71("tbody", { className: twJoin28("flex flex-col", rowHeight === void 0 && "gap-4"), children: Array.from({ length: numTableRows }).map((_, index) => /* @__PURE__ */ jsx71(
|
|
3164
|
-
"tr",
|
|
3165
|
-
{
|
|
3166
|
-
className: twJoin28("flex gap-4", hasBorder && "px-2 not-last:border-b"),
|
|
3167
|
-
style: rowHeight ? { height: rowHeight } : void 0,
|
|
3168
|
-
children: /* @__PURE__ */ jsx71("td", { className: "flex grow items-center px-1", children: /* @__PURE__ */ jsx71(Skeleton, { className: twJoin28("w-full rounded-none", rowHeight ? "h-3" : "h-6") }, index) }, index)
|
|
3169
|
-
},
|
|
3170
|
-
index
|
|
3171
|
-
)) }) });
|
|
3172
|
-
};
|
|
3173
|
-
|
|
3174
3113
|
// src/core/drawer/DrawerHeader.tsx
|
|
3175
|
-
import { Fragment as Fragment10, jsx as
|
|
3114
|
+
import { Fragment as Fragment10, jsx as jsx69, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
3176
3115
|
var DrawerHeader = ({
|
|
3177
3116
|
resource,
|
|
3178
3117
|
pagination,
|
|
@@ -3185,115 +3124,115 @@ var DrawerHeader = ({
|
|
|
3185
3124
|
const { onClose } = useDrawer();
|
|
3186
3125
|
return /* @__PURE__ */ jsxs30("div", { className: "z-1 flex w-full flex-col items-stretch shadow", children: [
|
|
3187
3126
|
/* @__PURE__ */ jsxs30("div", { className: "flex justify-between px-8 py-1 shadow-sm", children: [
|
|
3188
|
-
/* @__PURE__ */
|
|
3189
|
-
/* @__PURE__ */
|
|
3190
|
-
/* @__PURE__ */
|
|
3127
|
+
/* @__PURE__ */ jsx69("div", { className: "flex items-center gap-1.5 text-base text-muted", children: resource && /* @__PURE__ */ jsxs30(Fragment10, { children: [
|
|
3128
|
+
/* @__PURE__ */ jsx69(Icon, { icon: resource.icon || faBookmark }),
|
|
3129
|
+
/* @__PURE__ */ jsx69("div", { children: resource.name })
|
|
3191
3130
|
] }) }),
|
|
3192
3131
|
/* @__PURE__ */ jsxs30("div", { className: "flex items-center gap-2", children: [
|
|
3193
3132
|
pagination && /* @__PURE__ */ jsxs30("div", { className: "flex gap-1", children: [
|
|
3194
3133
|
pagination.extra,
|
|
3195
|
-
/* @__PURE__ */
|
|
3196
|
-
/* @__PURE__ */
|
|
3134
|
+
/* @__PURE__ */ jsx69(Button, { size: "sm", onClick: pagination.onPrevious, disabled: !pagination.hasPrevious, children: /* @__PURE__ */ jsx69(Icon, { icon: faChevronUp }) }),
|
|
3135
|
+
/* @__PURE__ */ jsx69(Button, { size: "sm", onClick: pagination.onNext, disabled: !pagination.hasNext, children: /* @__PURE__ */ jsx69(Icon, { icon: faChevronDown4 }) })
|
|
3197
3136
|
] }),
|
|
3198
|
-
closeAction ?? /* @__PURE__ */
|
|
3137
|
+
closeAction ?? /* @__PURE__ */ jsx69(Button, { size: "xs", variant: "transparent", onClick: onClose, children: /* @__PURE__ */ jsx69("span", { className: "text-xl text-muted", children: /* @__PURE__ */ jsx69(Icon, { icon: faClose }) }) })
|
|
3199
3138
|
] })
|
|
3200
3139
|
] }),
|
|
3201
3140
|
/* @__PURE__ */ jsxs30("div", { className: "flex items-center gap-2 px-8 py-2", children: [
|
|
3202
3141
|
/* @__PURE__ */ jsxs30("div", { className: "flex min-w-0 shrink grow flex-col", children: [
|
|
3203
|
-
/* @__PURE__ */
|
|
3204
|
-
subtitle && /* @__PURE__ */
|
|
3142
|
+
/* @__PURE__ */ jsx69(Text, { variant: "title-1", className: twJoin27(typeof title === "string" && "truncate"), children: title }),
|
|
3143
|
+
subtitle && /* @__PURE__ */ jsx69("div", { className: "text-base font-light", children: subtitle })
|
|
3205
3144
|
] }),
|
|
3206
|
-
label && /* @__PURE__ */
|
|
3207
|
-
/* @__PURE__ */
|
|
3145
|
+
label && /* @__PURE__ */ jsx69("div", { className: "flex items-center gap-2", children: label }),
|
|
3146
|
+
/* @__PURE__ */ jsx69("div", { className: "flex shrink-0 items-center gap-2", children: actions })
|
|
3208
3147
|
] })
|
|
3209
3148
|
] });
|
|
3210
3149
|
};
|
|
3211
3150
|
var DrawerHeaderSkeleton = () => /* @__PURE__ */ jsxs30("div", { className: "space-y-2 px-8 py-2", children: [
|
|
3212
3151
|
/* @__PURE__ */ jsxs30("div", { className: "flex justify-between", children: [
|
|
3213
|
-
/* @__PURE__ */
|
|
3214
|
-
/* @__PURE__ */
|
|
3152
|
+
/* @__PURE__ */ jsx69(Skeleton, { className: "h-6 w-36" }),
|
|
3153
|
+
/* @__PURE__ */ jsx69(Skeleton, { className: "h-6 w-16" })
|
|
3215
3154
|
] }),
|
|
3216
|
-
/* @__PURE__ */
|
|
3155
|
+
/* @__PURE__ */ jsx69(Skeleton, { className: "h-8 w-28" })
|
|
3217
3156
|
] });
|
|
3218
3157
|
|
|
3219
3158
|
// src/core/empty-state/EmptyState.tsx
|
|
3220
3159
|
import { FontAwesomeIcon as FontAwesomeIcon3 } from "@fortawesome/react-fontawesome";
|
|
3221
3160
|
import { faCircleDashed } from "@fortawesome/sharp-solid-svg-icons";
|
|
3222
3161
|
import { forwardRef as forwardRef19 } from "react";
|
|
3223
|
-
import { jsx as
|
|
3162
|
+
import { jsx as jsx70, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
3224
3163
|
var EmptyState = forwardRef19(
|
|
3225
3164
|
({ icon = faCircleDashed, title, description }, ref) => /* @__PURE__ */ jsxs31("div", { className: "flex flex-col items-center justify-center gap-3 p-4", ref, children: [
|
|
3226
|
-
/* @__PURE__ */
|
|
3165
|
+
/* @__PURE__ */ jsx70(FontAwesomeIcon3, { className: "text-muted ring-transparent", icon, size: "2x" }),
|
|
3227
3166
|
/* @__PURE__ */ jsxs31("div", { className: "flex max-w-prose flex-col text-center", children: [
|
|
3228
|
-
title && /* @__PURE__ */
|
|
3229
|
-
description && /* @__PURE__ */
|
|
3167
|
+
title && /* @__PURE__ */ jsx70(Text, { variant: "title-3", className: "text-muted", children: title }),
|
|
3168
|
+
description && /* @__PURE__ */ jsx70(Text, { variant: "footnote", className: "leading-5 text-muted", children: description })
|
|
3230
3169
|
] })
|
|
3231
3170
|
] })
|
|
3232
3171
|
);
|
|
3233
3172
|
|
|
3234
3173
|
// src/core/header-tile/HeaderTile.tsx
|
|
3235
|
-
import { twJoin as
|
|
3236
|
-
import { jsx as
|
|
3174
|
+
import { twJoin as twJoin28 } from "tailwind-merge";
|
|
3175
|
+
import { jsx as jsx71, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
3237
3176
|
var HeaderTileSimple = ({ title, content, className, grouped }) => /* @__PURE__ */ jsxs32(
|
|
3238
3177
|
"div",
|
|
3239
3178
|
{
|
|
3240
|
-
className:
|
|
3179
|
+
className: twJoin28(
|
|
3241
3180
|
"flex h-18.5 w-fit flex-col items-start justify-between px-3 py-1.5",
|
|
3242
3181
|
!grouped && "rounded-md border border-surface-neutral",
|
|
3243
3182
|
className
|
|
3244
3183
|
),
|
|
3245
3184
|
children: [
|
|
3246
|
-
/* @__PURE__ */
|
|
3247
|
-
typeof content === "string" ? /* @__PURE__ */
|
|
3185
|
+
/* @__PURE__ */ jsx71(Text, { variant: "label", className: "text-neutral", children: title }),
|
|
3186
|
+
typeof content === "string" ? /* @__PURE__ */ jsx71(Text, { className: "text-neutral", children: content }) : content
|
|
3248
3187
|
]
|
|
3249
3188
|
}
|
|
3250
3189
|
);
|
|
3251
|
-
var HeaderTileWithPopover = ({ title, content, popover, className, grouped }) => /* @__PURE__ */
|
|
3252
|
-
/* @__PURE__ */
|
|
3190
|
+
var HeaderTileWithPopover = ({ title, content, popover, className, grouped }) => /* @__PURE__ */ jsx71("div", { className: "w-fit", children: /* @__PURE__ */ jsxs32(Popover.Root, { children: [
|
|
3191
|
+
/* @__PURE__ */ jsx71(
|
|
3253
3192
|
Popover.Trigger,
|
|
3254
3193
|
{
|
|
3255
3194
|
variant: "transparent",
|
|
3256
3195
|
soften: "none",
|
|
3257
|
-
className:
|
|
3196
|
+
className: twJoin28(
|
|
3258
3197
|
"flex h-18.5! w-fit justify-start px-3 py-1.5 transition-all duration-150 ease-in-out hover:shadow-md",
|
|
3259
3198
|
!grouped && "rounded-md border border-surface-neutral",
|
|
3260
3199
|
className
|
|
3261
3200
|
),
|
|
3262
3201
|
children: /* @__PURE__ */ jsxs32("div", { className: "flex h-full flex-col items-start justify-between", children: [
|
|
3263
|
-
/* @__PURE__ */
|
|
3264
|
-
typeof content === "string" ? /* @__PURE__ */
|
|
3202
|
+
/* @__PURE__ */ jsx71(Text, { variant: "label", as: "span", className: "text-neutral", children: title }),
|
|
3203
|
+
typeof content === "string" ? /* @__PURE__ */ jsx71(Text, { as: "span", className: "text-neutral", children: content }) : content
|
|
3265
3204
|
] })
|
|
3266
3205
|
}
|
|
3267
3206
|
),
|
|
3268
|
-
popover && /* @__PURE__ */
|
|
3207
|
+
popover && /* @__PURE__ */ jsx71(Popover.Body, { contentClassName: "max-w-150 min-w-60 p-3", children: popover })
|
|
3269
3208
|
] }) });
|
|
3270
3209
|
var HeaderTile = (props) => {
|
|
3271
3210
|
if (props.popover) {
|
|
3272
|
-
return /* @__PURE__ */
|
|
3211
|
+
return /* @__PURE__ */ jsx71(HeaderTileWithPopover, { ...props });
|
|
3273
3212
|
}
|
|
3274
|
-
return /* @__PURE__ */
|
|
3213
|
+
return /* @__PURE__ */ jsx71(HeaderTileSimple, { ...props });
|
|
3275
3214
|
};
|
|
3276
3215
|
|
|
3277
3216
|
// src/core/header-tile/HeaderTileGroup.tsx
|
|
3278
|
-
import { twJoin as
|
|
3279
|
-
import { jsx as
|
|
3280
|
-
var HeaderTileGroup = ({ children, className }) => /* @__PURE__ */
|
|
3217
|
+
import { twJoin as twJoin29 } from "tailwind-merge";
|
|
3218
|
+
import { jsx as jsx72 } from "react/jsx-runtime";
|
|
3219
|
+
var HeaderTileGroup = ({ children, className }) => /* @__PURE__ */ jsx72(
|
|
3281
3220
|
"div",
|
|
3282
3221
|
{
|
|
3283
|
-
className:
|
|
3222
|
+
className: twJoin29(
|
|
3284
3223
|
"flex w-fit items-center divide-x divide-surface-neutral rounded-md border border-surface-neutral",
|
|
3285
3224
|
className
|
|
3286
3225
|
),
|
|
3287
3226
|
children
|
|
3288
3227
|
}
|
|
3289
3228
|
);
|
|
3290
|
-
HeaderTileGroup.Tile = (props) => /* @__PURE__ */
|
|
3229
|
+
HeaderTileGroup.Tile = (props) => /* @__PURE__ */ jsx72(HeaderTile, { ...props, grouped: true });
|
|
3291
3230
|
|
|
3292
3231
|
// src/core/label/Label.tsx
|
|
3293
3232
|
import * as React12 from "react";
|
|
3294
3233
|
|
|
3295
3234
|
// src/core/label/labelStyles.ts
|
|
3296
|
-
import { twJoin as
|
|
3235
|
+
import { twJoin as twJoin30 } from "tailwind-merge";
|
|
3297
3236
|
var sizeStyles3 = {
|
|
3298
3237
|
xs: "px-1 text-xs gap-0.5 h-4 rounded-md",
|
|
3299
3238
|
sm: "h-5 gap-0.5 px-1 text-sm rounded-md",
|
|
@@ -3322,33 +3261,33 @@ var colorStyles2 = {
|
|
|
3322
3261
|
disabled: "bg-gray-700 text-gray-50 border border-gray-600"
|
|
3323
3262
|
}
|
|
3324
3263
|
};
|
|
3325
|
-
var labelStyles = ({ intent = "default", size = "sm", variant = "default" }) =>
|
|
3264
|
+
var labelStyles = ({ intent = "default", size = "sm", variant = "default" }) => twJoin30(
|
|
3326
3265
|
"inline-flex w-fit shrink-0 items-center justify-center truncate font-normal break-all",
|
|
3327
3266
|
sizeStyles3[size],
|
|
3328
3267
|
colorStyles2[variant][intent]
|
|
3329
3268
|
);
|
|
3330
3269
|
|
|
3331
3270
|
// src/core/label/Label.tsx
|
|
3332
|
-
import { jsx as
|
|
3271
|
+
import { jsx as jsx73 } from "react/jsx-runtime";
|
|
3333
3272
|
var LabelImpl2 = ({ children, intent, size, variant, ...rest }, ref) => {
|
|
3334
|
-
return /* @__PURE__ */
|
|
3273
|
+
return /* @__PURE__ */ jsx73("span", { ref, className: labelStyles({ intent, size, variant }), ...rest, children });
|
|
3335
3274
|
};
|
|
3336
3275
|
var Label = React12.forwardRef(LabelImpl2);
|
|
3337
3276
|
|
|
3338
3277
|
// src/core/layouts/PageContainer.tsx
|
|
3339
3278
|
import { forwardRef as forwardRef21 } from "react";
|
|
3340
|
-
import { jsx as
|
|
3279
|
+
import { jsx as jsx74 } from "react/jsx-runtime";
|
|
3341
3280
|
var RESPONSIVE_PADDING = "px-4 md:px-8 lg:px-12 xl:px-16";
|
|
3342
3281
|
var PageContainer = forwardRef21(
|
|
3343
|
-
({ children, className }, ref) => /* @__PURE__ */
|
|
3282
|
+
({ children, className }, ref) => /* @__PURE__ */ jsx74("div", { ref, className: twMerge("h-full w-full overflow-y-auto pt-8", className, RESPONSIVE_PADDING), children })
|
|
3344
3283
|
);
|
|
3345
3284
|
var ScreenHeightPageContainer = forwardRef21(
|
|
3346
|
-
({ children, className }, ref) => /* @__PURE__ */
|
|
3285
|
+
({ children, className }, ref) => /* @__PURE__ */ jsx74(
|
|
3347
3286
|
"div",
|
|
3348
3287
|
{
|
|
3349
3288
|
ref,
|
|
3350
3289
|
className: twMerge("flex h-screen w-full flex-col overflow-y-hidden", className, RESPONSIVE_PADDING),
|
|
3351
|
-
children: /* @__PURE__ */
|
|
3290
|
+
children: /* @__PURE__ */ jsx74("div", { className: "flex h-screen w-full flex-1 flex-col overflow-y-hidden pt-8 pb-4", children })
|
|
3352
3291
|
}
|
|
3353
3292
|
)
|
|
3354
3293
|
);
|
|
@@ -3363,21 +3302,21 @@ import {
|
|
|
3363
3302
|
Separator,
|
|
3364
3303
|
Trigger as Trigger5
|
|
3365
3304
|
} from "@radix-ui/react-dropdown-menu";
|
|
3366
|
-
import { twJoin as
|
|
3367
|
-
import { jsx as
|
|
3305
|
+
import { twJoin as twJoin31 } from "tailwind-merge";
|
|
3306
|
+
import { jsx as jsx75, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
3368
3307
|
var MenuTrigger = ({ children, ...rest }) => {
|
|
3369
3308
|
if (children == null) {
|
|
3370
|
-
return /* @__PURE__ */
|
|
3309
|
+
return /* @__PURE__ */ jsx75(Trigger5, { asChild: true, children: /* @__PURE__ */ jsx75(Button, { ...rest, children: /* @__PURE__ */ jsx75(Icon, { icon: faEllipsis }) }) });
|
|
3371
3310
|
}
|
|
3372
3311
|
if (typeof children === "string") {
|
|
3373
|
-
return /* @__PURE__ */
|
|
3374
|
-
/* @__PURE__ */
|
|
3375
|
-
/* @__PURE__ */
|
|
3312
|
+
return /* @__PURE__ */ jsx75(Trigger5, { asChild: true, children: /* @__PURE__ */ jsxs33(Button, { ...rest, children: [
|
|
3313
|
+
/* @__PURE__ */ jsx75("span", { children }),
|
|
3314
|
+
/* @__PURE__ */ jsx75(DropdownChevron, {})
|
|
3376
3315
|
] }) });
|
|
3377
3316
|
}
|
|
3378
|
-
return /* @__PURE__ */
|
|
3317
|
+
return /* @__PURE__ */ jsx75(Trigger5, { asChild: true, children: /* @__PURE__ */ jsx75(Button, { ...rest, children }) });
|
|
3379
3318
|
};
|
|
3380
|
-
var MenuContent = ({ children, unrestrictedHeight = false, ...props }) => /* @__PURE__ */
|
|
3319
|
+
var MenuContent = ({ children, unrestrictedHeight = false, ...props }) => /* @__PURE__ */ jsx75(Portal4, { children: /* @__PURE__ */ jsx75(
|
|
3381
3320
|
Content6,
|
|
3382
3321
|
{
|
|
3383
3322
|
collisionPadding: 8,
|
|
@@ -3385,15 +3324,15 @@ var MenuContent = ({ children, unrestrictedHeight = false, ...props }) => /* @__
|
|
|
3385
3324
|
align: "end",
|
|
3386
3325
|
className: "z-100 min-w-48 rounded-lg bg-white p-1.5 shadow-lg",
|
|
3387
3326
|
...props,
|
|
3388
|
-
children: /* @__PURE__ */
|
|
3327
|
+
children: /* @__PURE__ */ jsx75("div", { className: twJoin31("overflow-y-auto", !unrestrictedHeight && "max-h-[252px]"), children })
|
|
3389
3328
|
}
|
|
3390
3329
|
) });
|
|
3391
|
-
var MenuItem = ({ loading, disabled, size = "default", ...rest }) => /* @__PURE__ */
|
|
3330
|
+
var MenuItem = ({ loading, disabled, size = "default", ...rest }) => /* @__PURE__ */ jsx75(
|
|
3392
3331
|
Item,
|
|
3393
3332
|
{
|
|
3394
3333
|
"data-loading": loading || void 0,
|
|
3395
3334
|
disabled: loading || disabled,
|
|
3396
|
-
className:
|
|
3335
|
+
className: twJoin31(
|
|
3397
3336
|
"on-menu-item-active group flex w-full cursor-pointer items-center rounded-md p-2 text-neutral outline-hidden select-none data-disabled:cursor-not-allowed data-disabled:text-placeholder data-highlighted:bg-surface-neutral data-loading:bg-transparent data-loading:text-placeholder",
|
|
3398
3337
|
size === "default" ? "gap-1.5 text-sm" : "gap-2 text-base"
|
|
3399
3338
|
),
|
|
@@ -3402,31 +3341,31 @@ var MenuItem = ({ loading, disabled, size = "default", ...rest }) => /* @__PURE_
|
|
|
3402
3341
|
);
|
|
3403
3342
|
var MenuItemWithDisabledTooltip = ({ tooltip, onSelect, ...props }) => {
|
|
3404
3343
|
if (!props.disabled || !tooltip) {
|
|
3405
|
-
return /* @__PURE__ */
|
|
3344
|
+
return /* @__PURE__ */ jsx75(MenuItem, { ...props, onSelect });
|
|
3406
3345
|
}
|
|
3407
|
-
return /* @__PURE__ */
|
|
3346
|
+
return /* @__PURE__ */ jsx75(
|
|
3408
3347
|
Tooltip,
|
|
3409
3348
|
{
|
|
3410
|
-
trigger: /* @__PURE__ */
|
|
3349
|
+
trigger: /* @__PURE__ */ jsx75("span", { children: /* @__PURE__ */ jsx75(MenuItem, { ...props }) }),
|
|
3411
3350
|
content: tooltip,
|
|
3412
3351
|
side: "left"
|
|
3413
3352
|
}
|
|
3414
3353
|
);
|
|
3415
3354
|
};
|
|
3416
|
-
var MenuRoot = (props) => /* @__PURE__ */
|
|
3417
|
-
var MenuSeparator = () => /* @__PURE__ */
|
|
3355
|
+
var MenuRoot = (props) => /* @__PURE__ */ jsx75(Root6, { modal: false, ...props });
|
|
3356
|
+
var MenuSeparator = () => /* @__PURE__ */ jsx75(Separator, { className: "my-[5px] h-px bg-surface-dark" });
|
|
3418
3357
|
var Menu = ({ children, trigger, align, variant = "default", triggerSize, ...rest }) => {
|
|
3419
3358
|
switch (variant) {
|
|
3420
3359
|
case "minimal":
|
|
3421
3360
|
return /* @__PURE__ */ jsxs33(MenuRoot, { ...rest, children: [
|
|
3422
|
-
/* @__PURE__ */
|
|
3423
|
-
/* @__PURE__ */
|
|
3361
|
+
/* @__PURE__ */ jsx75(MenuTrigger, { ...rest, size: triggerSize || "xs", variant: "transparent", children: trigger }),
|
|
3362
|
+
/* @__PURE__ */ jsx75(MenuContent, { align, children })
|
|
3424
3363
|
] });
|
|
3425
3364
|
case "default":
|
|
3426
3365
|
default:
|
|
3427
3366
|
return /* @__PURE__ */ jsxs33(MenuRoot, { ...rest, children: [
|
|
3428
|
-
/* @__PURE__ */
|
|
3429
|
-
/* @__PURE__ */
|
|
3367
|
+
/* @__PURE__ */ jsx75(MenuTrigger, { size: triggerSize, ...rest, children: trigger }),
|
|
3368
|
+
/* @__PURE__ */ jsx75(MenuContent, { align, children })
|
|
3430
3369
|
] });
|
|
3431
3370
|
}
|
|
3432
3371
|
};
|
|
@@ -3439,33 +3378,33 @@ Menu.ItemWithDisabledToolTip = MenuItemWithDisabledTooltip;
|
|
|
3439
3378
|
Menu.Separator = MenuSeparator;
|
|
3440
3379
|
|
|
3441
3380
|
// src/core/modal/components/ModalActions.tsx
|
|
3442
|
-
import { jsx as
|
|
3381
|
+
import { jsx as jsx76 } from "react/jsx-runtime";
|
|
3443
3382
|
var ModalActions = ({ children }) => {
|
|
3444
3383
|
if (children == null) {
|
|
3445
3384
|
return null;
|
|
3446
3385
|
}
|
|
3447
|
-
return /* @__PURE__ */
|
|
3386
|
+
return /* @__PURE__ */ jsx76("div", { className: "sticky bottom-0 z-2 flex items-center justify-end gap-x-2 overflow-clip rounded-b-xl bg-white/80 px-8 pt-2 pb-6 backdrop-blur-sm", children });
|
|
3448
3387
|
};
|
|
3449
3388
|
|
|
3450
3389
|
// src/core/modal/components/ModalBody.tsx
|
|
3451
|
-
import { jsx as
|
|
3390
|
+
import { jsx as jsx77 } from "react/jsx-runtime";
|
|
3452
3391
|
var ModalBody = ({ children }) => {
|
|
3453
3392
|
if (children == null) {
|
|
3454
3393
|
return null;
|
|
3455
3394
|
}
|
|
3456
|
-
return /* @__PURE__ */
|
|
3395
|
+
return /* @__PURE__ */ jsx77("div", { className: "px-8 py-1.5", children });
|
|
3457
3396
|
};
|
|
3458
3397
|
|
|
3459
3398
|
// src/core/modal/components/ModalCloseButton.tsx
|
|
3460
3399
|
import { Close as Close2 } from "@radix-ui/react-dialog";
|
|
3461
|
-
import { jsx as
|
|
3462
|
-
var ModalCloseButton = (props) => /* @__PURE__ */
|
|
3400
|
+
import { jsx as jsx78 } from "react/jsx-runtime";
|
|
3401
|
+
var ModalCloseButton = (props) => /* @__PURE__ */ jsx78(Close2, { asChild: true, children: /* @__PURE__ */ jsx78(Button, { ...props }) });
|
|
3463
3402
|
|
|
3464
3403
|
// src/core/modal/components/ModalContent.tsx
|
|
3465
3404
|
import { Content as Content7, Overlay, Portal as Portal5 } from "@radix-ui/react-dialog";
|
|
3466
3405
|
import { forwardRef as forwardRef22 } from "react";
|
|
3467
|
-
import { twJoin as
|
|
3468
|
-
import { jsx as
|
|
3406
|
+
import { twJoin as twJoin32 } from "tailwind-merge";
|
|
3407
|
+
import { jsx as jsx79 } from "react/jsx-runtime";
|
|
3469
3408
|
var preventDismiss = (e) => e.preventDefault();
|
|
3470
3409
|
var handleDismiss = (dismissible) => {
|
|
3471
3410
|
if (dismissible) {
|
|
@@ -3482,22 +3421,22 @@ var ModalContent = forwardRef22(
|
|
|
3482
3421
|
dismissible = true,
|
|
3483
3422
|
fullscreen,
|
|
3484
3423
|
...rest
|
|
3485
|
-
}, ref) => /* @__PURE__ */
|
|
3424
|
+
}, ref) => /* @__PURE__ */ jsx79(Portal5, { children: /* @__PURE__ */ jsx79(
|
|
3486
3425
|
Overlay,
|
|
3487
3426
|
{
|
|
3488
3427
|
className: "fixed inset-0 z-50 bg-black/50 data-[state=open]:animate-fade-in-custom-easing",
|
|
3489
|
-
children: /* @__PURE__ */
|
|
3428
|
+
children: /* @__PURE__ */ jsx79(
|
|
3490
3429
|
Content7,
|
|
3491
3430
|
{
|
|
3492
3431
|
...rest,
|
|
3493
3432
|
ref,
|
|
3494
|
-
className:
|
|
3433
|
+
className: twJoin32(
|
|
3495
3434
|
fullscreen ? "h-[calc(100vh-1rem)] w-[calc(100vw-1rem)]" : `max-h-[calc(100vh-2rem)] w-[clamp(100vw-2rem,100%,100vw-2rem)] ${maxWidthClassName}`,
|
|
3496
3435
|
`fixed top-1/2 left-1/2 flex -translate-x-1/2 -translate-y-1/2 flex-col rounded-xl bg-white shadow-lg focus:outline-hidden data-[state=open]:animate-fade-in-subtle-movement ${overflowYClassName}`
|
|
3497
3436
|
),
|
|
3498
3437
|
onPointerDownOutside: fullscreen ? handleDismiss() : onDismiss ?? handleDismiss(dismissible),
|
|
3499
3438
|
onEscapeKeyDown: fullscreen ? handleDismiss() : onDismiss ?? handleDismiss(dismissible),
|
|
3500
|
-
children: /* @__PURE__ */
|
|
3439
|
+
children: /* @__PURE__ */ jsx79("div", { className: "relative flex h-full min-w-0 flex-1 flex-col", children })
|
|
3501
3440
|
}
|
|
3502
3441
|
)
|
|
3503
3442
|
}
|
|
@@ -3506,28 +3445,28 @@ var ModalContent = forwardRef22(
|
|
|
3506
3445
|
|
|
3507
3446
|
// src/core/modal/components/ModalDescription.tsx
|
|
3508
3447
|
import { Description } from "@radix-ui/react-dialog";
|
|
3509
|
-
import { jsx as
|
|
3448
|
+
import { jsx as jsx80 } from "react/jsx-runtime";
|
|
3510
3449
|
var ModalDescription = ({ children }) => {
|
|
3511
3450
|
if (children == null) {
|
|
3512
3451
|
return null;
|
|
3513
3452
|
}
|
|
3514
|
-
return /* @__PURE__ */
|
|
3453
|
+
return /* @__PURE__ */ jsx80(Description, { className: "pb-3 text-base/6 font-normal text-neutral", children });
|
|
3515
3454
|
};
|
|
3516
3455
|
|
|
3517
3456
|
// src/core/modal/components/ModalErrorCallout.tsx
|
|
3518
|
-
import { jsx as
|
|
3457
|
+
import { jsx as jsx81 } from "react/jsx-runtime";
|
|
3519
3458
|
var ModalErrorCallout = ({ children }) => {
|
|
3520
3459
|
if (!children) {
|
|
3521
3460
|
return null;
|
|
3522
3461
|
}
|
|
3523
|
-
return /* @__PURE__ */
|
|
3462
|
+
return /* @__PURE__ */ jsx81("div", { className: "sticky top-14 z-10 px-5", children: /* @__PURE__ */ jsx81(Callout, { intent: "danger", children }) });
|
|
3524
3463
|
};
|
|
3525
3464
|
|
|
3526
3465
|
// src/core/modal/components/ModalRoot.tsx
|
|
3527
3466
|
import { Root as Root7 } from "@radix-ui/react-dialog";
|
|
3528
|
-
import { jsx as
|
|
3467
|
+
import { jsx as jsx82 } from "react/jsx-runtime";
|
|
3529
3468
|
var ModalRoot = (props) => {
|
|
3530
|
-
return /* @__PURE__ */
|
|
3469
|
+
return /* @__PURE__ */ jsx82(Root7, { ...props });
|
|
3531
3470
|
};
|
|
3532
3471
|
|
|
3533
3472
|
// src/core/modal/components/ModalTitle.tsx
|
|
@@ -3536,28 +3475,28 @@ import { Title } from "@radix-ui/react-dialog";
|
|
|
3536
3475
|
// src/core/modal/components/ModalCloseX.tsx
|
|
3537
3476
|
import { faClose as faClose2 } from "@fortawesome/sharp-solid-svg-icons";
|
|
3538
3477
|
import { Close as Close3 } from "@radix-ui/react-dialog";
|
|
3539
|
-
import { jsx as
|
|
3540
|
-
var ModalCloseX = () => /* @__PURE__ */
|
|
3478
|
+
import { jsx as jsx83 } from "react/jsx-runtime";
|
|
3479
|
+
var ModalCloseX = () => /* @__PURE__ */ jsx83("span", { className: "absolute top-2.5 right-2.5", children: /* @__PURE__ */ jsx83(Close3, { asChild: true, "aria-label": "Close", children: /* @__PURE__ */ jsx83(Button, { variant: "transparent", children: /* @__PURE__ */ jsx83("span", { className: "px-0.5 text-xl text-muted", children: /* @__PURE__ */ jsx83(Icon, { icon: faClose2 }) }) }) }) });
|
|
3541
3480
|
|
|
3542
3481
|
// src/core/modal/components/ModalTitle.tsx
|
|
3543
|
-
import { jsx as
|
|
3482
|
+
import { jsx as jsx84, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
3544
3483
|
var ModalTitle = ({ children, showX = true }) => {
|
|
3545
3484
|
if (children == null) {
|
|
3546
3485
|
return null;
|
|
3547
3486
|
}
|
|
3548
3487
|
return /* @__PURE__ */ jsxs34("div", { className: "sticky top-0 z-2 overflow-clip rounded-t-xl bg-white/80 px-8 pt-8 pb-1.5 backdrop-blur-sm", children: [
|
|
3549
|
-
/* @__PURE__ */
|
|
3550
|
-
showX && /* @__PURE__ */
|
|
3488
|
+
/* @__PURE__ */ jsx84(Title, { className: "text-xl font-semibold text-dark", children }),
|
|
3489
|
+
showX && /* @__PURE__ */ jsx84(ModalCloseX, {})
|
|
3551
3490
|
] });
|
|
3552
3491
|
};
|
|
3553
3492
|
|
|
3554
3493
|
// src/core/modal/components/ModalTriggerButton.tsx
|
|
3555
3494
|
import { Trigger as Trigger6 } from "@radix-ui/react-dialog";
|
|
3556
|
-
import { jsx as
|
|
3557
|
-
var ModalTriggerButton = (props) => /* @__PURE__ */
|
|
3495
|
+
import { jsx as jsx85 } from "react/jsx-runtime";
|
|
3496
|
+
var ModalTriggerButton = (props) => /* @__PURE__ */ jsx85(Trigger6, { asChild: true, children: /* @__PURE__ */ jsx85(Button, { ...props }) });
|
|
3558
3497
|
|
|
3559
3498
|
// src/core/modal/Modal.tsx
|
|
3560
|
-
import { Fragment as Fragment11, jsx as
|
|
3499
|
+
import { Fragment as Fragment11, jsx as jsx86, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
3561
3500
|
var ModalBodyImpl = ({
|
|
3562
3501
|
children,
|
|
3563
3502
|
title,
|
|
@@ -3566,13 +3505,13 @@ var ModalBodyImpl = ({
|
|
|
3566
3505
|
actions,
|
|
3567
3506
|
showX = true
|
|
3568
3507
|
}) => /* @__PURE__ */ jsxs35(Fragment11, { children: [
|
|
3569
|
-
/* @__PURE__ */
|
|
3570
|
-
/* @__PURE__ */
|
|
3508
|
+
/* @__PURE__ */ jsx86(ModalTitle, { showX, children: title }),
|
|
3509
|
+
/* @__PURE__ */ jsx86(ModalErrorCallout, { children: error }),
|
|
3571
3510
|
(description || children) && /* @__PURE__ */ jsxs35(ModalBody, { children: [
|
|
3572
|
-
/* @__PURE__ */
|
|
3511
|
+
/* @__PURE__ */ jsx86(ModalDescription, { children: description }),
|
|
3573
3512
|
children
|
|
3574
3513
|
] }),
|
|
3575
|
-
/* @__PURE__ */
|
|
3514
|
+
/* @__PURE__ */ jsx86(ModalActions, { children: actions })
|
|
3576
3515
|
] });
|
|
3577
3516
|
var Modal = ({
|
|
3578
3517
|
children,
|
|
@@ -3599,7 +3538,7 @@ var Modal = ({
|
|
|
3599
3538
|
},
|
|
3600
3539
|
children: [
|
|
3601
3540
|
trigger,
|
|
3602
|
-
/* @__PURE__ */
|
|
3541
|
+
/* @__PURE__ */ jsx86(ModalContent, { "aria-describedby": description || void 0, ...rest, children: children !== void 0 ? children : /* @__PURE__ */ jsx86(ModalBodyImpl, { title, error, description, actions, children: content }) })
|
|
3603
3542
|
]
|
|
3604
3543
|
}
|
|
3605
3544
|
);
|
|
@@ -3612,8 +3551,8 @@ import * as React13 from "react";
|
|
|
3612
3551
|
|
|
3613
3552
|
// src/core/modal/FullscreenModalHeader.tsx
|
|
3614
3553
|
import { Title as Title2 } from "@radix-ui/react-dialog";
|
|
3615
|
-
import { twJoin as
|
|
3616
|
-
import { jsx as
|
|
3554
|
+
import { twJoin as twJoin33 } from "tailwind-merge";
|
|
3555
|
+
import { jsx as jsx87, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
3617
3556
|
var FullscreenModalHeader = ({
|
|
3618
3557
|
className,
|
|
3619
3558
|
title,
|
|
@@ -3621,20 +3560,20 @@ var FullscreenModalHeader = ({
|
|
|
3621
3560
|
leftSlot,
|
|
3622
3561
|
rightSlot
|
|
3623
3562
|
}) => {
|
|
3624
|
-
return /* @__PURE__ */ jsxs36("div", { className:
|
|
3563
|
+
return /* @__PURE__ */ jsxs36("div", { className: twJoin33("flex items-center justify-between gap-4", className), children: [
|
|
3625
3564
|
/* @__PURE__ */ jsxs36("div", { className: "flex flex-1 items-center gap-4", children: [
|
|
3626
3565
|
leftSlot,
|
|
3627
3566
|
/* @__PURE__ */ jsxs36("div", { className: "flex flex-col gap-1", children: [
|
|
3628
|
-
/* @__PURE__ */
|
|
3629
|
-
description && /* @__PURE__ */
|
|
3567
|
+
/* @__PURE__ */ jsx87(Title2, { className: "text-2xl font-medium text-neutral", children: title }),
|
|
3568
|
+
description && /* @__PURE__ */ jsx87("div", { className: "text-base/6 text-muted", children: description })
|
|
3630
3569
|
] })
|
|
3631
3570
|
] }),
|
|
3632
|
-
/* @__PURE__ */
|
|
3571
|
+
/* @__PURE__ */ jsx87("div", { className: "flex gap-2", children: rightSlot })
|
|
3633
3572
|
] });
|
|
3634
3573
|
};
|
|
3635
3574
|
|
|
3636
3575
|
// src/core/modal/FullscreenModal.tsx
|
|
3637
|
-
import { jsx as
|
|
3576
|
+
import { jsx as jsx88, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
3638
3577
|
var FullscreenModal = React13.forwardRef(
|
|
3639
3578
|
({ children, trigger, isOpen, onClose, onOpenChange, fullscreen = true, showX = false, title, ...rest }, ref) => /* @__PURE__ */ jsxs37(
|
|
3640
3579
|
ModalRoot,
|
|
@@ -3649,7 +3588,7 @@ var FullscreenModal = React13.forwardRef(
|
|
|
3649
3588
|
},
|
|
3650
3589
|
children: [
|
|
3651
3590
|
trigger,
|
|
3652
|
-
/* @__PURE__ */
|
|
3591
|
+
/* @__PURE__ */ jsx88(ModalContent, { fullscreen, ...rest, ref, children: title ? /* @__PURE__ */ jsx88(Modal.Body, { title, showX, children }) : children })
|
|
3653
3592
|
]
|
|
3654
3593
|
}
|
|
3655
3594
|
)
|
|
@@ -3661,15 +3600,15 @@ var FullscreenModalNamespace = Object.assign(FullscreenModal, {
|
|
|
3661
3600
|
});
|
|
3662
3601
|
|
|
3663
3602
|
// src/core/modal/AlertModal.tsx
|
|
3664
|
-
import { Fragment as Fragment12, jsx as
|
|
3603
|
+
import { Fragment as Fragment12, jsx as jsx89, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
3665
3604
|
var ModalBodyImpl2 = ({ children, title, error, description, actions }) => /* @__PURE__ */ jsxs38(Fragment12, { children: [
|
|
3666
|
-
/* @__PURE__ */
|
|
3667
|
-
/* @__PURE__ */
|
|
3605
|
+
/* @__PURE__ */ jsx89(ModalTitle, { showX: false, children: title }),
|
|
3606
|
+
/* @__PURE__ */ jsx89(ModalErrorCallout, { children: error }),
|
|
3668
3607
|
(description || children) && /* @__PURE__ */ jsxs38(ModalBody, { children: [
|
|
3669
|
-
/* @__PURE__ */
|
|
3608
|
+
/* @__PURE__ */ jsx89(ModalDescription, { children: description }),
|
|
3670
3609
|
children
|
|
3671
3610
|
] }),
|
|
3672
|
-
/* @__PURE__ */
|
|
3611
|
+
/* @__PURE__ */ jsx89(ModalActions, { children: actions })
|
|
3673
3612
|
] });
|
|
3674
3613
|
var AlertModal = ({
|
|
3675
3614
|
children,
|
|
@@ -3696,7 +3635,7 @@ var AlertModal = ({
|
|
|
3696
3635
|
},
|
|
3697
3636
|
children: [
|
|
3698
3637
|
trigger,
|
|
3699
|
-
/* @__PURE__ */
|
|
3638
|
+
/* @__PURE__ */ jsx89(ModalContent, { ...rest, dismissible: false, children: children !== void 0 ? children : /* @__PURE__ */ jsx89(ModalBodyImpl2, { title, error, description, actions, children: content }) })
|
|
3700
3639
|
]
|
|
3701
3640
|
}
|
|
3702
3641
|
);
|
|
@@ -3707,20 +3646,20 @@ AlertModal.CloseButton = ModalCloseButton;
|
|
|
3707
3646
|
// src/core/phone-number/PhoneNumber.tsx
|
|
3708
3647
|
import "react-international-phone/style.css";
|
|
3709
3648
|
import { PhoneInput } from "react-international-phone";
|
|
3710
|
-
import { twJoin as
|
|
3711
|
-
import { jsx as
|
|
3649
|
+
import { twJoin as twJoin34 } from "tailwind-merge";
|
|
3650
|
+
import { jsx as jsx90 } from "react/jsx-runtime";
|
|
3712
3651
|
var PhoneNumber = ({
|
|
3713
3652
|
hasError,
|
|
3714
3653
|
onChange,
|
|
3715
3654
|
...props
|
|
3716
3655
|
}) => {
|
|
3717
|
-
return /* @__PURE__ */
|
|
3656
|
+
return /* @__PURE__ */ jsx90(
|
|
3718
3657
|
PhoneInput,
|
|
3719
3658
|
{
|
|
3720
3659
|
defaultCountry: props.defaultCountry ?? "us",
|
|
3721
3660
|
disableDialCodeAndPrefix: true,
|
|
3722
3661
|
showDisabledDialCodeAndPrefix: true,
|
|
3723
|
-
inputClassName:
|
|
3662
|
+
inputClassName: twJoin34(
|
|
3724
3663
|
"flex-1 placeholder:text-placeholder",
|
|
3725
3664
|
hasError ? "border-red-300!" : "border-surface-neutral!"
|
|
3726
3665
|
),
|
|
@@ -3732,33 +3671,33 @@ var PhoneNumber = ({
|
|
|
3732
3671
|
};
|
|
3733
3672
|
|
|
3734
3673
|
// src/core/stepper/Stepper.tsx
|
|
3735
|
-
import { twJoin as
|
|
3736
|
-
import { jsx as
|
|
3674
|
+
import { twJoin as twJoin35 } from "tailwind-merge";
|
|
3675
|
+
import { jsx as jsx91, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
3737
3676
|
var StepItem = ({ label, step, isActive }) => /* @__PURE__ */ jsxs39("div", { className: "flex items-center gap-3", children: [
|
|
3738
|
-
/* @__PURE__ */
|
|
3677
|
+
/* @__PURE__ */ jsx91(
|
|
3739
3678
|
"div",
|
|
3740
3679
|
{
|
|
3741
|
-
className:
|
|
3680
|
+
className: twJoin35(
|
|
3742
3681
|
"flex size-6 items-center justify-center rounded-full",
|
|
3743
3682
|
isActive ? "bg-button-primary" : "bg-button-primary-disabled"
|
|
3744
3683
|
),
|
|
3745
|
-
children: /* @__PURE__ */
|
|
3684
|
+
children: /* @__PURE__ */ jsx91(Text, { className: "text-white", children: step })
|
|
3746
3685
|
}
|
|
3747
3686
|
),
|
|
3748
|
-
/* @__PURE__ */
|
|
3687
|
+
/* @__PURE__ */ jsx91(Text, { variant: "body-1", className: isActive ? "text-primary" : "text-indigo-200", children: label })
|
|
3749
3688
|
] });
|
|
3750
|
-
var Stepper = ({ steps, currentStep, className }) => /* @__PURE__ */
|
|
3689
|
+
var Stepper = ({ steps, currentStep, className }) => /* @__PURE__ */ jsx91("div", { className: twMerge("flex items-center justify-center gap-5", className), children: steps.map((label, index) => /* @__PURE__ */ jsx91(StepItem, { label, step: index + 1, isActive: index === currentStep }, label)) });
|
|
3751
3690
|
|
|
3752
3691
|
// src/core/table/Table.tsx
|
|
3753
|
-
import { useEffect as
|
|
3754
|
-
import { twJoin as
|
|
3692
|
+
import { useEffect as useEffect6 } from "react";
|
|
3693
|
+
import { twJoin as twJoin38 } from "tailwind-merge";
|
|
3755
3694
|
|
|
3756
3695
|
// src/core/utils/useIntersectionObserver.ts
|
|
3757
|
-
import { useCallback as useCallback9, useRef as
|
|
3696
|
+
import { useCallback as useCallback9, useRef as useRef6, useState as useState10 } from "react";
|
|
3758
3697
|
var useIntersectionObserver = (options = {}) => {
|
|
3759
3698
|
const { threshold = 1, root = null, rootMargin = "0px" } = options;
|
|
3760
3699
|
const [entry, setEntry] = useState10(null);
|
|
3761
|
-
const previousObserver =
|
|
3700
|
+
const previousObserver = useRef6(null);
|
|
3762
3701
|
const customRef = useCallback9(
|
|
3763
3702
|
(node) => {
|
|
3764
3703
|
if (previousObserver.current) {
|
|
@@ -3785,7 +3724,7 @@ var useIntersectionObserver = (options = {}) => {
|
|
|
3785
3724
|
import { faTable } from "@fortawesome/sharp-solid-svg-icons";
|
|
3786
3725
|
|
|
3787
3726
|
// src/core/table/TableRow.tsx
|
|
3788
|
-
import { twJoin as
|
|
3727
|
+
import { twJoin as twJoin36 } from "tailwind-merge";
|
|
3789
3728
|
|
|
3790
3729
|
// src/core/table/utils.ts
|
|
3791
3730
|
import { flexRender } from "@tanstack/react-table";
|
|
@@ -3868,7 +3807,7 @@ var handleHeaderStyle = handleStyle;
|
|
|
3868
3807
|
var handleCellStyle = handleStyle;
|
|
3869
3808
|
|
|
3870
3809
|
// src/core/table/TableRow.tsx
|
|
3871
|
-
import { jsx as
|
|
3810
|
+
import { jsx as jsx92 } from "react/jsx-runtime";
|
|
3872
3811
|
var TableRow = ({ table, rowClassName, cellClassName, row }) => {
|
|
3873
3812
|
const hasRowClick = !!table.options.meta?.onRowClick;
|
|
3874
3813
|
const isStaticSubRow = !!table.options.meta?.staticSubRows;
|
|
@@ -3878,18 +3817,18 @@ var TableRow = ({ table, rowClassName, cellClassName, row }) => {
|
|
|
3878
3817
|
}
|
|
3879
3818
|
};
|
|
3880
3819
|
const cells = row.getVisibleCells();
|
|
3881
|
-
return /* @__PURE__ */
|
|
3820
|
+
return /* @__PURE__ */ jsx92(
|
|
3882
3821
|
"tr",
|
|
3883
3822
|
{
|
|
3884
3823
|
"data-active": table.options.meta?.activeRowId === row.id ? "" : void 0,
|
|
3885
3824
|
"data-clickable": !isStaticSubRow && (hasRowClick || row.getCanExpand()) ? "" : void 0,
|
|
3886
3825
|
"data-depth": isStaticSubRow ? row.depth : void 0,
|
|
3887
3826
|
onClick: !isStaticSubRow && row.getCanExpand() ? row.getToggleExpandedHandler() : void 0,
|
|
3888
|
-
className:
|
|
3827
|
+
className: twJoin36(
|
|
3889
3828
|
"data-active:bg-indigo-100 data-clickable:hover:cursor-pointer data-clickable:hover:bg-surface-primary data-active:data-clickable:hover:bg-indigo-200",
|
|
3890
3829
|
rowClassName
|
|
3891
3830
|
),
|
|
3892
|
-
children: cells.map((cell) => /* @__PURE__ */
|
|
3831
|
+
children: cells.map((cell) => /* @__PURE__ */ jsx92(
|
|
3893
3832
|
"td",
|
|
3894
3833
|
{
|
|
3895
3834
|
onClickCapture: hasRowClick ? (ev) => onRowClick(ev, row) : void 0,
|
|
@@ -3904,40 +3843,40 @@ var TableRow = ({ table, rowClassName, cellClassName, row }) => {
|
|
|
3904
3843
|
};
|
|
3905
3844
|
|
|
3906
3845
|
// src/core/table/TableBody.tsx
|
|
3907
|
-
import { jsx as
|
|
3846
|
+
import { jsx as jsx93, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
3908
3847
|
var TableBody = ({ table, loading, rootClassName, afterRows, ...props }) => {
|
|
3909
3848
|
const { rows } = table.getRowModel();
|
|
3910
3849
|
if (rows.length === 0) {
|
|
3911
3850
|
if (loading) {
|
|
3912
3851
|
const colCount = table.getAllLeafColumns().length;
|
|
3913
|
-
return /* @__PURE__ */
|
|
3852
|
+
return /* @__PURE__ */ jsx93("tbody", { className: rootClassName, children: Array.from({ length: 20 }).map((_, i) => /* @__PURE__ */ jsx93(
|
|
3914
3853
|
"tr",
|
|
3915
3854
|
{
|
|
3916
3855
|
className: "[&:not(:last-child)>td]:border-b [&:not(:last-child)>td]:border-gray-200",
|
|
3917
|
-
children: Array.from({ length: colCount }).map((_2, j) => /* @__PURE__ */
|
|
3856
|
+
children: Array.from({ length: colCount }).map((_2, j) => /* @__PURE__ */ jsx93("td", { className: "p-2", children: /* @__PURE__ */ jsx93(Skeleton, { className: "h-3 w-full" }) }, j))
|
|
3918
3857
|
},
|
|
3919
3858
|
`skeleton-${i}`
|
|
3920
3859
|
)) });
|
|
3921
3860
|
}
|
|
3922
3861
|
return /* @__PURE__ */ jsxs40("tbody", { className: rootClassName, children: [
|
|
3923
|
-
/* @__PURE__ */
|
|
3862
|
+
/* @__PURE__ */ jsx93("tr", { children: /* @__PURE__ */ jsx93(EmptyRowsTd, { colSpan: table.getAllLeafColumns().length, emptyText: table.options.meta?.emptyText }) }),
|
|
3924
3863
|
afterRows
|
|
3925
3864
|
] });
|
|
3926
3865
|
}
|
|
3927
3866
|
return /* @__PURE__ */ jsxs40("tbody", { className: rootClassName, children: [
|
|
3928
|
-
rows.map((row) => /* @__PURE__ */
|
|
3867
|
+
rows.map((row) => /* @__PURE__ */ jsx93(TableRow, { ...props, table, row }, row.id)),
|
|
3929
3868
|
afterRows
|
|
3930
3869
|
] });
|
|
3931
3870
|
};
|
|
3932
|
-
var EmptyRowsTd = ({ emptyText = "No rows found", ...props }) => /* @__PURE__ */
|
|
3933
|
-
/* @__PURE__ */
|
|
3934
|
-
/* @__PURE__ */
|
|
3871
|
+
var EmptyRowsTd = ({ emptyText = "No rows found", ...props }) => /* @__PURE__ */ jsx93("td", { ...props, className: "h-full", children: /* @__PURE__ */ jsxs40("p", { className: "flex h-full min-h-12 w-full items-center justify-center gap-2 text-2xl/none text-placeholder", children: [
|
|
3872
|
+
/* @__PURE__ */ jsx93("span", { children: /* @__PURE__ */ jsx93(Icon, { icon: faTable }) }),
|
|
3873
|
+
/* @__PURE__ */ jsx93("span", { className: "text-base/none font-medium", children: emptyText })
|
|
3935
3874
|
] }) });
|
|
3936
3875
|
|
|
3937
3876
|
// src/core/table/TableHeader.tsx
|
|
3938
3877
|
import { faArrowDownWideShort, faArrowUpWideShort } from "@fortawesome/sharp-solid-svg-icons";
|
|
3939
|
-
import { twJoin as
|
|
3940
|
-
import { jsx as
|
|
3878
|
+
import { twJoin as twJoin37 } from "tailwind-merge";
|
|
3879
|
+
import { jsx as jsx94, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
3941
3880
|
var TableHeader = ({
|
|
3942
3881
|
table,
|
|
3943
3882
|
variant,
|
|
@@ -3945,7 +3884,7 @@ var TableHeader = ({
|
|
|
3945
3884
|
rowClassName,
|
|
3946
3885
|
cellClassName
|
|
3947
3886
|
}) => {
|
|
3948
|
-
return /* @__PURE__ */
|
|
3887
|
+
return /* @__PURE__ */ jsx94("thead", { className: rootClassName, children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx94("tr", { className: rowClassName, children: headerGroup.headers.map((header) => /* @__PURE__ */ jsx94(
|
|
3949
3888
|
Th,
|
|
3950
3889
|
{
|
|
3951
3890
|
scope: "col",
|
|
@@ -3968,14 +3907,14 @@ var Th = ({
|
|
|
3968
3907
|
const isLastInRow = header.index === header.headerGroup.headers.length - 1;
|
|
3969
3908
|
const canResize = !isLastInRow && !!header.getContext().table.options.columnResizeMode && header.column.getCanResize();
|
|
3970
3909
|
const isSubtable = variant === "subtable";
|
|
3971
|
-
const resizeHandle = canResize && /* @__PURE__ */
|
|
3910
|
+
const resizeHandle = canResize && /* @__PURE__ */ jsx94(
|
|
3972
3911
|
"div",
|
|
3973
3912
|
{
|
|
3974
3913
|
onMouseDown: header.getResizeHandler(),
|
|
3975
3914
|
onTouchStart: header.getResizeHandler(),
|
|
3976
3915
|
onClick: (e) => e.stopPropagation(),
|
|
3977
3916
|
"data-resizing": header.column.getIsResizing() ? "" : void 0,
|
|
3978
|
-
className:
|
|
3917
|
+
className: twJoin37(
|
|
3979
3918
|
"absolute top-0 right-0 bottom-0 z-10 w-1 cursor-col-resize touch-none select-none",
|
|
3980
3919
|
"after:pointer-events-none after:absolute after:top-0 after:right-0 after:h-screen after:w-0.5 after:transition-colors after:duration-150 after:content-['']",
|
|
3981
3920
|
isSubtable ? "hover:after:bg-indigo-600 data-resizing:after:bg-indigo-600" : "group-hover:after:bg-gray-200 hover:after:bg-indigo-600 data-resizing:after:bg-indigo-600"
|
|
@@ -3989,10 +3928,10 @@ var Th = ({
|
|
|
3989
3928
|
...props,
|
|
3990
3929
|
"data-clickable": "ok",
|
|
3991
3930
|
onClick: header.column.getToggleSortingHandler(),
|
|
3992
|
-
className:
|
|
3931
|
+
className: twJoin37(props.className, canResize && "group relative"),
|
|
3993
3932
|
children: [
|
|
3994
3933
|
children,
|
|
3995
|
-
/* @__PURE__ */
|
|
3934
|
+
/* @__PURE__ */ jsx94("span", { className: "ml-1.5", children: /* @__PURE__ */ jsx94(SortIcon, { dir: header.column.getIsSorted() }) }),
|
|
3996
3935
|
resizeHandle
|
|
3997
3936
|
]
|
|
3998
3937
|
}
|
|
@@ -4005,32 +3944,32 @@ var Th = ({
|
|
|
4005
3944
|
...props,
|
|
4006
3945
|
"data-clickable": "ok",
|
|
4007
3946
|
onClick: header.column.getToggleSortingHandler(),
|
|
4008
|
-
className:
|
|
3947
|
+
className: twJoin37(props.className, canResize && "group relative"),
|
|
4009
3948
|
children: [
|
|
4010
3949
|
children,
|
|
4011
|
-
/* @__PURE__ */
|
|
3950
|
+
/* @__PURE__ */ jsx94("span", { className: "invisible ml-1.5 group-hover:visible", children: /* @__PURE__ */ jsx94(SortIcon, { dir: header.column.getNextSortingOrder() }) }),
|
|
4012
3951
|
resizeHandle
|
|
4013
3952
|
]
|
|
4014
3953
|
}
|
|
4015
3954
|
);
|
|
4016
3955
|
}
|
|
4017
|
-
return /* @__PURE__ */ jsxs41("th", { ...props, className:
|
|
3956
|
+
return /* @__PURE__ */ jsxs41("th", { ...props, className: twJoin37(props.className, canResize && "group relative"), children: [
|
|
4018
3957
|
children,
|
|
4019
3958
|
resizeHandle
|
|
4020
3959
|
] });
|
|
4021
3960
|
};
|
|
4022
3961
|
var SortIcon = ({ dir }) => {
|
|
4023
3962
|
if (dir === "asc") {
|
|
4024
|
-
return /* @__PURE__ */
|
|
3963
|
+
return /* @__PURE__ */ jsx94(Icon, { icon: faArrowUpWideShort });
|
|
4025
3964
|
}
|
|
4026
3965
|
if (dir === "desc") {
|
|
4027
|
-
return /* @__PURE__ */
|
|
3966
|
+
return /* @__PURE__ */ jsx94(Icon, { icon: faArrowDownWideShort });
|
|
4028
3967
|
}
|
|
4029
3968
|
return null;
|
|
4030
3969
|
};
|
|
4031
3970
|
|
|
4032
3971
|
// src/core/table/Table.tsx
|
|
4033
|
-
import { Fragment as Fragment13, jsx as
|
|
3972
|
+
import { Fragment as Fragment13, jsx as jsx95, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
4034
3973
|
var tableVariants = {
|
|
4035
3974
|
default: "default",
|
|
4036
3975
|
seamless: "seamless",
|
|
@@ -4095,47 +4034,47 @@ var Table = ({ variant = "default", loading: loadingProp, ...props }) => {
|
|
|
4095
4034
|
const tableElementRef = props.table.options.meta?.tableElementRef ?? null;
|
|
4096
4035
|
switch (variant) {
|
|
4097
4036
|
case tableVariants.transparent:
|
|
4098
|
-
return /* @__PURE__ */
|
|
4037
|
+
return /* @__PURE__ */ jsx95("div", { className: "relative mb-auto min-w-full", children: /* @__PURE__ */ jsxs42(
|
|
4099
4038
|
"table",
|
|
4100
4039
|
{
|
|
4101
4040
|
ref: tableElementRef,
|
|
4102
4041
|
"data-ui": uiLoading,
|
|
4103
4042
|
style: resizeStyle,
|
|
4104
|
-
className:
|
|
4043
|
+
className: twJoin38(
|
|
4105
4044
|
"min-w-full border-separate border-spacing-0 data-[ui=loading]:pointer-events-none",
|
|
4106
4045
|
resizeStyle && "overflow-clip"
|
|
4107
4046
|
),
|
|
4108
4047
|
children: [
|
|
4109
|
-
/* @__PURE__ */
|
|
4110
|
-
/* @__PURE__ */
|
|
4048
|
+
/* @__PURE__ */ jsx95(TableHeader, { ...props, variant, ...headerClassNames(variant) }),
|
|
4049
|
+
/* @__PURE__ */ jsx95(TableBody, { ...props, ...bodyClassNames(variant), loading })
|
|
4111
4050
|
]
|
|
4112
4051
|
}
|
|
4113
4052
|
) });
|
|
4114
4053
|
case tableVariants.subtable:
|
|
4115
4054
|
return /* @__PURE__ */ jsxs42("div", { className: "relative mb-auto min-w-full", children: [
|
|
4116
|
-
showLoadingBar && /* @__PURE__ */
|
|
4055
|
+
showLoadingBar && /* @__PURE__ */ jsx95(LoadingBar, { className: "absolute top-0 right-0 left-0 z-10 h-1 rounded-none" }),
|
|
4117
4056
|
/* @__PURE__ */ jsxs42(
|
|
4118
4057
|
"table",
|
|
4119
4058
|
{
|
|
4120
4059
|
ref: tableElementRef,
|
|
4121
4060
|
"data-ui": uiLoading,
|
|
4122
4061
|
style: resizeStyle,
|
|
4123
|
-
className:
|
|
4062
|
+
className: twJoin38(
|
|
4124
4063
|
"min-w-full border-separate border-spacing-0 data-[ui=loading]:pointer-events-none",
|
|
4125
4064
|
resizeStyle && "overflow-clip"
|
|
4126
4065
|
),
|
|
4127
4066
|
children: [
|
|
4128
|
-
/* @__PURE__ */
|
|
4129
|
-
/* @__PURE__ */
|
|
4067
|
+
/* @__PURE__ */ jsx95(TableHeader, { ...props, variant, ...headerClassNames(variant) }),
|
|
4068
|
+
/* @__PURE__ */ jsx95(TableBody, { ...props, ...bodyClassNames(variant), loading })
|
|
4130
4069
|
]
|
|
4131
4070
|
}
|
|
4132
4071
|
)
|
|
4133
4072
|
] });
|
|
4134
4073
|
case tableVariants.seamless:
|
|
4135
|
-
return /* @__PURE__ */
|
|
4074
|
+
return /* @__PURE__ */ jsx95(
|
|
4136
4075
|
"div",
|
|
4137
4076
|
{
|
|
4138
|
-
className:
|
|
4077
|
+
className: twJoin38(
|
|
4139
4078
|
"relative mb-auto rounded-md border bg-white",
|
|
4140
4079
|
loading && coreRows.length === 0 ? "overflow-hidden" : "overflow-auto"
|
|
4141
4080
|
),
|
|
@@ -4145,13 +4084,13 @@ var Table = ({ variant = "default", loading: loadingProp, ...props }) => {
|
|
|
4145
4084
|
ref: tableElementRef,
|
|
4146
4085
|
"data-ui": uiLoading,
|
|
4147
4086
|
style: resizeStyle,
|
|
4148
|
-
className:
|
|
4087
|
+
className: twJoin38(
|
|
4149
4088
|
"relative min-w-full border-separate border-spacing-0 data-[ui=loading]:pointer-events-none",
|
|
4150
4089
|
resizeStyle && "overflow-clip"
|
|
4151
4090
|
),
|
|
4152
4091
|
children: [
|
|
4153
|
-
/* @__PURE__ */
|
|
4154
|
-
/* @__PURE__ */
|
|
4092
|
+
/* @__PURE__ */ jsx95(TableHeader, { ...props, variant, ...headerClassNames(variant) }),
|
|
4093
|
+
/* @__PURE__ */ jsx95(TableBody, { ...props, ...bodyClassNames(variant), loading })
|
|
4155
4094
|
]
|
|
4156
4095
|
}
|
|
4157
4096
|
)
|
|
@@ -4159,7 +4098,7 @@ var Table = ({ variant = "default", loading: loadingProp, ...props }) => {
|
|
|
4159
4098
|
);
|
|
4160
4099
|
case tableVariants.default:
|
|
4161
4100
|
default:
|
|
4162
|
-
return /* @__PURE__ */
|
|
4101
|
+
return /* @__PURE__ */ jsx95(DefaultTable, { ...props, loading, fetching });
|
|
4163
4102
|
}
|
|
4164
4103
|
};
|
|
4165
4104
|
var DefaultTable = ({ table, loading, fetching }) => {
|
|
@@ -4171,42 +4110,42 @@ var DefaultTable = ({ table, loading, fetching }) => {
|
|
|
4171
4110
|
const showLoadingBar = fetching && coreRows.length > 0;
|
|
4172
4111
|
const resizeStyle = table.options.enableColumnResizing ? { width: table.getCenterTotalSize(), tableLayout: "fixed" } : void 0;
|
|
4173
4112
|
const tableElementRef = table.options.meta?.tableElementRef ?? null;
|
|
4174
|
-
|
|
4113
|
+
useEffect6(() => {
|
|
4175
4114
|
if (entry?.isIntersecting && infiniteScroll?.hasNextPage && !infiniteScroll.isFetchingNextPage) {
|
|
4176
4115
|
infiniteScroll.fetchNextPage();
|
|
4177
4116
|
}
|
|
4178
4117
|
}, [entry?.isIntersecting, infiniteScroll]);
|
|
4179
|
-
const skeletonRows = infiniteScroll?.hasNextPage ? Array.from({ length: 3 }).map((_, i) => /* @__PURE__ */
|
|
4118
|
+
const skeletonRows = infiniteScroll?.hasNextPage ? Array.from({ length: 3 }).map((_, i) => /* @__PURE__ */ jsx95("tr", { className: "[&:not(:last-child)>td]:border-b [&:not(:last-child)>td]:border-gray-200", children: Array.from({ length: colCount }).map((_2, j) => /* @__PURE__ */ jsx95("td", { className: "p-2", children: /* @__PURE__ */ jsx95(Skeleton, { className: "h-3 w-full" }) }, j)) }, `skeleton-${i}`)) : null;
|
|
4180
4119
|
return /* @__PURE__ */ jsxs42(
|
|
4181
4120
|
"div",
|
|
4182
4121
|
{
|
|
4183
|
-
className:
|
|
4122
|
+
className: twJoin38(
|
|
4184
4123
|
"relative mb-auto rounded-md border bg-white",
|
|
4185
|
-
coreRows.length === 0 ?
|
|
4124
|
+
coreRows.length === 0 ? twJoin38("h-full min-h-0", loading ? "overflow-hidden" : "overflow-auto") : "max-h-full min-h-0 overflow-auto"
|
|
4186
4125
|
),
|
|
4187
4126
|
children: [
|
|
4188
|
-
showLoadingBar && /* @__PURE__ */
|
|
4127
|
+
showLoadingBar && /* @__PURE__ */ jsx95(LoadingBar, { className: "sticky top-0 right-0 left-0 z-10 -mb-1 h-1 rounded-none" }),
|
|
4189
4128
|
/* @__PURE__ */ jsxs42(
|
|
4190
4129
|
"table",
|
|
4191
4130
|
{
|
|
4192
4131
|
ref: tableElementRef,
|
|
4193
4132
|
"data-ui": uiLoading,
|
|
4194
4133
|
style: resizeStyle,
|
|
4195
|
-
className:
|
|
4134
|
+
className: twJoin38(
|
|
4196
4135
|
"relative min-w-full border-separate border-spacing-0 data-[ui=loading]:pointer-events-none",
|
|
4197
4136
|
coreRows.length === 0 && !loading && "h-full",
|
|
4198
4137
|
resizeStyle && "overflow-clip"
|
|
4199
4138
|
),
|
|
4200
4139
|
children: [
|
|
4201
|
-
/* @__PURE__ */
|
|
4202
|
-
/* @__PURE__ */
|
|
4140
|
+
/* @__PURE__ */ jsx95(TableHeader, { table, variant: "default", ...headerClassNames("default") }),
|
|
4141
|
+
/* @__PURE__ */ jsx95(
|
|
4203
4142
|
TableBody,
|
|
4204
4143
|
{
|
|
4205
4144
|
table,
|
|
4206
4145
|
...bodyClassNames("default"),
|
|
4207
4146
|
loading,
|
|
4208
4147
|
afterRows: /* @__PURE__ */ jsxs42(Fragment13, { children: [
|
|
4209
|
-
infiniteScroll?.hasNextPage && /* @__PURE__ */
|
|
4148
|
+
infiniteScroll?.hasNextPage && /* @__PURE__ */ jsx95("tr", { ref: sentinelRef, "aria-hidden": "true", style: { height: 0, border: "none", padding: 0 }, children: /* @__PURE__ */ jsx95("td", { colSpan: colCount, style: { height: 0, border: "none", padding: 0 } }) }),
|
|
4210
4149
|
skeletonRows
|
|
4211
4150
|
] })
|
|
4212
4151
|
}
|
|
@@ -4221,9 +4160,9 @@ var DefaultTable = ({ table, loading, fetching }) => {
|
|
|
4221
4160
|
|
|
4222
4161
|
// src/core/table/VirtualizedTable.tsx
|
|
4223
4162
|
import { useVirtualizer } from "@tanstack/react-virtual";
|
|
4224
|
-
import { useEffect as
|
|
4225
|
-
import { twJoin as
|
|
4226
|
-
import { jsx as
|
|
4163
|
+
import { useEffect as useEffect7, useRef as useRef7 } from "react";
|
|
4164
|
+
import { twJoin as twJoin39 } from "tailwind-merge";
|
|
4165
|
+
import { jsx as jsx96, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
4227
4166
|
var DEFAULT_ROW_HEIGHT = 37;
|
|
4228
4167
|
var DEFAULT_OVERSCAN = 5;
|
|
4229
4168
|
var VirtualizedTable = ({
|
|
@@ -4235,7 +4174,7 @@ var VirtualizedTable = ({
|
|
|
4235
4174
|
}) => {
|
|
4236
4175
|
const loading = loadingProp ?? table.options.meta?.isLoading;
|
|
4237
4176
|
const fetching = loadingProp ?? table.options.meta?.isFetching;
|
|
4238
|
-
const scrollRef =
|
|
4177
|
+
const scrollRef = useRef7(null);
|
|
4239
4178
|
const isSubtable = variant === "subtable";
|
|
4240
4179
|
const infiniteScroll = table.options.meta?.infiniteScroll;
|
|
4241
4180
|
const colCount = table.getVisibleLeafColumns().length;
|
|
@@ -4252,14 +4191,14 @@ var VirtualizedTable = ({
|
|
|
4252
4191
|
overscan
|
|
4253
4192
|
});
|
|
4254
4193
|
const virtualRows = rowVirtualizer.getVirtualItems();
|
|
4255
|
-
|
|
4194
|
+
useEffect7(() => {
|
|
4256
4195
|
const lastItem = virtualRows.at(-1);
|
|
4257
4196
|
if (!lastItem) return;
|
|
4258
4197
|
if (lastItem.index >= rows.length - 1 && infiniteScroll?.hasNextPage && !infiniteScroll.isFetchingNextPage) {
|
|
4259
4198
|
infiniteScroll.fetchNextPage();
|
|
4260
4199
|
}
|
|
4261
4200
|
}, [virtualRows, rows.length, infiniteScroll]);
|
|
4262
|
-
const skeletonRows = infiniteScroll?.hasNextPage ? Array.from({ length: 3 }).map((_, i) => /* @__PURE__ */
|
|
4201
|
+
const skeletonRows = infiniteScroll?.hasNextPage ? Array.from({ length: 3 }).map((_, i) => /* @__PURE__ */ jsx96("tr", { className: "[&:not(:last-child)>td]:border-b [&:not(:last-child)>td]:border-gray-200", children: Array.from({ length: colCount }).map((_2, j) => /* @__PURE__ */ jsx96("td", { className: "p-2", children: /* @__PURE__ */ jsx96(Skeleton, { className: "h-3 w-full" }) }, j)) }, `skeleton-${i}`)) : null;
|
|
4263
4202
|
const paddingTop = virtualRows.length > 0 ? virtualRows[0]?.start ?? 0 : 0;
|
|
4264
4203
|
const paddingBottom = virtualRows.length > 0 ? rowVirtualizer.getTotalSize() - (virtualRows.at(-1)?.end ?? 0) : 0;
|
|
4265
4204
|
const { rootClassName: bodyRootClassName, ...bodyRowCellClassNames } = bodyClassNames(variant);
|
|
@@ -4267,18 +4206,18 @@ var VirtualizedTable = ({
|
|
|
4267
4206
|
"div",
|
|
4268
4207
|
{
|
|
4269
4208
|
ref: scrollRef,
|
|
4270
|
-
className:
|
|
4209
|
+
className: twJoin39(
|
|
4271
4210
|
"relative mb-auto",
|
|
4272
|
-
isSubtable ? "min-w-full" :
|
|
4211
|
+
isSubtable ? "min-w-full" : twJoin39(
|
|
4273
4212
|
"rounded-md border bg-white",
|
|
4274
|
-
coreRows.length === 0 ?
|
|
4213
|
+
coreRows.length === 0 ? twJoin39("h-full", loading ? "overflow-hidden" : "overflow-auto overscroll-none") : "max-h-full min-h-0 overflow-auto overscroll-none"
|
|
4275
4214
|
)
|
|
4276
4215
|
),
|
|
4277
4216
|
children: [
|
|
4278
|
-
showLoadingBar && /* @__PURE__ */
|
|
4217
|
+
showLoadingBar && /* @__PURE__ */ jsx96(
|
|
4279
4218
|
LoadingBar,
|
|
4280
4219
|
{
|
|
4281
|
-
className:
|
|
4220
|
+
className: twJoin39("inset-x-0 top-0 z-10 h-1 rounded-none", isSubtable ? "absolute" : "sticky -mb-1")
|
|
4282
4221
|
}
|
|
4283
4222
|
),
|
|
4284
4223
|
/* @__PURE__ */ jsxs43(
|
|
@@ -4287,20 +4226,20 @@ var VirtualizedTable = ({
|
|
|
4287
4226
|
ref: tableElementRef,
|
|
4288
4227
|
"data-ui": uiLoading,
|
|
4289
4228
|
style: resizeStyle,
|
|
4290
|
-
className:
|
|
4229
|
+
className: twJoin39(
|
|
4291
4230
|
"relative min-w-full border-separate border-spacing-0 data-[ui=loading]:pointer-events-none",
|
|
4292
4231
|
!isSubtable && coreRows.length === 0 && !loading && "h-full",
|
|
4293
4232
|
resizeStyle && "overflow-clip"
|
|
4294
4233
|
),
|
|
4295
4234
|
children: [
|
|
4296
|
-
/* @__PURE__ */
|
|
4297
|
-
rows.length === 0 ? /* @__PURE__ */
|
|
4298
|
-
paddingTop > 0 && /* @__PURE__ */
|
|
4235
|
+
/* @__PURE__ */ jsx96(TableHeader, { table, variant, ...headerClassNames(variant) }),
|
|
4236
|
+
rows.length === 0 ? /* @__PURE__ */ jsx96(TableBody, { table, ...bodyClassNames(variant), loading }) : /* @__PURE__ */ jsxs43("tbody", { className: bodyRootClassName, children: [
|
|
4237
|
+
paddingTop > 0 && /* @__PURE__ */ jsx96("tr", { "aria-hidden": "true", children: /* @__PURE__ */ jsx96("td", { colSpan: colCount, style: { height: paddingTop, padding: 0, border: "none" } }) }),
|
|
4299
4238
|
virtualRows.map((virtualRow) => {
|
|
4300
4239
|
const row = rows[virtualRow.index];
|
|
4301
|
-
return /* @__PURE__ */
|
|
4240
|
+
return /* @__PURE__ */ jsx96(TableRow, { table, row, ...bodyRowCellClassNames }, row.id);
|
|
4302
4241
|
}),
|
|
4303
|
-
paddingBottom > 0 && /* @__PURE__ */
|
|
4242
|
+
paddingBottom > 0 && /* @__PURE__ */ jsx96("tr", { "aria-hidden": "true", children: /* @__PURE__ */ jsx96("td", { colSpan: colCount, style: { height: paddingBottom, padding: 0, border: "none" } }) }),
|
|
4304
4243
|
skeletonRows
|
|
4305
4244
|
] })
|
|
4306
4245
|
]
|
|
@@ -4352,7 +4291,7 @@ var useTable = ({ tableRef, ...options }) => {
|
|
|
4352
4291
|
};
|
|
4353
4292
|
|
|
4354
4293
|
// src/core/table/useColumnResizing.ts
|
|
4355
|
-
import { useLayoutEffect as useLayoutEffect2, useRef as
|
|
4294
|
+
import { useLayoutEffect as useLayoutEffect2, useRef as useRef8, useState as useState11 } from "react";
|
|
4356
4295
|
var defaultSizingInfo = {
|
|
4357
4296
|
startOffset: null,
|
|
4358
4297
|
startSize: null,
|
|
@@ -4365,13 +4304,13 @@ var useColumnResizing = (options) => {
|
|
|
4365
4304
|
const defaultMinSize = options.defaultColumn?.minSize ?? 50;
|
|
4366
4305
|
const [columnSizing, setColumnSizing] = useState11({});
|
|
4367
4306
|
const [columnSizingInfo, setColumnSizingInfo] = useState11(defaultSizingInfo);
|
|
4368
|
-
const sizingInfoRef =
|
|
4369
|
-
const tableRef =
|
|
4370
|
-
const tableElementRef =
|
|
4371
|
-
const startSizesRef =
|
|
4372
|
-
const excessRef =
|
|
4373
|
-
const resizingColRef =
|
|
4374
|
-
const prevVisibleIdsRef =
|
|
4307
|
+
const sizingInfoRef = useRef8(defaultSizingInfo);
|
|
4308
|
+
const tableRef = useRef8(null);
|
|
4309
|
+
const tableElementRef = useRef8(null);
|
|
4310
|
+
const startSizesRef = useRef8([]);
|
|
4311
|
+
const excessRef = useRef8(0);
|
|
4312
|
+
const resizingColRef = useRef8(false);
|
|
4313
|
+
const prevVisibleIdsRef = useRef8("");
|
|
4375
4314
|
useLayoutEffect2(() => {
|
|
4376
4315
|
const table = tableRef.current;
|
|
4377
4316
|
const tableEl = tableElementRef.current;
|
|
@@ -4479,8 +4418,8 @@ var useColumnResizing = (options) => {
|
|
|
4479
4418
|
import { ToggleGroup, ToggleGroupItem } from "@radix-ui/react-toggle-group";
|
|
4480
4419
|
import { motion } from "motion/react";
|
|
4481
4420
|
import { Fragment as Fragment14, useId as useId2 } from "react";
|
|
4482
|
-
import { twJoin as
|
|
4483
|
-
import { jsx as
|
|
4421
|
+
import { twJoin as twJoin40 } from "tailwind-merge";
|
|
4422
|
+
import { jsx as jsx97, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
4484
4423
|
var TabGroup = ({
|
|
4485
4424
|
tabs,
|
|
4486
4425
|
currentTab,
|
|
@@ -4488,7 +4427,7 @@ var TabGroup = ({
|
|
|
4488
4427
|
size = "md"
|
|
4489
4428
|
}) => {
|
|
4490
4429
|
const layoutId = useId2();
|
|
4491
|
-
return /* @__PURE__ */
|
|
4430
|
+
return /* @__PURE__ */ jsx97(
|
|
4492
4431
|
ToggleGroup,
|
|
4493
4432
|
{
|
|
4494
4433
|
type: "single",
|
|
@@ -4496,7 +4435,7 @@ var TabGroup = ({
|
|
|
4496
4435
|
onValueChange: (value) => {
|
|
4497
4436
|
if (value) setCurrentTab(value);
|
|
4498
4437
|
},
|
|
4499
|
-
className:
|
|
4438
|
+
className: twJoin40(
|
|
4500
4439
|
"flex w-full justify-between gap-1 rounded-lg border border-surface-neutral bg-surface-light",
|
|
4501
4440
|
size === "sm" ? "p-1" : "p-0.5"
|
|
4502
4441
|
),
|
|
@@ -4506,7 +4445,7 @@ var TabGroup = ({
|
|
|
4506
4445
|
{
|
|
4507
4446
|
value: id,
|
|
4508
4447
|
disabled,
|
|
4509
|
-
className:
|
|
4448
|
+
className: twJoin40(
|
|
4510
4449
|
"relative flex w-full items-center justify-center rounded-md border transition-colors",
|
|
4511
4450
|
disabled && "cursor-not-allowed opacity-50",
|
|
4512
4451
|
!disabled && "focus-visible:border-indigo-700 focus-visible:outline-none",
|
|
@@ -4516,7 +4455,7 @@ var TabGroup = ({
|
|
|
4516
4455
|
size === "sm" ? "px-1.5 py-1" : "px-2 py-1"
|
|
4517
4456
|
),
|
|
4518
4457
|
children: [
|
|
4519
|
-
id === currentTab && !disabled && /* @__PURE__ */
|
|
4458
|
+
id === currentTab && !disabled && /* @__PURE__ */ jsx97(
|
|
4520
4459
|
motion.span,
|
|
4521
4460
|
{
|
|
4522
4461
|
layoutId,
|
|
@@ -4524,11 +4463,11 @@ var TabGroup = ({
|
|
|
4524
4463
|
transition: { type: "spring", stiffness: 500, damping: 40 }
|
|
4525
4464
|
}
|
|
4526
4465
|
),
|
|
4527
|
-
/* @__PURE__ */
|
|
4466
|
+
/* @__PURE__ */ jsx97("span", { className: "relative z-1", children: label })
|
|
4528
4467
|
]
|
|
4529
4468
|
}
|
|
4530
4469
|
),
|
|
4531
|
-
index !== tabs.length - 1 && /* @__PURE__ */
|
|
4470
|
+
index !== tabs.length - 1 && /* @__PURE__ */ jsx97("div", { className: "z-2 my-1 flex w-px bg-gray-300" })
|
|
4532
4471
|
] }, id))
|
|
4533
4472
|
}
|
|
4534
4473
|
);
|
|
@@ -4537,12 +4476,12 @@ var TabGroup = ({
|
|
|
4537
4476
|
// src/core/tabs/Tabs.tsx
|
|
4538
4477
|
import { Content as Content8, List, Root as Root8 } from "@radix-ui/react-tabs";
|
|
4539
4478
|
import { useId as useId3 } from "react";
|
|
4540
|
-
import { twJoin as
|
|
4479
|
+
import { twJoin as twJoin41 } from "tailwind-merge";
|
|
4541
4480
|
|
|
4542
4481
|
// src/core/tabs/Trigger.tsx
|
|
4543
4482
|
import { Trigger as Trigger7 } from "@radix-ui/react-tabs";
|
|
4544
4483
|
import { motion as motion2 } from "motion/react";
|
|
4545
|
-
import { jsx as
|
|
4484
|
+
import { jsx as jsx98, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
4546
4485
|
var TabsTrigger = ({
|
|
4547
4486
|
id,
|
|
4548
4487
|
label,
|
|
@@ -4564,8 +4503,8 @@ var TabsTrigger = ({
|
|
|
4564
4503
|
"fs-id": fsId,
|
|
4565
4504
|
children: [
|
|
4566
4505
|
label,
|
|
4567
|
-
extra && /* @__PURE__ */
|
|
4568
|
-
isActive && /* @__PURE__ */
|
|
4506
|
+
extra && /* @__PURE__ */ jsx98("span", { children: extra }),
|
|
4507
|
+
isActive && /* @__PURE__ */ jsx98(
|
|
4569
4508
|
motion2.span,
|
|
4570
4509
|
{
|
|
4571
4510
|
layoutId,
|
|
@@ -4578,7 +4517,7 @@ var TabsTrigger = ({
|
|
|
4578
4517
|
);
|
|
4579
4518
|
|
|
4580
4519
|
// src/core/tabs/Tabs.tsx
|
|
4581
|
-
import { jsx as
|
|
4520
|
+
import { jsx as jsx99, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
4582
4521
|
var [Provider2, useContext6] = createContextHelper();
|
|
4583
4522
|
var Tabs = ({
|
|
4584
4523
|
tabs,
|
|
@@ -4592,9 +4531,9 @@ var Tabs = ({
|
|
|
4592
4531
|
extraNode
|
|
4593
4532
|
}) => {
|
|
4594
4533
|
const layoutId = useId3();
|
|
4595
|
-
return /* @__PURE__ */
|
|
4596
|
-
/* @__PURE__ */ jsxs46("div", { className:
|
|
4597
|
-
/* @__PURE__ */
|
|
4534
|
+
return /* @__PURE__ */ jsx99(Provider2, { currentTab, children: /* @__PURE__ */ jsxs46(Root8, { className, value: currentTab, onValueChange: (id) => setCurrentTab(id), children: [
|
|
4535
|
+
/* @__PURE__ */ jsxs46("div", { className: twJoin41("flex gap-4", tabsListContainerClassName), children: [
|
|
4536
|
+
/* @__PURE__ */ jsx99(List, { className: twJoin41("flex space-x-4 overflow-x-auto pb-0.5", tabsListClassName), children: tabs.map(({ id, label, disabled, fsId }) => /* @__PURE__ */ jsx99(
|
|
4598
4537
|
TabsTrigger,
|
|
4599
4538
|
{
|
|
4600
4539
|
id,
|
|
@@ -4613,7 +4552,7 @@ var Tabs = ({
|
|
|
4613
4552
|
] }) });
|
|
4614
4553
|
};
|
|
4615
4554
|
var TabContent = ({ id, ...rest }) => {
|
|
4616
|
-
return /* @__PURE__ */
|
|
4555
|
+
return /* @__PURE__ */ jsx99(Content8, { value: id, ...rest });
|
|
4617
4556
|
};
|
|
4618
4557
|
var AlwaysMountedTabContent = ({
|
|
4619
4558
|
id,
|
|
@@ -4623,81 +4562,21 @@ var AlwaysMountedTabContent = ({
|
|
|
4623
4562
|
}) => {
|
|
4624
4563
|
const { currentTab } = useContext6();
|
|
4625
4564
|
const visible = id === currentTab;
|
|
4626
|
-
return /* @__PURE__ */
|
|
4565
|
+
return /* @__PURE__ */ jsx99("div", { className: twJoin41(visible ? visibleClassName : "hidden", className), children });
|
|
4627
4566
|
};
|
|
4628
4567
|
Tabs.TabContent = TabContent;
|
|
4629
4568
|
Tabs.AlwaysMountedTabContent = AlwaysMountedTabContent;
|
|
4630
4569
|
|
|
4631
|
-
// src/core/tabs/ScrollTabsLayout.tsx
|
|
4632
|
-
import { useCallback as useCallback10, useEffect as useEffect9, useRef as useRef10, useState as useState12 } from "react";
|
|
4633
|
-
import { twJoin as twJoin44 } from "tailwind-merge";
|
|
4634
|
-
import { Fragment as Fragment15, jsx as jsx103, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
4635
|
-
var ScrollTabsLayout = ({ tabs, onSelectTab, sectionClassName }) => {
|
|
4636
|
-
const [selectedTabName, setSelectedTabName] = useState12(tabs[0].tabName);
|
|
4637
|
-
const scrollContainerRef = useRef10(null);
|
|
4638
|
-
const tabRefs = useRef10({});
|
|
4639
|
-
const handleSelectTab = useCallback10(
|
|
4640
|
-
(tabId) => {
|
|
4641
|
-
scrollContainerRef.current?.scrollTo({
|
|
4642
|
-
// @ts-expect-error noUncheckedIndexedAccess
|
|
4643
|
-
top: tabRefs.current[tabId].offsetTop,
|
|
4644
|
-
behavior: "smooth"
|
|
4645
|
-
});
|
|
4646
|
-
setSelectedTabName(tabId);
|
|
4647
|
-
onSelectTab?.(tabId);
|
|
4648
|
-
},
|
|
4649
|
-
[onSelectTab]
|
|
4650
|
-
);
|
|
4651
|
-
useEffect9(() => {
|
|
4652
|
-
const scrollContainer = scrollContainerRef.current;
|
|
4653
|
-
const handleScroll = (e) => {
|
|
4654
|
-
Object.entries(tabRefs.current).forEach(([tabName, tabRef]) => {
|
|
4655
|
-
if (e.currentTarget?.scrollTop >= tabRef.offsetTop) {
|
|
4656
|
-
setSelectedTabName(tabName);
|
|
4657
|
-
onSelectTab?.(tabName);
|
|
4658
|
-
}
|
|
4659
|
-
});
|
|
4660
|
-
};
|
|
4661
|
-
scrollContainer?.addEventListener("scroll", handleScroll);
|
|
4662
|
-
return () => {
|
|
4663
|
-
scrollContainer?.removeEventListener("scroll", handleScroll);
|
|
4664
|
-
};
|
|
4665
|
-
});
|
|
4666
|
-
return /* @__PURE__ */ jsxs47(Fragment15, { children: [
|
|
4667
|
-
/* @__PURE__ */ jsx103(
|
|
4668
|
-
Tabs,
|
|
4669
|
-
{
|
|
4670
|
-
currentTab: selectedTabName,
|
|
4671
|
-
setCurrentTab: handleSelectTab,
|
|
4672
|
-
tabs: tabs.map((tab) => ({ id: tab.tabName, label: tab.tabName }))
|
|
4673
|
-
}
|
|
4674
|
-
),
|
|
4675
|
-
/* @__PURE__ */ jsx103("hr", {}),
|
|
4676
|
-
/* @__PURE__ */ jsxs47("div", { ref: scrollContainerRef, className: "relative h-screen overflow-y-auto", children: [
|
|
4677
|
-
tabs.map((tab) => /* @__PURE__ */ jsx103(
|
|
4678
|
-
"div",
|
|
4679
|
-
{
|
|
4680
|
-
ref: (el) => el ? tabRefs.current[tab.tabName] = el : void 0,
|
|
4681
|
-
className: twJoin44("first:pt-4", sectionClassName),
|
|
4682
|
-
children: tab.content
|
|
4683
|
-
},
|
|
4684
|
-
tab.tabName
|
|
4685
|
-
)),
|
|
4686
|
-
/* @__PURE__ */ jsx103("div", { className: "h-screen" })
|
|
4687
|
-
] })
|
|
4688
|
-
] });
|
|
4689
|
-
};
|
|
4690
|
-
|
|
4691
4570
|
// src/core/tabs/ComposableTabs.tsx
|
|
4692
4571
|
import { Content as Content9, List as List2, Root as Root9 } from "@radix-ui/react-tabs";
|
|
4693
4572
|
import { useId as useId4 } from "react";
|
|
4694
|
-
import { twJoin as
|
|
4695
|
-
import { jsx as
|
|
4573
|
+
import { twJoin as twJoin42 } from "tailwind-merge";
|
|
4574
|
+
import { jsx as jsx100, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
4696
4575
|
var [TabsProvider, useTabsContext] = createContextHelper();
|
|
4697
4576
|
var ComposableTabsList = ({ className, containerClassName, extraNode }) => {
|
|
4698
4577
|
const { tabs, currentTab, layoutId } = useTabsContext();
|
|
4699
|
-
return /* @__PURE__ */
|
|
4700
|
-
/* @__PURE__ */
|
|
4578
|
+
return /* @__PURE__ */ jsxs47("div", { className: twJoin42("flex gap-4", containerClassName), children: [
|
|
4579
|
+
/* @__PURE__ */ jsx100(List2, { className: twJoin42("flex space-x-4 overflow-x-auto", className), children: tabs.map(({ id, label, disabled }) => /* @__PURE__ */ jsx100(
|
|
4701
4580
|
TabsTrigger,
|
|
4702
4581
|
{
|
|
4703
4582
|
id,
|
|
@@ -4712,7 +4591,7 @@ var ComposableTabsList = ({ className, containerClassName, extraNode }) => {
|
|
|
4712
4591
|
] });
|
|
4713
4592
|
};
|
|
4714
4593
|
var ComposableTabContent = ({ id, ...rest }) => {
|
|
4715
|
-
return /* @__PURE__ */
|
|
4594
|
+
return /* @__PURE__ */ jsx100(Content9, { value: id, ...rest });
|
|
4716
4595
|
};
|
|
4717
4596
|
var ComposableAlwaysMountedTabContent = ({
|
|
4718
4597
|
id,
|
|
@@ -4722,7 +4601,7 @@ var ComposableAlwaysMountedTabContent = ({
|
|
|
4722
4601
|
}) => {
|
|
4723
4602
|
const { currentTab } = useTabsContext();
|
|
4724
4603
|
const visible = id === currentTab;
|
|
4725
|
-
return /* @__PURE__ */
|
|
4604
|
+
return /* @__PURE__ */ jsx100("div", { className: twJoin42(visible ? visibleClassName : "hidden", className), children });
|
|
4726
4605
|
};
|
|
4727
4606
|
var ComposableTabsRoot = ({
|
|
4728
4607
|
tabs,
|
|
@@ -4732,7 +4611,7 @@ var ComposableTabsRoot = ({
|
|
|
4732
4611
|
children
|
|
4733
4612
|
}) => {
|
|
4734
4613
|
const layoutId = useId4();
|
|
4735
|
-
return /* @__PURE__ */
|
|
4614
|
+
return /* @__PURE__ */ jsx100(TabsProvider, { tabs, currentTab, layoutId, children: /* @__PURE__ */ jsx100(Root9, { className, value: currentTab, onValueChange: (id) => setCurrentTab(id), children }) });
|
|
4736
4615
|
};
|
|
4737
4616
|
var ComposableTabs = {
|
|
4738
4617
|
Root: ComposableTabsRoot,
|
|
@@ -4744,53 +4623,24 @@ var ComposableTabs = {
|
|
|
4744
4623
|
// src/core/tag/Tag.tsx
|
|
4745
4624
|
import { faClose as faClose3 } from "@fortawesome/sharp-solid-svg-icons";
|
|
4746
4625
|
import * as React14 from "react";
|
|
4747
|
-
import { jsx as
|
|
4748
|
-
var TagLabel = ({ children, removable, onRemove, intent = "default", ...rest }, ref) => /* @__PURE__ */
|
|
4626
|
+
import { jsx as jsx101, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
4627
|
+
var TagLabel = ({ children, removable, onRemove, intent = "default", ...rest }, ref) => /* @__PURE__ */ jsxs48(Label, { ...rest, ref, intent, children: [
|
|
4749
4628
|
children,
|
|
4750
|
-
removable && /* @__PURE__ */
|
|
4629
|
+
removable && /* @__PURE__ */ jsx101(
|
|
4751
4630
|
"button",
|
|
4752
4631
|
{
|
|
4753
4632
|
className: "ml-1 inline-flex h-xs items-center px-1 text-muted hover:text-neutral focus:outline-hidden",
|
|
4754
4633
|
onClick: onRemove,
|
|
4755
|
-
children: /* @__PURE__ */
|
|
4634
|
+
children: /* @__PURE__ */ jsx101(Icon, { icon: faClose3 })
|
|
4756
4635
|
}
|
|
4757
4636
|
)
|
|
4758
4637
|
] });
|
|
4759
4638
|
var TagImpl = React14.forwardRef(TagLabel);
|
|
4760
4639
|
var Tag = ({ tooltip, ...rest }) => {
|
|
4761
4640
|
if (!tooltip) {
|
|
4762
|
-
return /* @__PURE__ */
|
|
4641
|
+
return /* @__PURE__ */ jsx101(TagImpl, { ...rest });
|
|
4763
4642
|
}
|
|
4764
|
-
return /* @__PURE__ */
|
|
4765
|
-
};
|
|
4766
|
-
|
|
4767
|
-
// src/core/utils/useIsHovered.ts
|
|
4768
|
-
import { useEffect as useEffect10, useState as useState13 } from "react";
|
|
4769
|
-
var useIsHovered = (ref) => {
|
|
4770
|
-
const [isHovered, setIsHovered] = useState13(false);
|
|
4771
|
-
useEffect10(() => {
|
|
4772
|
-
const handleMouseMove = () => {
|
|
4773
|
-
if (ref.current?.matches(":hover")) {
|
|
4774
|
-
setIsHovered(true);
|
|
4775
|
-
} else {
|
|
4776
|
-
setIsHovered(false);
|
|
4777
|
-
}
|
|
4778
|
-
};
|
|
4779
|
-
const handleScroll = () => {
|
|
4780
|
-
if (isHovered) {
|
|
4781
|
-
setIsHovered(false);
|
|
4782
|
-
}
|
|
4783
|
-
};
|
|
4784
|
-
window.addEventListener("mousemove", handleMouseMove);
|
|
4785
|
-
if (isHovered) {
|
|
4786
|
-
window.addEventListener("scroll", handleScroll, true);
|
|
4787
|
-
}
|
|
4788
|
-
return () => {
|
|
4789
|
-
window.removeEventListener("mousemove", handleMouseMove);
|
|
4790
|
-
window.removeEventListener("scroll", handleScroll, true);
|
|
4791
|
-
};
|
|
4792
|
-
}, [ref, isHovered]);
|
|
4793
|
-
return isHovered;
|
|
4643
|
+
return /* @__PURE__ */ jsx101(Tooltip, { trigger: /* @__PURE__ */ jsx101(TagImpl, { ...rest }), content: /* @__PURE__ */ jsx101("p", { className: "text-sm", children: tooltip }) });
|
|
4794
4644
|
};
|
|
4795
4645
|
export {
|
|
4796
4646
|
AlertModal,
|
|
@@ -4834,7 +4684,6 @@ export {
|
|
|
4834
4684
|
HeaderTile,
|
|
4835
4685
|
HeaderTileGroup,
|
|
4836
4686
|
Icon,
|
|
4837
|
-
IndeterminateCheckbox,
|
|
4838
4687
|
Input,
|
|
4839
4688
|
InputBox,
|
|
4840
4689
|
Label,
|
|
@@ -4851,7 +4700,6 @@ export {
|
|
|
4851
4700
|
RadioButtonGroup,
|
|
4852
4701
|
RadioButtonItem,
|
|
4853
4702
|
ScreenHeightPageContainer,
|
|
4854
|
-
ScrollTabsLayout,
|
|
4855
4703
|
Select,
|
|
4856
4704
|
SelectListItem,
|
|
4857
4705
|
SelectWithUnselect,
|
|
@@ -4861,10 +4709,7 @@ export {
|
|
|
4861
4709
|
Switch,
|
|
4862
4710
|
TabGroup,
|
|
4863
4711
|
Table,
|
|
4864
|
-
TableCheckboxSkeleton,
|
|
4865
|
-
TableSkeleton,
|
|
4866
4712
|
Tabs,
|
|
4867
|
-
TabsSkeleton,
|
|
4868
4713
|
TabsTrigger,
|
|
4869
4714
|
Tag,
|
|
4870
4715
|
Text,
|
|
@@ -4887,9 +4732,6 @@ export {
|
|
|
4887
4732
|
useDrawer,
|
|
4888
4733
|
useDrawerResize,
|
|
4889
4734
|
useForm,
|
|
4890
|
-
useIntersectionObserver,
|
|
4891
|
-
useIsHovered,
|
|
4892
|
-
useOverflowObserver,
|
|
4893
4735
|
useSwitchId,
|
|
4894
4736
|
useTable,
|
|
4895
4737
|
useUncontrolledField,
|