@l3mpire/ui 2.7.2 → 2.9.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 +13 -4
- package/dist/index.d.mts +29 -7
- package/dist/index.d.ts +29 -7
- package/dist/index.js +470 -239
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +469 -240
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -115,6 +115,7 @@ __export(index_exports, {
|
|
|
115
115
|
SidebarSection: () => SidebarSection,
|
|
116
116
|
SortButton: () => SortButton,
|
|
117
117
|
StatusCell: () => StatusCell,
|
|
118
|
+
SummaryChip: () => SummaryChip,
|
|
118
119
|
Switch: () => Switch,
|
|
119
120
|
TabContent: () => TabContent,
|
|
120
121
|
TabList: () => TabList,
|
|
@@ -169,6 +170,7 @@ __export(index_exports, {
|
|
|
169
170
|
toastVariants: () => toastVariants,
|
|
170
171
|
tooltipContentVariants: () => tooltipContentVariants,
|
|
171
172
|
typographyVariants: () => typographyVariants,
|
|
173
|
+
useFilterBarMode: () => useFilterBarMode,
|
|
172
174
|
useSidebarContext: () => useSidebarContext
|
|
173
175
|
});
|
|
174
176
|
module.exports = __toCommonJS(index_exports);
|
|
@@ -4968,7 +4970,7 @@ var FilterChip = React35.forwardRef(
|
|
|
4968
4970
|
ref,
|
|
4969
4971
|
className: cn(
|
|
4970
4972
|
"flex items-center overflow-clip",
|
|
4971
|
-
"bg-filter-chip-bg border border-filter-chip-border rounded-md",
|
|
4973
|
+
"bg-filter-chip-bg border border-filter-chip-border rounded-md shadow-sm",
|
|
4972
4974
|
className
|
|
4973
4975
|
),
|
|
4974
4976
|
...props,
|
|
@@ -5154,6 +5156,7 @@ var SortButton = ({
|
|
|
5154
5156
|
activeField,
|
|
5155
5157
|
direction,
|
|
5156
5158
|
onChange,
|
|
5159
|
+
iconOnly = false,
|
|
5157
5160
|
...props
|
|
5158
5161
|
}) => {
|
|
5159
5162
|
const [open, setOpen] = React37.useState(false);
|
|
@@ -5165,12 +5168,13 @@ var SortButton = ({
|
|
|
5165
5168
|
{
|
|
5166
5169
|
type: "button",
|
|
5167
5170
|
className: cn(
|
|
5168
|
-
"flex items-center gap-xs
|
|
5169
|
-
"min-h-[32px] max-h-[32px]
|
|
5171
|
+
"flex items-center gap-xs",
|
|
5172
|
+
"min-h-[32px] max-h-[32px]",
|
|
5170
5173
|
"bg-gradient-to-t from-[var(--color-btn-outlined-neutral-bg-default)] to-[var(--color-btn-outlined-neutral-bg-gradient-to-default)]",
|
|
5171
5174
|
"border border-[var(--color-btn-outlined-neutral-border-default)] rounded-md shadow-sm",
|
|
5172
5175
|
"cursor-pointer transition-colors",
|
|
5173
5176
|
"hover:from-[var(--color-btn-outlined-neutral-bg-hover)] hover:to-[var(--color-btn-outlined-neutral-bg-gradient-to-hover)]",
|
|
5177
|
+
iconOnly ? "size-8 justify-center p-0" : "px-md py-sm min-w-[80px]",
|
|
5174
5178
|
className
|
|
5175
5179
|
),
|
|
5176
5180
|
children: [
|
|
@@ -5182,7 +5186,7 @@ var SortButton = ({
|
|
|
5182
5186
|
className: "shrink-0 text-[var(--color-foreground)]"
|
|
5183
5187
|
}
|
|
5184
5188
|
),
|
|
5185
|
-
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("span", { className: "text-sm font-medium leading-sm whitespace-nowrap", children: [
|
|
5189
|
+
!iconOnly && /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("span", { className: "text-sm font-medium leading-sm whitespace-nowrap", children: [
|
|
5186
5190
|
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("span", { className: "text-[var(--color-muted-foreground)]", children: [
|
|
5187
5191
|
"Sort by",
|
|
5188
5192
|
" "
|
|
@@ -5335,18 +5339,19 @@ SortButton.displayName = "SortButton";
|
|
|
5335
5339
|
var React38 = __toESM(require("react"));
|
|
5336
5340
|
var import_icons25 = require("@l3mpire/icons");
|
|
5337
5341
|
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
5338
|
-
var FilterBarButton = React38.forwardRef(({ className, count, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
5342
|
+
var FilterBarButton = React38.forwardRef(({ className, count, iconOnly = false, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
5339
5343
|
"button",
|
|
5340
5344
|
{
|
|
5341
5345
|
ref,
|
|
5342
5346
|
type: "button",
|
|
5343
5347
|
className: cn(
|
|
5344
|
-
"flex items-center gap-sm
|
|
5345
|
-
"min-h-[32px] max-h-[32px]
|
|
5348
|
+
"flex items-center gap-sm",
|
|
5349
|
+
"min-h-[32px] max-h-[32px]",
|
|
5346
5350
|
"bg-gradient-to-t from-[var(--color-btn-outlined-neutral-bg-default)] to-[var(--color-btn-outlined-neutral-bg-gradient-to-default)]",
|
|
5347
5351
|
"border border-[var(--color-btn-outlined-neutral-border-default)] rounded-md shadow-sm",
|
|
5348
5352
|
"cursor-pointer transition-colors",
|
|
5349
5353
|
"hover:from-[var(--color-btn-outlined-neutral-bg-hover)] hover:to-[var(--color-btn-outlined-neutral-bg-gradient-to-hover)]",
|
|
5354
|
+
iconOnly ? count ? "px-sm justify-center" : "size-8 justify-center p-0" : "px-base py-sm min-w-[80px]",
|
|
5350
5355
|
className
|
|
5351
5356
|
),
|
|
5352
5357
|
...props,
|
|
@@ -5359,7 +5364,7 @@ var FilterBarButton = React38.forwardRef(({ className, count, children, ...props
|
|
|
5359
5364
|
className: "shrink-0 text-[var(--color-foreground)]"
|
|
5360
5365
|
}
|
|
5361
5366
|
),
|
|
5362
|
-
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "text-sm font-medium leading-sm whitespace-nowrap text-[var(--color-foreground)]", children: children ?? "Filters" }),
|
|
5367
|
+
!iconOnly && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "text-sm font-medium leading-sm whitespace-nowrap text-[var(--color-foreground)]", children: children ?? "Filters" }),
|
|
5363
5368
|
count != null && count > 0 && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "flex items-center p-2xs rounded-xs bg-filter-chip-badge-bg", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "text-[10px] font-medium leading-2xs text-filter-chip-badge-text", children: count }) })
|
|
5364
5369
|
]
|
|
5365
5370
|
}
|
|
@@ -6300,7 +6305,7 @@ var InteractiveFilterChip = ({
|
|
|
6300
6305
|
{
|
|
6301
6306
|
className: cn(
|
|
6302
6307
|
"inline-flex items-center overflow-clip",
|
|
6303
|
-
"bg-filter-chip-bg border border-filter-chip-border rounded-md",
|
|
6308
|
+
"bg-filter-chip-bg border border-filter-chip-border rounded-md shadow-sm",
|
|
6304
6309
|
className
|
|
6305
6310
|
),
|
|
6306
6311
|
children: [
|
|
@@ -6422,69 +6427,83 @@ var InteractiveFilterChip = ({
|
|
|
6422
6427
|
InteractiveFilterChip.displayName = "InteractiveFilterChip";
|
|
6423
6428
|
|
|
6424
6429
|
// src/components/ui/filter/filter-system.tsx
|
|
6425
|
-
var
|
|
6430
|
+
var React48 = __toESM(require("react"));
|
|
6431
|
+
var import_icons34 = require("@l3mpire/icons");
|
|
6426
6432
|
|
|
6427
6433
|
// src/components/ui/filter/advanced-chip.tsx
|
|
6428
6434
|
var React43 = __toESM(require("react"));
|
|
6429
6435
|
var import_icons30 = require("@l3mpire/icons");
|
|
6430
6436
|
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
6437
|
+
var btnBase = [
|
|
6438
|
+
"flex items-center justify-center",
|
|
6439
|
+
"min-h-[32px] max-h-[32px]",
|
|
6440
|
+
"bg-gradient-to-t from-[var(--color-btn-outlined-neutral-bg-default)] from-[10%] to-[var(--color-btn-outlined-neutral-bg-gradient-to-default)]",
|
|
6441
|
+
"border border-[var(--color-btn-outlined-neutral-border-default)] shadow-sm",
|
|
6442
|
+
"cursor-pointer transition-colors",
|
|
6443
|
+
"hover:from-[var(--color-btn-outlined-neutral-bg-hover)] hover:to-[var(--color-btn-outlined-neutral-bg-gradient-to-hover)]"
|
|
6444
|
+
];
|
|
6431
6445
|
var AdvancedChip = React43.forwardRef(
|
|
6432
|
-
({ className, count, onClear, onClick, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
6433
|
-
|
|
6434
|
-
|
|
6435
|
-
|
|
6436
|
-
|
|
6437
|
-
|
|
6438
|
-
|
|
6439
|
-
|
|
6440
|
-
|
|
6441
|
-
|
|
6442
|
-
"
|
|
6443
|
-
{
|
|
6444
|
-
ref,
|
|
6445
|
-
type: "button",
|
|
6446
|
-
onClick,
|
|
6447
|
-
className: "flex items-center gap-sm px-base py-sm cursor-pointer transition-colors hover:bg-[var(--color-primary)]/10",
|
|
6448
|
-
...props,
|
|
6449
|
-
children: [
|
|
6450
|
-
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "text-sm font-medium leading-sm whitespace-nowrap text-[var(--color-primary)]", children: "Advanced filter" }),
|
|
6451
|
-
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "flex items-center p-2xs rounded-xs bg-filter-chip-badge-bg", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "text-[10px] font-medium leading-2xs text-filter-chip-badge-text", children: count }) })
|
|
6452
|
-
]
|
|
6453
|
-
}
|
|
6446
|
+
({ className, count, onClear, onClick, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: cn("inline-flex items-center", className), children: [
|
|
6447
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
6448
|
+
"button",
|
|
6449
|
+
{
|
|
6450
|
+
ref,
|
|
6451
|
+
type: "button",
|
|
6452
|
+
onClick,
|
|
6453
|
+
className: cn(
|
|
6454
|
+
btnBase,
|
|
6455
|
+
"gap-sm px-base py-sm min-w-[80px]",
|
|
6456
|
+
"rounded-l-md -mr-px"
|
|
6454
6457
|
),
|
|
6455
|
-
|
|
6456
|
-
|
|
6457
|
-
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
6458
|
-
|
|
6459
|
-
|
|
6460
|
-
|
|
6461
|
-
|
|
6462
|
-
|
|
6463
|
-
|
|
6464
|
-
|
|
6465
|
-
|
|
6466
|
-
|
|
6467
|
-
|
|
6468
|
-
|
|
6469
|
-
|
|
6470
|
-
|
|
6471
|
-
|
|
6472
|
-
|
|
6473
|
-
|
|
6458
|
+
...props,
|
|
6459
|
+
children: [
|
|
6460
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "text-sm font-medium leading-sm whitespace-nowrap text-[var(--color-foreground)]", children: "Advanced filters" }),
|
|
6461
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "flex items-center p-2xs rounded-xs bg-filter-chip-badge-bg", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "text-[10px] font-medium leading-2xs text-filter-chip-badge-text", children: count }) })
|
|
6462
|
+
]
|
|
6463
|
+
}
|
|
6464
|
+
),
|
|
6465
|
+
onClear && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
6466
|
+
"button",
|
|
6467
|
+
{
|
|
6468
|
+
type: "button",
|
|
6469
|
+
onClick: (e) => {
|
|
6470
|
+
e.stopPropagation();
|
|
6471
|
+
onClear();
|
|
6472
|
+
},
|
|
6473
|
+
className: cn(
|
|
6474
|
+
btnBase,
|
|
6475
|
+
"p-sm",
|
|
6476
|
+
"rounded-r-md -ml-px"
|
|
6477
|
+
),
|
|
6478
|
+
"aria-label": "Clear all advanced filters",
|
|
6479
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_icons30.Icon, { icon: import_icons30.faXmarkOutline, size: "sm", className: "text-[var(--color-foreground)]" })
|
|
6480
|
+
}
|
|
6481
|
+
)
|
|
6482
|
+
] })
|
|
6474
6483
|
);
|
|
6475
6484
|
AdvancedChip.displayName = "AdvancedChip";
|
|
6476
6485
|
|
|
6477
6486
|
// src/components/ui/filter/advanced-popover.tsx
|
|
6478
6487
|
var React45 = __toESM(require("react"));
|
|
6479
6488
|
var PopoverPrimitive10 = __toESM(require("@radix-ui/react-popover"));
|
|
6489
|
+
var import_icons32 = require("@l3mpire/icons");
|
|
6480
6490
|
|
|
6481
6491
|
// src/components/ui/filter/advanced-row.tsx
|
|
6482
6492
|
var React44 = __toESM(require("react"));
|
|
6483
6493
|
var PopoverPrimitive9 = __toESM(require("@radix-ui/react-popover"));
|
|
6484
6494
|
var import_icons31 = require("@l3mpire/icons");
|
|
6485
6495
|
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
6496
|
+
var selectBtnStyle = [
|
|
6497
|
+
"flex items-center gap-base",
|
|
6498
|
+
"px-base py-sm",
|
|
6499
|
+
"bg-gradient-to-t from-[var(--color-btn-outlined-neutral-bg-default)] to-[var(--color-btn-outlined-neutral-bg-gradient-to-default)]",
|
|
6500
|
+
"border border-[var(--color-btn-outlined-neutral-border-default)] rounded-md shadow-sm",
|
|
6501
|
+
"cursor-pointer transition-colors",
|
|
6502
|
+
"hover:from-[var(--color-btn-outlined-neutral-bg-hover)] hover:to-[var(--color-btn-outlined-neutral-bg-gradient-to-hover)]"
|
|
6503
|
+
];
|
|
6486
6504
|
var AdvancedRow = ({
|
|
6487
6505
|
connector,
|
|
6506
|
+
onConnectorToggle,
|
|
6488
6507
|
propertyDef,
|
|
6489
6508
|
condition,
|
|
6490
6509
|
properties,
|
|
@@ -6493,7 +6512,6 @@ var AdvancedRow = ({
|
|
|
6493
6512
|
onDelete
|
|
6494
6513
|
}) => {
|
|
6495
6514
|
const [operatorOpen, setOperatorOpen] = React44.useState(false);
|
|
6496
|
-
const [valueOpen, setValueOpen] = React44.useState(false);
|
|
6497
6515
|
const [propertyOpen, setPropertyOpen] = React44.useState(false);
|
|
6498
6516
|
const handleOperatorSelect = (op) => {
|
|
6499
6517
|
if (isNoValueOperator(op)) {
|
|
@@ -6508,46 +6526,36 @@ var AdvancedRow = ({
|
|
|
6508
6526
|
onUpdate({ ...condition, value: val });
|
|
6509
6527
|
};
|
|
6510
6528
|
const displayValue = condition.value == null ? "" : typeof condition.value === "string" ? condition.value : String(condition.value);
|
|
6511
|
-
|
|
6512
|
-
|
|
6513
|
-
|
|
6514
|
-
const arr = map.get(p.group) ?? [];
|
|
6515
|
-
arr.push(p);
|
|
6516
|
-
map.set(p.group, arr);
|
|
6517
|
-
}
|
|
6518
|
-
return map;
|
|
6519
|
-
}, [properties]);
|
|
6520
|
-
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "group flex items-center gap-base py-xs", children: [
|
|
6521
|
-
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
6522
|
-
"span",
|
|
6529
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "flex items-center gap-base w-full", children: [
|
|
6530
|
+
connector === "Where" ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "shrink-0 w-[64px] flex items-center justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "text-xs font-medium leading-xs text-[var(--color-muted-foreground)]", children: "Where" }) }) : /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
6531
|
+
"button",
|
|
6523
6532
|
{
|
|
6533
|
+
type: "button",
|
|
6534
|
+
onClick: onConnectorToggle,
|
|
6524
6535
|
className: cn(
|
|
6525
|
-
"shrink-0
|
|
6526
|
-
|
|
6536
|
+
"shrink-0 flex items-center justify-center gap-xs",
|
|
6537
|
+
"min-w-[64px] min-h-[24px] max-h-[24px] p-xs",
|
|
6538
|
+
"bg-gradient-to-t from-[var(--color-btn-outlined-neutral-bg-default)] from-[10%] to-[var(--color-btn-outlined-neutral-bg-gradient-to-default)]",
|
|
6539
|
+
"border border-[var(--color-btn-outlined-neutral-border-default)] rounded-base shadow-sm",
|
|
6540
|
+
"cursor-pointer transition-colors text-xs font-medium leading-xs text-[var(--color-foreground)]",
|
|
6541
|
+
"hover:from-[var(--color-btn-outlined-neutral-bg-hover)] hover:to-[var(--color-btn-outlined-neutral-bg-gradient-to-hover)]"
|
|
6527
6542
|
),
|
|
6528
|
-
children:
|
|
6543
|
+
children: [
|
|
6529
6544
|
connector,
|
|
6530
|
-
|
|
6531
|
-
]
|
|
6545
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_icons31.Icon, { icon: import_icons31.faRefreshOutline, size: "xs", className: "text-[var(--color-foreground)]" })
|
|
6546
|
+
]
|
|
6532
6547
|
}
|
|
6533
6548
|
),
|
|
6534
6549
|
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(PopoverPrimitive9.Root, { open: propertyOpen, onOpenChange: setPropertyOpen, children: [
|
|
6535
|
-
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(PopoverPrimitive9.Trigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
6536
|
-
"
|
|
6537
|
-
{
|
|
6538
|
-
|
|
6539
|
-
|
|
6540
|
-
|
|
6541
|
-
|
|
6542
|
-
|
|
6543
|
-
|
|
6544
|
-
" \u203A ",
|
|
6545
|
-
propertyDef.label
|
|
6546
|
-
] }),
|
|
6547
|
-
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("svg", { width: "10", height: "10", viewBox: "0 0 10 10", fill: "currentColor", className: "text-[var(--color-muted-foreground)]", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("path", { d: "M2.5 4L5 6.5L7.5 4", stroke: "currentColor", strokeWidth: "1.2", fill: "none", strokeLinecap: "round" }) })
|
|
6548
|
-
]
|
|
6549
|
-
}
|
|
6550
|
-
) }),
|
|
6550
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(PopoverPrimitive9.Trigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("button", { type: "button", className: cn(selectBtnStyle, "shrink-0 min-w-[80px]"), children: [
|
|
6551
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_icons31.Icon, { icon: propertyDef.icon, size: "sm", className: "shrink-0 text-[var(--color-muted-foreground)]" }),
|
|
6552
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("span", { className: "text-sm font-regular leading-sm text-[var(--color-foreground)] whitespace-nowrap", children: [
|
|
6553
|
+
propertyDef.groupLabel,
|
|
6554
|
+
" > ",
|
|
6555
|
+
propertyDef.label
|
|
6556
|
+
] }),
|
|
6557
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_icons31.Icon, { icon: import_icons31.faChevronDownOutline, size: "xs", className: "shrink-0 text-[var(--color-foreground)]" })
|
|
6558
|
+
] }) }),
|
|
6551
6559
|
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(PopoverPrimitive9.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
6552
6560
|
PopoverPrimitive9.Content,
|
|
6553
6561
|
{
|
|
@@ -6560,7 +6568,7 @@ var AdvancedRow = ({
|
|
|
6560
6568
|
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0",
|
|
6561
6569
|
"min-w-[200px]"
|
|
6562
6570
|
),
|
|
6563
|
-
children:
|
|
6571
|
+
children: properties.map((p) => /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
6564
6572
|
"button",
|
|
6565
6573
|
{
|
|
6566
6574
|
type: "button",
|
|
@@ -6579,22 +6587,15 @@ var AdvancedRow = ({
|
|
|
6579
6587
|
]
|
|
6580
6588
|
},
|
|
6581
6589
|
p.id
|
|
6582
|
-
))
|
|
6590
|
+
))
|
|
6583
6591
|
}
|
|
6584
6592
|
) })
|
|
6585
6593
|
] }),
|
|
6586
6594
|
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(PopoverPrimitive9.Root, { open: operatorOpen, onOpenChange: setOperatorOpen, children: [
|
|
6587
|
-
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(PopoverPrimitive9.Trigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
6588
|
-
"
|
|
6589
|
-
{
|
|
6590
|
-
|
|
6591
|
-
className: "flex items-center gap-xs px-base py-sm rounded-base border border-[var(--color-input)] bg-[var(--color-background)] cursor-pointer hover:bg-[var(--color-accent)] transition-colors",
|
|
6592
|
-
children: [
|
|
6593
|
-
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "text-sm font-regular leading-sm text-[var(--color-foreground)] whitespace-nowrap", children: condition.operator ?? "select" }),
|
|
6594
|
-
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("svg", { width: "10", height: "10", viewBox: "0 0 10 10", fill: "currentColor", className: "text-[var(--color-muted-foreground)]", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("path", { d: "M2.5 4L5 6.5L7.5 4", stroke: "currentColor", strokeWidth: "1.2", fill: "none", strokeLinecap: "round" }) })
|
|
6595
|
-
]
|
|
6596
|
-
}
|
|
6597
|
-
) }),
|
|
6595
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(PopoverPrimitive9.Trigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("button", { type: "button", className: cn(selectBtnStyle, "shrink-0 w-[103px]"), children: [
|
|
6596
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "flex-1 text-sm font-regular leading-sm text-[var(--color-foreground)] whitespace-nowrap text-left", children: condition.operator ?? "Select" }),
|
|
6597
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_icons31.Icon, { icon: import_icons31.faChevronDownOutline, size: "xs", className: "shrink-0 text-[var(--color-foreground)]" })
|
|
6598
|
+
] }) }),
|
|
6598
6599
|
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(PopoverPrimitive9.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
6599
6600
|
PopoverPrimitive9.Content,
|
|
6600
6601
|
{
|
|
@@ -6624,9 +6625,10 @@ var AdvancedRow = ({
|
|
|
6624
6625
|
type: "text",
|
|
6625
6626
|
value: displayValue,
|
|
6626
6627
|
onChange: (e) => handleValueChange(e.target.value),
|
|
6627
|
-
placeholder: "
|
|
6628
|
+
placeholder: "Placeholder",
|
|
6628
6629
|
className: cn(
|
|
6629
|
-
"
|
|
6630
|
+
"w-[160px] shrink-0 px-base py-sm rounded-md",
|
|
6631
|
+
"border border-[var(--color-input)]",
|
|
6630
6632
|
"bg-[var(--color-background)] text-sm font-regular leading-sm text-[var(--color-foreground)]",
|
|
6631
6633
|
"placeholder:text-[var(--color-muted-foreground)]",
|
|
6632
6634
|
"focus:outline-none focus:ring-2 focus:ring-[var(--color-ring)] focus:ring-offset-0"
|
|
@@ -6638,9 +6640,9 @@ var AdvancedRow = ({
|
|
|
6638
6640
|
{
|
|
6639
6641
|
type: "button",
|
|
6640
6642
|
onClick: onDelete,
|
|
6641
|
-
className: "shrink-0 flex items-center justify-center p-sm rounded-
|
|
6643
|
+
className: "ml-auto shrink-0 flex items-center justify-center p-sm rounded-md cursor-pointer transition-colors hover:bg-[var(--color-accent)]",
|
|
6642
6644
|
"aria-label": "Remove filter",
|
|
6643
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_icons31.Icon, { icon: import_icons31.
|
|
6645
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_icons31.Icon, { icon: import_icons31.faXmarkOutline, size: "sm", className: "text-[var(--color-foreground)]" })
|
|
6644
6646
|
}
|
|
6645
6647
|
)
|
|
6646
6648
|
] });
|
|
@@ -6649,6 +6651,14 @@ AdvancedRow.displayName = "AdvancedRow";
|
|
|
6649
6651
|
|
|
6650
6652
|
// src/components/ui/filter/advanced-popover.tsx
|
|
6651
6653
|
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
6654
|
+
var outlinedBtn = [
|
|
6655
|
+
"flex items-center gap-sm px-base py-sm",
|
|
6656
|
+
"min-h-[32px] max-h-[32px] min-w-[80px]",
|
|
6657
|
+
"bg-gradient-to-t from-[var(--color-btn-outlined-neutral-bg-default)] from-[10%] to-[var(--color-btn-outlined-neutral-bg-gradient-to-default)]",
|
|
6658
|
+
"border border-[var(--color-btn-outlined-neutral-border-default)] rounded-md shadow-sm",
|
|
6659
|
+
"cursor-pointer transition-colors text-sm font-medium leading-sm text-[var(--color-foreground)]",
|
|
6660
|
+
"hover:from-[var(--color-btn-outlined-neutral-bg-hover)] hover:to-[var(--color-btn-outlined-neutral-bg-gradient-to-hover)]"
|
|
6661
|
+
];
|
|
6652
6662
|
var AdvancedPopover = ({
|
|
6653
6663
|
filters,
|
|
6654
6664
|
properties,
|
|
@@ -6658,6 +6668,7 @@ var AdvancedPopover = ({
|
|
|
6658
6668
|
children
|
|
6659
6669
|
}) => {
|
|
6660
6670
|
const [addSelectorOpen, setAddSelectorOpen] = React45.useState(false);
|
|
6671
|
+
const [logicOps, setLogicOps] = React45.useState({});
|
|
6661
6672
|
const getPropertyDef = (propertyId) => properties.find((p) => p.id === propertyId);
|
|
6662
6673
|
const handleUpdateFilter = (updated) => {
|
|
6663
6674
|
onFiltersChange(filters.map((f) => f.id === updated.id ? updated : f));
|
|
@@ -6680,6 +6691,12 @@ var AdvancedPopover = ({
|
|
|
6680
6691
|
onFiltersChange([]);
|
|
6681
6692
|
onOpenChange?.(false);
|
|
6682
6693
|
};
|
|
6694
|
+
const toggleLogicOp = (filterId) => {
|
|
6695
|
+
setLogicOps((prev) => ({
|
|
6696
|
+
...prev,
|
|
6697
|
+
[filterId]: (prev[filterId] ?? "and") === "and" ? "or" : "and"
|
|
6698
|
+
}));
|
|
6699
|
+
};
|
|
6683
6700
|
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(PopoverPrimitive10.Root, { open, onOpenChange, children: [
|
|
6684
6701
|
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(PopoverPrimitive10.Trigger, { asChild: true, children }),
|
|
6685
6702
|
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(PopoverPrimitive10.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
@@ -6688,22 +6705,22 @@ var AdvancedPopover = ({
|
|
|
6688
6705
|
sideOffset: 4,
|
|
6689
6706
|
align: "start",
|
|
6690
6707
|
className: cn(
|
|
6691
|
-
"z-50 flex flex-col
|
|
6692
|
-
"bg-[var(--color-
|
|
6708
|
+
"z-50 flex flex-col",
|
|
6709
|
+
"bg-[var(--color-background)] rounded-md shadow-lg",
|
|
6693
6710
|
"data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
|
|
6694
6711
|
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
|
|
6695
|
-
"data-[side=bottom]:slide-in-from-top-2"
|
|
6696
|
-
"min-w-[520px] max-w-[90vw]"
|
|
6712
|
+
"data-[side=bottom]:slide-in-from-top-2"
|
|
6697
6713
|
),
|
|
6698
6714
|
children: [
|
|
6699
|
-
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex flex-col
|
|
6715
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex flex-col gap-base p-base", children: [
|
|
6700
6716
|
filters.map((filter, i) => {
|
|
6701
6717
|
const propDef = getPropertyDef(filter.propertyId);
|
|
6702
6718
|
if (!propDef) return null;
|
|
6703
6719
|
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
6704
6720
|
AdvancedRow,
|
|
6705
6721
|
{
|
|
6706
|
-
connector: i === 0 ? "Where" : "And",
|
|
6722
|
+
connector: i === 0 ? "Where" : (logicOps[filter.id] ?? "and") === "and" ? "And" : "Or",
|
|
6723
|
+
onConnectorToggle: i > 0 ? () => toggleLogicOp(filter.id) : void 0,
|
|
6707
6724
|
propertyDef: propDef,
|
|
6708
6725
|
condition: filter,
|
|
6709
6726
|
properties,
|
|
@@ -6716,7 +6733,7 @@ var AdvancedPopover = ({
|
|
|
6716
6733
|
}),
|
|
6717
6734
|
filters.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("p", { className: "py-base text-sm text-[var(--color-muted-foreground)]", children: "No advanced filters yet." })
|
|
6718
6735
|
] }),
|
|
6719
|
-
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex items-center justify-between
|
|
6736
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex items-center justify-between p-base border-t border-[var(--color-border)]", children: [
|
|
6720
6737
|
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
6721
6738
|
PropertySelector,
|
|
6722
6739
|
{
|
|
@@ -6724,22 +6741,165 @@ var AdvancedPopover = ({
|
|
|
6724
6741
|
onSelect: handleAddFilter,
|
|
6725
6742
|
open: addSelectorOpen,
|
|
6726
6743
|
onOpenChange: setAddSelectorOpen,
|
|
6727
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime48.
|
|
6744
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("button", { type: "button", className: cn(outlinedBtn), children: [
|
|
6745
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_icons32.Icon, { icon: import_icons32.faPlusOutline, size: "sm", className: "text-[var(--color-foreground)]" }),
|
|
6746
|
+
"Add filter"
|
|
6747
|
+
] })
|
|
6748
|
+
}
|
|
6749
|
+
),
|
|
6750
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
6751
|
+
"button",
|
|
6752
|
+
{
|
|
6753
|
+
type: "button",
|
|
6754
|
+
onClick: handleClearAll,
|
|
6755
|
+
className: "text-sm font-medium leading-sm text-[var(--color-foreground)] cursor-pointer transition-colors hover:opacity-70 px-base py-sm",
|
|
6756
|
+
children: "Clear all filters"
|
|
6757
|
+
}
|
|
6758
|
+
)
|
|
6759
|
+
] })
|
|
6760
|
+
]
|
|
6761
|
+
}
|
|
6762
|
+
) })
|
|
6763
|
+
] });
|
|
6764
|
+
};
|
|
6765
|
+
AdvancedPopover.displayName = "AdvancedPopover";
|
|
6766
|
+
|
|
6767
|
+
// src/components/ui/filter/summary-chip.tsx
|
|
6768
|
+
var React46 = __toESM(require("react"));
|
|
6769
|
+
var PopoverPrimitive11 = __toESM(require("@radix-ui/react-popover"));
|
|
6770
|
+
var import_icons33 = require("@l3mpire/icons");
|
|
6771
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
6772
|
+
var SummaryChip = ({
|
|
6773
|
+
count,
|
|
6774
|
+
filters,
|
|
6775
|
+
properties,
|
|
6776
|
+
onFiltersChange,
|
|
6777
|
+
onClearAll,
|
|
6778
|
+
className
|
|
6779
|
+
}) => {
|
|
6780
|
+
const [open, setOpen] = React46.useState(false);
|
|
6781
|
+
const [addSelectorOpen, setAddSelectorOpen] = React46.useState(false);
|
|
6782
|
+
const [logicOps, setLogicOps] = React46.useState({});
|
|
6783
|
+
const getPropertyDef = (propertyId) => properties.find((p) => p.id === propertyId);
|
|
6784
|
+
const handleUpdateFilter = (updated) => {
|
|
6785
|
+
onFiltersChange(filters.map((f) => f.id === updated.id ? updated : f));
|
|
6786
|
+
};
|
|
6787
|
+
const handleDeleteFilter = (id) => {
|
|
6788
|
+
const next = filters.filter((f) => f.id !== id);
|
|
6789
|
+
onFiltersChange(next);
|
|
6790
|
+
if (next.length === 0) setOpen(false);
|
|
6791
|
+
};
|
|
6792
|
+
const handlePropertyChange = (filterId, newProp) => {
|
|
6793
|
+
const newCondition = createFilterWithDefaults(newProp.id, newProp.type);
|
|
6794
|
+
onFiltersChange(
|
|
6795
|
+
filters.map((f) => f.id === filterId ? { ...newCondition, id: filterId } : f)
|
|
6796
|
+
);
|
|
6797
|
+
};
|
|
6798
|
+
const handleAddFilter = (property) => {
|
|
6799
|
+
const newFilter = createFilterWithDefaults(property.id, property.type);
|
|
6800
|
+
onFiltersChange([...filters, newFilter]);
|
|
6801
|
+
setAddSelectorOpen(false);
|
|
6802
|
+
};
|
|
6803
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(PopoverPrimitive11.Root, { open, onOpenChange: setOpen, children: [
|
|
6804
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(PopoverPrimitive11.Trigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
6805
|
+
"button",
|
|
6806
|
+
{
|
|
6807
|
+
type: "button",
|
|
6808
|
+
className: cn(
|
|
6809
|
+
"inline-flex items-center gap-sm px-base py-sm",
|
|
6810
|
+
"min-h-[32px] max-h-[32px]",
|
|
6811
|
+
"bg-gradient-to-t from-[var(--color-btn-outlined-neutral-bg-default)] from-[10%] to-[var(--color-btn-outlined-neutral-bg-gradient-to-default)]",
|
|
6812
|
+
"border border-[var(--color-btn-outlined-neutral-border-default)] rounded-md shadow-sm",
|
|
6813
|
+
"cursor-pointer transition-colors",
|
|
6814
|
+
"hover:from-[var(--color-btn-outlined-neutral-bg-hover)] hover:to-[var(--color-btn-outlined-neutral-bg-gradient-to-hover)]",
|
|
6815
|
+
className
|
|
6816
|
+
),
|
|
6817
|
+
children: [
|
|
6818
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
6819
|
+
import_icons33.Icon,
|
|
6820
|
+
{
|
|
6821
|
+
icon: import_icons33.faSlidersOutline,
|
|
6822
|
+
size: "sm",
|
|
6823
|
+
className: "shrink-0 text-[var(--color-foreground)]"
|
|
6824
|
+
}
|
|
6825
|
+
),
|
|
6826
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "text-sm font-medium leading-sm whitespace-nowrap text-[var(--color-foreground)]", children: "Filters" }),
|
|
6827
|
+
count > 0 && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "flex items-center p-2xs rounded-xs bg-filter-chip-badge-bg", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "text-[10px] font-medium leading-2xs text-filter-chip-badge-text", children: count }) })
|
|
6828
|
+
]
|
|
6829
|
+
}
|
|
6830
|
+
) }),
|
|
6831
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(PopoverPrimitive11.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
6832
|
+
PopoverPrimitive11.Content,
|
|
6833
|
+
{
|
|
6834
|
+
sideOffset: 4,
|
|
6835
|
+
align: "start",
|
|
6836
|
+
className: cn(
|
|
6837
|
+
"z-50 flex flex-col overflow-clip",
|
|
6838
|
+
"bg-[var(--color-dropdown-bg)] border border-[var(--color-dropdown-border)] rounded-md shadow-lg",
|
|
6839
|
+
"data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
|
|
6840
|
+
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
|
|
6841
|
+
"data-[side=bottom]:slide-in-from-top-2",
|
|
6842
|
+
"min-w-[420px] max-w-[90vw]"
|
|
6843
|
+
),
|
|
6844
|
+
children: [
|
|
6845
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex flex-col gap-base p-base", children: [
|
|
6846
|
+
filters.map((filter, i) => {
|
|
6847
|
+
const propDef = getPropertyDef(filter.propertyId);
|
|
6848
|
+
if (!propDef) return null;
|
|
6849
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
6850
|
+
AdvancedRow,
|
|
6851
|
+
{
|
|
6852
|
+
connector: i === 0 ? "Where" : (logicOps[filter.id] ?? "and") === "and" ? "And" : "Or",
|
|
6853
|
+
onConnectorToggle: i > 0 ? () => setLogicOps((prev) => ({ ...prev, [filter.id]: (prev[filter.id] ?? "and") === "and" ? "or" : "and" })) : void 0,
|
|
6854
|
+
propertyDef: propDef,
|
|
6855
|
+
condition: filter,
|
|
6856
|
+
properties,
|
|
6857
|
+
onUpdate: handleUpdateFilter,
|
|
6858
|
+
onPropertyChange: (p) => handlePropertyChange(filter.id, p),
|
|
6859
|
+
onDelete: () => handleDeleteFilter(filter.id)
|
|
6860
|
+
},
|
|
6861
|
+
filter.id
|
|
6862
|
+
);
|
|
6863
|
+
}),
|
|
6864
|
+
filters.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("p", { className: "py-base text-sm text-[var(--color-muted-foreground)]", children: "No active filters." })
|
|
6865
|
+
] }),
|
|
6866
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex items-center justify-between p-base border-t border-[var(--color-border)]", children: [
|
|
6867
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
6868
|
+
PropertySelector,
|
|
6869
|
+
{
|
|
6870
|
+
properties,
|
|
6871
|
+
onSelect: handleAddFilter,
|
|
6872
|
+
open: addSelectorOpen,
|
|
6873
|
+
onOpenChange: setAddSelectorOpen,
|
|
6874
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
6728
6875
|
"button",
|
|
6729
6876
|
{
|
|
6730
6877
|
type: "button",
|
|
6731
|
-
className:
|
|
6732
|
-
|
|
6878
|
+
className: cn(
|
|
6879
|
+
"flex items-center gap-sm px-base py-sm",
|
|
6880
|
+
"min-h-[32px] max-h-[32px] min-w-[80px]",
|
|
6881
|
+
"bg-gradient-to-t from-[var(--color-btn-outlined-neutral-bg-default)] from-[10%] to-[var(--color-btn-outlined-neutral-bg-gradient-to-default)]",
|
|
6882
|
+
"border border-[var(--color-btn-outlined-neutral-border-default)] rounded-md shadow-sm",
|
|
6883
|
+
"cursor-pointer transition-colors text-sm font-medium leading-sm text-[var(--color-foreground)]",
|
|
6884
|
+
"hover:from-[var(--color-btn-outlined-neutral-bg-hover)] hover:to-[var(--color-btn-outlined-neutral-bg-gradient-to-hover)]"
|
|
6885
|
+
),
|
|
6886
|
+
children: [
|
|
6887
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_icons33.Icon, { icon: import_icons33.faPlusOutline, size: "sm", className: "text-[var(--color-foreground)]" }),
|
|
6888
|
+
"Add filter"
|
|
6889
|
+
]
|
|
6733
6890
|
}
|
|
6734
6891
|
)
|
|
6735
6892
|
}
|
|
6736
6893
|
),
|
|
6737
|
-
/* @__PURE__ */ (0,
|
|
6894
|
+
filters.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
6738
6895
|
"button",
|
|
6739
6896
|
{
|
|
6740
6897
|
type: "button",
|
|
6741
|
-
onClick:
|
|
6742
|
-
|
|
6898
|
+
onClick: () => {
|
|
6899
|
+
onClearAll();
|
|
6900
|
+
setOpen(false);
|
|
6901
|
+
},
|
|
6902
|
+
className: "text-sm font-medium leading-sm text-[var(--color-foreground)] cursor-pointer transition-colors hover:opacity-70 px-base py-sm",
|
|
6743
6903
|
children: "Clear all filters"
|
|
6744
6904
|
}
|
|
6745
6905
|
)
|
|
@@ -6749,22 +6909,45 @@ var AdvancedPopover = ({
|
|
|
6749
6909
|
) })
|
|
6750
6910
|
] });
|
|
6751
6911
|
};
|
|
6752
|
-
|
|
6912
|
+
SummaryChip.displayName = "SummaryChip";
|
|
6913
|
+
|
|
6914
|
+
// src/components/ui/filter/use-filter-bar-mode.ts
|
|
6915
|
+
var React47 = __toESM(require("react"));
|
|
6916
|
+
function useFilterBarMode(ref, override) {
|
|
6917
|
+
const [mode, setMode] = React47.useState("default");
|
|
6918
|
+
React47.useEffect(() => {
|
|
6919
|
+
if (override) return;
|
|
6920
|
+
const el = ref.current;
|
|
6921
|
+
if (!el) return;
|
|
6922
|
+
const observer = new ResizeObserver((entries) => {
|
|
6923
|
+
const width = entries[0]?.contentRect.width ?? 0;
|
|
6924
|
+
setMode(width > 600 ? "default" : "minimal");
|
|
6925
|
+
});
|
|
6926
|
+
observer.observe(el);
|
|
6927
|
+
return () => observer.disconnect();
|
|
6928
|
+
}, [ref, override]);
|
|
6929
|
+
return override ?? mode;
|
|
6930
|
+
}
|
|
6753
6931
|
|
|
6754
6932
|
// src/components/ui/filter/filter-system.tsx
|
|
6755
|
-
var
|
|
6933
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
6756
6934
|
var FilterSystem = ({
|
|
6757
6935
|
properties,
|
|
6758
6936
|
filterState,
|
|
6759
6937
|
onFilterStateChange,
|
|
6760
6938
|
sortFields,
|
|
6939
|
+
mode: modeOverride,
|
|
6761
6940
|
children,
|
|
6762
6941
|
actions,
|
|
6763
6942
|
className
|
|
6764
6943
|
}) => {
|
|
6765
|
-
const
|
|
6766
|
-
const
|
|
6767
|
-
const [
|
|
6944
|
+
const containerRef = React48.useRef(null);
|
|
6945
|
+
const mode = useFilterBarMode(containerRef, modeOverride);
|
|
6946
|
+
const [propertySelectorOpen, setPropertySelectorOpen] = React48.useState(false);
|
|
6947
|
+
const [advancedOpen, setAdvancedOpen] = React48.useState(false);
|
|
6948
|
+
const [pendingFilterId, setPendingFilterId] = React48.useState(null);
|
|
6949
|
+
const allFilters = [...filterState.basicFilters, ...filterState.advancedFilters];
|
|
6950
|
+
const totalCount = allFilters.length;
|
|
6768
6951
|
const handleAddFilter = (property) => {
|
|
6769
6952
|
const newFilter = createFilterWithDefaults(property.id, property.type);
|
|
6770
6953
|
if (newFilter.operator && isNoValueOperator(newFilter.operator)) {
|
|
@@ -6819,100 +7002,146 @@ var FilterSystem = ({
|
|
|
6819
7002
|
});
|
|
6820
7003
|
};
|
|
6821
7004
|
const handleAdvancedFiltersChange = (filters) => {
|
|
6822
|
-
onFilterStateChange({
|
|
6823
|
-
...filterState,
|
|
6824
|
-
advancedFilters: filters
|
|
6825
|
-
});
|
|
7005
|
+
onFilterStateChange({ ...filterState, advancedFilters: filters });
|
|
6826
7006
|
};
|
|
6827
7007
|
const handleClearAdvanced = () => {
|
|
7008
|
+
onFilterStateChange({ ...filterState, advancedFilters: [] });
|
|
7009
|
+
};
|
|
7010
|
+
const handleClearAll = () => {
|
|
6828
7011
|
onFilterStateChange({
|
|
6829
7012
|
...filterState,
|
|
7013
|
+
basicFilters: [],
|
|
6830
7014
|
advancedFilters: []
|
|
6831
7015
|
});
|
|
6832
7016
|
};
|
|
6833
7017
|
const handleSortChange = (field, direction) => {
|
|
6834
|
-
onFilterStateChange({
|
|
6835
|
-
...filterState,
|
|
6836
|
-
sort: { field, direction }
|
|
6837
|
-
});
|
|
7018
|
+
onFilterStateChange({ ...filterState, sort: { field, direction } });
|
|
6838
7019
|
};
|
|
6839
7020
|
const getPropertyDef = (propertyId) => properties.find((p) => p.id === propertyId);
|
|
6840
7021
|
const hasAdvanced = filterState.advancedFilters.length > 0;
|
|
6841
|
-
|
|
6842
|
-
|
|
7022
|
+
const isMinimal = mode === "minimal";
|
|
7023
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(FilterBar, { ref: containerRef, className, children: [
|
|
7024
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(FilterBarLeft, { children: [
|
|
6843
7025
|
children,
|
|
6844
|
-
sortFields && filterState.sort && /* @__PURE__ */ (0,
|
|
7026
|
+
sortFields && filterState.sort && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
6845
7027
|
SortButton,
|
|
6846
7028
|
{
|
|
6847
7029
|
fields: sortFields,
|
|
6848
7030
|
activeField: filterState.sort.field,
|
|
6849
7031
|
direction: filterState.sort.direction,
|
|
6850
|
-
onChange: handleSortChange
|
|
7032
|
+
onChange: handleSortChange,
|
|
7033
|
+
iconOnly: isMinimal
|
|
6851
7034
|
}
|
|
6852
7035
|
),
|
|
6853
|
-
|
|
6854
|
-
|
|
6855
|
-
|
|
6856
|
-
|
|
6857
|
-
properties,
|
|
6858
|
-
onFiltersChange: handleAdvancedFiltersChange,
|
|
6859
|
-
open: advancedOpen,
|
|
6860
|
-
onOpenChange: setAdvancedOpen,
|
|
6861
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
6862
|
-
AdvancedChip,
|
|
6863
|
-
{
|
|
6864
|
-
count: filterState.advancedFilters.length,
|
|
6865
|
-
onClick: () => setAdvancedOpen(true),
|
|
6866
|
-
onClear: handleClearAdvanced
|
|
6867
|
-
}
|
|
6868
|
-
)
|
|
6869
|
-
}
|
|
6870
|
-
),
|
|
6871
|
-
filterState.basicFilters.map((filter) => {
|
|
6872
|
-
const propDef = getPropertyDef(filter.propertyId);
|
|
6873
|
-
if (!propDef) return null;
|
|
6874
|
-
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
6875
|
-
InteractiveFilterChip,
|
|
7036
|
+
isMinimal ? totalCount > 0 ? (
|
|
7037
|
+
/* Has filters → SummaryChip (interactive popover) */
|
|
7038
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
7039
|
+
SummaryChip,
|
|
6876
7040
|
{
|
|
6877
|
-
|
|
6878
|
-
|
|
7041
|
+
count: totalCount,
|
|
7042
|
+
filters: allFilters,
|
|
6879
7043
|
properties,
|
|
6880
|
-
|
|
6881
|
-
|
|
6882
|
-
|
|
6883
|
-
|
|
6884
|
-
|
|
6885
|
-
|
|
6886
|
-
|
|
6887
|
-
|
|
6888
|
-
|
|
6889
|
-
|
|
6890
|
-
|
|
6891
|
-
|
|
6892
|
-
|
|
6893
|
-
|
|
6894
|
-
|
|
6895
|
-
|
|
6896
|
-
|
|
6897
|
-
|
|
6898
|
-
|
|
7044
|
+
onFiltersChange: (filters) => {
|
|
7045
|
+
onFilterStateChange({
|
|
7046
|
+
...filterState,
|
|
7047
|
+
basicFilters: filters,
|
|
7048
|
+
advancedFilters: []
|
|
7049
|
+
});
|
|
7050
|
+
},
|
|
7051
|
+
onClearAll: handleClearAll
|
|
7052
|
+
}
|
|
7053
|
+
)
|
|
7054
|
+
) : (
|
|
7055
|
+
/* No filters → same FilterBarButton as default, icon-only */
|
|
7056
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
7057
|
+
PropertySelector,
|
|
7058
|
+
{
|
|
7059
|
+
properties,
|
|
7060
|
+
onSelect: handleAddFilter,
|
|
7061
|
+
open: propertySelectorOpen,
|
|
7062
|
+
onOpenChange: setPropertySelectorOpen,
|
|
7063
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(FilterBarButton, { iconOnly: true })
|
|
7064
|
+
}
|
|
7065
|
+
)
|
|
7066
|
+
) : (
|
|
7067
|
+
/* ── DEFAULT MODE ────────────────────────────────────── */
|
|
7068
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_jsx_runtime50.Fragment, { children: [
|
|
7069
|
+
hasAdvanced && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
7070
|
+
AdvancedPopover,
|
|
6899
7071
|
{
|
|
6900
|
-
|
|
7072
|
+
filters: filterState.advancedFilters,
|
|
7073
|
+
properties,
|
|
7074
|
+
onFiltersChange: handleAdvancedFiltersChange,
|
|
7075
|
+
open: advancedOpen,
|
|
7076
|
+
onOpenChange: setAdvancedOpen,
|
|
7077
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
7078
|
+
AdvancedChip,
|
|
7079
|
+
{
|
|
7080
|
+
count: filterState.advancedFilters.length,
|
|
7081
|
+
onClick: () => setAdvancedOpen(true),
|
|
7082
|
+
onClear: handleClearAdvanced
|
|
7083
|
+
}
|
|
7084
|
+
)
|
|
7085
|
+
}
|
|
7086
|
+
),
|
|
7087
|
+
filterState.basicFilters.map((filter) => {
|
|
7088
|
+
const propDef = getPropertyDef(filter.propertyId);
|
|
7089
|
+
if (!propDef) return null;
|
|
7090
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
7091
|
+
InteractiveFilterChip,
|
|
7092
|
+
{
|
|
7093
|
+
propertyDef: propDef,
|
|
7094
|
+
condition: filter,
|
|
7095
|
+
properties,
|
|
7096
|
+
mode: pendingFilterId === filter.id ? "add" : "edit",
|
|
7097
|
+
autoOpen: pendingFilterId === filter.id,
|
|
7098
|
+
onUpdate: handleUpdateFilter,
|
|
7099
|
+
onPropertyChange: (newProp) => handlePropertyChange(filter.id, newProp),
|
|
7100
|
+
onDelete: () => handleDeleteFilter(filter.id),
|
|
7101
|
+
onConvertToAdvanced: () => handleConvertToAdvanced(filter.id)
|
|
7102
|
+
},
|
|
7103
|
+
filter.id
|
|
7104
|
+
);
|
|
7105
|
+
}),
|
|
7106
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
7107
|
+
PropertySelector,
|
|
7108
|
+
{
|
|
7109
|
+
properties,
|
|
7110
|
+
onSelect: handleAddFilter,
|
|
7111
|
+
open: propertySelectorOpen,
|
|
7112
|
+
onOpenChange: setPropertySelectorOpen,
|
|
7113
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
7114
|
+
FilterBarButton,
|
|
7115
|
+
{
|
|
7116
|
+
count: totalCount || void 0
|
|
7117
|
+
}
|
|
7118
|
+
)
|
|
6901
7119
|
}
|
|
6902
7120
|
)
|
|
6903
|
-
}
|
|
7121
|
+
] })
|
|
6904
7122
|
)
|
|
6905
7123
|
] }),
|
|
6906
|
-
actions && /* @__PURE__ */ (0,
|
|
7124
|
+
(actions || totalCount > 0) && /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(FilterBarRight, { children: [
|
|
7125
|
+
totalCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
7126
|
+
"button",
|
|
7127
|
+
{
|
|
7128
|
+
type: "button",
|
|
7129
|
+
onClick: handleClearAll,
|
|
7130
|
+
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)]",
|
|
7131
|
+
children: isMinimal ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_icons34.Icon, { icon: import_icons34.faXmarkOutline, size: "sm", className: "text-[var(--color-foreground)]" }) : /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "text-sm font-medium leading-sm text-[var(--color-foreground)]", children: "Clear" })
|
|
7132
|
+
}
|
|
7133
|
+
),
|
|
7134
|
+
actions
|
|
7135
|
+
] })
|
|
6907
7136
|
] });
|
|
6908
7137
|
};
|
|
6909
7138
|
FilterSystem.displayName = "FilterSystem";
|
|
6910
7139
|
|
|
6911
7140
|
// src/components/ui/date-picker.tsx
|
|
6912
|
-
var
|
|
6913
|
-
var
|
|
6914
|
-
var
|
|
6915
|
-
var
|
|
7141
|
+
var React49 = __toESM(require("react"));
|
|
7142
|
+
var PopoverPrimitive12 = __toESM(require("@radix-ui/react-popover"));
|
|
7143
|
+
var import_icons35 = require("@l3mpire/icons");
|
|
7144
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
6916
7145
|
function getDaysInMonth(year, month) {
|
|
6917
7146
|
return new Date(year, month + 1, 0).getDate();
|
|
6918
7147
|
}
|
|
@@ -6944,16 +7173,16 @@ var MONTH_NAMES = [
|
|
|
6944
7173
|
"November",
|
|
6945
7174
|
"December"
|
|
6946
7175
|
];
|
|
6947
|
-
var DatePickerContext =
|
|
7176
|
+
var DatePickerContext = React49.createContext(
|
|
6948
7177
|
null
|
|
6949
7178
|
);
|
|
6950
7179
|
function useDatePickerContext() {
|
|
6951
|
-
const ctx =
|
|
7180
|
+
const ctx = React49.useContext(DatePickerContext);
|
|
6952
7181
|
if (!ctx)
|
|
6953
7182
|
throw new Error("DatePicker compound components must be used within <DatePicker>");
|
|
6954
7183
|
return ctx;
|
|
6955
7184
|
}
|
|
6956
|
-
var DatePicker =
|
|
7185
|
+
var DatePicker = React49.forwardRef(
|
|
6957
7186
|
({
|
|
6958
7187
|
className,
|
|
6959
7188
|
mode = "single",
|
|
@@ -6964,22 +7193,22 @@ var DatePicker = React47.forwardRef(
|
|
|
6964
7193
|
children,
|
|
6965
7194
|
...props
|
|
6966
7195
|
}, ref) => {
|
|
6967
|
-
const today =
|
|
6968
|
-
const initialDate =
|
|
7196
|
+
const today = React49.useMemo(() => startOfDay(/* @__PURE__ */ new Date()), []);
|
|
7197
|
+
const initialDate = React49.useMemo(() => {
|
|
6969
7198
|
if (value) {
|
|
6970
7199
|
if (value instanceof Date) return value;
|
|
6971
7200
|
return value.from;
|
|
6972
7201
|
}
|
|
6973
7202
|
return today;
|
|
6974
7203
|
}, []);
|
|
6975
|
-
const [month, setMonth] =
|
|
7204
|
+
const [month, setMonth] = React49.useState(
|
|
6976
7205
|
defaultMonth ?? initialDate.getMonth()
|
|
6977
7206
|
);
|
|
6978
|
-
const [year, setYear] =
|
|
7207
|
+
const [year, setYear] = React49.useState(
|
|
6979
7208
|
defaultYear ?? initialDate.getFullYear()
|
|
6980
7209
|
);
|
|
6981
|
-
const [hoveredDate, setHoveredDate] =
|
|
6982
|
-
const goToPrevMonth =
|
|
7210
|
+
const [hoveredDate, setHoveredDate] = React49.useState();
|
|
7211
|
+
const goToPrevMonth = React49.useCallback(() => {
|
|
6983
7212
|
setMonth((m) => {
|
|
6984
7213
|
if (m === 0) {
|
|
6985
7214
|
setYear((y) => y - 1);
|
|
@@ -6988,7 +7217,7 @@ var DatePicker = React47.forwardRef(
|
|
|
6988
7217
|
return m - 1;
|
|
6989
7218
|
});
|
|
6990
7219
|
}, []);
|
|
6991
|
-
const goToNextMonth =
|
|
7220
|
+
const goToNextMonth = React49.useCallback(() => {
|
|
6992
7221
|
setMonth((m) => {
|
|
6993
7222
|
if (m === 11) {
|
|
6994
7223
|
setYear((y) => y + 1);
|
|
@@ -6997,7 +7226,7 @@ var DatePicker = React47.forwardRef(
|
|
|
6997
7226
|
return m + 1;
|
|
6998
7227
|
});
|
|
6999
7228
|
}, []);
|
|
7000
|
-
const onSelect =
|
|
7229
|
+
const onSelect = React49.useCallback(
|
|
7001
7230
|
(date) => {
|
|
7002
7231
|
if (mode === "single") {
|
|
7003
7232
|
onValueChange?.(date);
|
|
@@ -7016,7 +7245,7 @@ var DatePicker = React47.forwardRef(
|
|
|
7016
7245
|
},
|
|
7017
7246
|
[mode, value, onValueChange]
|
|
7018
7247
|
);
|
|
7019
|
-
const ctxValue =
|
|
7248
|
+
const ctxValue = React49.useMemo(
|
|
7020
7249
|
() => ({
|
|
7021
7250
|
mode,
|
|
7022
7251
|
selected: value,
|
|
@@ -7043,7 +7272,7 @@ var DatePicker = React47.forwardRef(
|
|
|
7043
7272
|
hoveredDate
|
|
7044
7273
|
]
|
|
7045
7274
|
);
|
|
7046
|
-
return /* @__PURE__ */ (0,
|
|
7275
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(DatePickerContext.Provider, { value: ctxValue, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
7047
7276
|
"div",
|
|
7048
7277
|
{
|
|
7049
7278
|
ref,
|
|
@@ -7066,32 +7295,32 @@ function defaultFormatDate(date) {
|
|
|
7066
7295
|
year: "numeric"
|
|
7067
7296
|
});
|
|
7068
7297
|
}
|
|
7069
|
-
var DatePickerSelects =
|
|
7298
|
+
var DatePickerSelects = React49.forwardRef(({ className, formatDate = defaultFormatDate, ...props }, ref) => {
|
|
7070
7299
|
const { selected } = useDatePickerContext();
|
|
7071
7300
|
const fromDate = selected instanceof Date ? selected : selected?.from;
|
|
7072
7301
|
const toDate = selected instanceof Date ? void 0 : selected?.to;
|
|
7073
|
-
return /* @__PURE__ */ (0,
|
|
7302
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
7074
7303
|
"div",
|
|
7075
7304
|
{
|
|
7076
7305
|
ref,
|
|
7077
7306
|
className: cn("flex flex-col items-start pt-lg px-lg", className),
|
|
7078
7307
|
...props,
|
|
7079
|
-
children: /* @__PURE__ */ (0,
|
|
7080
|
-
/* @__PURE__ */ (0,
|
|
7081
|
-
/* @__PURE__ */ (0,
|
|
7082
|
-
/* @__PURE__ */ (0,
|
|
7308
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "flex items-center gap-base w-full", children: [
|
|
7309
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.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: [
|
|
7310
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "flex-1 text-sm font-regular leading-sm text-datepicker-header-text truncate", children: fromDate ? formatDate(fromDate) : "Start date" }),
|
|
7311
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_icons35.Icon, { icon: import_icons35.faCalendarOutline, size: "sm", className: "shrink-0 text-datepicker-header-text" })
|
|
7083
7312
|
] }),
|
|
7084
|
-
/* @__PURE__ */ (0,
|
|
7085
|
-
|
|
7313
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
7314
|
+
import_icons35.Icon,
|
|
7086
7315
|
{
|
|
7087
|
-
icon:
|
|
7316
|
+
icon: import_icons35.faArrowRightOutline,
|
|
7088
7317
|
size: "sm",
|
|
7089
7318
|
className: "shrink-0 text-datepicker-header-weekday"
|
|
7090
7319
|
}
|
|
7091
7320
|
),
|
|
7092
|
-
/* @__PURE__ */ (0,
|
|
7093
|
-
/* @__PURE__ */ (0,
|
|
7094
|
-
/* @__PURE__ */ (0,
|
|
7321
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.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: [
|
|
7322
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "flex-1 text-sm font-regular leading-sm text-datepicker-header-text truncate", children: toDate ? formatDate(toDate) : "End date" }),
|
|
7323
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_icons35.Icon, { icon: import_icons35.faCalendarOutline, size: "sm", className: "shrink-0 text-datepicker-header-text" })
|
|
7095
7324
|
] })
|
|
7096
7325
|
] })
|
|
7097
7326
|
}
|
|
@@ -7107,7 +7336,7 @@ var DatePickerDay = ({ date, isOutside }) => {
|
|
|
7107
7336
|
const inRange = mode === "range" && selected && !(selected instanceof Date) && selected.from && selected.to && !isSelected && isInRange(date, selected.from, selected.to);
|
|
7108
7337
|
const inPreviewRange = mode === "range" && selected && !(selected instanceof Date) && selected.from && !selected.to && hoveredDate && !isSelected && hoveredDate.getTime() > selected.from.getTime() && isInRange(date, selected.from, hoveredDate);
|
|
7109
7338
|
const isInRangeOrPreview = inRange || inPreviewRange;
|
|
7110
|
-
return /* @__PURE__ */ (0,
|
|
7339
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
7111
7340
|
"button",
|
|
7112
7341
|
{
|
|
7113
7342
|
type: "button",
|
|
@@ -7131,14 +7360,14 @@ var DatePickerDay = ({ date, isOutside }) => {
|
|
|
7131
7360
|
),
|
|
7132
7361
|
children: [
|
|
7133
7362
|
date.getDate(),
|
|
7134
|
-
isToday && !isOutside && /* @__PURE__ */ (0,
|
|
7363
|
+
isToday && !isOutside && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "absolute bottom-0.5 left-1/2 -translate-x-1/2 size-1.5 rounded-full bg-datepicker-day-today" })
|
|
7135
7364
|
]
|
|
7136
7365
|
}
|
|
7137
7366
|
);
|
|
7138
7367
|
};
|
|
7139
|
-
var DatePickerCalendar =
|
|
7368
|
+
var DatePickerCalendar = React49.forwardRef(({ className, header, ...props }, ref) => {
|
|
7140
7369
|
const { month, year, goToPrevMonth, goToNextMonth } = useDatePickerContext();
|
|
7141
|
-
const weeks =
|
|
7370
|
+
const weeks = React49.useMemo(() => {
|
|
7142
7371
|
const firstDay = new Date(year, month, 1);
|
|
7143
7372
|
const startOffset = getWeekdayIndex(firstDay);
|
|
7144
7373
|
const daysInMonth = getDaysInMonth(year, month);
|
|
@@ -7178,7 +7407,7 @@ var DatePickerCalendar = React47.forwardRef(({ className, header, ...props }, re
|
|
|
7178
7407
|
}
|
|
7179
7408
|
return result;
|
|
7180
7409
|
}, [month, year]);
|
|
7181
|
-
return /* @__PURE__ */ (0,
|
|
7410
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
7182
7411
|
"div",
|
|
7183
7412
|
{
|
|
7184
7413
|
ref,
|
|
@@ -7186,38 +7415,38 @@ var DatePickerCalendar = React47.forwardRef(({ className, header, ...props }, re
|
|
|
7186
7415
|
...props,
|
|
7187
7416
|
children: [
|
|
7188
7417
|
header,
|
|
7189
|
-
/* @__PURE__ */ (0,
|
|
7190
|
-
/* @__PURE__ */ (0,
|
|
7191
|
-
/* @__PURE__ */ (0,
|
|
7418
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "flex flex-col gap-lg p-lg", children: [
|
|
7419
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
7420
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("span", { className: "text-base font-medium leading-base text-datepicker-header-text", children: [
|
|
7192
7421
|
MONTH_NAMES[month],
|
|
7193
7422
|
" ",
|
|
7194
7423
|
year
|
|
7195
7424
|
] }),
|
|
7196
|
-
/* @__PURE__ */ (0,
|
|
7197
|
-
/* @__PURE__ */ (0,
|
|
7425
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "flex items-center gap-xs", children: [
|
|
7426
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
7198
7427
|
"button",
|
|
7199
7428
|
{
|
|
7200
7429
|
type: "button",
|
|
7201
7430
|
onClick: goToPrevMonth,
|
|
7202
7431
|
className: "flex items-center justify-center p-xs rounded-base hover:bg-datepicker-day-bg-hover transition-colors cursor-pointer",
|
|
7203
7432
|
"aria-label": "Previous month",
|
|
7204
|
-
children: /* @__PURE__ */ (0,
|
|
7433
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_icons35.Icon, { icon: import_icons35.faChevronLeftOutline, size: "xs", className: "text-datepicker-header-nav" })
|
|
7205
7434
|
}
|
|
7206
7435
|
),
|
|
7207
|
-
/* @__PURE__ */ (0,
|
|
7436
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
7208
7437
|
"button",
|
|
7209
7438
|
{
|
|
7210
7439
|
type: "button",
|
|
7211
7440
|
onClick: goToNextMonth,
|
|
7212
7441
|
className: "flex items-center justify-center p-xs rounded-base hover:bg-datepicker-day-bg-hover transition-colors cursor-pointer",
|
|
7213
7442
|
"aria-label": "Next month",
|
|
7214
|
-
children: /* @__PURE__ */ (0,
|
|
7443
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_icons35.Icon, { icon: import_icons35.faChevronRightOutline, size: "xs", className: "text-datepicker-header-nav" })
|
|
7215
7444
|
}
|
|
7216
7445
|
)
|
|
7217
7446
|
] })
|
|
7218
7447
|
] }),
|
|
7219
|
-
/* @__PURE__ */ (0,
|
|
7220
|
-
/* @__PURE__ */ (0,
|
|
7448
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "flex flex-col", children: [
|
|
7449
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "grid grid-cols-7 gap-base py-sm", children: WEEKDAYS.map((day) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
7221
7450
|
"span",
|
|
7222
7451
|
{
|
|
7223
7452
|
className: "w-9 text-center text-xs font-regular leading-xs text-datepicker-header-weekday",
|
|
@@ -7225,7 +7454,7 @@ var DatePickerCalendar = React47.forwardRef(({ className, header, ...props }, re
|
|
|
7225
7454
|
},
|
|
7226
7455
|
day
|
|
7227
7456
|
)) }),
|
|
7228
|
-
/* @__PURE__ */ (0,
|
|
7457
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "flex flex-col", children: weeks.map((week, wi) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "grid grid-cols-7 gap-base", children: week.map((day, di) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
7229
7458
|
DatePickerDay,
|
|
7230
7459
|
{
|
|
7231
7460
|
date: day.date,
|
|
@@ -7240,10 +7469,10 @@ var DatePickerCalendar = React47.forwardRef(({ className, header, ...props }, re
|
|
|
7240
7469
|
);
|
|
7241
7470
|
});
|
|
7242
7471
|
DatePickerCalendar.displayName = "DatePickerCalendar";
|
|
7243
|
-
var DatePickerSuggestions =
|
|
7472
|
+
var DatePickerSuggestions = React49.forwardRef(
|
|
7244
7473
|
({ className, suggestions, formatDate = defaultFormatDate, ...props }, ref) => {
|
|
7245
7474
|
const { onSelect, mode } = useDatePickerContext();
|
|
7246
|
-
const onValueChange =
|
|
7475
|
+
const onValueChange = React49.useContext(DatePickerContext) ? void 0 : void 0;
|
|
7247
7476
|
const ctx = useDatePickerContext();
|
|
7248
7477
|
const handleClick = (suggestion) => {
|
|
7249
7478
|
const val = suggestion.getValue();
|
|
@@ -7265,7 +7494,7 @@ var DatePickerSuggestions = React47.forwardRef(
|
|
|
7265
7494
|
const to = val.to ? formatDate(val.to) : "";
|
|
7266
7495
|
return to ? `${from} - ${to}` : from;
|
|
7267
7496
|
};
|
|
7268
|
-
return /* @__PURE__ */ (0,
|
|
7497
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
7269
7498
|
"div",
|
|
7270
7499
|
{
|
|
7271
7500
|
ref,
|
|
@@ -7275,16 +7504,16 @@ var DatePickerSuggestions = React47.forwardRef(
|
|
|
7275
7504
|
),
|
|
7276
7505
|
...props,
|
|
7277
7506
|
children: [
|
|
7278
|
-
/* @__PURE__ */ (0,
|
|
7279
|
-
/* @__PURE__ */ (0,
|
|
7507
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "pt-lg px-base", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "flex items-center p-base rounded-base", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "flex-1 text-xs font-medium leading-xs text-datepicker-suggestion-heading uppercase truncate", children: "Suggestions" }) }) }),
|
|
7508
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "flex flex-1 flex-col p-base min-w-[222px]", children: suggestions.map((suggestion, i) => /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
7280
7509
|
"button",
|
|
7281
7510
|
{
|
|
7282
7511
|
type: "button",
|
|
7283
7512
|
onClick: () => handleClick(suggestion),
|
|
7284
7513
|
className: "flex items-center gap-sm p-base rounded-base hover:bg-datepicker-suggestion-hover transition-colors cursor-pointer text-left",
|
|
7285
7514
|
children: [
|
|
7286
|
-
/* @__PURE__ */ (0,
|
|
7287
|
-
/* @__PURE__ */ (0,
|
|
7515
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "text-sm font-regular leading-sm text-datepicker-suggestion-text truncate shrink-0", children: suggestion.label }),
|
|
7516
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "text-xs font-regular leading-xs text-datepicker-suggestion-date truncate", children: formatSuggestionDate(suggestion) })
|
|
7288
7517
|
]
|
|
7289
7518
|
},
|
|
7290
7519
|
i
|
|
@@ -7295,8 +7524,8 @@ var DatePickerSuggestions = React47.forwardRef(
|
|
|
7295
7524
|
}
|
|
7296
7525
|
);
|
|
7297
7526
|
DatePickerSuggestions.displayName = "DatePickerSuggestions";
|
|
7298
|
-
var DatePickerFooter =
|
|
7299
|
-
({ className, children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
7527
|
+
var DatePickerFooter = React49.forwardRef(
|
|
7528
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
7300
7529
|
"div",
|
|
7301
7530
|
{
|
|
7302
7531
|
ref,
|
|
@@ -7312,8 +7541,8 @@ var DatePickerFooter = React47.forwardRef(
|
|
|
7312
7541
|
)
|
|
7313
7542
|
);
|
|
7314
7543
|
DatePickerFooter.displayName = "DatePickerFooter";
|
|
7315
|
-
var DatePickerPanel =
|
|
7316
|
-
({ className, children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
7544
|
+
var DatePickerPanel = React49.forwardRef(
|
|
7545
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
7317
7546
|
"div",
|
|
7318
7547
|
{
|
|
7319
7548
|
ref,
|
|
@@ -7324,10 +7553,10 @@ var DatePickerPanel = React47.forwardRef(
|
|
|
7324
7553
|
)
|
|
7325
7554
|
);
|
|
7326
7555
|
DatePickerPanel.displayName = "DatePickerPanel";
|
|
7327
|
-
var DatePickerRoot =
|
|
7328
|
-
var DatePickerTrigger =
|
|
7329
|
-
var DatePickerPopover =
|
|
7330
|
-
|
|
7556
|
+
var DatePickerRoot = PopoverPrimitive12.Root;
|
|
7557
|
+
var DatePickerTrigger = PopoverPrimitive12.Trigger;
|
|
7558
|
+
var DatePickerPopover = React49.forwardRef(({ className, sideOffset = 4, align = "start", children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(PopoverPrimitive12.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
7559
|
+
PopoverPrimitive12.Content,
|
|
7331
7560
|
{
|
|
7332
7561
|
ref,
|
|
7333
7562
|
sideOffset,
|
|
@@ -7487,6 +7716,7 @@ function getDefaultSuggestions(referenceDate) {
|
|
|
7487
7716
|
SidebarSection,
|
|
7488
7717
|
SortButton,
|
|
7489
7718
|
StatusCell,
|
|
7719
|
+
SummaryChip,
|
|
7490
7720
|
Switch,
|
|
7491
7721
|
TabContent,
|
|
7492
7722
|
TabList,
|
|
@@ -7541,6 +7771,7 @@ function getDefaultSuggestions(referenceDate) {
|
|
|
7541
7771
|
toastVariants,
|
|
7542
7772
|
tooltipContentVariants,
|
|
7543
7773
|
typographyVariants,
|
|
7774
|
+
useFilterBarMode,
|
|
7544
7775
|
useSidebarContext
|
|
7545
7776
|
});
|
|
7546
7777
|
//# sourceMappingURL=index.js.map
|