@l3mpire/ui 2.10.0 → 2.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/USAGE.md +7 -4
- package/dist/index.d.mts +22 -5
- package/dist/index.d.ts +22 -5
- package/dist/index.js +907 -617
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +917 -621
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/styles/globals.css +10 -1
package/dist/index.js
CHANGED
|
@@ -206,7 +206,7 @@ var import_jsx_runtime = require("react/jsx-runtime");
|
|
|
206
206
|
var badgeVariants = (0, import_class_variance_authority.cva)(
|
|
207
207
|
[
|
|
208
208
|
"inline-flex items-center justify-center whitespace-nowrap",
|
|
209
|
-
"font-
|
|
209
|
+
"font-semibold",
|
|
210
210
|
"border border-transparent"
|
|
211
211
|
],
|
|
212
212
|
{
|
|
@@ -295,7 +295,7 @@ var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
|
295
295
|
var buttonVariants = (0, import_class_variance_authority2.cva)(
|
|
296
296
|
[
|
|
297
297
|
"inline-flex items-center justify-center whitespace-nowrap",
|
|
298
|
-
"font-
|
|
298
|
+
"font-semibold transition-colors",
|
|
299
299
|
"focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring",
|
|
300
300
|
"disabled:pointer-events-none",
|
|
301
301
|
"border",
|
|
@@ -328,7 +328,7 @@ var buttonVariants = (0, import_class_variance_authority2.cva)(
|
|
|
328
328
|
},
|
|
329
329
|
size: {
|
|
330
330
|
sm: [
|
|
331
|
-
"h-6
|
|
331
|
+
"h-6 py-xs gap-xs",
|
|
332
332
|
"text-xs",
|
|
333
333
|
"min-w-16 rounded-base"
|
|
334
334
|
],
|
|
@@ -423,13 +423,13 @@ var buttonVariants = (0, import_class_variance_authority2.cva)(
|
|
|
423
423
|
appearance: "ghost",
|
|
424
424
|
intent: "brand",
|
|
425
425
|
class: [
|
|
426
|
-
"bg-btn-ghost-
|
|
427
|
-
"text-btn-ghost-
|
|
428
|
-
"border-btn-ghost-
|
|
429
|
-
"hover:bg-btn-ghost-
|
|
430
|
-
"hover:text-btn-ghost-
|
|
431
|
-
"active:bg-btn-ghost-
|
|
432
|
-
"active:text-btn-ghost-
|
|
426
|
+
"bg-btn-ghost-brand-bg-default",
|
|
427
|
+
"text-btn-ghost-brand-text-default",
|
|
428
|
+
"border-btn-ghost-brand-border-default",
|
|
429
|
+
"hover:bg-btn-ghost-brand-bg-hover",
|
|
430
|
+
"hover:text-btn-ghost-brand-text-hover",
|
|
431
|
+
"active:bg-btn-ghost-brand-bg-pressed",
|
|
432
|
+
"active:text-btn-ghost-brand-text-pressed"
|
|
433
433
|
]
|
|
434
434
|
},
|
|
435
435
|
// ── Ghost + Alert ──────────────────────────────────────────────────
|
|
@@ -487,13 +487,17 @@ var Button = React2.forwardRef(
|
|
|
487
487
|
const isDisabled = disabled || loading;
|
|
488
488
|
const isIconOnly = iconOnlyProp ?? !children;
|
|
489
489
|
const iconSize = iconSizeMap[size ?? "md"];
|
|
490
|
+
const smPadding = size === "sm" && !isIconOnly ? cn(
|
|
491
|
+
leftIcon || loading ? "pl-xs" : "pl-sm",
|
|
492
|
+
rightIcon ? "pr-xs" : "pr-sm"
|
|
493
|
+
) : "";
|
|
490
494
|
const variantClasses = buttonVariants({
|
|
491
495
|
appearance,
|
|
492
496
|
intent,
|
|
493
497
|
size,
|
|
494
498
|
iconOnly: isIconOnly || void 0,
|
|
495
499
|
fullWidth,
|
|
496
|
-
className
|
|
500
|
+
className: cn(smPadding, className)
|
|
497
501
|
});
|
|
498
502
|
if (asChild) {
|
|
499
503
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_slot.Slot, { ref, className: cn(variantClasses), ...props, children });
|
|
@@ -595,7 +599,7 @@ var BrowserTabItem = React3.forwardRef(
|
|
|
595
599
|
},
|
|
596
600
|
onClick: (e) => e.stopPropagation(),
|
|
597
601
|
className: cn(
|
|
598
|
-
"text-sm font-
|
|
602
|
+
"text-sm font-semibold leading-sm bg-transparent outline-none p-0 m-0",
|
|
599
603
|
"border-b border-browser-tab-item-border border-dashed border-t-0 border-l-0 border-r-0",
|
|
600
604
|
isActive ? "text-browser-tab-item-active-text" : "text-browser-tab-item-inactive-text"
|
|
601
605
|
),
|
|
@@ -605,7 +609,7 @@ var BrowserTabItem = React3.forwardRef(
|
|
|
605
609
|
"span",
|
|
606
610
|
{
|
|
607
611
|
className: cn(
|
|
608
|
-
"text-sm font-
|
|
612
|
+
"text-sm font-semibold leading-sm whitespace-nowrap",
|
|
609
613
|
isActive ? "text-browser-tab-item-active-text" : "text-browser-tab-item-inactive-text"
|
|
610
614
|
),
|
|
611
615
|
onDoubleClick: (e) => {
|
|
@@ -794,7 +798,7 @@ var BrowserTab = React3.forwardRef(
|
|
|
794
798
|
"span",
|
|
795
799
|
{
|
|
796
800
|
className: cn(
|
|
797
|
-
"text-sm font-
|
|
801
|
+
"text-sm font-semibold leading-sm whitespace-nowrap",
|
|
798
802
|
item.isActive ? "text-browser-tab-item-active-text" : "text-browser-tab-item-inactive-text"
|
|
799
803
|
),
|
|
800
804
|
children: item.label
|
|
@@ -897,7 +901,7 @@ var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
|
897
901
|
var linkVariants = (0, import_class_variance_authority4.cva)(
|
|
898
902
|
[
|
|
899
903
|
"inline-flex items-center",
|
|
900
|
-
"font-
|
|
904
|
+
"font-semibold",
|
|
901
905
|
"transition-colors cursor-pointer",
|
|
902
906
|
"disabled:pointer-events-none",
|
|
903
907
|
"[&_svg]:pointer-events-none [&_svg]:shrink-0"
|
|
@@ -1029,7 +1033,7 @@ var InputLabel = React6.forwardRef(({ className, type = "default", disabled, inf
|
|
|
1029
1033
|
className: cn(
|
|
1030
1034
|
"inline-flex items-center gap-xs",
|
|
1031
1035
|
"text-xs",
|
|
1032
|
-
"font-
|
|
1036
|
+
"font-semibold",
|
|
1033
1037
|
"leading-xs",
|
|
1034
1038
|
textColor2,
|
|
1035
1039
|
className
|
|
@@ -1101,7 +1105,7 @@ var typeIconMap = {
|
|
|
1101
1105
|
warning: { icon: import_icons6.faTriangleExclamationSolid, color: "text-info-message-warning-icon" },
|
|
1102
1106
|
empty: { icon: import_icons6.faCircleInfoSolid, color: "text-info-message-empty-icon" }
|
|
1103
1107
|
};
|
|
1104
|
-
var titleStyle = "text-sm font-
|
|
1108
|
+
var titleStyle = "text-sm font-semibold leading-sm text-info-message-title";
|
|
1105
1109
|
var descriptionStyle = "text-xs font-regular leading-xs text-info-message-description";
|
|
1106
1110
|
var closeButtonStyle = "inline-flex shrink-0 items-center justify-center p-xs rounded-base text-info-message-close hover:bg-black/5 transition-colors";
|
|
1107
1111
|
var typeLinkIntentMap = {
|
|
@@ -1199,7 +1203,7 @@ var typeIconMap2 = {
|
|
|
1199
1203
|
alert: { icon: import_icons7.faCircleExclamationSolid, color: "text-toast-alert-icon" },
|
|
1200
1204
|
warning: { icon: import_icons7.faTriangleExclamationSolid, color: "text-toast-warning-icon" }
|
|
1201
1205
|
};
|
|
1202
|
-
var titleStyle2 = "text-sm font-
|
|
1206
|
+
var titleStyle2 = "text-sm font-semibold leading-sm text-toast-title";
|
|
1203
1207
|
var subtitleStyle = "text-sm font-regular leading-sm text-toast-subtitle";
|
|
1204
1208
|
var closeButtonStyle2 = "inline-flex shrink-0 items-center justify-center self-start p-sm rounded-md text-toast-close hover:bg-black/5 transition-colors";
|
|
1205
1209
|
var ToastProvider = ToastPrimitive.Provider;
|
|
@@ -1274,7 +1278,7 @@ var trackStyles = {
|
|
|
1274
1278
|
]
|
|
1275
1279
|
};
|
|
1276
1280
|
var thumbStyle = "pointer-events-none block rounded-full size-3 translate-x-0.5 bg-switch-thumb-bg shadow-md transition-transform data-[state=checked]:translate-x-[13px]";
|
|
1277
|
-
var labelBase = "cursor-pointer select-none text-sm font-
|
|
1281
|
+
var labelBase = "cursor-pointer select-none text-sm font-semibold leading-sm";
|
|
1278
1282
|
var labelColor = {
|
|
1279
1283
|
default: "text-switch-label-text",
|
|
1280
1284
|
disabled: "pointer-events-none text-switch-label-disabled"
|
|
@@ -1819,7 +1823,7 @@ var Avatar = React13.forwardRef(({ className, size = "xl", shape = "rounded", sr
|
|
|
1819
1823
|
{
|
|
1820
1824
|
delayMs: 0,
|
|
1821
1825
|
className: cn(
|
|
1822
|
-
"font-
|
|
1826
|
+
"font-semibold",
|
|
1823
1827
|
"text-avatar-fallback-text",
|
|
1824
1828
|
"select-none text-center",
|
|
1825
1829
|
initialsFontSize[size ?? "xl"]
|
|
@@ -1868,7 +1872,7 @@ var iconStyle = {
|
|
|
1868
1872
|
default: "text-checkbox-checked-icon",
|
|
1869
1873
|
disabled: "text-checkbox-disabled-icon"
|
|
1870
1874
|
};
|
|
1871
|
-
var labelBase2 = "cursor-pointer select-none overflow-hidden text-ellipsis whitespace-nowrap text-sm font-
|
|
1875
|
+
var labelBase2 = "cursor-pointer select-none overflow-hidden text-ellipsis whitespace-nowrap text-sm font-semibold leading-sm";
|
|
1872
1876
|
var labelColor2 = {
|
|
1873
1877
|
default: "text-checkbox-label-default",
|
|
1874
1878
|
disabled: "pointer-events-none text-checkbox-label-disabled"
|
|
@@ -1956,7 +1960,7 @@ var dotStyle = {
|
|
|
1956
1960
|
default: "bg-radio-selected-dot",
|
|
1957
1961
|
disabled: "bg-radio-disabled-dot"
|
|
1958
1962
|
};
|
|
1959
|
-
var labelBase3 = "cursor-pointer select-none overflow-hidden text-ellipsis whitespace-nowrap text-sm font-
|
|
1963
|
+
var labelBase3 = "cursor-pointer select-none overflow-hidden text-ellipsis whitespace-nowrap text-sm font-semibold leading-sm";
|
|
1960
1964
|
var labelColor3 = {
|
|
1961
1965
|
default: "text-radio-label-default",
|
|
1962
1966
|
disabled: "pointer-events-none text-radio-label-disabled"
|
|
@@ -2017,8 +2021,8 @@ var import_icons11 = require("@l3mpire/icons");
|
|
|
2017
2021
|
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
2018
2022
|
var textSm = "text-sm font-regular leading-sm";
|
|
2019
2023
|
var textXs = "text-xs font-regular leading-xs";
|
|
2020
|
-
var textXsMedium = "text-xs font-
|
|
2021
|
-
var textSmMedium = "text-sm font-
|
|
2024
|
+
var textXsMedium = "text-xs font-semibold leading-xs";
|
|
2025
|
+
var textSmMedium = "text-sm font-semibold leading-sm";
|
|
2022
2026
|
var containerStyle = [
|
|
2023
2027
|
"flex flex-col gap-base overflow-clip",
|
|
2024
2028
|
"bg-dropdown-bg",
|
|
@@ -2219,7 +2223,7 @@ var SidebarHeadingItem = React17.forwardRef(
|
|
|
2219
2223
|
ref,
|
|
2220
2224
|
className: cn(
|
|
2221
2225
|
"flex items-center w-full",
|
|
2222
|
-
"text-xs leading-xs font-
|
|
2226
|
+
"text-xs leading-xs font-semibold text-sidebar-heading-text mb-base",
|
|
2223
2227
|
className
|
|
2224
2228
|
),
|
|
2225
2229
|
...props,
|
|
@@ -2309,7 +2313,7 @@ var SidebarItem = React18.forwardRef(
|
|
|
2309
2313
|
"span",
|
|
2310
2314
|
{
|
|
2311
2315
|
className: cn(
|
|
2312
|
-
"flex-1 min-w-0 truncate text-sm leading-sm font-
|
|
2316
|
+
"flex-1 min-w-0 truncate text-sm leading-sm font-semibold",
|
|
2313
2317
|
textColorClass
|
|
2314
2318
|
),
|
|
2315
2319
|
children: label
|
|
@@ -2397,7 +2401,7 @@ var iconColor = {
|
|
|
2397
2401
|
};
|
|
2398
2402
|
var errorGuidance = {
|
|
2399
2403
|
icon: "shrink-0 text-select-error-icon",
|
|
2400
|
-
text: "text-xs font-
|
|
2404
|
+
text: "text-xs font-semibold leading-xs text-select-error-text"
|
|
2401
2405
|
};
|
|
2402
2406
|
function SelectChips({ tags, onTagRemove, chipHeightPx }) {
|
|
2403
2407
|
const containerRef = React19.useRef(null);
|
|
@@ -2442,7 +2446,7 @@ function SelectChips({ tags, onTagRemove, chipHeightPx }) {
|
|
|
2442
2446
|
"inline-flex items-center gap-xs shrink-0",
|
|
2443
2447
|
"px-sm rounded-base",
|
|
2444
2448
|
"bg-tag-neutral-bg text-tag-neutral-text",
|
|
2445
|
-
"text-xs font-
|
|
2449
|
+
"text-xs font-semibold leading-xs",
|
|
2446
2450
|
"whitespace-nowrap"
|
|
2447
2451
|
);
|
|
2448
2452
|
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex flex-1 items-center gap-xs min-w-0 overflow-hidden relative", children: [
|
|
@@ -2692,7 +2696,7 @@ var TabTrigger = React20.forwardRef(({ className, badge, children, ...props }, r
|
|
|
2692
2696
|
"span",
|
|
2693
2697
|
{
|
|
2694
2698
|
className: cn(
|
|
2695
|
-
"text-sm font-
|
|
2699
|
+
"text-sm font-semibold leading-sm whitespace-nowrap",
|
|
2696
2700
|
"text-tab-item-default-text",
|
|
2697
2701
|
"group-data-[state=active]:text-tab-item-active-text"
|
|
2698
2702
|
),
|
|
@@ -2726,7 +2730,7 @@ var tagVariants = (0, import_class_variance_authority12.cva)(
|
|
|
2726
2730
|
"inline-flex items-center",
|
|
2727
2731
|
"gap-xs",
|
|
2728
2732
|
"rounded-base",
|
|
2729
|
-
"font-
|
|
2733
|
+
"font-semibold",
|
|
2730
2734
|
"whitespace-nowrap"
|
|
2731
2735
|
],
|
|
2732
2736
|
{
|
|
@@ -2831,7 +2835,7 @@ var fieldStates = {
|
|
|
2831
2835
|
};
|
|
2832
2836
|
var errorGuidance2 = {
|
|
2833
2837
|
icon: "shrink-0 text-textarea-error-icon",
|
|
2834
|
-
text: "text-xs font-
|
|
2838
|
+
text: "text-xs font-semibold leading-xs text-textarea-error-text"
|
|
2835
2839
|
};
|
|
2836
2840
|
var charLimitStyle = "shrink-0 text-right text-xs font-regular leading-xs text-textarea-char-limit";
|
|
2837
2841
|
function resolveState(error, success, disabled) {
|
|
@@ -2958,7 +2962,7 @@ var attachedButtonStyles = {
|
|
|
2958
2962
|
};
|
|
2959
2963
|
var errorGuidance3 = {
|
|
2960
2964
|
icon: "shrink-0 text-text-input-error-icon",
|
|
2961
|
-
text: "text-xs font-
|
|
2965
|
+
text: "text-xs font-semibold leading-xs text-text-input-error-text"
|
|
2962
2966
|
};
|
|
2963
2967
|
function resolveState2(error, success, disabled) {
|
|
2964
2968
|
if (disabled) return "disabled";
|
|
@@ -3122,12 +3126,12 @@ var chipStyle = [
|
|
|
3122
3126
|
"inline-flex items-center gap-xs shrink-0",
|
|
3123
3127
|
"h-6 px-sm rounded-base",
|
|
3124
3128
|
"bg-tag-neutral-bg text-tag-neutral-text",
|
|
3125
|
-
"text-xs font-
|
|
3129
|
+
"text-xs font-semibold leading-xs",
|
|
3126
3130
|
"whitespace-nowrap"
|
|
3127
3131
|
];
|
|
3128
3132
|
var errorGuidance4 = {
|
|
3129
3133
|
icon: "shrink-0 text-text-input-error-icon",
|
|
3130
|
-
text: "text-xs font-
|
|
3134
|
+
text: "text-xs font-semibold leading-xs text-text-input-error-text"
|
|
3131
3135
|
};
|
|
3132
3136
|
var ChipInput = React24.forwardRef(
|
|
3133
3137
|
({
|
|
@@ -3317,7 +3321,7 @@ var wrapperStates3 = {
|
|
|
3317
3321
|
};
|
|
3318
3322
|
var errorGuidance5 = {
|
|
3319
3323
|
icon: "shrink-0 text-text-input-error-icon",
|
|
3320
|
-
text: "text-xs font-
|
|
3324
|
+
text: "text-xs font-semibold leading-xs text-text-input-error-text"
|
|
3321
3325
|
};
|
|
3322
3326
|
var NumberInput = React25.forwardRef(
|
|
3323
3327
|
({
|
|
@@ -3498,7 +3502,7 @@ var typographyVariants = (0, import_class_variance_authority16.cva)("", {
|
|
|
3498
3502
|
},
|
|
3499
3503
|
weight: {
|
|
3500
3504
|
regular: "font-regular",
|
|
3501
|
-
|
|
3505
|
+
semibold: "font-semibold",
|
|
3502
3506
|
bold: "font-bold"
|
|
3503
3507
|
}
|
|
3504
3508
|
},
|
|
@@ -3564,7 +3568,7 @@ var UserMenuInfoRow = React27.forwardRef(
|
|
|
3564
3568
|
children: [
|
|
3565
3569
|
avatar,
|
|
3566
3570
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex flex-1 flex-col min-w-0", children: [
|
|
3567
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "text-sm font-
|
|
3571
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "text-sm font-semibold leading-sm text-user-menu-name truncate", children: name }),
|
|
3568
3572
|
subtitle && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "text-xs font-regular leading-xs text-user-menu-subtitle truncate", children: subtitle })
|
|
3569
3573
|
] }),
|
|
3570
3574
|
action
|
|
@@ -3673,7 +3677,7 @@ var ModalTitle = React28.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
3673
3677
|
DialogPrimitive.Title,
|
|
3674
3678
|
{
|
|
3675
3679
|
ref,
|
|
3676
|
-
className: cn("text-base font-
|
|
3680
|
+
className: cn("text-base font-semibold leading-base text-modal-header-title", className),
|
|
3677
3681
|
...props
|
|
3678
3682
|
}
|
|
3679
3683
|
));
|
|
@@ -3835,7 +3839,7 @@ var EmptyState = React30.forwardRef(
|
|
|
3835
3839
|
"p",
|
|
3836
3840
|
{
|
|
3837
3841
|
className: cn(
|
|
3838
|
-
"font-
|
|
3842
|
+
"font-semibold text-table-cell-text-primary",
|
|
3839
3843
|
isMd ? "text-base leading-base" : "text-sm leading-sm"
|
|
3840
3844
|
),
|
|
3841
3845
|
children: title
|
|
@@ -3904,7 +3908,7 @@ var AvatarCell = ({
|
|
|
3904
3908
|
}) => /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: cn("flex items-center gap-md", className), children: [
|
|
3905
3909
|
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Avatar, { initials: getInitials(name), src, alt: name, size: "lg", shape: "rounded" }),
|
|
3906
3910
|
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex flex-col", children: [
|
|
3907
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "text-sm font-
|
|
3911
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "text-sm font-semibold text-table-cell-text-primary leading-sm", children: name }),
|
|
3908
3912
|
subtitle && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "text-xs font-regular text-table-cell-text-secondary leading-xs", children: subtitle })
|
|
3909
3913
|
] })
|
|
3910
3914
|
] });
|
|
@@ -3942,7 +3946,7 @@ var NumberCell = ({
|
|
|
3942
3946
|
className
|
|
3943
3947
|
),
|
|
3944
3948
|
children: [
|
|
3945
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "text-sm font-
|
|
3949
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "text-sm font-semibold text-table-cell-text-primary", children: formatted }),
|
|
3946
3950
|
secondaryStat && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3947
3951
|
"span",
|
|
3948
3952
|
{
|
|
@@ -4010,7 +4014,7 @@ var TextCell = ({
|
|
|
4010
4014
|
{
|
|
4011
4015
|
className: cn(
|
|
4012
4016
|
"text-sm",
|
|
4013
|
-
secondary ? "font-regular text-table-cell-text-secondary" : "font-
|
|
4017
|
+
secondary ? "font-regular text-table-cell-text-secondary" : "font-semibold text-table-cell-text-primary",
|
|
4014
4018
|
className
|
|
4015
4019
|
),
|
|
4016
4020
|
children: value
|
|
@@ -4059,7 +4063,7 @@ var EditableCell = ({
|
|
|
4059
4063
|
{
|
|
4060
4064
|
ref: inputRef,
|
|
4061
4065
|
className: cn(
|
|
4062
|
-
"w-full bg-transparent text-sm font-
|
|
4066
|
+
"w-full bg-transparent text-sm font-semibold text-table-cell-text-primary",
|
|
4063
4067
|
"outline-none border-b border-table-border py-0 h-[20px]",
|
|
4064
4068
|
className
|
|
4065
4069
|
),
|
|
@@ -4076,7 +4080,7 @@ var EditableCell = ({
|
|
|
4076
4080
|
role: "button",
|
|
4077
4081
|
tabIndex: 0,
|
|
4078
4082
|
className: cn(
|
|
4079
|
-
"text-sm font-
|
|
4083
|
+
"text-sm font-semibold text-table-cell-text-primary cursor-text leading-sm h-[20px] inline-block",
|
|
4080
4084
|
className
|
|
4081
4085
|
),
|
|
4082
4086
|
onDoubleClick: () => setIsEditing(true),
|
|
@@ -4142,7 +4146,7 @@ var TableFooter = React32.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
4142
4146
|
{
|
|
4143
4147
|
ref,
|
|
4144
4148
|
className: cn(
|
|
4145
|
-
"border-t border-table-border bg-table-bg font-
|
|
4149
|
+
"border-t border-table-border bg-table-bg font-semibold",
|
|
4146
4150
|
className
|
|
4147
4151
|
),
|
|
4148
4152
|
...props
|
|
@@ -4168,7 +4172,7 @@ var TableHead = React32.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
4168
4172
|
{
|
|
4169
4173
|
ref,
|
|
4170
4174
|
className: cn(
|
|
4171
|
-
"group/head h-10 px-md py-md text-left align-middle text-xs font-
|
|
4175
|
+
"group/head h-10 px-md py-md text-left align-middle text-xs font-semibold leading-xs",
|
|
4172
4176
|
"text-table-head-text bg-table-head-bg-default",
|
|
4173
4177
|
"hover:bg-table-head-bg-hover",
|
|
4174
4178
|
"border-b border-r border-table-border last:border-r-0",
|
|
@@ -4184,7 +4188,7 @@ var TableCell = React32.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
4184
4188
|
{
|
|
4185
4189
|
ref,
|
|
4186
4190
|
className: cn(
|
|
4187
|
-
"px-md py-md align-middle text-sm font-
|
|
4191
|
+
"px-md py-md align-middle text-sm font-semibold max-h-[52px]",
|
|
4188
4192
|
"text-table-cell-text-primary",
|
|
4189
4193
|
"border-b border-r border-table-border last:border-r-0",
|
|
4190
4194
|
"[&:has([role=checkbox])]:pr-0",
|
|
@@ -4283,7 +4287,7 @@ function ColumnFilterPopover({
|
|
|
4283
4287
|
),
|
|
4284
4288
|
onClick: (e) => e.stopPropagation(),
|
|
4285
4289
|
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex flex-col gap-sm", children: [
|
|
4286
|
-
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "text-xs font-
|
|
4290
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "text-xs font-semibold text-table-head-text", children: "Filter" }),
|
|
4287
4291
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
4288
4292
|
"select",
|
|
4289
4293
|
{
|
|
@@ -5017,13 +5021,13 @@ var FilterChipSegment = React35.forwardRef(
|
|
|
5017
5021
|
"span",
|
|
5018
5022
|
{
|
|
5019
5023
|
className: cn(
|
|
5020
|
-
"text-sm font-
|
|
5024
|
+
"text-sm font-semibold leading-sm whitespace-nowrap",
|
|
5021
5025
|
segmentType === "placeholder" ? "text-filter-chip-segment-placeholder" : "text-filter-chip-segment-text"
|
|
5022
5026
|
),
|
|
5023
5027
|
children: label
|
|
5024
5028
|
}
|
|
5025
5029
|
),
|
|
5026
|
-
badgeCount != null && badgeCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "flex items-center gap-2xs p-2xs rounded-xs bg-filter-chip-badge-bg", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "text-[10px] font-
|
|
5030
|
+
badgeCount != null && badgeCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "flex items-center gap-2xs p-2xs rounded-xs bg-filter-chip-badge-bg", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "text-[10px] font-semibold leading-2xs text-filter-chip-badge-text", children: badgeCount }) }),
|
|
5027
5031
|
children
|
|
5028
5032
|
]
|
|
5029
5033
|
}
|
|
@@ -5274,7 +5278,7 @@ var SortButton = ({
|
|
|
5274
5278
|
className: "shrink-0 text-[var(--color-foreground)]"
|
|
5275
5279
|
}
|
|
5276
5280
|
),
|
|
5277
|
-
!iconOnly && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("span", { className: "text-sm font-
|
|
5281
|
+
!iconOnly && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("span", { className: "text-sm font-semibold leading-sm whitespace-nowrap", children: [
|
|
5278
5282
|
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("span", { className: "text-[var(--color-muted-foreground)]", children: [
|
|
5279
5283
|
"Sort by",
|
|
5280
5284
|
" "
|
|
@@ -5433,7 +5437,7 @@ var FilterBarButton = React39.forwardRef(({ className, count, iconOnly = false,
|
|
|
5433
5437
|
ref,
|
|
5434
5438
|
type: "button",
|
|
5435
5439
|
className: cn(
|
|
5436
|
-
"flex items-center gap-sm",
|
|
5440
|
+
"shrink-0 flex items-center gap-sm overflow-hidden",
|
|
5437
5441
|
"min-h-[32px] max-h-[32px]",
|
|
5438
5442
|
"bg-gradient-to-t from-[var(--color-btn-outlined-neutral-bg-default)] to-[var(--color-btn-outlined-neutral-bg-gradient-to-default)]",
|
|
5439
5443
|
"border border-[var(--color-btn-outlined-neutral-border-default)] rounded-md shadow-sm",
|
|
@@ -5452,8 +5456,8 @@ var FilterBarButton = React39.forwardRef(({ className, count, iconOnly = false,
|
|
|
5452
5456
|
className: "shrink-0 text-[var(--color-foreground)]"
|
|
5453
5457
|
}
|
|
5454
5458
|
),
|
|
5455
|
-
!iconOnly && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "text-sm font-
|
|
5456
|
-
count != null && count > 0 && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "flex items-center p-2xs rounded-xs bg-filter-chip-badge-bg", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "text-[10px] font-
|
|
5459
|
+
!iconOnly && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "text-sm font-semibold leading-sm whitespace-nowrap text-[var(--color-foreground)]", children: children ?? "Filters" }),
|
|
5460
|
+
count != null && count > 0 && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "flex items-center p-2xs rounded-xs bg-filter-chip-badge-bg", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "text-[10px] font-semibold leading-2xs text-filter-chip-badge-text", children: count }) })
|
|
5457
5461
|
]
|
|
5458
5462
|
}
|
|
5459
5463
|
));
|
|
@@ -5466,7 +5470,7 @@ var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
|
5466
5470
|
var SaveViewButton = React40.forwardRef(
|
|
5467
5471
|
({ className, label = "Save view", onSave, onDropdown, ...props }, ref) => {
|
|
5468
5472
|
const sharedStyle = [
|
|
5469
|
-
"flex items-center justify-center",
|
|
5473
|
+
"relative flex items-center justify-center",
|
|
5470
5474
|
"min-h-[32px] max-h-[32px]",
|
|
5471
5475
|
"bg-gradient-to-t from-[var(--color-btn-solid-brand-bg-default)] from-[10%] to-[var(--color-btn-solid-brand-bg-gradient-to-default)]",
|
|
5472
5476
|
"border border-[var(--color-btn-solid-brand-border-default)]",
|
|
@@ -5491,7 +5495,7 @@ var SaveViewButton = React40.forwardRef(
|
|
|
5491
5495
|
"rounded-l-md -mr-px"
|
|
5492
5496
|
),
|
|
5493
5497
|
children: [
|
|
5494
|
-
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "text-sm font-
|
|
5498
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "text-sm font-semibold leading-sm whitespace-nowrap text-[var(--color-btn-solid-brand-text-default)]", children: label }),
|
|
5495
5499
|
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "absolute inset-0 rounded-l-[11px] border border-[var(--color-btn-solid-brand-inner-border-default)] shadow-sm pointer-events-none" })
|
|
5496
5500
|
]
|
|
5497
5501
|
}
|
|
@@ -5569,7 +5573,7 @@ var OperatorSelector = ({
|
|
|
5569
5573
|
{
|
|
5570
5574
|
className: cn(
|
|
5571
5575
|
"text-sm font-regular leading-sm",
|
|
5572
|
-
op === activeOperator ? "text-[var(--color-foreground)] font-
|
|
5576
|
+
op === activeOperator ? "text-[var(--color-foreground)] font-semibold" : "text-[var(--color-dropdown-item-text)]"
|
|
5573
5577
|
),
|
|
5574
5578
|
children: op
|
|
5575
5579
|
}
|
|
@@ -5605,7 +5609,7 @@ var OperatorList = ({
|
|
|
5605
5609
|
{
|
|
5606
5610
|
className: cn(
|
|
5607
5611
|
"text-sm font-regular leading-sm",
|
|
5608
|
-
op === activeOperator ? "text-[var(--color-foreground)] font-
|
|
5612
|
+
op === activeOperator ? "text-[var(--color-foreground)] font-semibold" : "text-[var(--color-dropdown-item-text)]"
|
|
5609
5613
|
),
|
|
5610
5614
|
children: op
|
|
5611
5615
|
}
|
|
@@ -5616,311 +5620,344 @@ var OperatorList = ({
|
|
|
5616
5620
|
};
|
|
5617
5621
|
OperatorList.displayName = "OperatorList";
|
|
5618
5622
|
|
|
5619
|
-
// src/components/ui/filter/value-
|
|
5623
|
+
// src/components/ui/filter/value-inputs/shared.ts
|
|
5624
|
+
var inputClasses = [
|
|
5625
|
+
"w-full px-base py-sm rounded-base border border-[var(--color-input)]",
|
|
5626
|
+
"bg-[var(--color-background)] text-sm font-regular leading-sm text-[var(--color-foreground)]",
|
|
5627
|
+
"placeholder:text-[var(--color-muted-foreground)]",
|
|
5628
|
+
"focus:outline-none focus:ring-2 focus:ring-[var(--color-ring)] focus:ring-offset-0"
|
|
5629
|
+
].join(" ");
|
|
5630
|
+
var halfInputClasses = [
|
|
5631
|
+
"flex-1 px-base py-sm rounded-base border border-[var(--color-input)]",
|
|
5632
|
+
"bg-[var(--color-background)] text-sm font-regular leading-sm text-[var(--color-foreground)]",
|
|
5633
|
+
"focus:outline-none focus:ring-2 focus:ring-[var(--color-ring)]"
|
|
5634
|
+
].join(" ");
|
|
5635
|
+
var applyBtnClasses = "self-end px-md py-sm text-sm font-semibold leading-sm text-[var(--color-primary-foreground)] bg-[var(--color-primary)] rounded-base cursor-pointer hover:opacity-90 transition-opacity";
|
|
5636
|
+
|
|
5637
|
+
// src/components/ui/filter/value-inputs/text-value-input.tsx
|
|
5620
5638
|
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
5639
|
+
var TextValueInput = ({
|
|
5640
|
+
value,
|
|
5641
|
+
onChange,
|
|
5642
|
+
onSubmit,
|
|
5643
|
+
className
|
|
5644
|
+
}) => {
|
|
5645
|
+
const handleKeyDown = (e) => {
|
|
5646
|
+
if (e.key === "Enter") onSubmit?.();
|
|
5647
|
+
};
|
|
5648
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: cn("flex flex-col gap-base p-base", className), children: [
|
|
5649
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
5650
|
+
"input",
|
|
5651
|
+
{
|
|
5652
|
+
type: "text",
|
|
5653
|
+
value: value ?? "",
|
|
5654
|
+
onChange: (e) => onChange(e.target.value),
|
|
5655
|
+
onKeyDown: handleKeyDown,
|
|
5656
|
+
placeholder: "Enter value...",
|
|
5657
|
+
autoFocus: true,
|
|
5658
|
+
className: inputClasses
|
|
5659
|
+
}
|
|
5660
|
+
),
|
|
5661
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("button", { type: "button", onClick: onSubmit, className: applyBtnClasses, children: "Apply" })
|
|
5662
|
+
] });
|
|
5663
|
+
};
|
|
5664
|
+
TextValueInput.displayName = "TextValueInput";
|
|
5665
|
+
|
|
5666
|
+
// src/components/ui/filter/value-inputs/number-value-input.tsx
|
|
5667
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
5668
|
+
var NumberValueInput = ({
|
|
5669
|
+
value,
|
|
5670
|
+
onChange,
|
|
5671
|
+
onSubmit,
|
|
5672
|
+
className
|
|
5673
|
+
}) => {
|
|
5674
|
+
const handleKeyDown = (e) => {
|
|
5675
|
+
if (e.key === "Enter") onSubmit?.();
|
|
5676
|
+
};
|
|
5677
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: cn("flex flex-col gap-base p-base", className), children: [
|
|
5678
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
5679
|
+
"input",
|
|
5680
|
+
{
|
|
5681
|
+
type: "number",
|
|
5682
|
+
value: value ?? "",
|
|
5683
|
+
onChange: (e) => onChange(e.target.value ? Number(e.target.value) : null),
|
|
5684
|
+
onKeyDown: handleKeyDown,
|
|
5685
|
+
placeholder: "Enter number...",
|
|
5686
|
+
autoFocus: true,
|
|
5687
|
+
className: inputClasses
|
|
5688
|
+
}
|
|
5689
|
+
),
|
|
5690
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("button", { type: "button", onClick: onSubmit, className: applyBtnClasses, children: "Apply" })
|
|
5691
|
+
] });
|
|
5692
|
+
};
|
|
5693
|
+
NumberValueInput.displayName = "NumberValueInput";
|
|
5694
|
+
var NumberRangeValueInput = ({
|
|
5695
|
+
value,
|
|
5696
|
+
onChange,
|
|
5697
|
+
onSubmit,
|
|
5698
|
+
className
|
|
5699
|
+
}) => {
|
|
5700
|
+
const rangeVal = value ?? [0, 0];
|
|
5701
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: cn("flex flex-col gap-base p-base", className), children: [
|
|
5702
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "flex items-center gap-base", children: [
|
|
5703
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
5704
|
+
"input",
|
|
5705
|
+
{
|
|
5706
|
+
type: "number",
|
|
5707
|
+
value: rangeVal[0] ?? "",
|
|
5708
|
+
onChange: (e) => onChange([Number(e.target.value), rangeVal[1]]),
|
|
5709
|
+
placeholder: "Min",
|
|
5710
|
+
autoFocus: true,
|
|
5711
|
+
className: halfInputClasses
|
|
5712
|
+
}
|
|
5713
|
+
),
|
|
5714
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: "text-sm text-[var(--color-muted-foreground)]", children: "and" }),
|
|
5715
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
5716
|
+
"input",
|
|
5717
|
+
{
|
|
5718
|
+
type: "number",
|
|
5719
|
+
value: rangeVal[1] ?? "",
|
|
5720
|
+
onChange: (e) => onChange([rangeVal[0], Number(e.target.value)]),
|
|
5721
|
+
placeholder: "Max",
|
|
5722
|
+
className: halfInputClasses
|
|
5723
|
+
}
|
|
5724
|
+
)
|
|
5725
|
+
] }),
|
|
5726
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("button", { type: "button", onClick: onSubmit, className: applyBtnClasses, children: "Apply" })
|
|
5727
|
+
] });
|
|
5728
|
+
};
|
|
5729
|
+
NumberRangeValueInput.displayName = "NumberRangeValueInput";
|
|
5730
|
+
|
|
5731
|
+
// src/components/ui/filter/value-inputs/date-value-input.tsx
|
|
5732
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
5621
5733
|
var RELATIVE_DATE_PRESETS = [
|
|
5622
5734
|
{ group: "Past", options: ["Today", "Yesterday", "Last 7 days", "Last 14 days", "Last 30 days", "Last 90 days"] },
|
|
5623
5735
|
{ group: "Current", options: ["This week", "This month", "This quarter", "This year"] },
|
|
5624
5736
|
{ group: "Future", options: ["Tomorrow", "Next 7 days", "Next 14 days", "Next 30 days", "Next week", "Next month", "Next quarter"] }
|
|
5625
5737
|
];
|
|
5626
|
-
var
|
|
5627
|
-
dataType,
|
|
5628
|
-
operator,
|
|
5738
|
+
var DatePickerValueInput = ({
|
|
5629
5739
|
value,
|
|
5630
5740
|
onChange,
|
|
5631
5741
|
onSubmit,
|
|
5632
|
-
options = [],
|
|
5633
5742
|
className
|
|
5634
|
-
}) => {
|
|
5635
|
-
|
|
5636
|
-
|
|
5637
|
-
|
|
5638
|
-
|
|
5639
|
-
|
|
5640
|
-
|
|
5641
|
-
|
|
5642
|
-
|
|
5643
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
5644
|
-
"input",
|
|
5645
|
-
{
|
|
5646
|
-
type: "text",
|
|
5647
|
-
value: value ?? "",
|
|
5648
|
-
onChange: (e) => onChange(e.target.value),
|
|
5649
|
-
onKeyDown: handleKeyDown,
|
|
5650
|
-
placeholder: "Enter value...",
|
|
5651
|
-
autoFocus: true,
|
|
5652
|
-
className: cn(
|
|
5653
|
-
"w-full px-base py-sm rounded-base border border-[var(--color-input)]",
|
|
5654
|
-
"bg-[var(--color-background)] text-sm font-regular leading-sm text-[var(--color-foreground)]",
|
|
5655
|
-
"placeholder:text-[var(--color-muted-foreground)]",
|
|
5656
|
-
"focus:outline-none focus:ring-2 focus:ring-[var(--color-ring)] focus:ring-offset-0"
|
|
5657
|
-
)
|
|
5658
|
-
}
|
|
5659
|
-
),
|
|
5660
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
5661
|
-
"button",
|
|
5662
|
-
{
|
|
5663
|
-
type: "button",
|
|
5664
|
-
onClick: onSubmit,
|
|
5665
|
-
className: "self-end px-md py-sm text-sm font-medium leading-sm text-[var(--color-primary-foreground)] bg-[var(--color-primary)] rounded-base cursor-pointer hover:opacity-90 transition-opacity",
|
|
5666
|
-
children: "Apply"
|
|
5667
|
-
}
|
|
5668
|
-
)
|
|
5669
|
-
] });
|
|
5670
|
-
case "NumberInput":
|
|
5671
|
-
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: cn("flex flex-col gap-base p-base", className), children: [
|
|
5672
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
5673
|
-
"input",
|
|
5674
|
-
{
|
|
5675
|
-
type: "number",
|
|
5676
|
-
value: value ?? "",
|
|
5677
|
-
onChange: (e) => onChange(e.target.value ? Number(e.target.value) : null),
|
|
5678
|
-
onKeyDown: handleKeyDown,
|
|
5679
|
-
placeholder: "Enter number...",
|
|
5680
|
-
autoFocus: true,
|
|
5681
|
-
className: cn(
|
|
5682
|
-
"w-full px-base py-sm rounded-base border border-[var(--color-input)]",
|
|
5683
|
-
"bg-[var(--color-background)] text-sm font-regular leading-sm text-[var(--color-foreground)]",
|
|
5684
|
-
"placeholder:text-[var(--color-muted-foreground)]",
|
|
5685
|
-
"focus:outline-none focus:ring-2 focus:ring-[var(--color-ring)] focus:ring-offset-0"
|
|
5686
|
-
)
|
|
5687
|
-
}
|
|
5688
|
-
),
|
|
5689
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
5690
|
-
"button",
|
|
5691
|
-
{
|
|
5692
|
-
type: "button",
|
|
5693
|
-
onClick: onSubmit,
|
|
5694
|
-
className: "self-end px-md py-sm text-sm font-medium leading-sm text-[var(--color-primary-foreground)] bg-[var(--color-primary)] rounded-base cursor-pointer hover:opacity-90 transition-opacity",
|
|
5695
|
-
children: "Apply"
|
|
5696
|
-
}
|
|
5697
|
-
)
|
|
5698
|
-
] });
|
|
5699
|
-
case "NumberRange": {
|
|
5700
|
-
const rangeVal = value ?? [0, 0];
|
|
5701
|
-
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: cn("flex flex-col gap-base p-base", className), children: [
|
|
5702
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "flex items-center gap-base", children: [
|
|
5703
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
5704
|
-
"input",
|
|
5705
|
-
{
|
|
5706
|
-
type: "number",
|
|
5707
|
-
value: rangeVal[0] ?? "",
|
|
5708
|
-
onChange: (e) => onChange([Number(e.target.value), rangeVal[1]]),
|
|
5709
|
-
placeholder: "Min",
|
|
5710
|
-
autoFocus: true,
|
|
5711
|
-
className: cn(
|
|
5712
|
-
"flex-1 px-base py-sm rounded-base border border-[var(--color-input)]",
|
|
5713
|
-
"bg-[var(--color-background)] text-sm font-regular leading-sm text-[var(--color-foreground)]",
|
|
5714
|
-
"focus:outline-none focus:ring-2 focus:ring-[var(--color-ring)]"
|
|
5715
|
-
)
|
|
5716
|
-
}
|
|
5717
|
-
),
|
|
5718
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: "text-sm text-[var(--color-muted-foreground)]", children: "and" }),
|
|
5719
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
5720
|
-
"input",
|
|
5721
|
-
{
|
|
5722
|
-
type: "number",
|
|
5723
|
-
value: rangeVal[1] ?? "",
|
|
5724
|
-
onChange: (e) => onChange([rangeVal[0], Number(e.target.value)]),
|
|
5725
|
-
placeholder: "Max",
|
|
5726
|
-
className: cn(
|
|
5727
|
-
"flex-1 px-base py-sm rounded-base border border-[var(--color-input)]",
|
|
5728
|
-
"bg-[var(--color-background)] text-sm font-regular leading-sm text-[var(--color-foreground)]",
|
|
5729
|
-
"focus:outline-none focus:ring-2 focus:ring-[var(--color-ring)]"
|
|
5730
|
-
)
|
|
5731
|
-
}
|
|
5732
|
-
)
|
|
5733
|
-
] }),
|
|
5734
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
5735
|
-
"button",
|
|
5736
|
-
{
|
|
5737
|
-
type: "button",
|
|
5738
|
-
onClick: onSubmit,
|
|
5739
|
-
className: "self-end px-md py-sm text-sm font-medium leading-sm text-[var(--color-primary-foreground)] bg-[var(--color-primary)] rounded-base cursor-pointer hover:opacity-90 transition-opacity",
|
|
5740
|
-
children: "Apply"
|
|
5741
|
-
}
|
|
5742
|
-
)
|
|
5743
|
-
] });
|
|
5743
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: cn("flex flex-col gap-base p-base", className), children: [
|
|
5744
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
5745
|
+
"input",
|
|
5746
|
+
{
|
|
5747
|
+
type: "date",
|
|
5748
|
+
value: value instanceof Date ? value.toISOString().split("T")[0] : value ?? "",
|
|
5749
|
+
onChange: (e) => onChange(e.target.value ? new Date(e.target.value) : null),
|
|
5750
|
+
autoFocus: true,
|
|
5751
|
+
className: inputClasses
|
|
5744
5752
|
}
|
|
5745
|
-
|
|
5746
|
-
|
|
5747
|
-
|
|
5748
|
-
|
|
5749
|
-
|
|
5750
|
-
|
|
5751
|
-
|
|
5752
|
-
|
|
5753
|
-
|
|
5754
|
-
|
|
5755
|
-
|
|
5756
|
-
|
|
5757
|
-
|
|
5758
|
-
|
|
5759
|
-
|
|
5760
|
-
|
|
5753
|
+
),
|
|
5754
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("button", { type: "button", onClick: onSubmit, className: applyBtnClasses, children: "Apply" })
|
|
5755
|
+
] });
|
|
5756
|
+
DatePickerValueInput.displayName = "DatePickerValueInput";
|
|
5757
|
+
function toDateString(d) {
|
|
5758
|
+
if (!d) return "";
|
|
5759
|
+
if (d instanceof Date) return d.toISOString().split("T")[0];
|
|
5760
|
+
return String(d);
|
|
5761
|
+
}
|
|
5762
|
+
var DateRangeValueInput = ({
|
|
5763
|
+
value,
|
|
5764
|
+
onChange,
|
|
5765
|
+
onSubmit,
|
|
5766
|
+
className
|
|
5767
|
+
}) => {
|
|
5768
|
+
const rangeVal = Array.isArray(value) ? value : [null, null];
|
|
5769
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: cn("flex flex-col gap-base p-base", className), children: [
|
|
5770
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex items-center gap-base", children: [
|
|
5771
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
5772
|
+
"input",
|
|
5773
|
+
{
|
|
5774
|
+
type: "date",
|
|
5775
|
+
value: toDateString(rangeVal[0]),
|
|
5776
|
+
onChange: (e) => {
|
|
5777
|
+
const from = e.target.value ? new Date(e.target.value) : null;
|
|
5778
|
+
onChange([from, rangeVal[1]]);
|
|
5761
5779
|
},
|
|
5762
|
-
|
|
5763
|
-
|
|
5764
|
-
|
|
5765
|
-
|
|
5766
|
-
|
|
5780
|
+
autoFocus: true,
|
|
5781
|
+
className: halfInputClasses
|
|
5782
|
+
}
|
|
5783
|
+
),
|
|
5784
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "text-sm text-[var(--color-muted-foreground)]", children: "to" }),
|
|
5785
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
5786
|
+
"input",
|
|
5787
|
+
{
|
|
5788
|
+
type: "date",
|
|
5789
|
+
value: toDateString(rangeVal[1]),
|
|
5790
|
+
onChange: (e) => {
|
|
5791
|
+
const to = e.target.value ? new Date(e.target.value) : null;
|
|
5792
|
+
onChange([rangeVal[0], to]);
|
|
5793
|
+
},
|
|
5794
|
+
className: halfInputClasses
|
|
5795
|
+
}
|
|
5796
|
+
)
|
|
5797
|
+
] }),
|
|
5798
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("button", { type: "button", onClick: onSubmit, className: applyBtnClasses, children: "Apply" })
|
|
5799
|
+
] });
|
|
5800
|
+
};
|
|
5801
|
+
DateRangeValueInput.displayName = "DateRangeValueInput";
|
|
5802
|
+
var PresetTagsValueInput = ({
|
|
5803
|
+
value,
|
|
5804
|
+
onChange,
|
|
5805
|
+
onSubmit,
|
|
5806
|
+
className
|
|
5807
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: cn("flex flex-col gap-base p-base max-w-[280px]", className), children: RELATIVE_DATE_PRESETS.map((group) => /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex flex-col gap-xs", children: [
|
|
5808
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "text-xs font-semibold leading-xs text-[var(--color-muted-foreground)] uppercase px-xs", children: group.group }),
|
|
5809
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "flex flex-wrap gap-xs", children: group.options.map((preset) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
5810
|
+
"button",
|
|
5811
|
+
{
|
|
5812
|
+
type: "button",
|
|
5813
|
+
onClick: () => {
|
|
5814
|
+
onChange(preset);
|
|
5815
|
+
onSubmit?.();
|
|
5816
|
+
},
|
|
5817
|
+
className: cn(
|
|
5818
|
+
"px-base py-2xs rounded-base border cursor-pointer transition-colors text-sm font-regular leading-sm",
|
|
5819
|
+
value === preset ? "border-[var(--color-ring)] bg-[var(--color-primary)] text-[var(--color-primary-foreground)]" : "border-[var(--color-input)] bg-[var(--color-background)] text-[var(--color-foreground)] hover:bg-[var(--color-accent)]"
|
|
5820
|
+
),
|
|
5821
|
+
children: preset
|
|
5822
|
+
},
|
|
5823
|
+
preset
|
|
5824
|
+
)) })
|
|
5825
|
+
] }, group.group)) });
|
|
5826
|
+
PresetTagsValueInput.displayName = "PresetTagsValueInput";
|
|
5827
|
+
|
|
5828
|
+
// src/components/ui/filter/value-inputs/select-value-input.tsx
|
|
5829
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
5830
|
+
var SingleSelectValueInput = ({
|
|
5831
|
+
value,
|
|
5832
|
+
onChange,
|
|
5833
|
+
onSubmit,
|
|
5834
|
+
options,
|
|
5835
|
+
className
|
|
5836
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: cn("flex flex-col gap-xs p-base max-h-[250px] overflow-y-auto", className), children: options.map((opt) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
5837
|
+
"button",
|
|
5838
|
+
{
|
|
5839
|
+
type: "button",
|
|
5840
|
+
onClick: () => {
|
|
5841
|
+
onChange(opt);
|
|
5842
|
+
onSubmit?.();
|
|
5843
|
+
},
|
|
5844
|
+
className: cn(
|
|
5845
|
+
"flex items-center gap-base p-base rounded-base cursor-pointer transition-colors text-left",
|
|
5846
|
+
"hover:bg-[var(--color-dropdown-item-hover)]",
|
|
5847
|
+
value === opt && "bg-[var(--color-dropdown-item-hover)]"
|
|
5848
|
+
),
|
|
5849
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "text-sm font-regular leading-sm text-[var(--color-foreground)]", children: opt })
|
|
5850
|
+
},
|
|
5851
|
+
opt
|
|
5852
|
+
)) });
|
|
5853
|
+
SingleSelectValueInput.displayName = "SingleSelectValueInput";
|
|
5854
|
+
var MultiSelectValueInput = ({
|
|
5855
|
+
value,
|
|
5856
|
+
onChange,
|
|
5857
|
+
onSubmit,
|
|
5858
|
+
options,
|
|
5859
|
+
className
|
|
5860
|
+
}) => {
|
|
5861
|
+
const selected = Array.isArray(value) ? value : [];
|
|
5862
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: cn("flex flex-col gap-xs p-base", className), children: [
|
|
5863
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "flex flex-col max-h-[200px] overflow-y-auto", children: options.map((opt) => {
|
|
5864
|
+
const isSelected = selected.includes(opt);
|
|
5865
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
5767
5866
|
"button",
|
|
5768
5867
|
{
|
|
5769
5868
|
type: "button",
|
|
5770
5869
|
onClick: () => {
|
|
5771
|
-
|
|
5772
|
-
|
|
5870
|
+
const next = isSelected ? selected.filter((s) => s !== opt) : [...selected, opt];
|
|
5871
|
+
onChange(next);
|
|
5773
5872
|
},
|
|
5774
5873
|
className: cn(
|
|
5775
5874
|
"flex items-center gap-base p-base rounded-base cursor-pointer transition-colors text-left",
|
|
5776
|
-
"hover:bg-[var(--color-dropdown-item-hover)]"
|
|
5777
|
-
value === opt && "bg-[var(--color-dropdown-item-hover)]"
|
|
5875
|
+
"hover:bg-[var(--color-dropdown-item-hover)]"
|
|
5778
5876
|
),
|
|
5779
|
-
children:
|
|
5877
|
+
children: [
|
|
5878
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
5879
|
+
"span",
|
|
5880
|
+
{
|
|
5881
|
+
className: cn(
|
|
5882
|
+
"flex items-center justify-center size-4 rounded-xs border transition-colors",
|
|
5883
|
+
isSelected ? "bg-[var(--color-primary)] border-[var(--color-primary)]" : "border-[var(--color-input)] bg-[var(--color-background)]"
|
|
5884
|
+
),
|
|
5885
|
+
children: isSelected && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("svg", { width: "10", height: "10", viewBox: "0 0 10 10", fill: "none", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("path", { d: "M2 5L4 7L8 3", stroke: "white", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) })
|
|
5886
|
+
}
|
|
5887
|
+
),
|
|
5888
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "text-sm font-regular leading-sm text-[var(--color-foreground)]", children: opt })
|
|
5889
|
+
]
|
|
5780
5890
|
},
|
|
5781
5891
|
opt
|
|
5782
|
-
)
|
|
5783
|
-
|
|
5784
|
-
|
|
5785
|
-
|
|
5786
|
-
|
|
5787
|
-
|
|
5788
|
-
|
|
5789
|
-
|
|
5790
|
-
|
|
5791
|
-
|
|
5792
|
-
|
|
5793
|
-
|
|
5794
|
-
|
|
5795
|
-
|
|
5796
|
-
|
|
5797
|
-
|
|
5798
|
-
|
|
5799
|
-
|
|
5800
|
-
|
|
5801
|
-
|
|
5802
|
-
|
|
5803
|
-
|
|
5804
|
-
|
|
5805
|
-
|
|
5806
|
-
|
|
5807
|
-
|
|
5808
|
-
|
|
5809
|
-
|
|
5810
|
-
|
|
5811
|
-
|
|
5812
|
-
|
|
5813
|
-
|
|
5814
|
-
|
|
5815
|
-
|
|
5816
|
-
|
|
5817
|
-
|
|
5818
|
-
|
|
5819
|
-
|
|
5820
|
-
|
|
5821
|
-
|
|
5822
|
-
|
|
5823
|
-
|
|
5824
|
-
|
|
5825
|
-
|
|
5826
|
-
|
|
5827
|
-
|
|
5828
|
-
|
|
5829
|
-
|
|
5892
|
+
);
|
|
5893
|
+
}) }),
|
|
5894
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("button", { type: "button", onClick: onSubmit, className: applyBtnClasses, children: "Apply" })
|
|
5895
|
+
] });
|
|
5896
|
+
};
|
|
5897
|
+
MultiSelectValueInput.displayName = "MultiSelectValueInput";
|
|
5898
|
+
|
|
5899
|
+
// src/components/ui/filter/value-inputs/relation-value-input.tsx
|
|
5900
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
5901
|
+
var RelationValueInput = ({
|
|
5902
|
+
value,
|
|
5903
|
+
onChange,
|
|
5904
|
+
onSubmit,
|
|
5905
|
+
className
|
|
5906
|
+
}) => {
|
|
5907
|
+
const handleKeyDown = (e) => {
|
|
5908
|
+
if (e.key === "Enter") onSubmit?.();
|
|
5909
|
+
};
|
|
5910
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: cn("flex flex-col gap-base p-base", className), children: [
|
|
5911
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
5912
|
+
"input",
|
|
5913
|
+
{
|
|
5914
|
+
type: "text",
|
|
5915
|
+
value: value ?? "",
|
|
5916
|
+
onChange: (e) => onChange(e.target.value),
|
|
5917
|
+
onKeyDown: handleKeyDown,
|
|
5918
|
+
placeholder: "Search...",
|
|
5919
|
+
autoFocus: true,
|
|
5920
|
+
className: inputClasses
|
|
5921
|
+
}
|
|
5922
|
+
),
|
|
5923
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("button", { type: "button", onClick: onSubmit, className: applyBtnClasses, children: "Apply" })
|
|
5924
|
+
] });
|
|
5925
|
+
};
|
|
5926
|
+
RelationValueInput.displayName = "RelationValueInput";
|
|
5927
|
+
|
|
5928
|
+
// src/components/ui/filter/value-input.tsx
|
|
5929
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
5930
|
+
var ValueInput = ({
|
|
5931
|
+
dataType,
|
|
5932
|
+
operator,
|
|
5933
|
+
value,
|
|
5934
|
+
onChange,
|
|
5935
|
+
onSubmit,
|
|
5936
|
+
options = [],
|
|
5937
|
+
className
|
|
5938
|
+
}) => {
|
|
5939
|
+
const inputType = getValueInputType(dataType, operator);
|
|
5940
|
+
if (!inputType) return null;
|
|
5941
|
+
switch (inputType) {
|
|
5942
|
+
case "TextInput":
|
|
5943
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TextValueInput, { value, onChange, onSubmit, className });
|
|
5944
|
+
case "NumberInput":
|
|
5945
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(NumberValueInput, { value, onChange, onSubmit, className });
|
|
5946
|
+
case "NumberRange":
|
|
5947
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(NumberRangeValueInput, { value, onChange, onSubmit, className });
|
|
5948
|
+
case "PresetTags":
|
|
5949
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(PresetTagsValueInput, { value, onChange, onSubmit, className });
|
|
5950
|
+
case "SingleSelect":
|
|
5951
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(SingleSelectValueInput, { value, onChange, onSubmit, options, className });
|
|
5952
|
+
case "MultiSelect":
|
|
5953
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(MultiSelectValueInput, { value, onChange, onSubmit, options, className });
|
|
5830
5954
|
case "DatePicker":
|
|
5831
|
-
return /* @__PURE__ */ (0,
|
|
5832
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
5833
|
-
"input",
|
|
5834
|
-
{
|
|
5835
|
-
type: "date",
|
|
5836
|
-
value: value instanceof Date ? value.toISOString().split("T")[0] : value ?? "",
|
|
5837
|
-
onChange: (e) => onChange(e.target.value ? new Date(e.target.value) : null),
|
|
5838
|
-
autoFocus: true,
|
|
5839
|
-
className: cn(
|
|
5840
|
-
"w-full px-base py-sm rounded-base border border-[var(--color-input)]",
|
|
5841
|
-
"bg-[var(--color-background)] text-sm font-regular leading-sm text-[var(--color-foreground)]",
|
|
5842
|
-
"focus:outline-none focus:ring-2 focus:ring-[var(--color-ring)]"
|
|
5843
|
-
)
|
|
5844
|
-
}
|
|
5845
|
-
),
|
|
5846
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
5847
|
-
"button",
|
|
5848
|
-
{
|
|
5849
|
-
type: "button",
|
|
5850
|
-
onClick: onSubmit,
|
|
5851
|
-
className: "self-end px-md py-sm text-sm font-medium leading-sm text-[var(--color-primary-foreground)] bg-[var(--color-primary)] rounded-base cursor-pointer hover:opacity-90 transition-opacity",
|
|
5852
|
-
children: "Apply"
|
|
5853
|
-
}
|
|
5854
|
-
)
|
|
5855
|
-
] });
|
|
5955
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(DatePickerValueInput, { value, onChange, onSubmit, className });
|
|
5856
5956
|
case "DateRange":
|
|
5857
|
-
return /* @__PURE__ */ (0,
|
|
5858
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "flex items-center gap-base", children: [
|
|
5859
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
5860
|
-
"input",
|
|
5861
|
-
{
|
|
5862
|
-
type: "date",
|
|
5863
|
-
autoFocus: true,
|
|
5864
|
-
className: cn(
|
|
5865
|
-
"flex-1 px-base py-sm rounded-base border border-[var(--color-input)]",
|
|
5866
|
-
"bg-[var(--color-background)] text-sm font-regular leading-sm text-[var(--color-foreground)]",
|
|
5867
|
-
"focus:outline-none focus:ring-2 focus:ring-[var(--color-ring)]"
|
|
5868
|
-
)
|
|
5869
|
-
}
|
|
5870
|
-
),
|
|
5871
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: "text-sm text-[var(--color-muted-foreground)]", children: "to" }),
|
|
5872
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
5873
|
-
"input",
|
|
5874
|
-
{
|
|
5875
|
-
type: "date",
|
|
5876
|
-
className: cn(
|
|
5877
|
-
"flex-1 px-base py-sm rounded-base border border-[var(--color-input)]",
|
|
5878
|
-
"bg-[var(--color-background)] text-sm font-regular leading-sm text-[var(--color-foreground)]",
|
|
5879
|
-
"focus:outline-none focus:ring-2 focus:ring-[var(--color-ring)]"
|
|
5880
|
-
)
|
|
5881
|
-
}
|
|
5882
|
-
)
|
|
5883
|
-
] }),
|
|
5884
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
5885
|
-
"button",
|
|
5886
|
-
{
|
|
5887
|
-
type: "button",
|
|
5888
|
-
onClick: onSubmit,
|
|
5889
|
-
className: "self-end px-md py-sm text-sm font-medium leading-sm text-[var(--color-primary-foreground)] bg-[var(--color-primary)] rounded-base cursor-pointer hover:opacity-90 transition-opacity",
|
|
5890
|
-
children: "Apply"
|
|
5891
|
-
}
|
|
5892
|
-
)
|
|
5893
|
-
] });
|
|
5957
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(DateRangeValueInput, { value, onChange, onSubmit, className });
|
|
5894
5958
|
case "RelationPicker":
|
|
5895
5959
|
case "MultiRelationPicker":
|
|
5896
|
-
return /* @__PURE__ */ (0,
|
|
5897
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
5898
|
-
"input",
|
|
5899
|
-
{
|
|
5900
|
-
type: "text",
|
|
5901
|
-
value: value ?? "",
|
|
5902
|
-
onChange: (e) => onChange(e.target.value),
|
|
5903
|
-
onKeyDown: handleKeyDown,
|
|
5904
|
-
placeholder: "Search...",
|
|
5905
|
-
autoFocus: true,
|
|
5906
|
-
className: cn(
|
|
5907
|
-
"w-full px-base py-sm rounded-base border border-[var(--color-input)]",
|
|
5908
|
-
"bg-[var(--color-background)] text-sm font-regular leading-sm text-[var(--color-foreground)]",
|
|
5909
|
-
"placeholder:text-[var(--color-muted-foreground)]",
|
|
5910
|
-
"focus:outline-none focus:ring-2 focus:ring-[var(--color-ring)]"
|
|
5911
|
-
)
|
|
5912
|
-
}
|
|
5913
|
-
),
|
|
5914
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
5915
|
-
"button",
|
|
5916
|
-
{
|
|
5917
|
-
type: "button",
|
|
5918
|
-
onClick: onSubmit,
|
|
5919
|
-
className: "self-end px-md py-sm text-sm font-medium leading-sm text-[var(--color-primary-foreground)] bg-[var(--color-primary)] rounded-base cursor-pointer hover:opacity-90 transition-opacity",
|
|
5920
|
-
children: "Apply"
|
|
5921
|
-
}
|
|
5922
|
-
)
|
|
5923
|
-
] });
|
|
5960
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(RelationValueInput, { value, onChange, onSubmit, className });
|
|
5924
5961
|
default:
|
|
5925
5962
|
return null;
|
|
5926
5963
|
}
|
|
@@ -5931,14 +5968,50 @@ ValueInput.displayName = "ValueInput";
|
|
|
5931
5968
|
var React41 = __toESM(require("react"));
|
|
5932
5969
|
var PopoverPrimitive5 = __toESM(require("@radix-ui/react-popover"));
|
|
5933
5970
|
var import_icons27 = require("@l3mpire/icons");
|
|
5934
|
-
var
|
|
5971
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
5972
|
+
var AdvancedFilterFooter = ({ onClick, count }) => /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_jsx_runtime48.Fragment, { children: [
|
|
5973
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "h-px bg-[var(--color-dropdown-border)] mx-xs" }),
|
|
5974
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
5975
|
+
"button",
|
|
5976
|
+
{
|
|
5977
|
+
type: "button",
|
|
5978
|
+
onPointerDown: (e) => e.preventDefault(),
|
|
5979
|
+
onClick,
|
|
5980
|
+
className: "flex items-center gap-base p-base rounded-base cursor-pointer transition-colors hover:bg-[var(--color-dropdown-item-hover)]",
|
|
5981
|
+
children: [
|
|
5982
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
5983
|
+
import_icons27.Icon,
|
|
5984
|
+
{
|
|
5985
|
+
icon: import_icons27.faFilterOutline,
|
|
5986
|
+
size: "sm",
|
|
5987
|
+
className: "shrink-0 text-[var(--color-dropdown-item-icon)]"
|
|
5988
|
+
}
|
|
5989
|
+
),
|
|
5990
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "flex-1 text-sm font-regular leading-sm text-[var(--color-dropdown-item-text)] text-left truncate", children: "Advanced filter" }),
|
|
5991
|
+
count > 0 && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("span", { className: "text-xs font-regular leading-xs text-[var(--color-muted-foreground)]", children: [
|
|
5992
|
+
count,
|
|
5993
|
+
" ",
|
|
5994
|
+
count === 1 ? "rule" : "rules"
|
|
5995
|
+
] })
|
|
5996
|
+
]
|
|
5997
|
+
}
|
|
5998
|
+
)
|
|
5999
|
+
] });
|
|
5935
6000
|
var PropertySelector = ({
|
|
5936
6001
|
properties,
|
|
5937
6002
|
onSelect,
|
|
5938
6003
|
open,
|
|
5939
6004
|
onOpenChange,
|
|
5940
|
-
children
|
|
6005
|
+
children,
|
|
6006
|
+
onAdvancedFilter,
|
|
6007
|
+
advancedFilterCount = 0
|
|
5941
6008
|
}) => {
|
|
6009
|
+
const handleAdvancedClick = (e) => {
|
|
6010
|
+
e.stopPropagation();
|
|
6011
|
+
e.preventDefault();
|
|
6012
|
+
onAdvancedFilter?.();
|
|
6013
|
+
};
|
|
6014
|
+
const showAdvancedFooter = !!onAdvancedFilter;
|
|
5942
6015
|
const [activeGroup, setActiveGroup] = React41.useState(null);
|
|
5943
6016
|
const [search, setSearch] = React41.useState("");
|
|
5944
6017
|
React41.useEffect(() => {
|
|
@@ -5964,6 +6037,20 @@ var PropertySelector = ({
|
|
|
5964
6037
|
}
|
|
5965
6038
|
return Array.from(map.values());
|
|
5966
6039
|
}, [properties]);
|
|
6040
|
+
const globalSearchResults = React41.useMemo(() => {
|
|
6041
|
+
if (!search || activeGroup) return [];
|
|
6042
|
+
const lower = search.toLowerCase();
|
|
6043
|
+
return properties.filter((p) => p.label.toLowerCase().includes(lower));
|
|
6044
|
+
}, [properties, search, activeGroup]);
|
|
6045
|
+
const filteredGroups = React41.useMemo(() => {
|
|
6046
|
+
if (!search || activeGroup) return groups;
|
|
6047
|
+
const lower = search.toLowerCase();
|
|
6048
|
+
return groups.filter(
|
|
6049
|
+
(g) => g.groupLabel.toLowerCase().includes(lower) || properties.some(
|
|
6050
|
+
(p) => p.group === g.group && p.label.toLowerCase().includes(lower)
|
|
6051
|
+
)
|
|
6052
|
+
);
|
|
6053
|
+
}, [groups, properties, search, activeGroup]);
|
|
5967
6054
|
const filteredProperties = React41.useMemo(() => {
|
|
5968
6055
|
if (!activeGroup) return [];
|
|
5969
6056
|
const groupProps = properties.filter((p) => p.group === activeGroup);
|
|
@@ -5972,13 +6059,15 @@ var PropertySelector = ({
|
|
|
5972
6059
|
return groupProps.filter((p) => p.label.toLowerCase().includes(lower));
|
|
5973
6060
|
}, [properties, activeGroup, search]);
|
|
5974
6061
|
const activeGroupInfo = groups.find((g) => g.group === activeGroup);
|
|
5975
|
-
|
|
5976
|
-
|
|
5977
|
-
/* @__PURE__ */ (0,
|
|
6062
|
+
const showGlobalResults = search.length > 0 && !activeGroup && globalSearchResults.length > 0;
|
|
6063
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(PopoverPrimitive5.Root, { open, onOpenChange, children: [
|
|
6064
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(PopoverPrimitive5.Trigger, { asChild: true, children }),
|
|
6065
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(PopoverPrimitive5.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
5978
6066
|
PopoverPrimitive5.Content,
|
|
5979
6067
|
{
|
|
5980
6068
|
sideOffset: 4,
|
|
5981
6069
|
align: "start",
|
|
6070
|
+
onCloseAutoFocus: (e) => e.preventDefault(),
|
|
5982
6071
|
className: cn(
|
|
5983
6072
|
"z-50 flex flex-col gap-xs overflow-clip p-xs",
|
|
5984
6073
|
"bg-[var(--color-dropdown-bg)] border border-[var(--color-dropdown-border)] rounded-md shadow-lg",
|
|
@@ -5987,111 +6076,178 @@ var PropertySelector = ({
|
|
|
5987
6076
|
"data-[side=bottom]:slide-in-from-top-2",
|
|
5988
6077
|
"min-w-[230px]"
|
|
5989
6078
|
),
|
|
5990
|
-
children:
|
|
5991
|
-
|
|
5992
|
-
|
|
5993
|
-
"
|
|
5994
|
-
|
|
5995
|
-
|
|
5996
|
-
onClick: () => setActiveGroup(g.group),
|
|
5997
|
-
className: "flex items-center gap-base p-base rounded-base cursor-pointer transition-colors hover:bg-[var(--color-dropdown-item-hover)]",
|
|
5998
|
-
children: [
|
|
5999
|
-
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
6079
|
+
children: [
|
|
6080
|
+
activeGroup === null ? (
|
|
6081
|
+
/* ── Level 1: Search + Categories ───────────────────────── */
|
|
6082
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex flex-col gap-xs", children: [
|
|
6083
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex items-center gap-base px-md py-base border border-[var(--color-input)] rounded-md", children: [
|
|
6084
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
6000
6085
|
import_icons27.Icon,
|
|
6001
6086
|
{
|
|
6002
|
-
icon:
|
|
6087
|
+
icon: import_icons27.faMagnifyingGlassOutline,
|
|
6003
6088
|
size: "sm",
|
|
6004
|
-
className: "shrink-0 text-[var(--color-
|
|
6089
|
+
className: "shrink-0 text-[var(--color-muted-foreground)]"
|
|
6005
6090
|
}
|
|
6006
6091
|
),
|
|
6007
|
-
/* @__PURE__ */ (0,
|
|
6008
|
-
|
|
6009
|
-
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
6010
|
-
import_icons27.Icon,
|
|
6092
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
6093
|
+
"input",
|
|
6011
6094
|
{
|
|
6012
|
-
|
|
6013
|
-
|
|
6014
|
-
|
|
6095
|
+
type: "text",
|
|
6096
|
+
value: search,
|
|
6097
|
+
onChange: (e) => setSearch(e.target.value),
|
|
6098
|
+
placeholder: "Search...",
|
|
6099
|
+
autoFocus: true,
|
|
6100
|
+
className: "flex-1 text-sm font-regular leading-sm text-[var(--color-foreground)] bg-transparent outline-none placeholder:text-[var(--color-muted-foreground)]"
|
|
6015
6101
|
}
|
|
6016
6102
|
)
|
|
6017
|
-
]
|
|
6018
|
-
|
|
6019
|
-
|
|
6020
|
-
|
|
6021
|
-
|
|
6022
|
-
|
|
6023
|
-
|
|
6024
|
-
|
|
6025
|
-
|
|
6026
|
-
|
|
6027
|
-
|
|
6028
|
-
|
|
6029
|
-
|
|
6030
|
-
|
|
6031
|
-
|
|
6032
|
-
|
|
6033
|
-
|
|
6034
|
-
|
|
6035
|
-
|
|
6103
|
+
] }),
|
|
6104
|
+
showGlobalResults ? (
|
|
6105
|
+
/* ── Global search results (flat property list) ─────── */
|
|
6106
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "flex flex-col max-h-[300px] overflow-y-auto", children: globalSearchResults.map((prop) => /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
6107
|
+
"button",
|
|
6108
|
+
{
|
|
6109
|
+
type: "button",
|
|
6110
|
+
onClick: () => {
|
|
6111
|
+
onSelect(prop);
|
|
6112
|
+
onOpenChange?.(false);
|
|
6113
|
+
},
|
|
6114
|
+
className: "flex items-center gap-base p-base rounded-base cursor-pointer transition-colors hover:bg-[var(--color-dropdown-item-hover)]",
|
|
6115
|
+
children: [
|
|
6116
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
6117
|
+
import_icons27.Icon,
|
|
6118
|
+
{
|
|
6119
|
+
icon: prop.icon,
|
|
6120
|
+
size: "sm",
|
|
6121
|
+
className: "shrink-0 text-[var(--color-dropdown-item-icon)]"
|
|
6122
|
+
}
|
|
6123
|
+
),
|
|
6124
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "flex-1 text-sm font-regular leading-sm text-[var(--color-dropdown-item-text)] text-left truncate", children: prop.label }),
|
|
6125
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "text-xs font-regular leading-xs text-[var(--color-muted-foreground)]", children: prop.groupLabel })
|
|
6126
|
+
]
|
|
6127
|
+
},
|
|
6128
|
+
prop.id
|
|
6129
|
+
)) })
|
|
6130
|
+
) : (
|
|
6131
|
+
/* ── Group list ─────────────────────────────────────── */
|
|
6132
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex flex-col", children: [
|
|
6133
|
+
filteredGroups.map((g) => /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
6134
|
+
"button",
|
|
6036
6135
|
{
|
|
6037
|
-
|
|
6038
|
-
|
|
6039
|
-
|
|
6040
|
-
|
|
6041
|
-
|
|
6042
|
-
|
|
6043
|
-
|
|
6044
|
-
|
|
6045
|
-
|
|
6046
|
-
|
|
6047
|
-
|
|
6048
|
-
|
|
6049
|
-
|
|
6050
|
-
|
|
6051
|
-
|
|
6052
|
-
|
|
6053
|
-
|
|
6054
|
-
|
|
6055
|
-
|
|
6056
|
-
|
|
6057
|
-
|
|
6058
|
-
|
|
6059
|
-
|
|
6060
|
-
|
|
6061
|
-
|
|
6062
|
-
|
|
6063
|
-
|
|
6064
|
-
|
|
6136
|
+
type: "button",
|
|
6137
|
+
onClick: () => {
|
|
6138
|
+
setActiveGroup(g.group);
|
|
6139
|
+
setSearch("");
|
|
6140
|
+
},
|
|
6141
|
+
className: "flex items-center gap-base p-base rounded-base cursor-pointer transition-colors hover:bg-[var(--color-dropdown-item-hover)]",
|
|
6142
|
+
children: [
|
|
6143
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
6144
|
+
import_icons27.Icon,
|
|
6145
|
+
{
|
|
6146
|
+
icon: g.groupIcon,
|
|
6147
|
+
size: "sm",
|
|
6148
|
+
className: "shrink-0 text-[var(--color-dropdown-item-icon)]"
|
|
6149
|
+
}
|
|
6150
|
+
),
|
|
6151
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "flex-1 text-sm font-regular leading-sm text-[var(--color-dropdown-item-text)] text-left truncate", children: g.groupLabel }),
|
|
6152
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "text-xs font-semibold leading-xs text-[var(--color-muted-foreground)]", children: g.count }),
|
|
6153
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
6154
|
+
import_icons27.Icon,
|
|
6155
|
+
{
|
|
6156
|
+
icon: import_icons27.faChevronRightOutline,
|
|
6157
|
+
size: "xs",
|
|
6158
|
+
className: "shrink-0 text-[var(--color-dropdown-item-icon)]"
|
|
6159
|
+
}
|
|
6160
|
+
)
|
|
6161
|
+
]
|
|
6162
|
+
},
|
|
6163
|
+
g.group
|
|
6164
|
+
)),
|
|
6165
|
+
filteredGroups.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "p-base text-sm text-[var(--color-muted-foreground)]", children: "No results" })
|
|
6166
|
+
] })
|
|
6065
6167
|
)
|
|
6066
|
-
] })
|
|
6067
|
-
|
|
6068
|
-
|
|
6168
|
+
] })
|
|
6169
|
+
) : (
|
|
6170
|
+
/* ── Level 2: Properties ─────────────────────────────────── */
|
|
6171
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex flex-col gap-xs", children: [
|
|
6172
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
6069
6173
|
"button",
|
|
6070
6174
|
{
|
|
6071
6175
|
type: "button",
|
|
6072
6176
|
onClick: () => {
|
|
6073
|
-
|
|
6074
|
-
|
|
6177
|
+
setActiveGroup(null);
|
|
6178
|
+
setSearch("");
|
|
6075
6179
|
},
|
|
6076
6180
|
className: "flex items-center gap-base p-base rounded-base cursor-pointer transition-colors hover:bg-[var(--color-dropdown-item-hover)]",
|
|
6077
6181
|
children: [
|
|
6078
|
-
/* @__PURE__ */ (0,
|
|
6182
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
6079
6183
|
import_icons27.Icon,
|
|
6080
6184
|
{
|
|
6081
|
-
icon:
|
|
6185
|
+
icon: import_icons27.faChevronLeftOutline,
|
|
6082
6186
|
size: "sm",
|
|
6083
6187
|
className: "shrink-0 text-[var(--color-dropdown-item-icon)]"
|
|
6084
6188
|
}
|
|
6085
6189
|
),
|
|
6086
|
-
/* @__PURE__ */ (0,
|
|
6190
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "flex-1 text-xs font-semibold leading-xs text-[var(--color-muted-foreground)] text-left truncate", children: activeGroupInfo?.groupLabel })
|
|
6087
6191
|
]
|
|
6088
|
-
}
|
|
6089
|
-
|
|
6090
|
-
)),
|
|
6091
|
-
|
|
6192
|
+
}
|
|
6193
|
+
),
|
|
6194
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex items-center gap-base px-md py-base border border-[var(--color-input)] rounded-md", children: [
|
|
6195
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
6196
|
+
import_icons27.Icon,
|
|
6197
|
+
{
|
|
6198
|
+
icon: import_icons27.faMagnifyingGlassOutline,
|
|
6199
|
+
size: "sm",
|
|
6200
|
+
className: "shrink-0 text-[var(--color-muted-foreground)]"
|
|
6201
|
+
}
|
|
6202
|
+
),
|
|
6203
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
6204
|
+
"input",
|
|
6205
|
+
{
|
|
6206
|
+
type: "text",
|
|
6207
|
+
value: search,
|
|
6208
|
+
onChange: (e) => setSearch(e.target.value),
|
|
6209
|
+
placeholder: "Search...",
|
|
6210
|
+
autoFocus: true,
|
|
6211
|
+
className: "flex-1 text-sm font-regular leading-sm text-[var(--color-foreground)] bg-transparent outline-none placeholder:text-[var(--color-muted-foreground)]"
|
|
6212
|
+
}
|
|
6213
|
+
)
|
|
6214
|
+
] }),
|
|
6215
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex flex-col max-h-[300px] overflow-y-auto", children: [
|
|
6216
|
+
filteredProperties.map((prop) => /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
6217
|
+
"button",
|
|
6218
|
+
{
|
|
6219
|
+
type: "button",
|
|
6220
|
+
onClick: () => {
|
|
6221
|
+
onSelect(prop);
|
|
6222
|
+
onOpenChange?.(false);
|
|
6223
|
+
},
|
|
6224
|
+
className: "flex items-center gap-base p-base rounded-base cursor-pointer transition-colors hover:bg-[var(--color-dropdown-item-hover)]",
|
|
6225
|
+
children: [
|
|
6226
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
6227
|
+
import_icons27.Icon,
|
|
6228
|
+
{
|
|
6229
|
+
icon: prop.icon,
|
|
6230
|
+
size: "sm",
|
|
6231
|
+
className: "shrink-0 text-[var(--color-dropdown-item-icon)]"
|
|
6232
|
+
}
|
|
6233
|
+
),
|
|
6234
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "flex-1 text-sm font-regular leading-sm text-[var(--color-dropdown-item-text)] text-left truncate", children: prop.label })
|
|
6235
|
+
]
|
|
6236
|
+
},
|
|
6237
|
+
prop.id
|
|
6238
|
+
)),
|
|
6239
|
+
filteredProperties.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "p-base text-sm text-[var(--color-muted-foreground)]", children: "No results" })
|
|
6240
|
+
] })
|
|
6092
6241
|
] })
|
|
6093
|
-
|
|
6094
|
-
|
|
6242
|
+
),
|
|
6243
|
+
showAdvancedFooter && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
6244
|
+
AdvancedFilterFooter,
|
|
6245
|
+
{
|
|
6246
|
+
onClick: handleAdvancedClick,
|
|
6247
|
+
count: advancedFilterCount
|
|
6248
|
+
}
|
|
6249
|
+
)
|
|
6250
|
+
]
|
|
6095
6251
|
}
|
|
6096
6252
|
) })
|
|
6097
6253
|
] });
|
|
@@ -6101,16 +6257,16 @@ PropertySelector.displayName = "PropertySelector";
|
|
|
6101
6257
|
// src/components/ui/filter/kebab-menu.tsx
|
|
6102
6258
|
var PopoverPrimitive6 = __toESM(require("@radix-ui/react-popover"));
|
|
6103
6259
|
var import_icons28 = require("@l3mpire/icons");
|
|
6104
|
-
var
|
|
6260
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
6105
6261
|
var KebabMenu = ({
|
|
6106
6262
|
onConvertToAdvanced,
|
|
6107
6263
|
onDelete,
|
|
6108
6264
|
open,
|
|
6109
6265
|
onOpenChange,
|
|
6110
6266
|
children
|
|
6111
|
-
}) => /* @__PURE__ */ (0,
|
|
6112
|
-
/* @__PURE__ */ (0,
|
|
6113
|
-
/* @__PURE__ */ (0,
|
|
6267
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(PopoverPrimitive6.Root, { open, onOpenChange, children: [
|
|
6268
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(PopoverPrimitive6.Trigger, { asChild: true, children }),
|
|
6269
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(PopoverPrimitive6.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
6114
6270
|
PopoverPrimitive6.Content,
|
|
6115
6271
|
{
|
|
6116
6272
|
sideOffset: 4,
|
|
@@ -6124,7 +6280,7 @@ var KebabMenu = ({
|
|
|
6124
6280
|
"min-w-[210px]"
|
|
6125
6281
|
),
|
|
6126
6282
|
children: [
|
|
6127
|
-
onConvertToAdvanced && /* @__PURE__ */ (0,
|
|
6283
|
+
onConvertToAdvanced && /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
6128
6284
|
"button",
|
|
6129
6285
|
{
|
|
6130
6286
|
type: "button",
|
|
@@ -6134,7 +6290,7 @@ var KebabMenu = ({
|
|
|
6134
6290
|
},
|
|
6135
6291
|
className: "flex items-center gap-base p-base rounded-base cursor-pointer transition-colors hover:bg-[var(--color-dropdown-item-hover)]",
|
|
6136
6292
|
children: [
|
|
6137
|
-
/* @__PURE__ */ (0,
|
|
6293
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
6138
6294
|
import_icons28.Icon,
|
|
6139
6295
|
{
|
|
6140
6296
|
icon: import_icons28.faArrowRightOutline,
|
|
@@ -6142,12 +6298,12 @@ var KebabMenu = ({
|
|
|
6142
6298
|
className: "shrink-0 text-[var(--color-dropdown-item-icon)]"
|
|
6143
6299
|
}
|
|
6144
6300
|
),
|
|
6145
|
-
/* @__PURE__ */ (0,
|
|
6301
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "text-sm font-regular leading-sm text-[var(--color-dropdown-item-text)]", children: "Convert to advanced" })
|
|
6146
6302
|
]
|
|
6147
6303
|
}
|
|
6148
6304
|
),
|
|
6149
|
-
onConvertToAdvanced && onDelete && /* @__PURE__ */ (0,
|
|
6150
|
-
onDelete && /* @__PURE__ */ (0,
|
|
6305
|
+
onConvertToAdvanced && onDelete && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "h-px mx-base my-xs bg-[var(--color-border)]" }),
|
|
6306
|
+
onDelete && /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
6151
6307
|
"button",
|
|
6152
6308
|
{
|
|
6153
6309
|
type: "button",
|
|
@@ -6157,7 +6313,7 @@ var KebabMenu = ({
|
|
|
6157
6313
|
},
|
|
6158
6314
|
className: "flex items-center gap-base p-base rounded-base cursor-pointer transition-colors hover:bg-[var(--color-dropdown-item-hover)]",
|
|
6159
6315
|
children: [
|
|
6160
|
-
/* @__PURE__ */ (0,
|
|
6316
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
6161
6317
|
import_icons28.Icon,
|
|
6162
6318
|
{
|
|
6163
6319
|
icon: import_icons28.faTrashOutline,
|
|
@@ -6165,7 +6321,7 @@ var KebabMenu = ({
|
|
|
6165
6321
|
className: "shrink-0 text-[var(--color-destructive)]"
|
|
6166
6322
|
}
|
|
6167
6323
|
),
|
|
6168
|
-
/* @__PURE__ */ (0,
|
|
6324
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "text-sm font-regular leading-sm text-[var(--color-destructive)]", children: "Delete filter" })
|
|
6169
6325
|
]
|
|
6170
6326
|
}
|
|
6171
6327
|
)
|
|
@@ -6179,7 +6335,7 @@ KebabMenu.displayName = "KebabMenu";
|
|
|
6179
6335
|
var React42 = __toESM(require("react"));
|
|
6180
6336
|
var PopoverPrimitive7 = __toESM(require("@radix-ui/react-popover"));
|
|
6181
6337
|
var import_icons29 = require("@l3mpire/icons");
|
|
6182
|
-
var
|
|
6338
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
6183
6339
|
var FilterEditor = ({
|
|
6184
6340
|
propertyDef,
|
|
6185
6341
|
condition,
|
|
@@ -6224,9 +6380,9 @@ var FilterEditor = ({
|
|
|
6224
6380
|
onOpenChange?.(false);
|
|
6225
6381
|
onClose();
|
|
6226
6382
|
};
|
|
6227
|
-
return /* @__PURE__ */ (0,
|
|
6228
|
-
/* @__PURE__ */ (0,
|
|
6229
|
-
/* @__PURE__ */ (0,
|
|
6383
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(PopoverPrimitive7.Root, { open, onOpenChange, children: [
|
|
6384
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(PopoverPrimitive7.Trigger, { asChild: true, children }),
|
|
6385
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(PopoverPrimitive7.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
6230
6386
|
PopoverPrimitive7.Content,
|
|
6231
6387
|
{
|
|
6232
6388
|
sideOffset: 4,
|
|
@@ -6240,8 +6396,8 @@ var FilterEditor = ({
|
|
|
6240
6396
|
"min-w-[240px]"
|
|
6241
6397
|
),
|
|
6242
6398
|
children: [
|
|
6243
|
-
/* @__PURE__ */ (0,
|
|
6244
|
-
/* @__PURE__ */ (0,
|
|
6399
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "flex items-center gap-base px-base pt-base pb-xs border-b border-[var(--color-border)]", children: [
|
|
6400
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
6245
6401
|
import_icons29.Icon,
|
|
6246
6402
|
{
|
|
6247
6403
|
icon: propertyDef.icon,
|
|
@@ -6249,8 +6405,8 @@ var FilterEditor = ({
|
|
|
6249
6405
|
className: "shrink-0 text-[var(--color-dropdown-item-icon)]"
|
|
6250
6406
|
}
|
|
6251
6407
|
),
|
|
6252
|
-
/* @__PURE__ */ (0,
|
|
6253
|
-
localOperator && view === "value" && /* @__PURE__ */ (0,
|
|
6408
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "text-sm font-semibold leading-sm text-[var(--color-foreground)]", children: propertyDef.label }),
|
|
6409
|
+
localOperator && view === "value" && /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
6254
6410
|
"button",
|
|
6255
6411
|
{
|
|
6256
6412
|
type: "button",
|
|
@@ -6263,14 +6419,14 @@ var FilterEditor = ({
|
|
|
6263
6419
|
}
|
|
6264
6420
|
)
|
|
6265
6421
|
] }),
|
|
6266
|
-
view === "operator" ? /* @__PURE__ */ (0,
|
|
6422
|
+
view === "operator" ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "p-xs", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
6267
6423
|
OperatorList,
|
|
6268
6424
|
{
|
|
6269
6425
|
dataType: propertyDef.type,
|
|
6270
6426
|
activeOperator: localOperator,
|
|
6271
6427
|
onSelect: handleOperatorSelect
|
|
6272
6428
|
}
|
|
6273
|
-
) }) : localOperator && /* @__PURE__ */ (0,
|
|
6429
|
+
) }) : localOperator && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
6274
6430
|
ValueInput,
|
|
6275
6431
|
{
|
|
6276
6432
|
dataType: propertyDef.type,
|
|
@@ -6291,7 +6447,7 @@ FilterEditor.displayName = "FilterEditor";
|
|
|
6291
6447
|
// src/components/ui/filter/interactive-filter-chip.tsx
|
|
6292
6448
|
var React43 = __toESM(require("react"));
|
|
6293
6449
|
var PopoverPrimitive8 = __toESM(require("@radix-ui/react-popover"));
|
|
6294
|
-
var
|
|
6450
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
6295
6451
|
function formatFilterValue(value) {
|
|
6296
6452
|
if (value == null) return void 0;
|
|
6297
6453
|
if (typeof value === "boolean") return value ? "Yes" : "No";
|
|
@@ -6324,9 +6480,9 @@ var SegmentPopover = ({
|
|
|
6324
6480
|
children,
|
|
6325
6481
|
align = "start",
|
|
6326
6482
|
minWidth = "240px"
|
|
6327
|
-
}) => /* @__PURE__ */ (0,
|
|
6328
|
-
/* @__PURE__ */ (0,
|
|
6329
|
-
/* @__PURE__ */ (0,
|
|
6483
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(PopoverPrimitive8.Root, { open, onOpenChange, children: [
|
|
6484
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(PopoverPrimitive8.Trigger, { asChild: true, children: trigger }),
|
|
6485
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(PopoverPrimitive8.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
6330
6486
|
PopoverPrimitive8.Content,
|
|
6331
6487
|
{
|
|
6332
6488
|
sideOffset: 4,
|
|
@@ -6359,12 +6515,20 @@ var InteractiveFilterChip = ({
|
|
|
6359
6515
|
const [valueOpen, setValueOpen] = React43.useState(false);
|
|
6360
6516
|
const [propertyOpen, setPropertyOpen] = React43.useState(false);
|
|
6361
6517
|
const [kebabOpen, setKebabOpen] = React43.useState(false);
|
|
6518
|
+
const [pendingValueOpen, setPendingValueOpen] = React43.useState(false);
|
|
6519
|
+
const autoOpenHandled = React43.useRef(false);
|
|
6362
6520
|
React43.useEffect(() => {
|
|
6363
|
-
if (autoOpen && condition.operator && !isNoValueOperator(condition.operator)) {
|
|
6364
|
-
|
|
6365
|
-
|
|
6521
|
+
if (autoOpen && !autoOpenHandled.current && condition.operator && !isNoValueOperator(condition.operator)) {
|
|
6522
|
+
autoOpenHandled.current = true;
|
|
6523
|
+
setValueOpen(true);
|
|
6366
6524
|
}
|
|
6367
|
-
}, []);
|
|
6525
|
+
}, [autoOpen, condition.operator]);
|
|
6526
|
+
React43.useEffect(() => {
|
|
6527
|
+
if (!operatorOpen && pendingValueOpen) {
|
|
6528
|
+
setPendingValueOpen(false);
|
|
6529
|
+
setValueOpen(true);
|
|
6530
|
+
}
|
|
6531
|
+
}, [operatorOpen, pendingValueOpen]);
|
|
6368
6532
|
const handleOperatorSelect = (op) => {
|
|
6369
6533
|
if (isNoValueOperator(op)) {
|
|
6370
6534
|
onUpdate({ ...condition, operator: op, value: null });
|
|
@@ -6374,7 +6538,7 @@ var InteractiveFilterChip = ({
|
|
|
6374
6538
|
onUpdate({ ...condition, operator: op, value: resetValue });
|
|
6375
6539
|
setOperatorOpen(false);
|
|
6376
6540
|
if (resetValue == null) {
|
|
6377
|
-
|
|
6541
|
+
setPendingValueOpen(true);
|
|
6378
6542
|
}
|
|
6379
6543
|
}
|
|
6380
6544
|
};
|
|
@@ -6388,7 +6552,7 @@ var InteractiveFilterChip = ({
|
|
|
6388
6552
|
const displayValue = formatFilterValue(condition.value);
|
|
6389
6553
|
const hasValue = hasOperator && displayValue != null;
|
|
6390
6554
|
const badgeCount = getBadgeCount(condition.value);
|
|
6391
|
-
return /* @__PURE__ */ (0,
|
|
6555
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
6392
6556
|
"div",
|
|
6393
6557
|
{
|
|
6394
6558
|
className: cn(
|
|
@@ -6397,7 +6561,7 @@ var InteractiveFilterChip = ({
|
|
|
6397
6561
|
className
|
|
6398
6562
|
),
|
|
6399
6563
|
children: [
|
|
6400
|
-
properties ? /* @__PURE__ */ (0,
|
|
6564
|
+
properties ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
6401
6565
|
PropertySelector,
|
|
6402
6566
|
{
|
|
6403
6567
|
properties,
|
|
@@ -6407,7 +6571,7 @@ var InteractiveFilterChip = ({
|
|
|
6407
6571
|
},
|
|
6408
6572
|
open: propertyOpen,
|
|
6409
6573
|
onOpenChange: setPropertyOpen,
|
|
6410
|
-
children: /* @__PURE__ */ (0,
|
|
6574
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
6411
6575
|
FilterChipSegment,
|
|
6412
6576
|
{
|
|
6413
6577
|
segmentType: "property",
|
|
@@ -6418,7 +6582,7 @@ var InteractiveFilterChip = ({
|
|
|
6418
6582
|
}
|
|
6419
6583
|
) })
|
|
6420
6584
|
}
|
|
6421
|
-
) : /* @__PURE__ */ (0,
|
|
6585
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
6422
6586
|
FilterChipSegment,
|
|
6423
6587
|
{
|
|
6424
6588
|
segmentType: "property",
|
|
@@ -6427,13 +6591,13 @@ var InteractiveFilterChip = ({
|
|
|
6427
6591
|
label: propertyDef.label
|
|
6428
6592
|
}
|
|
6429
6593
|
),
|
|
6430
|
-
/* @__PURE__ */ (0,
|
|
6594
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
6431
6595
|
SegmentPopover,
|
|
6432
6596
|
{
|
|
6433
6597
|
open: operatorOpen,
|
|
6434
6598
|
onOpenChange: setOperatorOpen,
|
|
6435
6599
|
minWidth: "180px",
|
|
6436
|
-
trigger: /* @__PURE__ */ (0,
|
|
6600
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
6437
6601
|
FilterChipSegment,
|
|
6438
6602
|
{
|
|
6439
6603
|
segmentType: hasOperator ? "operator" : "placeholder",
|
|
@@ -6442,7 +6606,7 @@ var InteractiveFilterChip = ({
|
|
|
6442
6606
|
onClick: () => setOperatorOpen(true)
|
|
6443
6607
|
}
|
|
6444
6608
|
) }),
|
|
6445
|
-
children: /* @__PURE__ */ (0,
|
|
6609
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "p-xs", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
6446
6610
|
OperatorList,
|
|
6447
6611
|
{
|
|
6448
6612
|
dataType: propertyDef.type,
|
|
@@ -6452,13 +6616,13 @@ var InteractiveFilterChip = ({
|
|
|
6452
6616
|
) })
|
|
6453
6617
|
}
|
|
6454
6618
|
),
|
|
6455
|
-
hasOperator && condition.operator && !isNoValueOperator(condition.operator) && /* @__PURE__ */ (0,
|
|
6619
|
+
hasOperator && condition.operator && !isNoValueOperator(condition.operator) && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
6456
6620
|
SegmentPopover,
|
|
6457
6621
|
{
|
|
6458
6622
|
open: valueOpen,
|
|
6459
6623
|
onOpenChange: setValueOpen,
|
|
6460
6624
|
minWidth: "240px",
|
|
6461
|
-
trigger: /* @__PURE__ */ (0,
|
|
6625
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
6462
6626
|
FilterChipSegment,
|
|
6463
6627
|
{
|
|
6464
6628
|
segmentType: hasValue ? "value" : "placeholder",
|
|
@@ -6468,7 +6632,7 @@ var InteractiveFilterChip = ({
|
|
|
6468
6632
|
onClick: () => setValueOpen(true)
|
|
6469
6633
|
}
|
|
6470
6634
|
) }),
|
|
6471
|
-
children: /* @__PURE__ */ (0,
|
|
6635
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
6472
6636
|
ValueInput,
|
|
6473
6637
|
{
|
|
6474
6638
|
dataType: propertyDef.type,
|
|
@@ -6481,7 +6645,7 @@ var InteractiveFilterChip = ({
|
|
|
6481
6645
|
)
|
|
6482
6646
|
}
|
|
6483
6647
|
),
|
|
6484
|
-
hasOperator && condition.operator && isNoValueOperator(condition.operator) && /* @__PURE__ */ (0,
|
|
6648
|
+
hasOperator && condition.operator && isNoValueOperator(condition.operator) && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
6485
6649
|
FilterChipSegment,
|
|
6486
6650
|
{
|
|
6487
6651
|
segmentType: "value",
|
|
@@ -6489,14 +6653,14 @@ var InteractiveFilterChip = ({
|
|
|
6489
6653
|
label: condition.operator
|
|
6490
6654
|
}
|
|
6491
6655
|
),
|
|
6492
|
-
hasOperator && /* @__PURE__ */ (0,
|
|
6656
|
+
hasOperator && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
6493
6657
|
KebabMenu,
|
|
6494
6658
|
{
|
|
6495
6659
|
open: kebabOpen,
|
|
6496
6660
|
onOpenChange: setKebabOpen,
|
|
6497
6661
|
onConvertToAdvanced,
|
|
6498
6662
|
onDelete,
|
|
6499
|
-
children: /* @__PURE__ */ (0,
|
|
6663
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
6500
6664
|
FilterChipSegment,
|
|
6501
6665
|
{
|
|
6502
6666
|
segmentType: "button",
|
|
@@ -6521,7 +6685,7 @@ var import_icons34 = require("@l3mpire/icons");
|
|
|
6521
6685
|
// src/components/ui/filter/advanced-chip.tsx
|
|
6522
6686
|
var React44 = __toESM(require("react"));
|
|
6523
6687
|
var import_icons30 = require("@l3mpire/icons");
|
|
6524
|
-
var
|
|
6688
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
6525
6689
|
var btnBase = [
|
|
6526
6690
|
"flex items-center justify-center",
|
|
6527
6691
|
"min-h-[32px] max-h-[32px]",
|
|
@@ -6531,8 +6695,8 @@ var btnBase = [
|
|
|
6531
6695
|
"hover:from-[var(--color-btn-outlined-neutral-bg-hover)] hover:to-[var(--color-btn-outlined-neutral-bg-gradient-to-hover)]"
|
|
6532
6696
|
];
|
|
6533
6697
|
var AdvancedChip = React44.forwardRef(
|
|
6534
|
-
({ className, count, onClear, onClick, ...props }, ref) => /* @__PURE__ */ (0,
|
|
6535
|
-
/* @__PURE__ */ (0,
|
|
6698
|
+
({ className, count, onClear, onClick, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: cn("inline-flex items-center", className), children: [
|
|
6699
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
|
|
6536
6700
|
"button",
|
|
6537
6701
|
{
|
|
6538
6702
|
ref,
|
|
@@ -6545,12 +6709,12 @@ var AdvancedChip = React44.forwardRef(
|
|
|
6545
6709
|
),
|
|
6546
6710
|
...props,
|
|
6547
6711
|
children: [
|
|
6548
|
-
/* @__PURE__ */ (0,
|
|
6549
|
-
/* @__PURE__ */ (0,
|
|
6712
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "text-sm font-semibold leading-sm whitespace-nowrap text-[var(--color-foreground)]", children: "Advanced filters" }),
|
|
6713
|
+
count > 0 && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "flex items-center p-2xs rounded-xs bg-filter-chip-badge-bg", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "text-[10px] font-semibold leading-2xs text-filter-chip-badge-text", children: count }) })
|
|
6550
6714
|
]
|
|
6551
6715
|
}
|
|
6552
6716
|
),
|
|
6553
|
-
onClear && /* @__PURE__ */ (0,
|
|
6717
|
+
onClear && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
6554
6718
|
"button",
|
|
6555
6719
|
{
|
|
6556
6720
|
type: "button",
|
|
@@ -6564,7 +6728,7 @@ var AdvancedChip = React44.forwardRef(
|
|
|
6564
6728
|
"rounded-r-md -ml-px"
|
|
6565
6729
|
),
|
|
6566
6730
|
"aria-label": "Clear all advanced filters",
|
|
6567
|
-
children: /* @__PURE__ */ (0,
|
|
6731
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_icons30.Icon, { icon: import_icons30.faXmarkOutline, size: "sm", className: "text-[var(--color-foreground)]" })
|
|
6568
6732
|
}
|
|
6569
6733
|
)
|
|
6570
6734
|
] })
|
|
@@ -6580,7 +6744,7 @@ var import_icons32 = require("@l3mpire/icons");
|
|
|
6580
6744
|
var React45 = __toESM(require("react"));
|
|
6581
6745
|
var PopoverPrimitive9 = __toESM(require("@radix-ui/react-popover"));
|
|
6582
6746
|
var import_icons31 = require("@l3mpire/icons");
|
|
6583
|
-
var
|
|
6747
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
6584
6748
|
var selectBtnStyle = [
|
|
6585
6749
|
"flex items-center gap-base",
|
|
6586
6750
|
"px-base py-sm",
|
|
@@ -6614,8 +6778,8 @@ var AdvancedRow = ({
|
|
|
6614
6778
|
onUpdate({ ...condition, value: val });
|
|
6615
6779
|
};
|
|
6616
6780
|
const displayValue = condition.value == null ? "" : typeof condition.value === "string" ? condition.value : String(condition.value);
|
|
6617
|
-
return /* @__PURE__ */ (0,
|
|
6618
|
-
connector === "Where" ? /* @__PURE__ */ (0,
|
|
6781
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "flex items-center gap-base w-full min-w-0", children: [
|
|
6782
|
+
connector === "Where" ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "shrink-0 w-[64px] flex items-center justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "text-xs font-semibold leading-xs text-[var(--color-muted-foreground)]", children: "Where" }) }) : /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
6619
6783
|
"button",
|
|
6620
6784
|
{
|
|
6621
6785
|
type: "button",
|
|
@@ -6625,26 +6789,26 @@ var AdvancedRow = ({
|
|
|
6625
6789
|
"min-w-[64px] min-h-[24px] max-h-[24px] p-xs",
|
|
6626
6790
|
"bg-gradient-to-t from-[var(--color-btn-outlined-neutral-bg-default)] from-[10%] to-[var(--color-btn-outlined-neutral-bg-gradient-to-default)]",
|
|
6627
6791
|
"border border-[var(--color-btn-outlined-neutral-border-default)] rounded-base shadow-sm",
|
|
6628
|
-
"cursor-pointer transition-colors text-xs font-
|
|
6792
|
+
"cursor-pointer transition-colors text-xs font-semibold leading-xs text-[var(--color-foreground)]",
|
|
6629
6793
|
"hover:from-[var(--color-btn-outlined-neutral-bg-hover)] hover:to-[var(--color-btn-outlined-neutral-bg-gradient-to-hover)]"
|
|
6630
6794
|
),
|
|
6631
6795
|
children: [
|
|
6632
6796
|
connector,
|
|
6633
|
-
/* @__PURE__ */ (0,
|
|
6797
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_icons31.Icon, { icon: import_icons31.faRefreshOutline, size: "xs", className: "text-[var(--color-foreground)]" })
|
|
6634
6798
|
]
|
|
6635
6799
|
}
|
|
6636
6800
|
),
|
|
6637
|
-
/* @__PURE__ */ (0,
|
|
6638
|
-
/* @__PURE__ */ (0,
|
|
6639
|
-
/* @__PURE__ */ (0,
|
|
6640
|
-
/* @__PURE__ */ (0,
|
|
6801
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(PopoverPrimitive9.Root, { open: propertyOpen, onOpenChange: setPropertyOpen, children: [
|
|
6802
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(PopoverPrimitive9.Trigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("button", { type: "button", className: cn(selectBtnStyle, "min-w-0"), children: [
|
|
6803
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_icons31.Icon, { icon: propertyDef.icon, size: "sm", className: "shrink-0 text-[var(--color-muted-foreground)]" }),
|
|
6804
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("span", { className: "text-sm font-regular leading-sm text-[var(--color-foreground)] whitespace-nowrap truncate", children: [
|
|
6641
6805
|
propertyDef.groupLabel,
|
|
6642
6806
|
" > ",
|
|
6643
6807
|
propertyDef.label
|
|
6644
6808
|
] }),
|
|
6645
|
-
/* @__PURE__ */ (0,
|
|
6809
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_icons31.Icon, { icon: import_icons31.faChevronDownOutline, size: "xs", className: "shrink-0 text-[var(--color-foreground)]" })
|
|
6646
6810
|
] }) }),
|
|
6647
|
-
/* @__PURE__ */ (0,
|
|
6811
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(PopoverPrimitive9.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
6648
6812
|
PopoverPrimitive9.Content,
|
|
6649
6813
|
{
|
|
6650
6814
|
sideOffset: 4,
|
|
@@ -6656,7 +6820,7 @@ var AdvancedRow = ({
|
|
|
6656
6820
|
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0",
|
|
6657
6821
|
"min-w-[200px]"
|
|
6658
6822
|
),
|
|
6659
|
-
children: properties.map((p) => /* @__PURE__ */ (0,
|
|
6823
|
+
children: properties.map((p) => /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
6660
6824
|
"button",
|
|
6661
6825
|
{
|
|
6662
6826
|
type: "button",
|
|
@@ -6670,8 +6834,8 @@ var AdvancedRow = ({
|
|
|
6670
6834
|
p.id === condition.propertyId && "bg-[var(--color-dropdown-item-hover)]"
|
|
6671
6835
|
),
|
|
6672
6836
|
children: [
|
|
6673
|
-
/* @__PURE__ */ (0,
|
|
6674
|
-
/* @__PURE__ */ (0,
|
|
6837
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_icons31.Icon, { icon: p.icon, size: "sm", className: "shrink-0 text-[var(--color-dropdown-item-icon)]" }),
|
|
6838
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "text-sm font-regular leading-sm text-[var(--color-dropdown-item-text)] truncate", children: p.label })
|
|
6675
6839
|
]
|
|
6676
6840
|
},
|
|
6677
6841
|
p.id
|
|
@@ -6679,12 +6843,12 @@ var AdvancedRow = ({
|
|
|
6679
6843
|
}
|
|
6680
6844
|
) })
|
|
6681
6845
|
] }),
|
|
6682
|
-
/* @__PURE__ */ (0,
|
|
6683
|
-
/* @__PURE__ */ (0,
|
|
6684
|
-
/* @__PURE__ */ (0,
|
|
6685
|
-
/* @__PURE__ */ (0,
|
|
6846
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(PopoverPrimitive9.Root, { open: operatorOpen, onOpenChange: setOperatorOpen, children: [
|
|
6847
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(PopoverPrimitive9.Trigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("button", { type: "button", className: cn(selectBtnStyle, "min-w-0"), children: [
|
|
6848
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "text-sm font-regular leading-sm text-[var(--color-foreground)] whitespace-nowrap truncate text-left", children: condition.operator ?? "Select" }),
|
|
6849
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_icons31.Icon, { icon: import_icons31.faChevronDownOutline, size: "xs", className: "shrink-0 text-[var(--color-foreground)]" })
|
|
6686
6850
|
] }) }),
|
|
6687
|
-
/* @__PURE__ */ (0,
|
|
6851
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(PopoverPrimitive9.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
6688
6852
|
PopoverPrimitive9.Content,
|
|
6689
6853
|
{
|
|
6690
6854
|
sideOffset: 4,
|
|
@@ -6696,7 +6860,7 @@ var AdvancedRow = ({
|
|
|
6696
6860
|
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0",
|
|
6697
6861
|
"min-w-[160px]"
|
|
6698
6862
|
),
|
|
6699
|
-
children: /* @__PURE__ */ (0,
|
|
6863
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
6700
6864
|
OperatorList,
|
|
6701
6865
|
{
|
|
6702
6866
|
dataType: propertyDef.type,
|
|
@@ -6707,7 +6871,7 @@ var AdvancedRow = ({
|
|
|
6707
6871
|
}
|
|
6708
6872
|
) })
|
|
6709
6873
|
] }),
|
|
6710
|
-
condition.operator && !isNoValueOperator(condition.operator) && /* @__PURE__ */ (0,
|
|
6874
|
+
condition.operator && !isNoValueOperator(condition.operator) && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
6711
6875
|
"input",
|
|
6712
6876
|
{
|
|
6713
6877
|
type: "text",
|
|
@@ -6723,14 +6887,14 @@ var AdvancedRow = ({
|
|
|
6723
6887
|
)
|
|
6724
6888
|
}
|
|
6725
6889
|
),
|
|
6726
|
-
/* @__PURE__ */ (0,
|
|
6890
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
6727
6891
|
"button",
|
|
6728
6892
|
{
|
|
6729
6893
|
type: "button",
|
|
6730
6894
|
onClick: onDelete,
|
|
6731
6895
|
className: "ml-auto shrink-0 flex items-center justify-center p-sm rounded-md cursor-pointer transition-colors hover:bg-[var(--color-accent)]",
|
|
6732
6896
|
"aria-label": "Remove filter",
|
|
6733
|
-
children: /* @__PURE__ */ (0,
|
|
6897
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_icons31.Icon, { icon: import_icons31.faXmarkOutline, size: "sm", className: "text-[var(--color-foreground)]" })
|
|
6734
6898
|
}
|
|
6735
6899
|
)
|
|
6736
6900
|
] });
|
|
@@ -6738,13 +6902,13 @@ var AdvancedRow = ({
|
|
|
6738
6902
|
AdvancedRow.displayName = "AdvancedRow";
|
|
6739
6903
|
|
|
6740
6904
|
// src/components/ui/filter/advanced-popover.tsx
|
|
6741
|
-
var
|
|
6905
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
6742
6906
|
var outlinedBtn = [
|
|
6743
6907
|
"flex items-center gap-sm px-base py-sm",
|
|
6744
6908
|
"min-h-[32px] max-h-[32px] min-w-[80px]",
|
|
6745
6909
|
"bg-gradient-to-t from-[var(--color-btn-outlined-neutral-bg-default)] from-[10%] to-[var(--color-btn-outlined-neutral-bg-gradient-to-default)]",
|
|
6746
6910
|
"border border-[var(--color-btn-outlined-neutral-border-default)] rounded-md shadow-sm",
|
|
6747
|
-
"cursor-pointer transition-colors text-sm font-
|
|
6911
|
+
"cursor-pointer transition-colors text-sm font-semibold leading-sm text-[var(--color-foreground)]",
|
|
6748
6912
|
"hover:from-[var(--color-btn-outlined-neutral-bg-hover)] hover:to-[var(--color-btn-outlined-neutral-bg-gradient-to-hover)]"
|
|
6749
6913
|
];
|
|
6750
6914
|
var AdvancedPopover = ({
|
|
@@ -6756,7 +6920,7 @@ var AdvancedPopover = ({
|
|
|
6756
6920
|
children
|
|
6757
6921
|
}) => {
|
|
6758
6922
|
const [addSelectorOpen, setAddSelectorOpen] = React46.useState(false);
|
|
6759
|
-
const [
|
|
6923
|
+
const [draftPickerOpen, setDraftPickerOpen] = React46.useState(false);
|
|
6760
6924
|
const getPropertyDef = (propertyId) => properties.find((p) => p.id === propertyId);
|
|
6761
6925
|
const handleUpdateFilter = (updated) => {
|
|
6762
6926
|
onFiltersChange(filters.map((f) => f.id === updated.id ? updated : f));
|
|
@@ -6780,19 +6944,21 @@ var AdvancedPopover = ({
|
|
|
6780
6944
|
onOpenChange?.(false);
|
|
6781
6945
|
};
|
|
6782
6946
|
const toggleLogicOp = (filterId) => {
|
|
6783
|
-
|
|
6784
|
-
|
|
6785
|
-
|
|
6786
|
-
|
|
6947
|
+
onFiltersChange(
|
|
6948
|
+
filters.map(
|
|
6949
|
+
(f) => f.id === filterId ? { ...f, logicOperator: (f.logicOperator ?? "and") === "and" ? "or" : "and" } : f
|
|
6950
|
+
)
|
|
6951
|
+
);
|
|
6787
6952
|
};
|
|
6788
|
-
return /* @__PURE__ */ (0,
|
|
6789
|
-
/* @__PURE__ */ (0,
|
|
6790
|
-
/* @__PURE__ */ (0,
|
|
6953
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(PopoverPrimitive10.Root, { open, onOpenChange, children: [
|
|
6954
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(PopoverPrimitive10.Trigger, { asChild: true, children }),
|
|
6955
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(PopoverPrimitive10.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
|
|
6791
6956
|
PopoverPrimitive10.Content,
|
|
6792
6957
|
{
|
|
6793
6958
|
sideOffset: 4,
|
|
6794
6959
|
align: "start",
|
|
6795
6960
|
collisionPadding: 16,
|
|
6961
|
+
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
6796
6962
|
className: cn(
|
|
6797
6963
|
"z-50 flex flex-col",
|
|
6798
6964
|
"bg-[var(--color-background)] rounded-md shadow-lg",
|
|
@@ -6802,14 +6968,14 @@ var AdvancedPopover = ({
|
|
|
6802
6968
|
"w-[min(520px,calc(100vw-32px))]"
|
|
6803
6969
|
),
|
|
6804
6970
|
children: [
|
|
6805
|
-
/* @__PURE__ */ (0,
|
|
6971
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex flex-col gap-base p-base", children: [
|
|
6806
6972
|
filters.map((filter, i) => {
|
|
6807
6973
|
const propDef = getPropertyDef(filter.propertyId);
|
|
6808
6974
|
if (!propDef) return null;
|
|
6809
|
-
return /* @__PURE__ */ (0,
|
|
6975
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
6810
6976
|
AdvancedRow,
|
|
6811
6977
|
{
|
|
6812
|
-
connector: i === 0 ? "Where" : (
|
|
6978
|
+
connector: i === 0 ? "Where" : (filter.logicOperator ?? "and") === "and" ? "And" : "Or",
|
|
6813
6979
|
onConnectorToggle: i > 0 ? () => toggleLogicOp(filter.id) : void 0,
|
|
6814
6980
|
propertyDef: propDef,
|
|
6815
6981
|
condition: filter,
|
|
@@ -6821,28 +6987,64 @@ var AdvancedPopover = ({
|
|
|
6821
6987
|
filter.id
|
|
6822
6988
|
);
|
|
6823
6989
|
}),
|
|
6824
|
-
filters.length === 0 && /*
|
|
6990
|
+
filters.length === 0 && /* ── Draft row: inline "Select property" placeholder ──── */
|
|
6991
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex items-center gap-base w-full min-w-0", children: [
|
|
6992
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "shrink-0 w-[64px] flex items-center justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "text-xs font-semibold leading-xs text-[var(--color-muted-foreground)]", children: "Where" }) }),
|
|
6993
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
6994
|
+
PropertySelector,
|
|
6995
|
+
{
|
|
6996
|
+
properties,
|
|
6997
|
+
onSelect: handleAddFilter,
|
|
6998
|
+
open: draftPickerOpen,
|
|
6999
|
+
onOpenChange: setDraftPickerOpen,
|
|
7000
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
|
|
7001
|
+
"button",
|
|
7002
|
+
{
|
|
7003
|
+
type: "button",
|
|
7004
|
+
className: cn(
|
|
7005
|
+
"flex items-center gap-base px-base py-sm min-w-0",
|
|
7006
|
+
"bg-gradient-to-t from-[var(--color-btn-outlined-neutral-bg-default)] to-[var(--color-btn-outlined-neutral-bg-gradient-to-default)]",
|
|
7007
|
+
"border border-[var(--color-btn-outlined-neutral-border-default)] rounded-md shadow-sm",
|
|
7008
|
+
"cursor-pointer transition-colors",
|
|
7009
|
+
"hover:from-[var(--color-btn-outlined-neutral-bg-hover)] hover:to-[var(--color-btn-outlined-neutral-bg-gradient-to-hover)]"
|
|
7010
|
+
),
|
|
7011
|
+
children: [
|
|
7012
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "text-sm font-regular leading-sm text-[var(--color-muted-foreground)] whitespace-nowrap", children: "Select property" }),
|
|
7013
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
7014
|
+
import_icons32.Icon,
|
|
7015
|
+
{
|
|
7016
|
+
icon: import_icons32.faChevronDownOutline,
|
|
7017
|
+
size: "xs",
|
|
7018
|
+
className: "shrink-0 text-[var(--color-foreground)]"
|
|
7019
|
+
}
|
|
7020
|
+
)
|
|
7021
|
+
]
|
|
7022
|
+
}
|
|
7023
|
+
)
|
|
7024
|
+
}
|
|
7025
|
+
)
|
|
7026
|
+
] })
|
|
6825
7027
|
] }),
|
|
6826
|
-
/* @__PURE__ */ (0,
|
|
6827
|
-
/* @__PURE__ */ (0,
|
|
7028
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex items-center justify-between p-base border-t border-[var(--color-border)]", children: [
|
|
7029
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
6828
7030
|
PropertySelector,
|
|
6829
7031
|
{
|
|
6830
7032
|
properties,
|
|
6831
7033
|
onSelect: handleAddFilter,
|
|
6832
7034
|
open: addSelectorOpen,
|
|
6833
7035
|
onOpenChange: setAddSelectorOpen,
|
|
6834
|
-
children: /* @__PURE__ */ (0,
|
|
6835
|
-
/* @__PURE__ */ (0,
|
|
7036
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("button", { type: "button", className: cn(outlinedBtn), children: [
|
|
7037
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_icons32.Icon, { icon: import_icons32.faPlusOutline, size: "sm", className: "text-[var(--color-foreground)]" }),
|
|
6836
7038
|
"Add filter"
|
|
6837
7039
|
] })
|
|
6838
7040
|
}
|
|
6839
7041
|
),
|
|
6840
|
-
/* @__PURE__ */ (0,
|
|
7042
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
6841
7043
|
"button",
|
|
6842
7044
|
{
|
|
6843
7045
|
type: "button",
|
|
6844
7046
|
onClick: handleClearAll,
|
|
6845
|
-
className: "text-sm font-
|
|
7047
|
+
className: "text-sm font-semibold leading-sm text-[var(--color-foreground)] cursor-pointer transition-colors hover:opacity-70 px-base py-sm",
|
|
6846
7048
|
children: "Clear all filters"
|
|
6847
7049
|
}
|
|
6848
7050
|
)
|
|
@@ -6858,18 +7060,27 @@ AdvancedPopover.displayName = "AdvancedPopover";
|
|
|
6858
7060
|
var React47 = __toESM(require("react"));
|
|
6859
7061
|
var PopoverPrimitive11 = __toESM(require("@radix-ui/react-popover"));
|
|
6860
7062
|
var import_icons33 = require("@l3mpire/icons");
|
|
6861
|
-
var
|
|
7063
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
6862
7064
|
var SummaryChip = ({
|
|
6863
7065
|
count,
|
|
6864
7066
|
filters,
|
|
6865
7067
|
properties,
|
|
6866
7068
|
onFiltersChange,
|
|
6867
7069
|
onClearAll,
|
|
6868
|
-
|
|
7070
|
+
children,
|
|
7071
|
+
className,
|
|
7072
|
+
open: openProp,
|
|
7073
|
+
onOpenChange
|
|
6869
7074
|
}) => {
|
|
6870
|
-
const [
|
|
7075
|
+
const [uncontrolledOpen, setUncontrolledOpen] = React47.useState(false);
|
|
7076
|
+
const isControlled = openProp !== void 0;
|
|
7077
|
+
const open = isControlled ? openProp : uncontrolledOpen;
|
|
7078
|
+
const setOpen = (v) => {
|
|
7079
|
+
if (!isControlled) setUncontrolledOpen(v);
|
|
7080
|
+
onOpenChange?.(v);
|
|
7081
|
+
};
|
|
6871
7082
|
const [addSelectorOpen, setAddSelectorOpen] = React47.useState(false);
|
|
6872
|
-
const [
|
|
7083
|
+
const [draftPickerOpen, setDraftPickerOpen] = React47.useState(false);
|
|
6873
7084
|
const getPropertyDef = (propertyId) => properties.find((p) => p.id === propertyId);
|
|
6874
7085
|
const handleUpdateFilter = (updated) => {
|
|
6875
7086
|
onFiltersChange(filters.map((f) => f.id === updated.id ? updated : f));
|
|
@@ -6890,8 +7101,15 @@ var SummaryChip = ({
|
|
|
6890
7101
|
onFiltersChange([...filters, newFilter]);
|
|
6891
7102
|
setAddSelectorOpen(false);
|
|
6892
7103
|
};
|
|
6893
|
-
|
|
6894
|
-
|
|
7104
|
+
const toggleLogicOp = (filterId) => {
|
|
7105
|
+
onFiltersChange(
|
|
7106
|
+
filters.map(
|
|
7107
|
+
(f) => f.id === filterId ? { ...f, logicOperator: (f.logicOperator ?? "and") === "and" ? "or" : "and" } : f
|
|
7108
|
+
)
|
|
7109
|
+
);
|
|
7110
|
+
};
|
|
7111
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(PopoverPrimitive11.Root, { open, onOpenChange: setOpen, children: [
|
|
7112
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(PopoverPrimitive11.Trigger, { asChild: true, children: children ?? /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
|
|
6895
7113
|
"button",
|
|
6896
7114
|
{
|
|
6897
7115
|
type: "button",
|
|
@@ -6905,7 +7123,7 @@ var SummaryChip = ({
|
|
|
6905
7123
|
className
|
|
6906
7124
|
),
|
|
6907
7125
|
children: [
|
|
6908
|
-
/* @__PURE__ */ (0,
|
|
7126
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
6909
7127
|
import_icons33.Icon,
|
|
6910
7128
|
{
|
|
6911
7129
|
icon: import_icons33.faSlidersOutline,
|
|
@@ -6913,17 +7131,18 @@ var SummaryChip = ({
|
|
|
6913
7131
|
className: "shrink-0 text-[var(--color-foreground)]"
|
|
6914
7132
|
}
|
|
6915
7133
|
),
|
|
6916
|
-
/* @__PURE__ */ (0,
|
|
6917
|
-
count > 0 && /* @__PURE__ */ (0,
|
|
7134
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "text-sm font-semibold leading-sm whitespace-nowrap text-[var(--color-foreground)]", children: "Filters" }),
|
|
7135
|
+
count > 0 && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "flex items-center p-2xs rounded-xs bg-filter-chip-badge-bg", children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "text-[10px] font-semibold leading-2xs text-filter-chip-badge-text", children: count }) })
|
|
6918
7136
|
]
|
|
6919
7137
|
}
|
|
6920
7138
|
) }),
|
|
6921
|
-
/* @__PURE__ */ (0,
|
|
7139
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(PopoverPrimitive11.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
|
|
6922
7140
|
PopoverPrimitive11.Content,
|
|
6923
7141
|
{
|
|
6924
7142
|
sideOffset: 4,
|
|
6925
7143
|
align: "start",
|
|
6926
7144
|
collisionPadding: 16,
|
|
7145
|
+
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
6927
7146
|
className: cn(
|
|
6928
7147
|
"z-50 flex flex-col overflow-clip",
|
|
6929
7148
|
"bg-[var(--color-dropdown-bg)] border border-[var(--color-dropdown-border)] rounded-md shadow-lg",
|
|
@@ -6933,15 +7152,15 @@ var SummaryChip = ({
|
|
|
6933
7152
|
"w-[min(520px,calc(100vw-32px))]"
|
|
6934
7153
|
),
|
|
6935
7154
|
children: [
|
|
6936
|
-
/* @__PURE__ */ (0,
|
|
7155
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "flex flex-col gap-base p-base", children: [
|
|
6937
7156
|
filters.map((filter, i) => {
|
|
6938
7157
|
const propDef = getPropertyDef(filter.propertyId);
|
|
6939
7158
|
if (!propDef) return null;
|
|
6940
|
-
return /* @__PURE__ */ (0,
|
|
7159
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
6941
7160
|
AdvancedRow,
|
|
6942
7161
|
{
|
|
6943
|
-
connector: i === 0 ? "Where" : (
|
|
6944
|
-
onConnectorToggle: i > 0 ? () =>
|
|
7162
|
+
connector: i === 0 ? "Where" : (filter.logicOperator ?? "and") === "and" ? "And" : "Or",
|
|
7163
|
+
onConnectorToggle: i > 0 ? () => toggleLogicOp(filter.id) : void 0,
|
|
6945
7164
|
propertyDef: propDef,
|
|
6946
7165
|
condition: filter,
|
|
6947
7166
|
properties,
|
|
@@ -6952,17 +7171,53 @@ var SummaryChip = ({
|
|
|
6952
7171
|
filter.id
|
|
6953
7172
|
);
|
|
6954
7173
|
}),
|
|
6955
|
-
filters.length === 0 && /*
|
|
7174
|
+
filters.length === 0 && /* ── Draft row: inline "Select property" placeholder ──── */
|
|
7175
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "flex items-center gap-base w-full min-w-0", children: [
|
|
7176
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "shrink-0 w-[64px] flex items-center justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "text-xs font-semibold leading-xs text-[var(--color-muted-foreground)]", children: "Where" }) }),
|
|
7177
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
7178
|
+
PropertySelector,
|
|
7179
|
+
{
|
|
7180
|
+
properties,
|
|
7181
|
+
onSelect: handleAddFilter,
|
|
7182
|
+
open: draftPickerOpen,
|
|
7183
|
+
onOpenChange: setDraftPickerOpen,
|
|
7184
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
|
|
7185
|
+
"button",
|
|
7186
|
+
{
|
|
7187
|
+
type: "button",
|
|
7188
|
+
className: cn(
|
|
7189
|
+
"flex items-center gap-base px-base py-sm min-w-0",
|
|
7190
|
+
"bg-gradient-to-t from-[var(--color-btn-outlined-neutral-bg-default)] to-[var(--color-btn-outlined-neutral-bg-gradient-to-default)]",
|
|
7191
|
+
"border border-[var(--color-btn-outlined-neutral-border-default)] rounded-md shadow-sm",
|
|
7192
|
+
"cursor-pointer transition-colors",
|
|
7193
|
+
"hover:from-[var(--color-btn-outlined-neutral-bg-hover)] hover:to-[var(--color-btn-outlined-neutral-bg-gradient-to-hover)]"
|
|
7194
|
+
),
|
|
7195
|
+
children: [
|
|
7196
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "text-sm font-regular leading-sm text-[var(--color-muted-foreground)] whitespace-nowrap", children: "Select property" }),
|
|
7197
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
7198
|
+
import_icons33.Icon,
|
|
7199
|
+
{
|
|
7200
|
+
icon: import_icons33.faChevronDownOutline,
|
|
7201
|
+
size: "xs",
|
|
7202
|
+
className: "shrink-0 text-[var(--color-foreground)]"
|
|
7203
|
+
}
|
|
7204
|
+
)
|
|
7205
|
+
]
|
|
7206
|
+
}
|
|
7207
|
+
)
|
|
7208
|
+
}
|
|
7209
|
+
)
|
|
7210
|
+
] })
|
|
6956
7211
|
] }),
|
|
6957
|
-
/* @__PURE__ */ (0,
|
|
6958
|
-
/* @__PURE__ */ (0,
|
|
7212
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "flex items-center justify-between p-base border-t border-[var(--color-border)]", children: [
|
|
7213
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
6959
7214
|
PropertySelector,
|
|
6960
7215
|
{
|
|
6961
7216
|
properties,
|
|
6962
7217
|
onSelect: handleAddFilter,
|
|
6963
7218
|
open: addSelectorOpen,
|
|
6964
7219
|
onOpenChange: setAddSelectorOpen,
|
|
6965
|
-
children: /* @__PURE__ */ (0,
|
|
7220
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
|
|
6966
7221
|
"button",
|
|
6967
7222
|
{
|
|
6968
7223
|
type: "button",
|
|
@@ -6971,18 +7226,18 @@ var SummaryChip = ({
|
|
|
6971
7226
|
"min-h-[32px] max-h-[32px] min-w-[80px]",
|
|
6972
7227
|
"bg-gradient-to-t from-[var(--color-btn-outlined-neutral-bg-default)] from-[10%] to-[var(--color-btn-outlined-neutral-bg-gradient-to-default)]",
|
|
6973
7228
|
"border border-[var(--color-btn-outlined-neutral-border-default)] rounded-md shadow-sm",
|
|
6974
|
-
"cursor-pointer transition-colors text-sm font-
|
|
7229
|
+
"cursor-pointer transition-colors text-sm font-semibold leading-sm text-[var(--color-foreground)]",
|
|
6975
7230
|
"hover:from-[var(--color-btn-outlined-neutral-bg-hover)] hover:to-[var(--color-btn-outlined-neutral-bg-gradient-to-hover)]"
|
|
6976
7231
|
),
|
|
6977
7232
|
children: [
|
|
6978
|
-
/* @__PURE__ */ (0,
|
|
7233
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_icons33.Icon, { icon: import_icons33.faPlusOutline, size: "sm", className: "text-[var(--color-foreground)]" }),
|
|
6979
7234
|
"Add filter"
|
|
6980
7235
|
]
|
|
6981
7236
|
}
|
|
6982
7237
|
)
|
|
6983
7238
|
}
|
|
6984
7239
|
),
|
|
6985
|
-
filters.length > 0 && /* @__PURE__ */ (0,
|
|
7240
|
+
filters.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
6986
7241
|
"button",
|
|
6987
7242
|
{
|
|
6988
7243
|
type: "button",
|
|
@@ -6990,7 +7245,7 @@ var SummaryChip = ({
|
|
|
6990
7245
|
onClearAll();
|
|
6991
7246
|
setOpen(false);
|
|
6992
7247
|
},
|
|
6993
|
-
className: "text-sm font-
|
|
7248
|
+
className: "text-sm font-semibold leading-sm text-[var(--color-foreground)] cursor-pointer transition-colors hover:opacity-70 px-base py-sm",
|
|
6994
7249
|
children: "Clear all filters"
|
|
6995
7250
|
}
|
|
6996
7251
|
)
|
|
@@ -7004,7 +7259,8 @@ SummaryChip.displayName = "SummaryChip";
|
|
|
7004
7259
|
|
|
7005
7260
|
// src/components/ui/filter/use-filter-bar-mode.ts
|
|
7006
7261
|
var React48 = __toESM(require("react"));
|
|
7007
|
-
|
|
7262
|
+
var DEFAULT_BREAKPOINT = 600;
|
|
7263
|
+
function useFilterBarMode(ref, override, breakpoint = DEFAULT_BREAKPOINT) {
|
|
7008
7264
|
const [mode, setMode] = React48.useState("default");
|
|
7009
7265
|
React48.useEffect(() => {
|
|
7010
7266
|
if (override) return;
|
|
@@ -7012,30 +7268,32 @@ function useFilterBarMode(ref, override) {
|
|
|
7012
7268
|
if (!el) return;
|
|
7013
7269
|
const observer = new ResizeObserver((entries) => {
|
|
7014
7270
|
const width = entries[0]?.contentRect.width ?? 0;
|
|
7015
|
-
setMode(width >
|
|
7271
|
+
setMode(width > breakpoint ? "default" : "minimal");
|
|
7016
7272
|
});
|
|
7017
7273
|
observer.observe(el);
|
|
7018
7274
|
return () => observer.disconnect();
|
|
7019
|
-
}, [ref, override]);
|
|
7275
|
+
}, [ref, override, breakpoint]);
|
|
7020
7276
|
return override ?? mode;
|
|
7021
7277
|
}
|
|
7022
7278
|
|
|
7023
7279
|
// src/components/ui/filter/filter-system.tsx
|
|
7024
|
-
var
|
|
7280
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
7025
7281
|
var FilterSystem = ({
|
|
7026
7282
|
properties,
|
|
7027
7283
|
filterState,
|
|
7028
7284
|
onFilterStateChange,
|
|
7029
7285
|
sortFields,
|
|
7030
7286
|
mode: modeOverride,
|
|
7287
|
+
breakpoint,
|
|
7031
7288
|
children,
|
|
7032
7289
|
actions,
|
|
7033
7290
|
className
|
|
7034
7291
|
}) => {
|
|
7035
7292
|
const containerRef = React49.useRef(null);
|
|
7036
|
-
const mode = useFilterBarMode(containerRef, modeOverride);
|
|
7293
|
+
const mode = useFilterBarMode(containerRef, modeOverride, breakpoint);
|
|
7037
7294
|
const [propertySelectorOpen, setPropertySelectorOpen] = React49.useState(false);
|
|
7038
7295
|
const [advancedOpen, setAdvancedOpen] = React49.useState(false);
|
|
7296
|
+
const [summaryOpen, setSummaryOpen] = React49.useState(false);
|
|
7039
7297
|
const [pendingFilterId, setPendingFilterId] = React49.useState(null);
|
|
7040
7298
|
const allFilters = [...filterState.basicFilters, ...filterState.advancedFilters];
|
|
7041
7299
|
const totalCount = allFilters.length;
|
|
@@ -7111,10 +7369,23 @@ var FilterSystem = ({
|
|
|
7111
7369
|
const getPropertyDef = (propertyId) => properties.find((p) => p.id === propertyId);
|
|
7112
7370
|
const hasAdvanced = filterState.advancedFilters.length > 0;
|
|
7113
7371
|
const isMinimal = mode === "minimal";
|
|
7114
|
-
|
|
7115
|
-
|
|
7372
|
+
const handleOpenAdvanced = () => {
|
|
7373
|
+
setPropertySelectorOpen(false);
|
|
7374
|
+
requestAnimationFrame(() => {
|
|
7375
|
+
if (isMinimal) {
|
|
7376
|
+
setSummaryOpen(true);
|
|
7377
|
+
} else {
|
|
7378
|
+
setAdvancedOpen(true);
|
|
7379
|
+
}
|
|
7380
|
+
});
|
|
7381
|
+
};
|
|
7382
|
+
const advancedFilterCount = filterState.advancedFilters.length;
|
|
7383
|
+
const showAdvancedChip = hasAdvanced || advancedOpen;
|
|
7384
|
+
const showSummaryChip = totalCount > 0 || summaryOpen;
|
|
7385
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(FilterBar, { ref: containerRef, className, children: [
|
|
7386
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(FilterBarLeft, { className: "flex-nowrap flex-1 min-w-0 overflow-x-auto scrollbar-none outline-none [&>*]:shrink-0", children: [
|
|
7116
7387
|
children,
|
|
7117
|
-
sortFields && filterState.sort && /* @__PURE__ */ (0,
|
|
7388
|
+
sortFields && filterState.sort && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
7118
7389
|
SortButton,
|
|
7119
7390
|
{
|
|
7120
7391
|
fields: sortFields,
|
|
@@ -7124,40 +7395,48 @@ var FilterSystem = ({
|
|
|
7124
7395
|
iconOnly: isMinimal
|
|
7125
7396
|
}
|
|
7126
7397
|
),
|
|
7127
|
-
isMinimal ?
|
|
7128
|
-
/*
|
|
7129
|
-
|
|
7130
|
-
SummaryChip,
|
|
7398
|
+
isMinimal ? /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_jsx_runtime56.Fragment, { children: [
|
|
7399
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
7400
|
+
"div",
|
|
7131
7401
|
{
|
|
7132
|
-
|
|
7133
|
-
|
|
7134
|
-
|
|
7135
|
-
|
|
7136
|
-
|
|
7137
|
-
|
|
7138
|
-
|
|
7139
|
-
|
|
7140
|
-
|
|
7141
|
-
|
|
7142
|
-
|
|
7402
|
+
className: showSummaryChip ? "inline-flex" : "inline-flex w-0 overflow-hidden opacity-0 pointer-events-none",
|
|
7403
|
+
"aria-hidden": !showSummaryChip || void 0,
|
|
7404
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
7405
|
+
SummaryChip,
|
|
7406
|
+
{
|
|
7407
|
+
count: totalCount,
|
|
7408
|
+
filters: allFilters,
|
|
7409
|
+
properties,
|
|
7410
|
+
onFiltersChange: (filters) => {
|
|
7411
|
+
onFilterStateChange({
|
|
7412
|
+
...filterState,
|
|
7413
|
+
basicFilters: filters,
|
|
7414
|
+
advancedFilters: []
|
|
7415
|
+
});
|
|
7416
|
+
},
|
|
7417
|
+
onClearAll: handleClearAll,
|
|
7418
|
+
open: summaryOpen,
|
|
7419
|
+
onOpenChange: setSummaryOpen
|
|
7420
|
+
}
|
|
7421
|
+
)
|
|
7143
7422
|
}
|
|
7144
|
-
)
|
|
7145
|
-
|
|
7146
|
-
/* No filters → same FilterBarButton as default, icon-only */
|
|
7147
|
-
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
7423
|
+
),
|
|
7424
|
+
!showSummaryChip && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
7148
7425
|
PropertySelector,
|
|
7149
7426
|
{
|
|
7150
7427
|
properties,
|
|
7151
7428
|
onSelect: handleAddFilter,
|
|
7152
7429
|
open: propertySelectorOpen,
|
|
7153
7430
|
onOpenChange: setPropertySelectorOpen,
|
|
7154
|
-
|
|
7431
|
+
onAdvancedFilter: handleOpenAdvanced,
|
|
7432
|
+
advancedFilterCount,
|
|
7433
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(FilterBarButton, { iconOnly: true })
|
|
7155
7434
|
}
|
|
7156
7435
|
)
|
|
7157
|
-
) : (
|
|
7436
|
+
] }) : (
|
|
7158
7437
|
/* ── DEFAULT MODE ────────────────────────────────────── */
|
|
7159
|
-
/* @__PURE__ */ (0,
|
|
7160
|
-
|
|
7438
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_jsx_runtime56.Fragment, { children: [
|
|
7439
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
7161
7440
|
AdvancedPopover,
|
|
7162
7441
|
{
|
|
7163
7442
|
filters: filterState.advancedFilters,
|
|
@@ -7165,12 +7444,19 @@ var FilterSystem = ({
|
|
|
7165
7444
|
onFiltersChange: handleAdvancedFiltersChange,
|
|
7166
7445
|
open: advancedOpen,
|
|
7167
7446
|
onOpenChange: setAdvancedOpen,
|
|
7168
|
-
children: /* @__PURE__ */ (0,
|
|
7169
|
-
|
|
7447
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
7448
|
+
"div",
|
|
7170
7449
|
{
|
|
7171
|
-
|
|
7172
|
-
|
|
7173
|
-
|
|
7450
|
+
className: showAdvancedChip ? "inline-flex" : "inline-flex w-0 overflow-hidden opacity-0 pointer-events-none",
|
|
7451
|
+
"aria-hidden": !showAdvancedChip || void 0,
|
|
7452
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
7453
|
+
AdvancedChip,
|
|
7454
|
+
{
|
|
7455
|
+
count: filterState.advancedFilters.length,
|
|
7456
|
+
onClick: () => setAdvancedOpen(true),
|
|
7457
|
+
onClear: handleClearAdvanced
|
|
7458
|
+
}
|
|
7459
|
+
)
|
|
7174
7460
|
}
|
|
7175
7461
|
)
|
|
7176
7462
|
}
|
|
@@ -7178,7 +7464,7 @@ var FilterSystem = ({
|
|
|
7178
7464
|
filterState.basicFilters.map((filter) => {
|
|
7179
7465
|
const propDef = getPropertyDef(filter.propertyId);
|
|
7180
7466
|
if (!propDef) return null;
|
|
7181
|
-
return /* @__PURE__ */ (0,
|
|
7467
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
7182
7468
|
InteractiveFilterChip,
|
|
7183
7469
|
{
|
|
7184
7470
|
propertyDef: propDef,
|
|
@@ -7194,34 +7480,38 @@ var FilterSystem = ({
|
|
|
7194
7480
|
filter.id
|
|
7195
7481
|
);
|
|
7196
7482
|
}),
|
|
7197
|
-
/* @__PURE__ */ (0,
|
|
7483
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
7198
7484
|
PropertySelector,
|
|
7199
7485
|
{
|
|
7200
7486
|
properties,
|
|
7201
7487
|
onSelect: handleAddFilter,
|
|
7202
7488
|
open: propertySelectorOpen,
|
|
7203
7489
|
onOpenChange: setPropertySelectorOpen,
|
|
7204
|
-
|
|
7205
|
-
|
|
7490
|
+
onAdvancedFilter: handleOpenAdvanced,
|
|
7491
|
+
advancedFilterCount,
|
|
7492
|
+
children: totalCount > 0 ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
7493
|
+
"button",
|
|
7206
7494
|
{
|
|
7207
|
-
|
|
7495
|
+
type: "button",
|
|
7496
|
+
className: "shrink-0 inline-flex items-center justify-center size-8 rounded-md border border-[var(--color-btn-outlined-neutral-border-default)] bg-gradient-to-t from-[var(--color-btn-outlined-neutral-bg-default)] from-[10%] to-[var(--color-btn-outlined-neutral-bg-gradient-to-default)] shadow-sm cursor-pointer transition-colors hover:from-[var(--color-btn-outlined-neutral-bg-hover)] hover:to-[var(--color-btn-outlined-neutral-bg-gradient-to-hover)]",
|
|
7497
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_icons34.Icon, { icon: import_icons34.faPlusOutline, size: "sm", className: "text-[var(--color-foreground)]" })
|
|
7208
7498
|
}
|
|
7209
|
-
)
|
|
7499
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(FilterBarButton, {})
|
|
7210
7500
|
}
|
|
7211
7501
|
)
|
|
7212
7502
|
] })
|
|
7213
7503
|
),
|
|
7214
|
-
totalCount > 0 && /* @__PURE__ */ (0,
|
|
7504
|
+
totalCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
7215
7505
|
"button",
|
|
7216
7506
|
{
|
|
7217
7507
|
type: "button",
|
|
7218
7508
|
onClick: handleClearAll,
|
|
7219
|
-
className: "flex items-center gap-sm px-base py-sm min-h-[32px] max-h-[32px] rounded-md cursor-pointer transition-colors hover:bg-[var(--color-accent)]",
|
|
7220
|
-
children: isMinimal ? /* @__PURE__ */ (0,
|
|
7509
|
+
className: "shrink-0 flex items-center gap-sm px-base py-sm min-h-[32px] max-h-[32px] rounded-md cursor-pointer transition-colors hover:bg-[var(--color-accent)]",
|
|
7510
|
+
children: isMinimal ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_icons34.Icon, { icon: import_icons34.faXmarkOutline, size: "sm", className: "text-[var(--color-foreground)]" }) : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "text-sm font-semibold leading-sm text-[var(--color-foreground)]", children: "Clear" })
|
|
7221
7511
|
}
|
|
7222
7512
|
)
|
|
7223
7513
|
] }),
|
|
7224
|
-
actions && /* @__PURE__ */ (0,
|
|
7514
|
+
actions && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(FilterBarRight, { className: "shrink-0 -ml-2xl pl-2xl relative z-10 bg-[linear-gradient(to_right,transparent_0px,var(--filter-bar-bg,var(--color-background,#fff))_24px)]", children: actions })
|
|
7225
7515
|
] });
|
|
7226
7516
|
};
|
|
7227
7517
|
FilterSystem.displayName = "FilterSystem";
|
|
@@ -7230,7 +7520,7 @@ FilterSystem.displayName = "FilterSystem";
|
|
|
7230
7520
|
var React50 = __toESM(require("react"));
|
|
7231
7521
|
var PopoverPrimitive12 = __toESM(require("@radix-ui/react-popover"));
|
|
7232
7522
|
var import_icons35 = require("@l3mpire/icons");
|
|
7233
|
-
var
|
|
7523
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
7234
7524
|
function getDaysInMonth(year, month) {
|
|
7235
7525
|
return new Date(year, month + 1, 0).getDate();
|
|
7236
7526
|
}
|
|
@@ -7361,7 +7651,7 @@ var DatePicker = React50.forwardRef(
|
|
|
7361
7651
|
hoveredDate
|
|
7362
7652
|
]
|
|
7363
7653
|
);
|
|
7364
|
-
return /* @__PURE__ */ (0,
|
|
7654
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(DatePickerContext.Provider, { value: ctxValue, children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
7365
7655
|
"div",
|
|
7366
7656
|
{
|
|
7367
7657
|
ref,
|
|
@@ -7388,18 +7678,18 @@ var DatePickerSelects = React50.forwardRef(({ className, formatDate = defaultFor
|
|
|
7388
7678
|
const { selected } = useDatePickerContext();
|
|
7389
7679
|
const fromDate = selected instanceof Date ? selected : selected?.from;
|
|
7390
7680
|
const toDate = selected instanceof Date ? void 0 : selected?.to;
|
|
7391
|
-
return /* @__PURE__ */ (0,
|
|
7681
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
7392
7682
|
"div",
|
|
7393
7683
|
{
|
|
7394
7684
|
ref,
|
|
7395
7685
|
className: cn("flex flex-col items-start pt-lg px-lg", className),
|
|
7396
7686
|
...props,
|
|
7397
|
-
children: /* @__PURE__ */ (0,
|
|
7398
|
-
/* @__PURE__ */ (0,
|
|
7399
|
-
/* @__PURE__ */ (0,
|
|
7400
|
-
/* @__PURE__ */ (0,
|
|
7687
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "flex items-center gap-base w-full", children: [
|
|
7688
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "flex-1 flex items-center gap-base min-w-0 px-base py-sm bg-gradient-to-t from-[var(--color-select-bg-default)] to-[var(--color-select-bg-gradient-to)] border border-[var(--color-select-border-default)] rounded-base shadow-sm", children: [
|
|
7689
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "flex-1 text-sm font-regular leading-sm text-datepicker-header-text truncate", children: fromDate ? formatDate(fromDate) : "Start date" }),
|
|
7690
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_icons35.Icon, { icon: import_icons35.faCalendarOutline, size: "sm", className: "shrink-0 text-datepicker-header-text" })
|
|
7401
7691
|
] }),
|
|
7402
|
-
/* @__PURE__ */ (0,
|
|
7692
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
7403
7693
|
import_icons35.Icon,
|
|
7404
7694
|
{
|
|
7405
7695
|
icon: import_icons35.faArrowRightOutline,
|
|
@@ -7407,9 +7697,9 @@ var DatePickerSelects = React50.forwardRef(({ className, formatDate = defaultFor
|
|
|
7407
7697
|
className: "shrink-0 text-datepicker-header-weekday"
|
|
7408
7698
|
}
|
|
7409
7699
|
),
|
|
7410
|
-
/* @__PURE__ */ (0,
|
|
7411
|
-
/* @__PURE__ */ (0,
|
|
7412
|
-
/* @__PURE__ */ (0,
|
|
7700
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "flex-1 flex items-center gap-base min-w-0 px-base py-sm bg-gradient-to-t from-[var(--color-select-bg-default)] to-[var(--color-select-bg-gradient-to)] border border-[var(--color-select-border-default)] rounded-base shadow-sm", children: [
|
|
7701
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "flex-1 text-sm font-regular leading-sm text-datepicker-header-text truncate", children: toDate ? formatDate(toDate) : "End date" }),
|
|
7702
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_icons35.Icon, { icon: import_icons35.faCalendarOutline, size: "sm", className: "shrink-0 text-datepicker-header-text" })
|
|
7413
7703
|
] })
|
|
7414
7704
|
] })
|
|
7415
7705
|
}
|
|
@@ -7425,7 +7715,7 @@ var DatePickerDay = ({ date, isOutside }) => {
|
|
|
7425
7715
|
const inRange = mode === "range" && selected && !(selected instanceof Date) && selected.from && selected.to && !isSelected && isInRange(date, selected.from, selected.to);
|
|
7426
7716
|
const inPreviewRange = mode === "range" && selected && !(selected instanceof Date) && selected.from && !selected.to && hoveredDate && !isSelected && hoveredDate.getTime() > selected.from.getTime() && isInRange(date, selected.from, hoveredDate);
|
|
7427
7717
|
const isInRangeOrPreview = inRange || inPreviewRange;
|
|
7428
|
-
return /* @__PURE__ */ (0,
|
|
7718
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
7429
7719
|
"button",
|
|
7430
7720
|
{
|
|
7431
7721
|
type: "button",
|
|
@@ -7435,7 +7725,7 @@ var DatePickerDay = ({ date, isOutside }) => {
|
|
|
7435
7725
|
disabled: isOutside,
|
|
7436
7726
|
className: cn(
|
|
7437
7727
|
"relative flex flex-col items-center justify-center w-9 rounded-full p-2 cursor-pointer transition-colors",
|
|
7438
|
-
"text-sm font-
|
|
7728
|
+
"text-sm font-semibold leading-sm text-center",
|
|
7439
7729
|
// Default
|
|
7440
7730
|
!isOutside && !isSelected && !isInRangeOrPreview && "text-datepicker-day-text-default hover:bg-datepicker-day-bg-hover",
|
|
7441
7731
|
// Outside month (disabled)
|
|
@@ -7449,7 +7739,7 @@ var DatePickerDay = ({ date, isOutside }) => {
|
|
|
7449
7739
|
),
|
|
7450
7740
|
children: [
|
|
7451
7741
|
date.getDate(),
|
|
7452
|
-
isToday && !isOutside && /* @__PURE__ */ (0,
|
|
7742
|
+
isToday && !isOutside && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "absolute bottom-0.5 left-1/2 -translate-x-1/2 size-1.5 rounded-full bg-datepicker-day-today" })
|
|
7453
7743
|
]
|
|
7454
7744
|
}
|
|
7455
7745
|
);
|
|
@@ -7496,7 +7786,7 @@ var DatePickerCalendar = React50.forwardRef(({ className, header, ...props }, re
|
|
|
7496
7786
|
}
|
|
7497
7787
|
return result;
|
|
7498
7788
|
}, [month, year]);
|
|
7499
|
-
return /* @__PURE__ */ (0,
|
|
7789
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
7500
7790
|
"div",
|
|
7501
7791
|
{
|
|
7502
7792
|
ref,
|
|
@@ -7504,38 +7794,38 @@ var DatePickerCalendar = React50.forwardRef(({ className, header, ...props }, re
|
|
|
7504
7794
|
...props,
|
|
7505
7795
|
children: [
|
|
7506
7796
|
header,
|
|
7507
|
-
/* @__PURE__ */ (0,
|
|
7508
|
-
/* @__PURE__ */ (0,
|
|
7509
|
-
/* @__PURE__ */ (0,
|
|
7797
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "flex flex-col gap-lg p-lg", children: [
|
|
7798
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
7799
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("span", { className: "text-base font-semibold leading-base text-datepicker-header-text", children: [
|
|
7510
7800
|
MONTH_NAMES[month],
|
|
7511
7801
|
" ",
|
|
7512
7802
|
year
|
|
7513
7803
|
] }),
|
|
7514
|
-
/* @__PURE__ */ (0,
|
|
7515
|
-
/* @__PURE__ */ (0,
|
|
7804
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "flex items-center gap-xs", children: [
|
|
7805
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
7516
7806
|
"button",
|
|
7517
7807
|
{
|
|
7518
7808
|
type: "button",
|
|
7519
7809
|
onClick: goToPrevMonth,
|
|
7520
7810
|
className: "flex items-center justify-center p-xs rounded-base hover:bg-datepicker-day-bg-hover transition-colors cursor-pointer",
|
|
7521
7811
|
"aria-label": "Previous month",
|
|
7522
|
-
children: /* @__PURE__ */ (0,
|
|
7812
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_icons35.Icon, { icon: import_icons35.faChevronLeftOutline, size: "xs", className: "text-datepicker-header-nav" })
|
|
7523
7813
|
}
|
|
7524
7814
|
),
|
|
7525
|
-
/* @__PURE__ */ (0,
|
|
7815
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
7526
7816
|
"button",
|
|
7527
7817
|
{
|
|
7528
7818
|
type: "button",
|
|
7529
7819
|
onClick: goToNextMonth,
|
|
7530
7820
|
className: "flex items-center justify-center p-xs rounded-base hover:bg-datepicker-day-bg-hover transition-colors cursor-pointer",
|
|
7531
7821
|
"aria-label": "Next month",
|
|
7532
|
-
children: /* @__PURE__ */ (0,
|
|
7822
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_icons35.Icon, { icon: import_icons35.faChevronRightOutline, size: "xs", className: "text-datepicker-header-nav" })
|
|
7533
7823
|
}
|
|
7534
7824
|
)
|
|
7535
7825
|
] })
|
|
7536
7826
|
] }),
|
|
7537
|
-
/* @__PURE__ */ (0,
|
|
7538
|
-
/* @__PURE__ */ (0,
|
|
7827
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "flex flex-col", children: [
|
|
7828
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "grid grid-cols-7 gap-base py-sm", children: WEEKDAYS.map((day) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
7539
7829
|
"span",
|
|
7540
7830
|
{
|
|
7541
7831
|
className: "w-9 text-center text-xs font-regular leading-xs text-datepicker-header-weekday",
|
|
@@ -7543,7 +7833,7 @@ var DatePickerCalendar = React50.forwardRef(({ className, header, ...props }, re
|
|
|
7543
7833
|
},
|
|
7544
7834
|
day
|
|
7545
7835
|
)) }),
|
|
7546
|
-
/* @__PURE__ */ (0,
|
|
7836
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "flex flex-col", children: weeks.map((week, wi) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "grid grid-cols-7 gap-base", children: week.map((day, di) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
7547
7837
|
DatePickerDay,
|
|
7548
7838
|
{
|
|
7549
7839
|
date: day.date,
|
|
@@ -7583,7 +7873,7 @@ var DatePickerSuggestions = React50.forwardRef(
|
|
|
7583
7873
|
const to = val.to ? formatDate(val.to) : "";
|
|
7584
7874
|
return to ? `${from} - ${to}` : from;
|
|
7585
7875
|
};
|
|
7586
|
-
return /* @__PURE__ */ (0,
|
|
7876
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
7587
7877
|
"div",
|
|
7588
7878
|
{
|
|
7589
7879
|
ref,
|
|
@@ -7593,16 +7883,16 @@ var DatePickerSuggestions = React50.forwardRef(
|
|
|
7593
7883
|
),
|
|
7594
7884
|
...props,
|
|
7595
7885
|
children: [
|
|
7596
|
-
/* @__PURE__ */ (0,
|
|
7597
|
-
/* @__PURE__ */ (0,
|
|
7886
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "pt-lg px-base", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "flex items-center p-base rounded-base", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "flex-1 text-xs font-semibold leading-xs text-datepicker-suggestion-heading uppercase truncate", children: "Suggestions" }) }) }),
|
|
7887
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "flex flex-1 flex-col p-base min-w-[222px]", children: suggestions.map((suggestion, i) => /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
7598
7888
|
"button",
|
|
7599
7889
|
{
|
|
7600
7890
|
type: "button",
|
|
7601
7891
|
onClick: () => handleClick(suggestion),
|
|
7602
7892
|
className: "flex items-center gap-sm p-base rounded-base hover:bg-datepicker-suggestion-hover transition-colors cursor-pointer text-left",
|
|
7603
7893
|
children: [
|
|
7604
|
-
/* @__PURE__ */ (0,
|
|
7605
|
-
/* @__PURE__ */ (0,
|
|
7894
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "text-sm font-regular leading-sm text-datepicker-suggestion-text truncate shrink-0", children: suggestion.label }),
|
|
7895
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "text-xs font-regular leading-xs text-datepicker-suggestion-date truncate", children: formatSuggestionDate(suggestion) })
|
|
7606
7896
|
]
|
|
7607
7897
|
},
|
|
7608
7898
|
i
|
|
@@ -7614,7 +7904,7 @@ var DatePickerSuggestions = React50.forwardRef(
|
|
|
7614
7904
|
);
|
|
7615
7905
|
DatePickerSuggestions.displayName = "DatePickerSuggestions";
|
|
7616
7906
|
var DatePickerFooter = React50.forwardRef(
|
|
7617
|
-
({ className, children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
7907
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
7618
7908
|
"div",
|
|
7619
7909
|
{
|
|
7620
7910
|
ref,
|
|
@@ -7631,7 +7921,7 @@ var DatePickerFooter = React50.forwardRef(
|
|
|
7631
7921
|
);
|
|
7632
7922
|
DatePickerFooter.displayName = "DatePickerFooter";
|
|
7633
7923
|
var DatePickerPanel = React50.forwardRef(
|
|
7634
|
-
({ className, children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
7924
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
7635
7925
|
"div",
|
|
7636
7926
|
{
|
|
7637
7927
|
ref,
|
|
@@ -7644,7 +7934,7 @@ var DatePickerPanel = React50.forwardRef(
|
|
|
7644
7934
|
DatePickerPanel.displayName = "DatePickerPanel";
|
|
7645
7935
|
var DatePickerRoot = PopoverPrimitive12.Root;
|
|
7646
7936
|
var DatePickerTrigger = PopoverPrimitive12.Trigger;
|
|
7647
|
-
var DatePickerPopover = React50.forwardRef(({ className, sideOffset = 4, align = "start", children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
7937
|
+
var DatePickerPopover = React50.forwardRef(({ className, sideOffset = 4, align = "start", children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(PopoverPrimitive12.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
7648
7938
|
PopoverPrimitive12.Content,
|
|
7649
7939
|
{
|
|
7650
7940
|
ref,
|