@l3mpire/ui 2.8.0 → 2.9.1
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 +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +157 -132
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +160 -135
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
package/dist/index.mjs
CHANGED
|
@@ -6318,68 +6318,82 @@ InteractiveFilterChip.displayName = "InteractiveFilterChip";
|
|
|
6318
6318
|
|
|
6319
6319
|
// src/components/ui/filter/filter-system.tsx
|
|
6320
6320
|
import * as React48 from "react";
|
|
6321
|
+
import { Icon as Icon33, faXmarkOutline as faXmarkOutline4 } from "@l3mpire/icons";
|
|
6321
6322
|
|
|
6322
6323
|
// src/components/ui/filter/advanced-chip.tsx
|
|
6323
6324
|
import * as React43 from "react";
|
|
6324
6325
|
import { Icon as Icon29, faXmarkOutline as faXmarkOutline2 } from "@l3mpire/icons";
|
|
6325
|
-
import {
|
|
6326
|
+
import { jsx as jsx46, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
6327
|
+
var btnBase = [
|
|
6328
|
+
"flex items-center justify-center",
|
|
6329
|
+
"min-h-[32px] max-h-[32px]",
|
|
6330
|
+
"bg-gradient-to-t from-[var(--color-btn-outlined-neutral-bg-default)] from-[10%] to-[var(--color-btn-outlined-neutral-bg-gradient-to-default)]",
|
|
6331
|
+
"border border-[var(--color-btn-outlined-neutral-border-default)] shadow-sm",
|
|
6332
|
+
"cursor-pointer transition-colors",
|
|
6333
|
+
"hover:from-[var(--color-btn-outlined-neutral-bg-hover)] hover:to-[var(--color-btn-outlined-neutral-bg-gradient-to-hover)]"
|
|
6334
|
+
];
|
|
6326
6335
|
var AdvancedChip = React43.forwardRef(
|
|
6327
|
-
({ className, count, onClear, onClick, ...props }, ref) => /* @__PURE__ */ jsxs41(
|
|
6328
|
-
|
|
6329
|
-
|
|
6330
|
-
|
|
6331
|
-
|
|
6332
|
-
|
|
6333
|
-
|
|
6334
|
-
|
|
6335
|
-
|
|
6336
|
-
|
|
6337
|
-
"
|
|
6338
|
-
{
|
|
6339
|
-
ref,
|
|
6340
|
-
type: "button",
|
|
6341
|
-
onClick,
|
|
6342
|
-
className: "flex items-center gap-sm px-base py-sm cursor-pointer transition-colors hover:bg-[var(--color-primary)]/10",
|
|
6343
|
-
...props,
|
|
6344
|
-
children: [
|
|
6345
|
-
/* @__PURE__ */ jsx46("span", { className: "text-sm font-medium leading-sm whitespace-nowrap text-[var(--color-primary)]", children: "Advanced filter" }),
|
|
6346
|
-
/* @__PURE__ */ jsx46("span", { className: "flex items-center p-2xs rounded-xs bg-filter-chip-badge-bg", children: /* @__PURE__ */ jsx46("span", { className: "text-[10px] font-medium leading-2xs text-filter-chip-badge-text", children: count }) })
|
|
6347
|
-
]
|
|
6348
|
-
}
|
|
6336
|
+
({ className, count, onClear, onClick, ...props }, ref) => /* @__PURE__ */ jsxs41("div", { className: cn("inline-flex items-center", className), children: [
|
|
6337
|
+
/* @__PURE__ */ jsxs41(
|
|
6338
|
+
"button",
|
|
6339
|
+
{
|
|
6340
|
+
ref,
|
|
6341
|
+
type: "button",
|
|
6342
|
+
onClick,
|
|
6343
|
+
className: cn(
|
|
6344
|
+
btnBase,
|
|
6345
|
+
"gap-sm px-base py-sm min-w-[80px]",
|
|
6346
|
+
"rounded-l-md -mr-px"
|
|
6349
6347
|
),
|
|
6350
|
-
|
|
6351
|
-
|
|
6352
|
-
/* @__PURE__ */ jsx46(
|
|
6353
|
-
|
|
6354
|
-
|
|
6355
|
-
|
|
6356
|
-
|
|
6357
|
-
|
|
6358
|
-
|
|
6359
|
-
|
|
6360
|
-
|
|
6361
|
-
|
|
6362
|
-
|
|
6363
|
-
|
|
6364
|
-
|
|
6365
|
-
|
|
6366
|
-
|
|
6367
|
-
|
|
6368
|
-
|
|
6348
|
+
...props,
|
|
6349
|
+
children: [
|
|
6350
|
+
/* @__PURE__ */ jsx46("span", { className: "text-sm font-medium leading-sm whitespace-nowrap text-[var(--color-foreground)]", children: "Advanced filters" }),
|
|
6351
|
+
/* @__PURE__ */ jsx46("span", { className: "flex items-center p-2xs rounded-xs bg-filter-chip-badge-bg", children: /* @__PURE__ */ jsx46("span", { className: "text-[10px] font-medium leading-2xs text-filter-chip-badge-text", children: count }) })
|
|
6352
|
+
]
|
|
6353
|
+
}
|
|
6354
|
+
),
|
|
6355
|
+
onClear && /* @__PURE__ */ jsx46(
|
|
6356
|
+
"button",
|
|
6357
|
+
{
|
|
6358
|
+
type: "button",
|
|
6359
|
+
onClick: (e) => {
|
|
6360
|
+
e.stopPropagation();
|
|
6361
|
+
onClear();
|
|
6362
|
+
},
|
|
6363
|
+
className: cn(
|
|
6364
|
+
btnBase,
|
|
6365
|
+
"p-sm",
|
|
6366
|
+
"rounded-r-md -ml-px"
|
|
6367
|
+
),
|
|
6368
|
+
"aria-label": "Clear all advanced filters",
|
|
6369
|
+
children: /* @__PURE__ */ jsx46(Icon29, { icon: faXmarkOutline2, size: "sm", className: "text-[var(--color-foreground)]" })
|
|
6370
|
+
}
|
|
6371
|
+
)
|
|
6372
|
+
] })
|
|
6369
6373
|
);
|
|
6370
6374
|
AdvancedChip.displayName = "AdvancedChip";
|
|
6371
6375
|
|
|
6372
6376
|
// src/components/ui/filter/advanced-popover.tsx
|
|
6373
6377
|
import * as React45 from "react";
|
|
6374
6378
|
import * as PopoverPrimitive10 from "@radix-ui/react-popover";
|
|
6379
|
+
import { Icon as Icon31, faPlusOutline as faPlusOutline2 } from "@l3mpire/icons";
|
|
6375
6380
|
|
|
6376
6381
|
// src/components/ui/filter/advanced-row.tsx
|
|
6377
6382
|
import * as React44 from "react";
|
|
6378
6383
|
import * as PopoverPrimitive9 from "@radix-ui/react-popover";
|
|
6379
|
-
import { Icon as Icon30,
|
|
6384
|
+
import { Icon as Icon30, faXmarkOutline as faXmarkOutline3, faRefreshOutline, faChevronDownOutline as faChevronDownOutline2 } from "@l3mpire/icons";
|
|
6380
6385
|
import { jsx as jsx47, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
6386
|
+
var selectBtnStyle = [
|
|
6387
|
+
"flex items-center gap-base",
|
|
6388
|
+
"px-base py-sm",
|
|
6389
|
+
"bg-gradient-to-t from-[var(--color-btn-outlined-neutral-bg-default)] to-[var(--color-btn-outlined-neutral-bg-gradient-to-default)]",
|
|
6390
|
+
"border border-[var(--color-btn-outlined-neutral-border-default)] rounded-md shadow-sm",
|
|
6391
|
+
"cursor-pointer transition-colors",
|
|
6392
|
+
"hover:from-[var(--color-btn-outlined-neutral-bg-hover)] hover:to-[var(--color-btn-outlined-neutral-bg-gradient-to-hover)]"
|
|
6393
|
+
];
|
|
6381
6394
|
var AdvancedRow = ({
|
|
6382
6395
|
connector,
|
|
6396
|
+
onConnectorToggle,
|
|
6383
6397
|
propertyDef,
|
|
6384
6398
|
condition,
|
|
6385
6399
|
properties,
|
|
@@ -6388,7 +6402,6 @@ var AdvancedRow = ({
|
|
|
6388
6402
|
onDelete
|
|
6389
6403
|
}) => {
|
|
6390
6404
|
const [operatorOpen, setOperatorOpen] = React44.useState(false);
|
|
6391
|
-
const [valueOpen, setValueOpen] = React44.useState(false);
|
|
6392
6405
|
const [propertyOpen, setPropertyOpen] = React44.useState(false);
|
|
6393
6406
|
const handleOperatorSelect = (op) => {
|
|
6394
6407
|
if (isNoValueOperator(op)) {
|
|
@@ -6403,46 +6416,36 @@ var AdvancedRow = ({
|
|
|
6403
6416
|
onUpdate({ ...condition, value: val });
|
|
6404
6417
|
};
|
|
6405
6418
|
const displayValue = condition.value == null ? "" : typeof condition.value === "string" ? condition.value : String(condition.value);
|
|
6406
|
-
|
|
6407
|
-
|
|
6408
|
-
|
|
6409
|
-
const arr = map.get(p.group) ?? [];
|
|
6410
|
-
arr.push(p);
|
|
6411
|
-
map.set(p.group, arr);
|
|
6412
|
-
}
|
|
6413
|
-
return map;
|
|
6414
|
-
}, [properties]);
|
|
6415
|
-
return /* @__PURE__ */ jsxs42("div", { className: "group flex items-center gap-base py-xs", children: [
|
|
6416
|
-
/* @__PURE__ */ jsx47(
|
|
6417
|
-
"span",
|
|
6419
|
+
return /* @__PURE__ */ jsxs42("div", { className: "flex items-center gap-base w-full", children: [
|
|
6420
|
+
connector === "Where" ? /* @__PURE__ */ jsx47("div", { className: "shrink-0 w-[64px] flex items-center justify-end", children: /* @__PURE__ */ jsx47("span", { className: "text-xs font-medium leading-xs text-[var(--color-muted-foreground)]", children: "Where" }) }) : /* @__PURE__ */ jsxs42(
|
|
6421
|
+
"button",
|
|
6418
6422
|
{
|
|
6423
|
+
type: "button",
|
|
6424
|
+
onClick: onConnectorToggle,
|
|
6419
6425
|
className: cn(
|
|
6420
|
-
"shrink-0
|
|
6421
|
-
|
|
6426
|
+
"shrink-0 flex items-center justify-center gap-xs",
|
|
6427
|
+
"min-w-[64px] min-h-[24px] max-h-[24px] p-xs",
|
|
6428
|
+
"bg-gradient-to-t from-[var(--color-btn-outlined-neutral-bg-default)] from-[10%] to-[var(--color-btn-outlined-neutral-bg-gradient-to-default)]",
|
|
6429
|
+
"border border-[var(--color-btn-outlined-neutral-border-default)] rounded-base shadow-sm",
|
|
6430
|
+
"cursor-pointer transition-colors text-xs font-medium leading-xs text-[var(--color-foreground)]",
|
|
6431
|
+
"hover:from-[var(--color-btn-outlined-neutral-bg-hover)] hover:to-[var(--color-btn-outlined-neutral-bg-gradient-to-hover)]"
|
|
6422
6432
|
),
|
|
6423
|
-
children:
|
|
6433
|
+
children: [
|
|
6424
6434
|
connector,
|
|
6425
|
-
|
|
6426
|
-
]
|
|
6435
|
+
/* @__PURE__ */ jsx47(Icon30, { icon: faRefreshOutline, size: "xs", className: "text-[var(--color-foreground)]" })
|
|
6436
|
+
]
|
|
6427
6437
|
}
|
|
6428
6438
|
),
|
|
6429
6439
|
/* @__PURE__ */ jsxs42(PopoverPrimitive9.Root, { open: propertyOpen, onOpenChange: setPropertyOpen, children: [
|
|
6430
|
-
/* @__PURE__ */ jsx47(PopoverPrimitive9.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs42(
|
|
6431
|
-
"
|
|
6432
|
-
{
|
|
6433
|
-
|
|
6434
|
-
|
|
6435
|
-
|
|
6436
|
-
|
|
6437
|
-
|
|
6438
|
-
|
|
6439
|
-
" \u203A ",
|
|
6440
|
-
propertyDef.label
|
|
6441
|
-
] }),
|
|
6442
|
-
/* @__PURE__ */ jsx47("svg", { width: "10", height: "10", viewBox: "0 0 10 10", fill: "currentColor", className: "text-[var(--color-muted-foreground)]", children: /* @__PURE__ */ jsx47("path", { d: "M2.5 4L5 6.5L7.5 4", stroke: "currentColor", strokeWidth: "1.2", fill: "none", strokeLinecap: "round" }) })
|
|
6443
|
-
]
|
|
6444
|
-
}
|
|
6445
|
-
) }),
|
|
6440
|
+
/* @__PURE__ */ jsx47(PopoverPrimitive9.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs42("button", { type: "button", className: cn(selectBtnStyle, "shrink-0 min-w-[80px]"), children: [
|
|
6441
|
+
/* @__PURE__ */ jsx47(Icon30, { icon: propertyDef.icon, size: "sm", className: "shrink-0 text-[var(--color-muted-foreground)]" }),
|
|
6442
|
+
/* @__PURE__ */ jsxs42("span", { className: "text-sm font-regular leading-sm text-[var(--color-foreground)] whitespace-nowrap", children: [
|
|
6443
|
+
propertyDef.groupLabel,
|
|
6444
|
+
" > ",
|
|
6445
|
+
propertyDef.label
|
|
6446
|
+
] }),
|
|
6447
|
+
/* @__PURE__ */ jsx47(Icon30, { icon: faChevronDownOutline2, size: "xs", className: "shrink-0 text-[var(--color-foreground)]" })
|
|
6448
|
+
] }) }),
|
|
6446
6449
|
/* @__PURE__ */ jsx47(PopoverPrimitive9.Portal, { children: /* @__PURE__ */ jsx47(
|
|
6447
6450
|
PopoverPrimitive9.Content,
|
|
6448
6451
|
{
|
|
@@ -6455,7 +6458,7 @@ var AdvancedRow = ({
|
|
|
6455
6458
|
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0",
|
|
6456
6459
|
"min-w-[200px]"
|
|
6457
6460
|
),
|
|
6458
|
-
children:
|
|
6461
|
+
children: properties.map((p) => /* @__PURE__ */ jsxs42(
|
|
6459
6462
|
"button",
|
|
6460
6463
|
{
|
|
6461
6464
|
type: "button",
|
|
@@ -6474,22 +6477,15 @@ var AdvancedRow = ({
|
|
|
6474
6477
|
]
|
|
6475
6478
|
},
|
|
6476
6479
|
p.id
|
|
6477
|
-
))
|
|
6480
|
+
))
|
|
6478
6481
|
}
|
|
6479
6482
|
) })
|
|
6480
6483
|
] }),
|
|
6481
6484
|
/* @__PURE__ */ jsxs42(PopoverPrimitive9.Root, { open: operatorOpen, onOpenChange: setOperatorOpen, children: [
|
|
6482
|
-
/* @__PURE__ */ jsx47(PopoverPrimitive9.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs42(
|
|
6483
|
-
"
|
|
6484
|
-
{
|
|
6485
|
-
|
|
6486
|
-
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",
|
|
6487
|
-
children: [
|
|
6488
|
-
/* @__PURE__ */ jsx47("span", { className: "text-sm font-regular leading-sm text-[var(--color-foreground)] whitespace-nowrap", children: condition.operator ?? "select" }),
|
|
6489
|
-
/* @__PURE__ */ jsx47("svg", { width: "10", height: "10", viewBox: "0 0 10 10", fill: "currentColor", className: "text-[var(--color-muted-foreground)]", children: /* @__PURE__ */ jsx47("path", { d: "M2.5 4L5 6.5L7.5 4", stroke: "currentColor", strokeWidth: "1.2", fill: "none", strokeLinecap: "round" }) })
|
|
6490
|
-
]
|
|
6491
|
-
}
|
|
6492
|
-
) }),
|
|
6485
|
+
/* @__PURE__ */ jsx47(PopoverPrimitive9.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs42("button", { type: "button", className: cn(selectBtnStyle, "shrink-0 w-[103px]"), children: [
|
|
6486
|
+
/* @__PURE__ */ jsx47("span", { className: "flex-1 text-sm font-regular leading-sm text-[var(--color-foreground)] whitespace-nowrap text-left", children: condition.operator ?? "Select" }),
|
|
6487
|
+
/* @__PURE__ */ jsx47(Icon30, { icon: faChevronDownOutline2, size: "xs", className: "shrink-0 text-[var(--color-foreground)]" })
|
|
6488
|
+
] }) }),
|
|
6493
6489
|
/* @__PURE__ */ jsx47(PopoverPrimitive9.Portal, { children: /* @__PURE__ */ jsx47(
|
|
6494
6490
|
PopoverPrimitive9.Content,
|
|
6495
6491
|
{
|
|
@@ -6519,9 +6515,10 @@ var AdvancedRow = ({
|
|
|
6519
6515
|
type: "text",
|
|
6520
6516
|
value: displayValue,
|
|
6521
6517
|
onChange: (e) => handleValueChange(e.target.value),
|
|
6522
|
-
placeholder: "
|
|
6518
|
+
placeholder: "Placeholder",
|
|
6523
6519
|
className: cn(
|
|
6524
|
-
"
|
|
6520
|
+
"w-[160px] shrink-0 px-base py-sm rounded-md",
|
|
6521
|
+
"border border-[var(--color-input)]",
|
|
6525
6522
|
"bg-[var(--color-background)] text-sm font-regular leading-sm text-[var(--color-foreground)]",
|
|
6526
6523
|
"placeholder:text-[var(--color-muted-foreground)]",
|
|
6527
6524
|
"focus:outline-none focus:ring-2 focus:ring-[var(--color-ring)] focus:ring-offset-0"
|
|
@@ -6533,9 +6530,9 @@ var AdvancedRow = ({
|
|
|
6533
6530
|
{
|
|
6534
6531
|
type: "button",
|
|
6535
6532
|
onClick: onDelete,
|
|
6536
|
-
className: "shrink-0 flex items-center justify-center p-sm rounded-
|
|
6533
|
+
className: "ml-auto shrink-0 flex items-center justify-center p-sm rounded-md cursor-pointer transition-colors hover:bg-[var(--color-accent)]",
|
|
6537
6534
|
"aria-label": "Remove filter",
|
|
6538
|
-
children: /* @__PURE__ */ jsx47(Icon30, { icon:
|
|
6535
|
+
children: /* @__PURE__ */ jsx47(Icon30, { icon: faXmarkOutline3, size: "sm", className: "text-[var(--color-foreground)]" })
|
|
6539
6536
|
}
|
|
6540
6537
|
)
|
|
6541
6538
|
] });
|
|
@@ -6544,6 +6541,14 @@ AdvancedRow.displayName = "AdvancedRow";
|
|
|
6544
6541
|
|
|
6545
6542
|
// src/components/ui/filter/advanced-popover.tsx
|
|
6546
6543
|
import { jsx as jsx48, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
6544
|
+
var outlinedBtn = [
|
|
6545
|
+
"flex items-center gap-sm px-base py-sm",
|
|
6546
|
+
"min-h-[32px] max-h-[32px] min-w-[80px]",
|
|
6547
|
+
"bg-gradient-to-t from-[var(--color-btn-outlined-neutral-bg-default)] from-[10%] to-[var(--color-btn-outlined-neutral-bg-gradient-to-default)]",
|
|
6548
|
+
"border border-[var(--color-btn-outlined-neutral-border-default)] rounded-md shadow-sm",
|
|
6549
|
+
"cursor-pointer transition-colors text-sm font-medium leading-sm text-[var(--color-foreground)]",
|
|
6550
|
+
"hover:from-[var(--color-btn-outlined-neutral-bg-hover)] hover:to-[var(--color-btn-outlined-neutral-bg-gradient-to-hover)]"
|
|
6551
|
+
];
|
|
6547
6552
|
var AdvancedPopover = ({
|
|
6548
6553
|
filters,
|
|
6549
6554
|
properties,
|
|
@@ -6553,6 +6558,7 @@ var AdvancedPopover = ({
|
|
|
6553
6558
|
children
|
|
6554
6559
|
}) => {
|
|
6555
6560
|
const [addSelectorOpen, setAddSelectorOpen] = React45.useState(false);
|
|
6561
|
+
const [logicOps, setLogicOps] = React45.useState({});
|
|
6556
6562
|
const getPropertyDef = (propertyId) => properties.find((p) => p.id === propertyId);
|
|
6557
6563
|
const handleUpdateFilter = (updated) => {
|
|
6558
6564
|
onFiltersChange(filters.map((f) => f.id === updated.id ? updated : f));
|
|
@@ -6575,6 +6581,12 @@ var AdvancedPopover = ({
|
|
|
6575
6581
|
onFiltersChange([]);
|
|
6576
6582
|
onOpenChange?.(false);
|
|
6577
6583
|
};
|
|
6584
|
+
const toggleLogicOp = (filterId) => {
|
|
6585
|
+
setLogicOps((prev) => ({
|
|
6586
|
+
...prev,
|
|
6587
|
+
[filterId]: (prev[filterId] ?? "and") === "and" ? "or" : "and"
|
|
6588
|
+
}));
|
|
6589
|
+
};
|
|
6578
6590
|
return /* @__PURE__ */ jsxs43(PopoverPrimitive10.Root, { open, onOpenChange, children: [
|
|
6579
6591
|
/* @__PURE__ */ jsx48(PopoverPrimitive10.Trigger, { asChild: true, children }),
|
|
6580
6592
|
/* @__PURE__ */ jsx48(PopoverPrimitive10.Portal, { children: /* @__PURE__ */ jsxs43(
|
|
@@ -6583,22 +6595,22 @@ var AdvancedPopover = ({
|
|
|
6583
6595
|
sideOffset: 4,
|
|
6584
6596
|
align: "start",
|
|
6585
6597
|
className: cn(
|
|
6586
|
-
"z-50 flex flex-col
|
|
6587
|
-
"bg-[var(--color-
|
|
6598
|
+
"z-50 flex flex-col",
|
|
6599
|
+
"bg-[var(--color-background)] rounded-md shadow-lg",
|
|
6588
6600
|
"data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
|
|
6589
6601
|
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
|
|
6590
|
-
"data-[side=bottom]:slide-in-from-top-2"
|
|
6591
|
-
"min-w-[520px] max-w-[90vw]"
|
|
6602
|
+
"data-[side=bottom]:slide-in-from-top-2"
|
|
6592
6603
|
),
|
|
6593
6604
|
children: [
|
|
6594
|
-
/* @__PURE__ */ jsxs43("div", { className: "flex flex-col
|
|
6605
|
+
/* @__PURE__ */ jsxs43("div", { className: "flex flex-col gap-base p-base", children: [
|
|
6595
6606
|
filters.map((filter, i) => {
|
|
6596
6607
|
const propDef = getPropertyDef(filter.propertyId);
|
|
6597
6608
|
if (!propDef) return null;
|
|
6598
6609
|
return /* @__PURE__ */ jsx48(
|
|
6599
6610
|
AdvancedRow,
|
|
6600
6611
|
{
|
|
6601
|
-
connector: i === 0 ? "Where" : "And",
|
|
6612
|
+
connector: i === 0 ? "Where" : (logicOps[filter.id] ?? "and") === "and" ? "And" : "Or",
|
|
6613
|
+
onConnectorToggle: i > 0 ? () => toggleLogicOp(filter.id) : void 0,
|
|
6602
6614
|
propertyDef: propDef,
|
|
6603
6615
|
condition: filter,
|
|
6604
6616
|
properties,
|
|
@@ -6611,7 +6623,7 @@ var AdvancedPopover = ({
|
|
|
6611
6623
|
}),
|
|
6612
6624
|
filters.length === 0 && /* @__PURE__ */ jsx48("p", { className: "py-base text-sm text-[var(--color-muted-foreground)]", children: "No advanced filters yet." })
|
|
6613
6625
|
] }),
|
|
6614
|
-
/* @__PURE__ */ jsxs43("div", { className: "flex items-center justify-between
|
|
6626
|
+
/* @__PURE__ */ jsxs43("div", { className: "flex items-center justify-between p-base border-t border-[var(--color-border)]", children: [
|
|
6615
6627
|
/* @__PURE__ */ jsx48(
|
|
6616
6628
|
PropertySelector,
|
|
6617
6629
|
{
|
|
@@ -6619,14 +6631,10 @@ var AdvancedPopover = ({
|
|
|
6619
6631
|
onSelect: handleAddFilter,
|
|
6620
6632
|
open: addSelectorOpen,
|
|
6621
6633
|
onOpenChange: setAddSelectorOpen,
|
|
6622
|
-
children: /* @__PURE__ */
|
|
6623
|
-
"
|
|
6624
|
-
|
|
6625
|
-
|
|
6626
|
-
className: "text-sm font-regular leading-sm text-[var(--color-muted-foreground)] hover:text-[var(--color-foreground)] cursor-pointer transition-colors",
|
|
6627
|
-
children: "+ Add filter"
|
|
6628
|
-
}
|
|
6629
|
-
)
|
|
6634
|
+
children: /* @__PURE__ */ jsxs43("button", { type: "button", className: cn(outlinedBtn), children: [
|
|
6635
|
+
/* @__PURE__ */ jsx48(Icon31, { icon: faPlusOutline2, size: "sm", className: "text-[var(--color-foreground)]" }),
|
|
6636
|
+
"Add filter"
|
|
6637
|
+
] })
|
|
6630
6638
|
}
|
|
6631
6639
|
),
|
|
6632
6640
|
/* @__PURE__ */ jsx48(
|
|
@@ -6634,7 +6642,7 @@ var AdvancedPopover = ({
|
|
|
6634
6642
|
{
|
|
6635
6643
|
type: "button",
|
|
6636
6644
|
onClick: handleClearAll,
|
|
6637
|
-
className: "text-sm font-
|
|
6645
|
+
className: "text-sm font-medium leading-sm text-[var(--color-foreground)] cursor-pointer transition-colors hover:opacity-70 px-base py-sm",
|
|
6638
6646
|
children: "Clear all filters"
|
|
6639
6647
|
}
|
|
6640
6648
|
)
|
|
@@ -6649,7 +6657,7 @@ AdvancedPopover.displayName = "AdvancedPopover";
|
|
|
6649
6657
|
// src/components/ui/filter/summary-chip.tsx
|
|
6650
6658
|
import * as React46 from "react";
|
|
6651
6659
|
import * as PopoverPrimitive11 from "@radix-ui/react-popover";
|
|
6652
|
-
import { Icon as
|
|
6660
|
+
import { Icon as Icon32, faSlidersOutline as faSlidersOutline2, faPlusOutline as faPlusOutline3 } from "@l3mpire/icons";
|
|
6653
6661
|
import { jsx as jsx49, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
6654
6662
|
var SummaryChip = ({
|
|
6655
6663
|
count,
|
|
@@ -6661,6 +6669,7 @@ var SummaryChip = ({
|
|
|
6661
6669
|
}) => {
|
|
6662
6670
|
const [open, setOpen] = React46.useState(false);
|
|
6663
6671
|
const [addSelectorOpen, setAddSelectorOpen] = React46.useState(false);
|
|
6672
|
+
const [logicOps, setLogicOps] = React46.useState({});
|
|
6664
6673
|
const getPropertyDef = (propertyId) => properties.find((p) => p.id === propertyId);
|
|
6665
6674
|
const handleUpdateFilter = (updated) => {
|
|
6666
6675
|
onFiltersChange(filters.map((f) => f.id === updated.id ? updated : f));
|
|
@@ -6689,24 +6698,23 @@ var SummaryChip = ({
|
|
|
6689
6698
|
className: cn(
|
|
6690
6699
|
"inline-flex items-center gap-sm px-base py-sm",
|
|
6691
6700
|
"min-h-[32px] max-h-[32px]",
|
|
6692
|
-
|
|
6693
|
-
"
|
|
6694
|
-
"cursor-pointer transition-colors
|
|
6701
|
+
"bg-gradient-to-t from-[var(--color-btn-outlined-neutral-bg-default)] from-[10%] to-[var(--color-btn-outlined-neutral-bg-gradient-to-default)]",
|
|
6702
|
+
"border border-[var(--color-btn-outlined-neutral-border-default)] rounded-md shadow-sm",
|
|
6703
|
+
"cursor-pointer transition-colors",
|
|
6704
|
+
"hover:from-[var(--color-btn-outlined-neutral-bg-hover)] hover:to-[var(--color-btn-outlined-neutral-bg-gradient-to-hover)]",
|
|
6695
6705
|
className
|
|
6696
6706
|
),
|
|
6697
6707
|
children: [
|
|
6698
6708
|
/* @__PURE__ */ jsx49(
|
|
6699
|
-
|
|
6709
|
+
Icon32,
|
|
6700
6710
|
{
|
|
6701
|
-
icon:
|
|
6711
|
+
icon: faSlidersOutline2,
|
|
6702
6712
|
size: "sm",
|
|
6703
|
-
className:
|
|
6713
|
+
className: "shrink-0 text-[var(--color-foreground)]"
|
|
6704
6714
|
}
|
|
6705
6715
|
),
|
|
6706
|
-
/* @__PURE__ */
|
|
6707
|
-
|
|
6708
|
-
count > 0 && ` (${count})`
|
|
6709
|
-
] })
|
|
6716
|
+
/* @__PURE__ */ jsx49("span", { className: "text-sm font-medium leading-sm whitespace-nowrap text-[var(--color-foreground)]", children: "Filters" }),
|
|
6717
|
+
count > 0 && /* @__PURE__ */ jsx49("span", { className: "flex items-center p-2xs rounded-xs bg-filter-chip-badge-bg", children: /* @__PURE__ */ jsx49("span", { className: "text-[10px] font-medium leading-2xs text-filter-chip-badge-text", children: count }) })
|
|
6710
6718
|
]
|
|
6711
6719
|
}
|
|
6712
6720
|
) }),
|
|
@@ -6724,14 +6732,15 @@ var SummaryChip = ({
|
|
|
6724
6732
|
"min-w-[420px] max-w-[90vw]"
|
|
6725
6733
|
),
|
|
6726
6734
|
children: [
|
|
6727
|
-
/* @__PURE__ */ jsxs44("div", { className: "flex flex-col
|
|
6735
|
+
/* @__PURE__ */ jsxs44("div", { className: "flex flex-col gap-base p-base", children: [
|
|
6728
6736
|
filters.map((filter, i) => {
|
|
6729
6737
|
const propDef = getPropertyDef(filter.propertyId);
|
|
6730
6738
|
if (!propDef) return null;
|
|
6731
6739
|
return /* @__PURE__ */ jsx49(
|
|
6732
6740
|
AdvancedRow,
|
|
6733
6741
|
{
|
|
6734
|
-
connector: i === 0 ? "Where" : "And",
|
|
6742
|
+
connector: i === 0 ? "Where" : (logicOps[filter.id] ?? "and") === "and" ? "And" : "Or",
|
|
6743
|
+
onConnectorToggle: i > 0 ? () => setLogicOps((prev) => ({ ...prev, [filter.id]: (prev[filter.id] ?? "and") === "and" ? "or" : "and" })) : void 0,
|
|
6735
6744
|
propertyDef: propDef,
|
|
6736
6745
|
condition: filter,
|
|
6737
6746
|
properties,
|
|
@@ -6744,7 +6753,7 @@ var SummaryChip = ({
|
|
|
6744
6753
|
}),
|
|
6745
6754
|
filters.length === 0 && /* @__PURE__ */ jsx49("p", { className: "py-base text-sm text-[var(--color-muted-foreground)]", children: "No active filters." })
|
|
6746
6755
|
] }),
|
|
6747
|
-
/* @__PURE__ */ jsxs44("div", { className: "flex items-center justify-between
|
|
6756
|
+
/* @__PURE__ */ jsxs44("div", { className: "flex items-center justify-between p-base border-t border-[var(--color-border)]", children: [
|
|
6748
6757
|
/* @__PURE__ */ jsx49(
|
|
6749
6758
|
PropertySelector,
|
|
6750
6759
|
{
|
|
@@ -6756,9 +6765,16 @@ var SummaryChip = ({
|
|
|
6756
6765
|
"button",
|
|
6757
6766
|
{
|
|
6758
6767
|
type: "button",
|
|
6759
|
-
className:
|
|
6768
|
+
className: cn(
|
|
6769
|
+
"flex items-center gap-sm px-base py-sm",
|
|
6770
|
+
"min-h-[32px] max-h-[32px] min-w-[80px]",
|
|
6771
|
+
"bg-gradient-to-t from-[var(--color-btn-outlined-neutral-bg-default)] from-[10%] to-[var(--color-btn-outlined-neutral-bg-gradient-to-default)]",
|
|
6772
|
+
"border border-[var(--color-btn-outlined-neutral-border-default)] rounded-md shadow-sm",
|
|
6773
|
+
"cursor-pointer transition-colors text-sm font-medium leading-sm text-[var(--color-foreground)]",
|
|
6774
|
+
"hover:from-[var(--color-btn-outlined-neutral-bg-hover)] hover:to-[var(--color-btn-outlined-neutral-bg-gradient-to-hover)]"
|
|
6775
|
+
),
|
|
6760
6776
|
children: [
|
|
6761
|
-
/* @__PURE__ */ jsx49(
|
|
6777
|
+
/* @__PURE__ */ jsx49(Icon32, { icon: faPlusOutline3, size: "sm", className: "text-[var(--color-foreground)]" }),
|
|
6762
6778
|
"Add filter"
|
|
6763
6779
|
]
|
|
6764
6780
|
}
|
|
@@ -6773,7 +6789,7 @@ var SummaryChip = ({
|
|
|
6773
6789
|
onClearAll();
|
|
6774
6790
|
setOpen(false);
|
|
6775
6791
|
},
|
|
6776
|
-
className: "text-sm font-
|
|
6792
|
+
className: "text-sm font-medium leading-sm text-[var(--color-foreground)] cursor-pointer transition-colors hover:opacity-70 px-base py-sm",
|
|
6777
6793
|
children: "Clear all filters"
|
|
6778
6794
|
}
|
|
6779
6795
|
)
|
|
@@ -6804,7 +6820,7 @@ function useFilterBarMode(ref, override) {
|
|
|
6804
6820
|
}
|
|
6805
6821
|
|
|
6806
6822
|
// src/components/ui/filter/filter-system.tsx
|
|
6807
|
-
import { Fragment as
|
|
6823
|
+
import { Fragment as Fragment4, jsx as jsx50, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
6808
6824
|
var FilterSystem = ({
|
|
6809
6825
|
properties,
|
|
6810
6826
|
filterState,
|
|
@@ -6939,7 +6955,7 @@ var FilterSystem = ({
|
|
|
6939
6955
|
)
|
|
6940
6956
|
) : (
|
|
6941
6957
|
/* ── DEFAULT MODE ────────────────────────────────────── */
|
|
6942
|
-
/* @__PURE__ */ jsxs45(
|
|
6958
|
+
/* @__PURE__ */ jsxs45(Fragment4, { children: [
|
|
6943
6959
|
hasAdvanced && /* @__PURE__ */ jsx50(
|
|
6944
6960
|
AdvancedPopover,
|
|
6945
6961
|
{
|
|
@@ -6993,6 +7009,15 @@ var FilterSystem = ({
|
|
|
6993
7009
|
}
|
|
6994
7010
|
)
|
|
6995
7011
|
] })
|
|
7012
|
+
),
|
|
7013
|
+
totalCount > 0 && /* @__PURE__ */ jsx50(
|
|
7014
|
+
"button",
|
|
7015
|
+
{
|
|
7016
|
+
type: "button",
|
|
7017
|
+
onClick: handleClearAll,
|
|
7018
|
+
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)]",
|
|
7019
|
+
children: isMinimal ? /* @__PURE__ */ jsx50(Icon33, { icon: faXmarkOutline4, size: "sm", className: "text-[var(--color-foreground)]" }) : /* @__PURE__ */ jsx50("span", { className: "text-sm font-medium leading-sm text-[var(--color-foreground)]", children: "Clear" })
|
|
7020
|
+
}
|
|
6996
7021
|
)
|
|
6997
7022
|
] }),
|
|
6998
7023
|
actions && /* @__PURE__ */ jsx50(FilterBarRight, { children: actions })
|
|
@@ -7004,7 +7029,7 @@ FilterSystem.displayName = "FilterSystem";
|
|
|
7004
7029
|
import * as React49 from "react";
|
|
7005
7030
|
import * as PopoverPrimitive12 from "@radix-ui/react-popover";
|
|
7006
7031
|
import {
|
|
7007
|
-
Icon as
|
|
7032
|
+
Icon as Icon34,
|
|
7008
7033
|
faChevronLeftOutline as faChevronLeftOutline3,
|
|
7009
7034
|
faChevronRightOutline as faChevronRightOutline3,
|
|
7010
7035
|
faArrowRightOutline as faArrowRightOutline2,
|
|
@@ -7177,10 +7202,10 @@ var DatePickerSelects = React49.forwardRef(({ className, formatDate = defaultFor
|
|
|
7177
7202
|
children: /* @__PURE__ */ jsxs46("div", { className: "flex items-center gap-base w-full", children: [
|
|
7178
7203
|
/* @__PURE__ */ jsxs46("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: [
|
|
7179
7204
|
/* @__PURE__ */ jsx51("span", { className: "flex-1 text-sm font-regular leading-sm text-datepicker-header-text truncate", children: fromDate ? formatDate(fromDate) : "Start date" }),
|
|
7180
|
-
/* @__PURE__ */ jsx51(
|
|
7205
|
+
/* @__PURE__ */ jsx51(Icon34, { icon: faCalendarOutline, size: "sm", className: "shrink-0 text-datepicker-header-text" })
|
|
7181
7206
|
] }),
|
|
7182
7207
|
/* @__PURE__ */ jsx51(
|
|
7183
|
-
|
|
7208
|
+
Icon34,
|
|
7184
7209
|
{
|
|
7185
7210
|
icon: faArrowRightOutline2,
|
|
7186
7211
|
size: "sm",
|
|
@@ -7189,7 +7214,7 @@ var DatePickerSelects = React49.forwardRef(({ className, formatDate = defaultFor
|
|
|
7189
7214
|
),
|
|
7190
7215
|
/* @__PURE__ */ jsxs46("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: [
|
|
7191
7216
|
/* @__PURE__ */ jsx51("span", { className: "flex-1 text-sm font-regular leading-sm text-datepicker-header-text truncate", children: toDate ? formatDate(toDate) : "End date" }),
|
|
7192
|
-
/* @__PURE__ */ jsx51(
|
|
7217
|
+
/* @__PURE__ */ jsx51(Icon34, { icon: faCalendarOutline, size: "sm", className: "shrink-0 text-datepicker-header-text" })
|
|
7193
7218
|
] })
|
|
7194
7219
|
] })
|
|
7195
7220
|
}
|
|
@@ -7299,7 +7324,7 @@ var DatePickerCalendar = React49.forwardRef(({ className, header, ...props }, re
|
|
|
7299
7324
|
onClick: goToPrevMonth,
|
|
7300
7325
|
className: "flex items-center justify-center p-xs rounded-base hover:bg-datepicker-day-bg-hover transition-colors cursor-pointer",
|
|
7301
7326
|
"aria-label": "Previous month",
|
|
7302
|
-
children: /* @__PURE__ */ jsx51(
|
|
7327
|
+
children: /* @__PURE__ */ jsx51(Icon34, { icon: faChevronLeftOutline3, size: "xs", className: "text-datepicker-header-nav" })
|
|
7303
7328
|
}
|
|
7304
7329
|
),
|
|
7305
7330
|
/* @__PURE__ */ jsx51(
|
|
@@ -7309,7 +7334,7 @@ var DatePickerCalendar = React49.forwardRef(({ className, header, ...props }, re
|
|
|
7309
7334
|
onClick: goToNextMonth,
|
|
7310
7335
|
className: "flex items-center justify-center p-xs rounded-base hover:bg-datepicker-day-bg-hover transition-colors cursor-pointer",
|
|
7311
7336
|
"aria-label": "Next month",
|
|
7312
|
-
children: /* @__PURE__ */ jsx51(
|
|
7337
|
+
children: /* @__PURE__ */ jsx51(Icon34, { icon: faChevronRightOutline3, size: "xs", className: "text-datepicker-header-nav" })
|
|
7313
7338
|
}
|
|
7314
7339
|
)
|
|
7315
7340
|
] })
|