@candidhealth/react-vitals 1.0.0-alpha.11 → 1.0.0-alpha.13
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 +55 -179
- package/dist/index.d.ts +55 -179
- package/dist/index.js +153 -257
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +151 -223
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -139,7 +139,6 @@ import * as React from "react";
|
|
|
139
139
|
|
|
140
140
|
// src/core/button/buttonStyles.ts
|
|
141
141
|
import { twJoin as twJoin3 } from "tailwind-merge";
|
|
142
|
-
var linkStyles = "text-indigo-600 hover:underline active:text-indigo-400 focus:outline-indigo-400 focus:outline-offset-2";
|
|
143
142
|
var roundedMdStyles = {
|
|
144
143
|
none: "",
|
|
145
144
|
right: "rounded-r-md",
|
|
@@ -736,7 +735,7 @@ var Copyable = ({ children, value, tooltip, onClick, asChild, className }) => {
|
|
|
736
735
|
children: asChild ? children : /* @__PURE__ */ jsx17("span", { children })
|
|
737
736
|
}
|
|
738
737
|
),
|
|
739
|
-
tooltip && state === "idle" && /* @__PURE__ */ jsx17(
|
|
738
|
+
tooltip && state === "idle" && /* @__PURE__ */ jsx17(Tooltip.Content, { side: "bottom", children: tooltip }),
|
|
740
739
|
/* @__PURE__ */ jsx17(RadixTooltip2.Portal, { children: /* @__PURE__ */ jsx17(
|
|
741
740
|
RadixTooltip2.Content,
|
|
742
741
|
{
|
|
@@ -1119,9 +1118,6 @@ var ErrorTextImpl = ({ className, ...props }, ref) => {
|
|
|
1119
1118
|
};
|
|
1120
1119
|
var ErrorText = forwardRef8(ErrorTextImpl);
|
|
1121
1120
|
|
|
1122
|
-
// src/core/form/index.ts
|
|
1123
|
-
import { FormProvider, useFieldArray, useFormContext as useFormContext2, useFormState as useFormState2, useWatch, useController as useController2 } from "react-hook-form";
|
|
1124
|
-
|
|
1125
1121
|
// src/core/form/components/ControlledField.tsx
|
|
1126
1122
|
import { createContext as createContext2, useContext as useContext2, useMemo as useMemo2 } from "react";
|
|
1127
1123
|
|
|
@@ -1515,7 +1511,7 @@ var DollarInput = forwardRef14(
|
|
|
1515
1511
|
setStrValue(inputValue);
|
|
1516
1512
|
return;
|
|
1517
1513
|
}
|
|
1518
|
-
if (inputValue.split(".")?.[1]?.length > 2) return;
|
|
1514
|
+
if ((inputValue.split(".")?.[1]?.length ?? 0) > 2) return;
|
|
1519
1515
|
const parsedValue = parseFloat(inputValue);
|
|
1520
1516
|
if (!isNaN(parsedValue)) {
|
|
1521
1517
|
setStrValue(inputValue);
|
|
@@ -1660,7 +1656,7 @@ var PercentInput = forwardRef15(
|
|
|
1660
1656
|
setStrValue(inputValue);
|
|
1661
1657
|
return;
|
|
1662
1658
|
}
|
|
1663
|
-
if (inputValue.split(".")?.[1]?.length > 2) return;
|
|
1659
|
+
if ((inputValue.split(".")?.[1]?.length ?? 0) > 2) return;
|
|
1664
1660
|
const parsedValue = parseFloat(inputValue);
|
|
1665
1661
|
if (!isNaN(parsedValue)) {
|
|
1666
1662
|
setStrValue(inputValue);
|
|
@@ -2150,10 +2146,13 @@ var AsyncMultiSelect = ({
|
|
|
2150
2146
|
if (!allValuesHaveOptions) {
|
|
2151
2147
|
return /* @__PURE__ */ jsx48("span", { className: "line-clamp-1", children: "Loading..." });
|
|
2152
2148
|
}
|
|
2153
|
-
const optionMatchingFirstVal =
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2149
|
+
const optionMatchingFirstVal = (
|
|
2150
|
+
// @ts-expect-error noUncheckedIndexedAccess
|
|
2151
|
+
valueToOptionMap.get(value[0]) || {
|
|
2152
|
+
label: value[0],
|
|
2153
|
+
icon: void 0
|
|
2154
|
+
}
|
|
2155
|
+
);
|
|
2157
2156
|
const firstValText = optionMatchingFirstVal ? optionMatchingFirstVal.label : value[0];
|
|
2158
2157
|
const icon = value.length === 1 ? optionMatchingFirstVal?.icon : void 0;
|
|
2159
2158
|
return /* @__PURE__ */ jsxs22(Fragment6, { children: [
|
|
@@ -2949,26 +2948,6 @@ import { useCallback as useCallback8, useEffect as useEffect5, useRef as useRef5
|
|
|
2949
2948
|
var MIN_LEFT_SPACE = 240;
|
|
2950
2949
|
var MIN_WIDTH_PCT = 0.5;
|
|
2951
2950
|
var MIN_WIDTH_PX = 500;
|
|
2952
|
-
var constraintPct = (val) => Math.min(1, Math.max(0, val));
|
|
2953
|
-
var localStoragePersist = (key) => ({
|
|
2954
|
-
load: () => {
|
|
2955
|
-
try {
|
|
2956
|
-
const val = localStorage.getItem(key);
|
|
2957
|
-
if (val && !Number.isNaN(Number(val))) {
|
|
2958
|
-
return constraintPct(Number(val));
|
|
2959
|
-
}
|
|
2960
|
-
return void 0;
|
|
2961
|
-
} catch {
|
|
2962
|
-
return void 0;
|
|
2963
|
-
}
|
|
2964
|
-
},
|
|
2965
|
-
save: (size) => {
|
|
2966
|
-
try {
|
|
2967
|
-
localStorage.setItem(key, constraintPct(size).toString());
|
|
2968
|
-
} catch {
|
|
2969
|
-
}
|
|
2970
|
-
}
|
|
2971
|
-
});
|
|
2972
2951
|
var computeWidth = (pct) => window.innerWidth * pct;
|
|
2973
2952
|
var computePct = (widthPx) => widthPx / window.innerWidth;
|
|
2974
2953
|
var constrainedWidth = (width) => {
|
|
@@ -3727,7 +3706,7 @@ AlertModal.CloseButton = ModalCloseButton;
|
|
|
3727
3706
|
|
|
3728
3707
|
// src/core/phone-number/PhoneNumber.tsx
|
|
3729
3708
|
import "react-international-phone/style.css";
|
|
3730
|
-
import {
|
|
3709
|
+
import { PhoneInput } from "react-international-phone";
|
|
3731
3710
|
import { twJoin as twJoin36 } from "tailwind-merge";
|
|
3732
3711
|
import { jsx as jsx93 } from "react/jsx-runtime";
|
|
3733
3712
|
var PhoneNumber = ({
|
|
@@ -3751,48 +3730,28 @@ var PhoneNumber = ({
|
|
|
3751
3730
|
}
|
|
3752
3731
|
);
|
|
3753
3732
|
};
|
|
3754
|
-
|
|
3755
|
-
|
|
3756
|
-
|
|
3757
|
-
|
|
3758
|
-
|
|
3759
|
-
|
|
3760
|
-
|
|
3761
|
-
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
}
|
|
3767
|
-
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
|
|
3771
|
-
|
|
3772
|
-
if (digitsOnly.length === 11 && digitsOnly.startsWith("1")) {
|
|
3773
|
-
return `+1 (${digitsOnly.slice(1, 4)}) ${digitsOnly.slice(4, 7)}-${digitsOnly.slice(7)}`;
|
|
3774
|
-
}
|
|
3775
|
-
if (digitsOnly.length === 10) {
|
|
3776
|
-
return `(${digitsOnly.slice(0, 3)}) ${digitsOnly.slice(3, 6)}-${digitsOnly.slice(6)}`;
|
|
3777
|
-
}
|
|
3778
|
-
return input;
|
|
3779
|
-
};
|
|
3780
|
-
var isValidPhoneNumber = (input) => {
|
|
3781
|
-
if (!input) {
|
|
3782
|
-
return false;
|
|
3783
|
-
}
|
|
3784
|
-
if (input.startsWith("+1")) {
|
|
3785
|
-
return input.length === 12;
|
|
3786
|
-
}
|
|
3787
|
-
if (input.startsWith("1")) {
|
|
3788
|
-
return input.length === 11;
|
|
3789
|
-
}
|
|
3790
|
-
return true;
|
|
3791
|
-
};
|
|
3733
|
+
|
|
3734
|
+
// src/core/stepper/Stepper.tsx
|
|
3735
|
+
import { twJoin as twJoin37 } from "tailwind-merge";
|
|
3736
|
+
import { jsx as jsx94, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
3737
|
+
var StepItem = ({ label, step, isActive }) => /* @__PURE__ */ jsxs39("div", { className: "flex items-center gap-3", children: [
|
|
3738
|
+
/* @__PURE__ */ jsx94(
|
|
3739
|
+
"div",
|
|
3740
|
+
{
|
|
3741
|
+
className: twJoin37(
|
|
3742
|
+
"flex size-6 items-center justify-center rounded-full",
|
|
3743
|
+
isActive ? "bg-button-primary" : "bg-button-primary-disabled"
|
|
3744
|
+
),
|
|
3745
|
+
children: /* @__PURE__ */ jsx94(Text, { className: "text-white", children: step })
|
|
3746
|
+
}
|
|
3747
|
+
),
|
|
3748
|
+
/* @__PURE__ */ jsx94(Text, { variant: "body-1", className: isActive ? "text-primary" : "text-indigo-200", children: label })
|
|
3749
|
+
] });
|
|
3750
|
+
var Stepper = ({ steps, currentStep, className }) => /* @__PURE__ */ jsx94("div", { className: twMerge("flex items-center justify-center gap-5", className), children: steps.map((label, index) => /* @__PURE__ */ jsx94(StepItem, { label, step: index + 1, isActive: index === currentStep }, label)) });
|
|
3792
3751
|
|
|
3793
3752
|
// src/core/table/Table.tsx
|
|
3794
3753
|
import { useEffect as useEffect7 } from "react";
|
|
3795
|
-
import { twJoin as
|
|
3754
|
+
import { twJoin as twJoin40 } from "tailwind-merge";
|
|
3796
3755
|
|
|
3797
3756
|
// src/core/utils/useIntersectionObserver.ts
|
|
3798
3757
|
import { useCallback as useCallback9, useRef as useRef7, useState as useState10 } from "react";
|
|
@@ -3826,7 +3785,7 @@ var useIntersectionObserver = (options = {}) => {
|
|
|
3826
3785
|
import { faTable } from "@fortawesome/sharp-solid-svg-icons";
|
|
3827
3786
|
|
|
3828
3787
|
// src/core/table/TableRow.tsx
|
|
3829
|
-
import { twJoin as
|
|
3788
|
+
import { twJoin as twJoin38 } from "tailwind-merge";
|
|
3830
3789
|
|
|
3831
3790
|
// src/core/table/utils.ts
|
|
3832
3791
|
import { flexRender } from "@tanstack/react-table";
|
|
@@ -3909,7 +3868,7 @@ var handleHeaderStyle = handleStyle;
|
|
|
3909
3868
|
var handleCellStyle = handleStyle;
|
|
3910
3869
|
|
|
3911
3870
|
// src/core/table/TableRow.tsx
|
|
3912
|
-
import { jsx as
|
|
3871
|
+
import { jsx as jsx95 } from "react/jsx-runtime";
|
|
3913
3872
|
var TableRow = ({ table, rowClassName, cellClassName, row }) => {
|
|
3914
3873
|
const hasRowClick = !!table.options.meta?.onRowClick;
|
|
3915
3874
|
const isStaticSubRow = !!table.options.meta?.staticSubRows;
|
|
@@ -3919,18 +3878,18 @@ var TableRow = ({ table, rowClassName, cellClassName, row }) => {
|
|
|
3919
3878
|
}
|
|
3920
3879
|
};
|
|
3921
3880
|
const cells = row.getVisibleCells();
|
|
3922
|
-
return /* @__PURE__ */
|
|
3881
|
+
return /* @__PURE__ */ jsx95(
|
|
3923
3882
|
"tr",
|
|
3924
3883
|
{
|
|
3925
3884
|
"data-active": table.options.meta?.activeRowId === row.id ? "" : void 0,
|
|
3926
3885
|
"data-clickable": !isStaticSubRow && (hasRowClick || row.getCanExpand()) ? "" : void 0,
|
|
3927
3886
|
"data-depth": isStaticSubRow ? row.depth : void 0,
|
|
3928
3887
|
onClick: !isStaticSubRow && row.getCanExpand() ? row.getToggleExpandedHandler() : void 0,
|
|
3929
|
-
className:
|
|
3888
|
+
className: twJoin38(
|
|
3930
3889
|
"data-active:bg-indigo-100 data-clickable:hover:cursor-pointer data-clickable:hover:bg-surface-primary data-active:data-clickable:hover:bg-indigo-200",
|
|
3931
3890
|
rowClassName
|
|
3932
3891
|
),
|
|
3933
|
-
children: cells.map((cell) => /* @__PURE__ */
|
|
3892
|
+
children: cells.map((cell) => /* @__PURE__ */ jsx95(
|
|
3934
3893
|
"td",
|
|
3935
3894
|
{
|
|
3936
3895
|
onClickCapture: hasRowClick ? (ev) => onRowClick(ev, row) : void 0,
|
|
@@ -3945,40 +3904,40 @@ var TableRow = ({ table, rowClassName, cellClassName, row }) => {
|
|
|
3945
3904
|
};
|
|
3946
3905
|
|
|
3947
3906
|
// src/core/table/TableBody.tsx
|
|
3948
|
-
import { jsx as
|
|
3907
|
+
import { jsx as jsx96, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
3949
3908
|
var TableBody = ({ table, loading, rootClassName, afterRows, ...props }) => {
|
|
3950
3909
|
const { rows } = table.getRowModel();
|
|
3951
3910
|
if (rows.length === 0) {
|
|
3952
3911
|
if (loading) {
|
|
3953
3912
|
const colCount = table.getAllLeafColumns().length;
|
|
3954
|
-
return /* @__PURE__ */
|
|
3913
|
+
return /* @__PURE__ */ jsx96("tbody", { className: rootClassName, children: Array.from({ length: 20 }).map((_, i) => /* @__PURE__ */ jsx96(
|
|
3955
3914
|
"tr",
|
|
3956
3915
|
{
|
|
3957
3916
|
className: "[&:not(:last-child)>td]:border-b [&:not(:last-child)>td]:border-gray-200",
|
|
3958
|
-
children: Array.from({ length: colCount }).map((_2, j) => /* @__PURE__ */
|
|
3917
|
+
children: Array.from({ length: colCount }).map((_2, j) => /* @__PURE__ */ jsx96("td", { className: "p-2", children: /* @__PURE__ */ jsx96(Skeleton, { className: "h-3 w-full" }) }, j))
|
|
3959
3918
|
},
|
|
3960
3919
|
`skeleton-${i}`
|
|
3961
3920
|
)) });
|
|
3962
3921
|
}
|
|
3963
|
-
return /* @__PURE__ */
|
|
3964
|
-
/* @__PURE__ */
|
|
3922
|
+
return /* @__PURE__ */ jsxs40("tbody", { className: rootClassName, children: [
|
|
3923
|
+
/* @__PURE__ */ jsx96("tr", { children: /* @__PURE__ */ jsx96(EmptyRowsTd, { colSpan: table.getAllLeafColumns().length, emptyText: table.options.meta?.emptyText }) }),
|
|
3965
3924
|
afterRows
|
|
3966
3925
|
] });
|
|
3967
3926
|
}
|
|
3968
|
-
return /* @__PURE__ */
|
|
3969
|
-
rows.map((row) => /* @__PURE__ */
|
|
3927
|
+
return /* @__PURE__ */ jsxs40("tbody", { className: rootClassName, children: [
|
|
3928
|
+
rows.map((row) => /* @__PURE__ */ jsx96(TableRow, { ...props, table, row }, row.id)),
|
|
3970
3929
|
afterRows
|
|
3971
3930
|
] });
|
|
3972
3931
|
};
|
|
3973
|
-
var EmptyRowsTd = ({ emptyText = "No rows found", ...props }) => /* @__PURE__ */
|
|
3974
|
-
/* @__PURE__ */
|
|
3975
|
-
/* @__PURE__ */
|
|
3932
|
+
var EmptyRowsTd = ({ emptyText = "No rows found", ...props }) => /* @__PURE__ */ jsx96("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: [
|
|
3933
|
+
/* @__PURE__ */ jsx96("span", { children: /* @__PURE__ */ jsx96(Icon, { icon: faTable }) }),
|
|
3934
|
+
/* @__PURE__ */ jsx96("span", { className: "text-base/none font-medium", children: emptyText })
|
|
3976
3935
|
] }) });
|
|
3977
3936
|
|
|
3978
3937
|
// src/core/table/TableHeader.tsx
|
|
3979
3938
|
import { faArrowDownWideShort, faArrowUpWideShort } from "@fortawesome/sharp-solid-svg-icons";
|
|
3980
|
-
import { twJoin as
|
|
3981
|
-
import { jsx as
|
|
3939
|
+
import { twJoin as twJoin39 } from "tailwind-merge";
|
|
3940
|
+
import { jsx as jsx97, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
3982
3941
|
var TableHeader = ({
|
|
3983
3942
|
table,
|
|
3984
3943
|
variant,
|
|
@@ -3986,7 +3945,7 @@ var TableHeader = ({
|
|
|
3986
3945
|
rowClassName,
|
|
3987
3946
|
cellClassName
|
|
3988
3947
|
}) => {
|
|
3989
|
-
return /* @__PURE__ */
|
|
3948
|
+
return /* @__PURE__ */ jsx97("thead", { className: rootClassName, children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx97("tr", { className: rowClassName, children: headerGroup.headers.map((header) => /* @__PURE__ */ jsx97(
|
|
3990
3949
|
Th,
|
|
3991
3950
|
{
|
|
3992
3951
|
scope: "col",
|
|
@@ -4009,14 +3968,14 @@ var Th = ({
|
|
|
4009
3968
|
const isLastInRow = header.index === header.headerGroup.headers.length - 1;
|
|
4010
3969
|
const canResize = !isLastInRow && !!header.getContext().table.options.columnResizeMode && header.column.getCanResize();
|
|
4011
3970
|
const isSubtable = variant === "subtable";
|
|
4012
|
-
const resizeHandle = canResize && /* @__PURE__ */
|
|
3971
|
+
const resizeHandle = canResize && /* @__PURE__ */ jsx97(
|
|
4013
3972
|
"div",
|
|
4014
3973
|
{
|
|
4015
3974
|
onMouseDown: header.getResizeHandler(),
|
|
4016
3975
|
onTouchStart: header.getResizeHandler(),
|
|
4017
3976
|
onClick: (e) => e.stopPropagation(),
|
|
4018
3977
|
"data-resizing": header.column.getIsResizing() ? "" : void 0,
|
|
4019
|
-
className:
|
|
3978
|
+
className: twJoin39(
|
|
4020
3979
|
"absolute top-0 right-0 bottom-0 z-10 w-1 cursor-col-resize touch-none select-none",
|
|
4021
3980
|
"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-['']",
|
|
4022
3981
|
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"
|
|
@@ -4024,54 +3983,54 @@ var Th = ({
|
|
|
4024
3983
|
}
|
|
4025
3984
|
);
|
|
4026
3985
|
if (header.column.getIsSorted()) {
|
|
4027
|
-
return /* @__PURE__ */
|
|
3986
|
+
return /* @__PURE__ */ jsxs41(
|
|
4028
3987
|
"th",
|
|
4029
3988
|
{
|
|
4030
3989
|
...props,
|
|
4031
3990
|
"data-clickable": "ok",
|
|
4032
3991
|
onClick: header.column.getToggleSortingHandler(),
|
|
4033
|
-
className:
|
|
3992
|
+
className: twJoin39(props.className, canResize && "group relative"),
|
|
4034
3993
|
children: [
|
|
4035
3994
|
children,
|
|
4036
|
-
/* @__PURE__ */
|
|
3995
|
+
/* @__PURE__ */ jsx97("span", { className: "ml-1.5", children: /* @__PURE__ */ jsx97(SortIcon, { dir: header.column.getIsSorted() }) }),
|
|
4037
3996
|
resizeHandle
|
|
4038
3997
|
]
|
|
4039
3998
|
}
|
|
4040
3999
|
);
|
|
4041
4000
|
}
|
|
4042
4001
|
if (header.column.getCanSort()) {
|
|
4043
|
-
return /* @__PURE__ */
|
|
4002
|
+
return /* @__PURE__ */ jsxs41(
|
|
4044
4003
|
"th",
|
|
4045
4004
|
{
|
|
4046
4005
|
...props,
|
|
4047
4006
|
"data-clickable": "ok",
|
|
4048
4007
|
onClick: header.column.getToggleSortingHandler(),
|
|
4049
|
-
className:
|
|
4008
|
+
className: twJoin39(props.className, canResize && "group relative"),
|
|
4050
4009
|
children: [
|
|
4051
4010
|
children,
|
|
4052
|
-
/* @__PURE__ */
|
|
4011
|
+
/* @__PURE__ */ jsx97("span", { className: "invisible ml-1.5 group-hover:visible", children: /* @__PURE__ */ jsx97(SortIcon, { dir: header.column.getNextSortingOrder() }) }),
|
|
4053
4012
|
resizeHandle
|
|
4054
4013
|
]
|
|
4055
4014
|
}
|
|
4056
4015
|
);
|
|
4057
4016
|
}
|
|
4058
|
-
return /* @__PURE__ */
|
|
4017
|
+
return /* @__PURE__ */ jsxs41("th", { ...props, className: twJoin39(props.className, canResize && "group relative"), children: [
|
|
4059
4018
|
children,
|
|
4060
4019
|
resizeHandle
|
|
4061
4020
|
] });
|
|
4062
4021
|
};
|
|
4063
4022
|
var SortIcon = ({ dir }) => {
|
|
4064
4023
|
if (dir === "asc") {
|
|
4065
|
-
return /* @__PURE__ */
|
|
4024
|
+
return /* @__PURE__ */ jsx97(Icon, { icon: faArrowUpWideShort });
|
|
4066
4025
|
}
|
|
4067
4026
|
if (dir === "desc") {
|
|
4068
|
-
return /* @__PURE__ */
|
|
4027
|
+
return /* @__PURE__ */ jsx97(Icon, { icon: faArrowDownWideShort });
|
|
4069
4028
|
}
|
|
4070
4029
|
return null;
|
|
4071
4030
|
};
|
|
4072
4031
|
|
|
4073
4032
|
// src/core/table/Table.tsx
|
|
4074
|
-
import { Fragment as Fragment13, jsx as
|
|
4033
|
+
import { Fragment as Fragment13, jsx as jsx98, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
4075
4034
|
var tableVariants = {
|
|
4076
4035
|
default: "default",
|
|
4077
4036
|
seamless: "seamless",
|
|
@@ -4136,63 +4095,63 @@ var Table = ({ variant = "default", loading: loadingProp, ...props }) => {
|
|
|
4136
4095
|
const tableElementRef = props.table.options.meta?.tableElementRef ?? null;
|
|
4137
4096
|
switch (variant) {
|
|
4138
4097
|
case tableVariants.transparent:
|
|
4139
|
-
return /* @__PURE__ */
|
|
4098
|
+
return /* @__PURE__ */ jsx98("div", { className: "relative mb-auto min-w-full", children: /* @__PURE__ */ jsxs42(
|
|
4140
4099
|
"table",
|
|
4141
4100
|
{
|
|
4142
4101
|
ref: tableElementRef,
|
|
4143
4102
|
"data-ui": uiLoading,
|
|
4144
4103
|
style: resizeStyle,
|
|
4145
|
-
className:
|
|
4104
|
+
className: twJoin40(
|
|
4146
4105
|
"min-w-full border-separate border-spacing-0 data-[ui=loading]:pointer-events-none",
|
|
4147
4106
|
resizeStyle && "overflow-clip"
|
|
4148
4107
|
),
|
|
4149
4108
|
children: [
|
|
4150
|
-
/* @__PURE__ */
|
|
4151
|
-
/* @__PURE__ */
|
|
4109
|
+
/* @__PURE__ */ jsx98(TableHeader, { ...props, variant, ...headerClassNames(variant) }),
|
|
4110
|
+
/* @__PURE__ */ jsx98(TableBody, { ...props, ...bodyClassNames(variant), loading })
|
|
4152
4111
|
]
|
|
4153
4112
|
}
|
|
4154
4113
|
) });
|
|
4155
4114
|
case tableVariants.subtable:
|
|
4156
|
-
return /* @__PURE__ */
|
|
4157
|
-
showLoadingBar && /* @__PURE__ */
|
|
4158
|
-
/* @__PURE__ */
|
|
4115
|
+
return /* @__PURE__ */ jsxs42("div", { className: "relative mb-auto min-w-full", children: [
|
|
4116
|
+
showLoadingBar && /* @__PURE__ */ jsx98(LoadingBar, { className: "absolute top-0 right-0 left-0 z-10 h-1 rounded-none" }),
|
|
4117
|
+
/* @__PURE__ */ jsxs42(
|
|
4159
4118
|
"table",
|
|
4160
4119
|
{
|
|
4161
4120
|
ref: tableElementRef,
|
|
4162
4121
|
"data-ui": uiLoading,
|
|
4163
4122
|
style: resizeStyle,
|
|
4164
|
-
className:
|
|
4123
|
+
className: twJoin40(
|
|
4165
4124
|
"min-w-full border-separate border-spacing-0 data-[ui=loading]:pointer-events-none",
|
|
4166
4125
|
resizeStyle && "overflow-clip"
|
|
4167
4126
|
),
|
|
4168
4127
|
children: [
|
|
4169
|
-
/* @__PURE__ */
|
|
4170
|
-
/* @__PURE__ */
|
|
4128
|
+
/* @__PURE__ */ jsx98(TableHeader, { ...props, variant, ...headerClassNames(variant) }),
|
|
4129
|
+
/* @__PURE__ */ jsx98(TableBody, { ...props, ...bodyClassNames(variant), loading })
|
|
4171
4130
|
]
|
|
4172
4131
|
}
|
|
4173
4132
|
)
|
|
4174
4133
|
] });
|
|
4175
4134
|
case tableVariants.seamless:
|
|
4176
|
-
return /* @__PURE__ */
|
|
4135
|
+
return /* @__PURE__ */ jsx98(
|
|
4177
4136
|
"div",
|
|
4178
4137
|
{
|
|
4179
|
-
className:
|
|
4138
|
+
className: twJoin40(
|
|
4180
4139
|
"relative mb-auto rounded-md border bg-white",
|
|
4181
4140
|
loading && coreRows.length === 0 ? "overflow-hidden" : "overflow-auto"
|
|
4182
4141
|
),
|
|
4183
|
-
children: /* @__PURE__ */
|
|
4142
|
+
children: /* @__PURE__ */ jsxs42(
|
|
4184
4143
|
"table",
|
|
4185
4144
|
{
|
|
4186
4145
|
ref: tableElementRef,
|
|
4187
4146
|
"data-ui": uiLoading,
|
|
4188
4147
|
style: resizeStyle,
|
|
4189
|
-
className:
|
|
4148
|
+
className: twJoin40(
|
|
4190
4149
|
"relative min-w-full border-separate border-spacing-0 data-[ui=loading]:pointer-events-none",
|
|
4191
4150
|
resizeStyle && "overflow-clip"
|
|
4192
4151
|
),
|
|
4193
4152
|
children: [
|
|
4194
|
-
/* @__PURE__ */
|
|
4195
|
-
/* @__PURE__ */
|
|
4153
|
+
/* @__PURE__ */ jsx98(TableHeader, { ...props, variant, ...headerClassNames(variant) }),
|
|
4154
|
+
/* @__PURE__ */ jsx98(TableBody, { ...props, ...bodyClassNames(variant), loading })
|
|
4196
4155
|
]
|
|
4197
4156
|
}
|
|
4198
4157
|
)
|
|
@@ -4200,7 +4159,7 @@ var Table = ({ variant = "default", loading: loadingProp, ...props }) => {
|
|
|
4200
4159
|
);
|
|
4201
4160
|
case tableVariants.default:
|
|
4202
4161
|
default:
|
|
4203
|
-
return /* @__PURE__ */
|
|
4162
|
+
return /* @__PURE__ */ jsx98(DefaultTable, { ...props, loading, fetching });
|
|
4204
4163
|
}
|
|
4205
4164
|
};
|
|
4206
4165
|
var DefaultTable = ({ table, loading, fetching }) => {
|
|
@@ -4217,37 +4176,37 @@ var DefaultTable = ({ table, loading, fetching }) => {
|
|
|
4217
4176
|
infiniteScroll.fetchNextPage();
|
|
4218
4177
|
}
|
|
4219
4178
|
}, [entry?.isIntersecting, infiniteScroll]);
|
|
4220
|
-
const skeletonRows = infiniteScroll?.hasNextPage ? Array.from({ length: 3 }).map((_, i) => /* @__PURE__ */
|
|
4221
|
-
return /* @__PURE__ */
|
|
4179
|
+
const skeletonRows = infiniteScroll?.hasNextPage ? Array.from({ length: 3 }).map((_, i) => /* @__PURE__ */ jsx98("tr", { className: "[&:not(:last-child)>td]:border-b [&:not(:last-child)>td]:border-gray-200", children: Array.from({ length: colCount }).map((_2, j) => /* @__PURE__ */ jsx98("td", { className: "p-2", children: /* @__PURE__ */ jsx98(Skeleton, { className: "h-3 w-full" }) }, j)) }, `skeleton-${i}`)) : null;
|
|
4180
|
+
return /* @__PURE__ */ jsxs42(
|
|
4222
4181
|
"div",
|
|
4223
4182
|
{
|
|
4224
|
-
className:
|
|
4183
|
+
className: twJoin40(
|
|
4225
4184
|
"relative mb-auto rounded-md border bg-white",
|
|
4226
|
-
coreRows.length === 0 ?
|
|
4185
|
+
coreRows.length === 0 ? twJoin40("h-full min-h-0", loading ? "overflow-hidden" : "overflow-auto") : "max-h-full min-h-0 overflow-auto"
|
|
4227
4186
|
),
|
|
4228
4187
|
children: [
|
|
4229
|
-
showLoadingBar && /* @__PURE__ */
|
|
4230
|
-
/* @__PURE__ */
|
|
4188
|
+
showLoadingBar && /* @__PURE__ */ jsx98(LoadingBar, { className: "sticky top-0 right-0 left-0 z-10 -mb-1 h-1 rounded-none" }),
|
|
4189
|
+
/* @__PURE__ */ jsxs42(
|
|
4231
4190
|
"table",
|
|
4232
4191
|
{
|
|
4233
4192
|
ref: tableElementRef,
|
|
4234
4193
|
"data-ui": uiLoading,
|
|
4235
4194
|
style: resizeStyle,
|
|
4236
|
-
className:
|
|
4195
|
+
className: twJoin40(
|
|
4237
4196
|
"relative min-w-full border-separate border-spacing-0 data-[ui=loading]:pointer-events-none",
|
|
4238
4197
|
coreRows.length === 0 && !loading && "h-full",
|
|
4239
4198
|
resizeStyle && "overflow-clip"
|
|
4240
4199
|
),
|
|
4241
4200
|
children: [
|
|
4242
|
-
/* @__PURE__ */
|
|
4243
|
-
/* @__PURE__ */
|
|
4201
|
+
/* @__PURE__ */ jsx98(TableHeader, { table, variant: "default", ...headerClassNames("default") }),
|
|
4202
|
+
/* @__PURE__ */ jsx98(
|
|
4244
4203
|
TableBody,
|
|
4245
4204
|
{
|
|
4246
4205
|
table,
|
|
4247
4206
|
...bodyClassNames("default"),
|
|
4248
4207
|
loading,
|
|
4249
|
-
afterRows: /* @__PURE__ */
|
|
4250
|
-
infiniteScroll?.hasNextPage && /* @__PURE__ */
|
|
4208
|
+
afterRows: /* @__PURE__ */ jsxs42(Fragment13, { children: [
|
|
4209
|
+
infiniteScroll?.hasNextPage && /* @__PURE__ */ jsx98("tr", { ref: sentinelRef, "aria-hidden": "true", style: { height: 0, border: "none", padding: 0 }, children: /* @__PURE__ */ jsx98("td", { colSpan: colCount, style: { height: 0, border: "none", padding: 0 } }) }),
|
|
4251
4210
|
skeletonRows
|
|
4252
4211
|
] })
|
|
4253
4212
|
}
|
|
@@ -4263,8 +4222,8 @@ var DefaultTable = ({ table, loading, fetching }) => {
|
|
|
4263
4222
|
// src/core/table/VirtualizedTable.tsx
|
|
4264
4223
|
import { useVirtualizer } from "@tanstack/react-virtual";
|
|
4265
4224
|
import { useEffect as useEffect8, useRef as useRef8 } from "react";
|
|
4266
|
-
import { twJoin as
|
|
4267
|
-
import { jsx as
|
|
4225
|
+
import { twJoin as twJoin41 } from "tailwind-merge";
|
|
4226
|
+
import { jsx as jsx99, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
4268
4227
|
var DEFAULT_ROW_HEIGHT = 37;
|
|
4269
4228
|
var DEFAULT_OVERSCAN = 5;
|
|
4270
4229
|
var VirtualizedTable = ({
|
|
@@ -4300,48 +4259,48 @@ var VirtualizedTable = ({
|
|
|
4300
4259
|
infiniteScroll.fetchNextPage();
|
|
4301
4260
|
}
|
|
4302
4261
|
}, [virtualRows, rows.length, infiniteScroll]);
|
|
4303
|
-
const skeletonRows = infiniteScroll?.hasNextPage ? Array.from({ length: 3 }).map((_, i) => /* @__PURE__ */
|
|
4262
|
+
const skeletonRows = infiniteScroll?.hasNextPage ? Array.from({ length: 3 }).map((_, i) => /* @__PURE__ */ jsx99("tr", { className: "[&:not(:last-child)>td]:border-b [&:not(:last-child)>td]:border-gray-200", children: Array.from({ length: colCount }).map((_2, j) => /* @__PURE__ */ jsx99("td", { className: "p-2", children: /* @__PURE__ */ jsx99(Skeleton, { className: "h-3 w-full" }) }, j)) }, `skeleton-${i}`)) : null;
|
|
4304
4263
|
const paddingTop = virtualRows.length > 0 ? virtualRows[0]?.start ?? 0 : 0;
|
|
4305
4264
|
const paddingBottom = virtualRows.length > 0 ? rowVirtualizer.getTotalSize() - (virtualRows.at(-1)?.end ?? 0) : 0;
|
|
4306
4265
|
const { rootClassName: bodyRootClassName, ...bodyRowCellClassNames } = bodyClassNames(variant);
|
|
4307
|
-
return /* @__PURE__ */
|
|
4266
|
+
return /* @__PURE__ */ jsxs43(
|
|
4308
4267
|
"div",
|
|
4309
4268
|
{
|
|
4310
4269
|
ref: scrollRef,
|
|
4311
|
-
className:
|
|
4270
|
+
className: twJoin41(
|
|
4312
4271
|
"relative mb-auto",
|
|
4313
|
-
isSubtable ? "min-w-full" :
|
|
4272
|
+
isSubtable ? "min-w-full" : twJoin41(
|
|
4314
4273
|
"rounded-md border bg-white",
|
|
4315
|
-
coreRows.length === 0 ?
|
|
4274
|
+
coreRows.length === 0 ? twJoin41("h-full", loading ? "overflow-hidden" : "overflow-auto overscroll-none") : "max-h-full min-h-0 overflow-auto overscroll-none"
|
|
4316
4275
|
)
|
|
4317
4276
|
),
|
|
4318
4277
|
children: [
|
|
4319
|
-
showLoadingBar && /* @__PURE__ */
|
|
4278
|
+
showLoadingBar && /* @__PURE__ */ jsx99(
|
|
4320
4279
|
LoadingBar,
|
|
4321
4280
|
{
|
|
4322
|
-
className:
|
|
4281
|
+
className: twJoin41("top-0 right-0 left-0 z-10 h-1 rounded-none", isSubtable ? "absolute" : "sticky -mb-1")
|
|
4323
4282
|
}
|
|
4324
4283
|
),
|
|
4325
|
-
/* @__PURE__ */
|
|
4284
|
+
/* @__PURE__ */ jsxs43(
|
|
4326
4285
|
"table",
|
|
4327
4286
|
{
|
|
4328
4287
|
ref: tableElementRef,
|
|
4329
4288
|
"data-ui": uiLoading,
|
|
4330
4289
|
style: resizeStyle,
|
|
4331
|
-
className:
|
|
4290
|
+
className: twJoin41(
|
|
4332
4291
|
"relative min-w-full border-separate border-spacing-0 data-[ui=loading]:pointer-events-none",
|
|
4333
4292
|
!isSubtable && coreRows.length === 0 && !loading && "h-full",
|
|
4334
4293
|
resizeStyle && "overflow-clip"
|
|
4335
4294
|
),
|
|
4336
4295
|
children: [
|
|
4337
|
-
/* @__PURE__ */
|
|
4338
|
-
rows.length === 0 ? /* @__PURE__ */
|
|
4339
|
-
paddingTop > 0 && /* @__PURE__ */
|
|
4296
|
+
/* @__PURE__ */ jsx99(TableHeader, { table, variant, ...headerClassNames(variant) }),
|
|
4297
|
+
rows.length === 0 ? /* @__PURE__ */ jsx99(TableBody, { table, ...bodyClassNames(variant), loading }) : /* @__PURE__ */ jsxs43("tbody", { className: bodyRootClassName, children: [
|
|
4298
|
+
paddingTop > 0 && /* @__PURE__ */ jsx99("tr", { "aria-hidden": "true", children: /* @__PURE__ */ jsx99("td", { colSpan: colCount, style: { height: paddingTop, padding: 0, border: "none" } }) }),
|
|
4340
4299
|
virtualRows.map((virtualRow) => {
|
|
4341
4300
|
const row = rows[virtualRow.index];
|
|
4342
|
-
return /* @__PURE__ */
|
|
4301
|
+
return /* @__PURE__ */ jsx99(TableRow, { table, row, ...bodyRowCellClassNames }, row.id);
|
|
4343
4302
|
}),
|
|
4344
|
-
paddingBottom > 0 && /* @__PURE__ */
|
|
4303
|
+
paddingBottom > 0 && /* @__PURE__ */ jsx99("tr", { "aria-hidden": "true", children: /* @__PURE__ */ jsx99("td", { colSpan: colCount, style: { height: paddingBottom, padding: 0, border: "none" } }) }),
|
|
4345
4304
|
skeletonRows
|
|
4346
4305
|
] })
|
|
4347
4306
|
]
|
|
@@ -4520,8 +4479,8 @@ var useColumnResizing = (options) => {
|
|
|
4520
4479
|
import { ToggleGroup, ToggleGroupItem } from "@radix-ui/react-toggle-group";
|
|
4521
4480
|
import { motion } from "motion/react";
|
|
4522
4481
|
import { Fragment as Fragment14, useId as useId2 } from "react";
|
|
4523
|
-
import { twJoin as
|
|
4524
|
-
import { jsx as
|
|
4482
|
+
import { twJoin as twJoin42 } from "tailwind-merge";
|
|
4483
|
+
import { jsx as jsx100, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
4525
4484
|
var TabGroup = ({
|
|
4526
4485
|
tabs,
|
|
4527
4486
|
currentTab,
|
|
@@ -4529,7 +4488,7 @@ var TabGroup = ({
|
|
|
4529
4488
|
size = "md"
|
|
4530
4489
|
}) => {
|
|
4531
4490
|
const layoutId = useId2();
|
|
4532
|
-
return /* @__PURE__ */
|
|
4491
|
+
return /* @__PURE__ */ jsx100(
|
|
4533
4492
|
ToggleGroup,
|
|
4534
4493
|
{
|
|
4535
4494
|
type: "single",
|
|
@@ -4537,17 +4496,17 @@ var TabGroup = ({
|
|
|
4537
4496
|
onValueChange: (value) => {
|
|
4538
4497
|
if (value) setCurrentTab(value);
|
|
4539
4498
|
},
|
|
4540
|
-
className:
|
|
4499
|
+
className: twJoin42(
|
|
4541
4500
|
"flex w-full justify-between gap-1 rounded-lg border border-surface-neutral bg-surface-light",
|
|
4542
4501
|
size === "sm" ? "p-1" : "p-0.5"
|
|
4543
4502
|
),
|
|
4544
|
-
children: tabs.map(({ id, label, disabled }, index) => /* @__PURE__ */
|
|
4545
|
-
/* @__PURE__ */
|
|
4503
|
+
children: tabs.map(({ id, label, disabled }, index) => /* @__PURE__ */ jsxs44(Fragment14, { children: [
|
|
4504
|
+
/* @__PURE__ */ jsxs44(
|
|
4546
4505
|
ToggleGroupItem,
|
|
4547
4506
|
{
|
|
4548
4507
|
value: id,
|
|
4549
4508
|
disabled,
|
|
4550
|
-
className:
|
|
4509
|
+
className: twJoin42(
|
|
4551
4510
|
"relative flex w-full items-center justify-center rounded-md border transition-colors",
|
|
4552
4511
|
disabled && "cursor-not-allowed opacity-50",
|
|
4553
4512
|
!disabled && "focus-visible:border-indigo-700 focus-visible:outline-none",
|
|
@@ -4557,7 +4516,7 @@ var TabGroup = ({
|
|
|
4557
4516
|
size === "sm" ? "px-1.5 py-1" : "px-2 py-1"
|
|
4558
4517
|
),
|
|
4559
4518
|
children: [
|
|
4560
|
-
id === currentTab && !disabled && /* @__PURE__ */
|
|
4519
|
+
id === currentTab && !disabled && /* @__PURE__ */ jsx100(
|
|
4561
4520
|
motion.span,
|
|
4562
4521
|
{
|
|
4563
4522
|
layoutId,
|
|
@@ -4565,11 +4524,11 @@ var TabGroup = ({
|
|
|
4565
4524
|
transition: { type: "spring", stiffness: 500, damping: 40 }
|
|
4566
4525
|
}
|
|
4567
4526
|
),
|
|
4568
|
-
/* @__PURE__ */
|
|
4527
|
+
/* @__PURE__ */ jsx100("span", { className: "relative z-1", children: label })
|
|
4569
4528
|
]
|
|
4570
4529
|
}
|
|
4571
4530
|
),
|
|
4572
|
-
index !== tabs.length - 1 && /* @__PURE__ */
|
|
4531
|
+
index !== tabs.length - 1 && /* @__PURE__ */ jsx100("div", { className: "z-2 my-1 flex w-px bg-gray-300" })
|
|
4573
4532
|
] }, id))
|
|
4574
4533
|
}
|
|
4575
4534
|
);
|
|
@@ -4578,12 +4537,12 @@ var TabGroup = ({
|
|
|
4578
4537
|
// src/core/tabs/Tabs.tsx
|
|
4579
4538
|
import { Content as Content8, List, Root as Root8 } from "@radix-ui/react-tabs";
|
|
4580
4539
|
import { useId as useId3 } from "react";
|
|
4581
|
-
import { twJoin as
|
|
4540
|
+
import { twJoin as twJoin43 } from "tailwind-merge";
|
|
4582
4541
|
|
|
4583
4542
|
// src/core/tabs/Trigger.tsx
|
|
4584
4543
|
import { Trigger as Trigger7 } from "@radix-ui/react-tabs";
|
|
4585
4544
|
import { motion as motion2 } from "motion/react";
|
|
4586
|
-
import { jsx as
|
|
4545
|
+
import { jsx as jsx101, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
4587
4546
|
var TabsTrigger = ({
|
|
4588
4547
|
id,
|
|
4589
4548
|
label,
|
|
@@ -4593,7 +4552,7 @@ var TabsTrigger = ({
|
|
|
4593
4552
|
className,
|
|
4594
4553
|
isActive,
|
|
4595
4554
|
layoutId
|
|
4596
|
-
}) => /* @__PURE__ */
|
|
4555
|
+
}) => /* @__PURE__ */ jsxs45(
|
|
4597
4556
|
Trigger7,
|
|
4598
4557
|
{
|
|
4599
4558
|
className: twMerge(
|
|
@@ -4605,8 +4564,8 @@ var TabsTrigger = ({
|
|
|
4605
4564
|
"fs-id": fsId,
|
|
4606
4565
|
children: [
|
|
4607
4566
|
label,
|
|
4608
|
-
extra && /* @__PURE__ */
|
|
4609
|
-
isActive && /* @__PURE__ */
|
|
4567
|
+
extra && /* @__PURE__ */ jsx101("span", { children: extra }),
|
|
4568
|
+
isActive && /* @__PURE__ */ jsx101(
|
|
4610
4569
|
motion2.span,
|
|
4611
4570
|
{
|
|
4612
4571
|
layoutId,
|
|
@@ -4619,7 +4578,7 @@ var TabsTrigger = ({
|
|
|
4619
4578
|
);
|
|
4620
4579
|
|
|
4621
4580
|
// src/core/tabs/Tabs.tsx
|
|
4622
|
-
import { jsx as
|
|
4581
|
+
import { jsx as jsx102, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
4623
4582
|
var [Provider2, useContext6] = createContextHelper();
|
|
4624
4583
|
var Tabs = ({
|
|
4625
4584
|
tabs,
|
|
@@ -4633,9 +4592,9 @@ var Tabs = ({
|
|
|
4633
4592
|
extraNode
|
|
4634
4593
|
}) => {
|
|
4635
4594
|
const layoutId = useId3();
|
|
4636
|
-
return /* @__PURE__ */
|
|
4637
|
-
/* @__PURE__ */
|
|
4638
|
-
/* @__PURE__ */
|
|
4595
|
+
return /* @__PURE__ */ jsx102(Provider2, { currentTab, children: /* @__PURE__ */ jsxs46(Root8, { className, value: currentTab, onValueChange: (id) => setCurrentTab(id), children: [
|
|
4596
|
+
/* @__PURE__ */ jsxs46("div", { className: twJoin43("flex gap-4", tabsListContainerClassName), children: [
|
|
4597
|
+
/* @__PURE__ */ jsx102(List, { className: twJoin43("flex space-x-4 overflow-x-auto pb-0.5", tabsListClassName), children: tabs.map(({ id, label, disabled, fsId }) => /* @__PURE__ */ jsx102(
|
|
4639
4598
|
TabsTrigger,
|
|
4640
4599
|
{
|
|
4641
4600
|
id,
|
|
@@ -4654,7 +4613,7 @@ var Tabs = ({
|
|
|
4654
4613
|
] }) });
|
|
4655
4614
|
};
|
|
4656
4615
|
var TabContent = ({ id, ...rest }) => {
|
|
4657
|
-
return /* @__PURE__ */
|
|
4616
|
+
return /* @__PURE__ */ jsx102(Content8, { value: id, ...rest });
|
|
4658
4617
|
};
|
|
4659
4618
|
var AlwaysMountedTabContent = ({
|
|
4660
4619
|
id,
|
|
@@ -4664,15 +4623,15 @@ var AlwaysMountedTabContent = ({
|
|
|
4664
4623
|
}) => {
|
|
4665
4624
|
const { currentTab } = useContext6();
|
|
4666
4625
|
const visible = id === currentTab;
|
|
4667
|
-
return /* @__PURE__ */
|
|
4626
|
+
return /* @__PURE__ */ jsx102("div", { className: twJoin43(visible ? visibleClassName : "hidden", className), children });
|
|
4668
4627
|
};
|
|
4669
4628
|
Tabs.TabContent = TabContent;
|
|
4670
4629
|
Tabs.AlwaysMountedTabContent = AlwaysMountedTabContent;
|
|
4671
4630
|
|
|
4672
4631
|
// src/core/tabs/ScrollTabsLayout.tsx
|
|
4673
4632
|
import { useCallback as useCallback10, useEffect as useEffect9, useRef as useRef10, useState as useState12 } from "react";
|
|
4674
|
-
import { twJoin as
|
|
4675
|
-
import { Fragment as Fragment15, jsx as
|
|
4633
|
+
import { twJoin as twJoin44 } from "tailwind-merge";
|
|
4634
|
+
import { Fragment as Fragment15, jsx as jsx103, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
4676
4635
|
var ScrollTabsLayout = ({ tabs, onSelectTab, sectionClassName }) => {
|
|
4677
4636
|
const [selectedTabName, setSelectedTabName] = useState12(tabs[0].tabName);
|
|
4678
4637
|
const scrollContainerRef = useRef10(null);
|
|
@@ -4680,6 +4639,7 @@ var ScrollTabsLayout = ({ tabs, onSelectTab, sectionClassName }) => {
|
|
|
4680
4639
|
const handleSelectTab = useCallback10(
|
|
4681
4640
|
(tabId) => {
|
|
4682
4641
|
scrollContainerRef.current?.scrollTo({
|
|
4642
|
+
// @ts-expect-error noUncheckedIndexedAccess
|
|
4683
4643
|
top: tabRefs.current[tabId].offsetTop,
|
|
4684
4644
|
behavior: "smooth"
|
|
4685
4645
|
});
|
|
@@ -4703,8 +4663,8 @@ var ScrollTabsLayout = ({ tabs, onSelectTab, sectionClassName }) => {
|
|
|
4703
4663
|
scrollContainer?.removeEventListener("scroll", handleScroll);
|
|
4704
4664
|
};
|
|
4705
4665
|
});
|
|
4706
|
-
return /* @__PURE__ */
|
|
4707
|
-
/* @__PURE__ */
|
|
4666
|
+
return /* @__PURE__ */ jsxs47(Fragment15, { children: [
|
|
4667
|
+
/* @__PURE__ */ jsx103(
|
|
4708
4668
|
Tabs,
|
|
4709
4669
|
{
|
|
4710
4670
|
currentTab: selectedTabName,
|
|
@@ -4712,18 +4672,18 @@ var ScrollTabsLayout = ({ tabs, onSelectTab, sectionClassName }) => {
|
|
|
4712
4672
|
tabs: tabs.map((tab) => ({ id: tab.tabName, label: tab.tabName }))
|
|
4713
4673
|
}
|
|
4714
4674
|
),
|
|
4715
|
-
/* @__PURE__ */
|
|
4716
|
-
/* @__PURE__ */
|
|
4717
|
-
tabs.map((tab) => /* @__PURE__ */
|
|
4675
|
+
/* @__PURE__ */ jsx103("hr", {}),
|
|
4676
|
+
/* @__PURE__ */ jsxs47("div", { ref: scrollContainerRef, className: "relative h-screen overflow-y-auto", children: [
|
|
4677
|
+
tabs.map((tab) => /* @__PURE__ */ jsx103(
|
|
4718
4678
|
"div",
|
|
4719
4679
|
{
|
|
4720
4680
|
ref: (el) => el ? tabRefs.current[tab.tabName] = el : void 0,
|
|
4721
|
-
className:
|
|
4681
|
+
className: twJoin44("first:pt-4", sectionClassName),
|
|
4722
4682
|
children: tab.content
|
|
4723
4683
|
},
|
|
4724
4684
|
tab.tabName
|
|
4725
4685
|
)),
|
|
4726
|
-
/* @__PURE__ */
|
|
4686
|
+
/* @__PURE__ */ jsx103("div", { className: "h-screen" })
|
|
4727
4687
|
] })
|
|
4728
4688
|
] });
|
|
4729
4689
|
};
|
|
@@ -4731,13 +4691,13 @@ var ScrollTabsLayout = ({ tabs, onSelectTab, sectionClassName }) => {
|
|
|
4731
4691
|
// src/core/tabs/ComposableTabs.tsx
|
|
4732
4692
|
import { Content as Content9, List as List2, Root as Root9 } from "@radix-ui/react-tabs";
|
|
4733
4693
|
import { useId as useId4 } from "react";
|
|
4734
|
-
import { twJoin as
|
|
4735
|
-
import { jsx as
|
|
4694
|
+
import { twJoin as twJoin45 } from "tailwind-merge";
|
|
4695
|
+
import { jsx as jsx104, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
4736
4696
|
var [TabsProvider, useTabsContext] = createContextHelper();
|
|
4737
4697
|
var ComposableTabsList = ({ className, containerClassName, extraNode }) => {
|
|
4738
4698
|
const { tabs, currentTab, layoutId } = useTabsContext();
|
|
4739
|
-
return /* @__PURE__ */
|
|
4740
|
-
/* @__PURE__ */
|
|
4699
|
+
return /* @__PURE__ */ jsxs48("div", { className: twJoin45("flex gap-4", containerClassName), children: [
|
|
4700
|
+
/* @__PURE__ */ jsx104(List2, { className: twJoin45("flex space-x-4 overflow-x-auto", className), children: tabs.map(({ id, label, disabled }) => /* @__PURE__ */ jsx104(
|
|
4741
4701
|
TabsTrigger,
|
|
4742
4702
|
{
|
|
4743
4703
|
id,
|
|
@@ -4752,7 +4712,7 @@ var ComposableTabsList = ({ className, containerClassName, extraNode }) => {
|
|
|
4752
4712
|
] });
|
|
4753
4713
|
};
|
|
4754
4714
|
var ComposableTabContent = ({ id, ...rest }) => {
|
|
4755
|
-
return /* @__PURE__ */
|
|
4715
|
+
return /* @__PURE__ */ jsx104(Content9, { value: id, ...rest });
|
|
4756
4716
|
};
|
|
4757
4717
|
var ComposableAlwaysMountedTabContent = ({
|
|
4758
4718
|
id,
|
|
@@ -4762,7 +4722,7 @@ var ComposableAlwaysMountedTabContent = ({
|
|
|
4762
4722
|
}) => {
|
|
4763
4723
|
const { currentTab } = useTabsContext();
|
|
4764
4724
|
const visible = id === currentTab;
|
|
4765
|
-
return /* @__PURE__ */
|
|
4725
|
+
return /* @__PURE__ */ jsx104("div", { className: twJoin45(visible ? visibleClassName : "hidden", className), children });
|
|
4766
4726
|
};
|
|
4767
4727
|
var ComposableTabsRoot = ({
|
|
4768
4728
|
tabs,
|
|
@@ -4772,7 +4732,7 @@ var ComposableTabsRoot = ({
|
|
|
4772
4732
|
children
|
|
4773
4733
|
}) => {
|
|
4774
4734
|
const layoutId = useId4();
|
|
4775
|
-
return /* @__PURE__ */
|
|
4735
|
+
return /* @__PURE__ */ jsx104(TabsProvider, { tabs, currentTab, layoutId, children: /* @__PURE__ */ jsx104(Root9, { className, value: currentTab, onValueChange: (id) => setCurrentTab(id), children }) });
|
|
4776
4736
|
};
|
|
4777
4737
|
var ComposableTabs = {
|
|
4778
4738
|
Root: ComposableTabsRoot,
|
|
@@ -4784,24 +4744,24 @@ var ComposableTabs = {
|
|
|
4784
4744
|
// src/core/tag/Tag.tsx
|
|
4785
4745
|
import { faClose as faClose3 } from "@fortawesome/sharp-solid-svg-icons";
|
|
4786
4746
|
import * as React14 from "react";
|
|
4787
|
-
import { jsx as
|
|
4788
|
-
var TagLabel = ({ children, removable, onRemove, intent = "default", ...rest }, ref) => /* @__PURE__ */
|
|
4747
|
+
import { jsx as jsx105, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
4748
|
+
var TagLabel = ({ children, removable, onRemove, intent = "default", ...rest }, ref) => /* @__PURE__ */ jsxs49(Label, { ...rest, ref, intent, children: [
|
|
4789
4749
|
children,
|
|
4790
|
-
removable && /* @__PURE__ */
|
|
4750
|
+
removable && /* @__PURE__ */ jsx105(
|
|
4791
4751
|
"button",
|
|
4792
4752
|
{
|
|
4793
4753
|
className: "ml-1 inline-flex h-xs items-center px-1 text-muted hover:text-neutral focus:outline-hidden",
|
|
4794
4754
|
onClick: onRemove,
|
|
4795
|
-
children: /* @__PURE__ */
|
|
4755
|
+
children: /* @__PURE__ */ jsx105(Icon, { icon: faClose3 })
|
|
4796
4756
|
}
|
|
4797
4757
|
)
|
|
4798
4758
|
] });
|
|
4799
4759
|
var TagImpl = React14.forwardRef(TagLabel);
|
|
4800
4760
|
var Tag = ({ tooltip, ...rest }) => {
|
|
4801
4761
|
if (!tooltip) {
|
|
4802
|
-
return /* @__PURE__ */
|
|
4762
|
+
return /* @__PURE__ */ jsx105(TagImpl, { ...rest });
|
|
4803
4763
|
}
|
|
4804
|
-
return /* @__PURE__ */
|
|
4764
|
+
return /* @__PURE__ */ jsx105(Tooltip, { trigger: /* @__PURE__ */ jsx105(TagImpl, { ...rest }), content: /* @__PURE__ */ jsx105("p", { className: "text-sm", children: tooltip }) });
|
|
4805
4765
|
};
|
|
4806
4766
|
|
|
4807
4767
|
// src/core/utils/useIsHovered.ts
|
|
@@ -4857,7 +4817,6 @@ export {
|
|
|
4857
4817
|
Drawer,
|
|
4858
4818
|
DrawerHeader,
|
|
4859
4819
|
DrawerHeaderSkeleton,
|
|
4860
|
-
DrawerStateContext,
|
|
4861
4820
|
DropdownChevron,
|
|
4862
4821
|
EmptyState,
|
|
4863
4822
|
ErrorText,
|
|
@@ -4867,7 +4826,6 @@ export {
|
|
|
4867
4826
|
FormInput,
|
|
4868
4827
|
FormMultiSelect,
|
|
4869
4828
|
FormPercentInput,
|
|
4870
|
-
FormProvider,
|
|
4871
4829
|
FormRadioButtonGroup,
|
|
4872
4830
|
FormSelect,
|
|
4873
4831
|
FormSwitch,
|
|
@@ -4879,14 +4837,10 @@ export {
|
|
|
4879
4837
|
IndeterminateCheckbox,
|
|
4880
4838
|
Input,
|
|
4881
4839
|
InputBox,
|
|
4882
|
-
IsEditingProvider,
|
|
4883
|
-
IsVisibleProvider,
|
|
4884
4840
|
Label,
|
|
4885
4841
|
LoadingBar,
|
|
4886
4842
|
LoadingState,
|
|
4887
4843
|
Menu,
|
|
4888
|
-
MenuRoot,
|
|
4889
|
-
MenuSeparator,
|
|
4890
4844
|
Modal,
|
|
4891
4845
|
MultiSelect,
|
|
4892
4846
|
OverflowTooltip,
|
|
@@ -4894,7 +4848,6 @@ export {
|
|
|
4894
4848
|
PercentInput,
|
|
4895
4849
|
PhoneNumber,
|
|
4896
4850
|
Popover,
|
|
4897
|
-
RESPONSIVE_PADDING,
|
|
4898
4851
|
RadioButtonGroup,
|
|
4899
4852
|
RadioButtonItem,
|
|
4900
4853
|
ScreenHeightPageContainer,
|
|
@@ -4904,6 +4857,7 @@ export {
|
|
|
4904
4857
|
SelectWithUnselect,
|
|
4905
4858
|
Skeleton,
|
|
4906
4859
|
Spinner,
|
|
4860
|
+
Stepper,
|
|
4907
4861
|
Switch,
|
|
4908
4862
|
TabGroup,
|
|
4909
4863
|
Table,
|
|
@@ -4915,56 +4869,30 @@ export {
|
|
|
4915
4869
|
Tag,
|
|
4916
4870
|
Text,
|
|
4917
4871
|
TextArea,
|
|
4918
|
-
TextAreaComp,
|
|
4919
4872
|
Tooltip,
|
|
4920
|
-
TooltipContent,
|
|
4921
4873
|
TwoCirclesSpinner,
|
|
4922
4874
|
UncontrolledField,
|
|
4923
4875
|
UncontrolledFieldProvider,
|
|
4924
4876
|
VirtualizedTable,
|
|
4925
|
-
bodyClassNames,
|
|
4926
|
-
buttonStyles,
|
|
4927
|
-
copyToClipboard,
|
|
4928
|
-
createContextHelper,
|
|
4929
|
-
createToggleContextHelper,
|
|
4930
4877
|
doesSelectItemMatch,
|
|
4931
|
-
|
|
4932
|
-
formatPhoneNumberForDisplay,
|
|
4933
|
-
getCountry,
|
|
4878
|
+
drawerSizes,
|
|
4934
4879
|
getFieldError,
|
|
4935
|
-
getInitials,
|
|
4936
|
-
headerClassNames,
|
|
4937
|
-
inputBoxStyles,
|
|
4938
|
-
inputStyles,
|
|
4939
|
-
isValidPhoneNumber,
|
|
4940
|
-
linkStyles,
|
|
4941
|
-
localStoragePersist,
|
|
4942
4880
|
tableVariants,
|
|
4943
4881
|
useAsyncMultiSelect,
|
|
4944
4882
|
useAsyncSelect,
|
|
4945
4883
|
useColumnResizing,
|
|
4946
4884
|
useControlledField,
|
|
4947
4885
|
useControlledFormField,
|
|
4948
|
-
useController2 as useController,
|
|
4949
4886
|
useCopyable,
|
|
4950
|
-
useDebounce,
|
|
4951
4887
|
useDrawer,
|
|
4952
4888
|
useDrawerResize,
|
|
4953
|
-
useFieldArray,
|
|
4954
4889
|
useForm,
|
|
4955
|
-
useFormContext2 as useFormContext,
|
|
4956
|
-
useFormState2 as useFormState,
|
|
4957
4890
|
useIntersectionObserver,
|
|
4958
|
-
useIsEditing,
|
|
4959
4891
|
useIsHovered,
|
|
4960
|
-
useIsVisible,
|
|
4961
4892
|
useOverflowObserver,
|
|
4962
4893
|
useSwitchId,
|
|
4963
|
-
useSyncState,
|
|
4964
4894
|
useTable,
|
|
4965
|
-
useToggle,
|
|
4966
4895
|
useUncontrolledField,
|
|
4967
|
-
useUncontrolledFormField
|
|
4968
|
-
useWatch
|
|
4896
|
+
useUncontrolledFormField
|
|
4969
4897
|
};
|
|
4970
4898
|
//# sourceMappingURL=index.mjs.map
|