@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.mjs
CHANGED
|
@@ -4857,7 +4857,7 @@ var FilterChip = React35.forwardRef(
|
|
|
4857
4857
|
ref,
|
|
4858
4858
|
className: cn(
|
|
4859
4859
|
"flex items-center overflow-clip",
|
|
4860
|
-
"bg-filter-chip-bg border border-filter-chip-border rounded-md",
|
|
4860
|
+
"bg-filter-chip-bg border border-filter-chip-border rounded-md shadow-sm",
|
|
4861
4861
|
className
|
|
4862
4862
|
),
|
|
4863
4863
|
...props,
|
|
@@ -5046,6 +5046,7 @@ var SortButton = ({
|
|
|
5046
5046
|
activeField,
|
|
5047
5047
|
direction,
|
|
5048
5048
|
onChange,
|
|
5049
|
+
iconOnly = false,
|
|
5049
5050
|
...props
|
|
5050
5051
|
}) => {
|
|
5051
5052
|
const [open, setOpen] = React37.useState(false);
|
|
@@ -5057,12 +5058,13 @@ var SortButton = ({
|
|
|
5057
5058
|
{
|
|
5058
5059
|
type: "button",
|
|
5059
5060
|
className: cn(
|
|
5060
|
-
"flex items-center gap-xs
|
|
5061
|
-
"min-h-[32px] max-h-[32px]
|
|
5061
|
+
"flex items-center gap-xs",
|
|
5062
|
+
"min-h-[32px] max-h-[32px]",
|
|
5062
5063
|
"bg-gradient-to-t from-[var(--color-btn-outlined-neutral-bg-default)] to-[var(--color-btn-outlined-neutral-bg-gradient-to-default)]",
|
|
5063
5064
|
"border border-[var(--color-btn-outlined-neutral-border-default)] rounded-md shadow-sm",
|
|
5064
5065
|
"cursor-pointer transition-colors",
|
|
5065
5066
|
"hover:from-[var(--color-btn-outlined-neutral-bg-hover)] hover:to-[var(--color-btn-outlined-neutral-bg-gradient-to-hover)]",
|
|
5067
|
+
iconOnly ? "size-8 justify-center p-0" : "px-md py-sm min-w-[80px]",
|
|
5066
5068
|
className
|
|
5067
5069
|
),
|
|
5068
5070
|
children: [
|
|
@@ -5074,7 +5076,7 @@ var SortButton = ({
|
|
|
5074
5076
|
className: "shrink-0 text-[var(--color-foreground)]"
|
|
5075
5077
|
}
|
|
5076
5078
|
),
|
|
5077
|
-
/* @__PURE__ */ jsxs32("span", { className: "text-sm font-medium leading-sm whitespace-nowrap", children: [
|
|
5079
|
+
!iconOnly && /* @__PURE__ */ jsxs32("span", { className: "text-sm font-medium leading-sm whitespace-nowrap", children: [
|
|
5078
5080
|
/* @__PURE__ */ jsxs32("span", { className: "text-[var(--color-muted-foreground)]", children: [
|
|
5079
5081
|
"Sort by",
|
|
5080
5082
|
" "
|
|
@@ -5227,18 +5229,19 @@ SortButton.displayName = "SortButton";
|
|
|
5227
5229
|
import * as React38 from "react";
|
|
5228
5230
|
import { Icon as Icon24, faSlidersOutline } from "@l3mpire/icons";
|
|
5229
5231
|
import { jsx as jsx38, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
5230
|
-
var FilterBarButton = React38.forwardRef(({ className, count, children, ...props }, ref) => /* @__PURE__ */ jsxs33(
|
|
5232
|
+
var FilterBarButton = React38.forwardRef(({ className, count, iconOnly = false, children, ...props }, ref) => /* @__PURE__ */ jsxs33(
|
|
5231
5233
|
"button",
|
|
5232
5234
|
{
|
|
5233
5235
|
ref,
|
|
5234
5236
|
type: "button",
|
|
5235
5237
|
className: cn(
|
|
5236
|
-
"flex items-center gap-sm
|
|
5237
|
-
"min-h-[32px] max-h-[32px]
|
|
5238
|
+
"flex items-center gap-sm",
|
|
5239
|
+
"min-h-[32px] max-h-[32px]",
|
|
5238
5240
|
"bg-gradient-to-t from-[var(--color-btn-outlined-neutral-bg-default)] to-[var(--color-btn-outlined-neutral-bg-gradient-to-default)]",
|
|
5239
5241
|
"border border-[var(--color-btn-outlined-neutral-border-default)] rounded-md shadow-sm",
|
|
5240
5242
|
"cursor-pointer transition-colors",
|
|
5241
5243
|
"hover:from-[var(--color-btn-outlined-neutral-bg-hover)] hover:to-[var(--color-btn-outlined-neutral-bg-gradient-to-hover)]",
|
|
5244
|
+
iconOnly ? count ? "px-sm justify-center" : "size-8 justify-center p-0" : "px-base py-sm min-w-[80px]",
|
|
5242
5245
|
className
|
|
5243
5246
|
),
|
|
5244
5247
|
...props,
|
|
@@ -5251,7 +5254,7 @@ var FilterBarButton = React38.forwardRef(({ className, count, children, ...props
|
|
|
5251
5254
|
className: "shrink-0 text-[var(--color-foreground)]"
|
|
5252
5255
|
}
|
|
5253
5256
|
),
|
|
5254
|
-
/* @__PURE__ */ jsx38("span", { className: "text-sm font-medium leading-sm whitespace-nowrap text-[var(--color-foreground)]", children: children ?? "Filters" }),
|
|
5257
|
+
!iconOnly && /* @__PURE__ */ jsx38("span", { className: "text-sm font-medium leading-sm whitespace-nowrap text-[var(--color-foreground)]", children: children ?? "Filters" }),
|
|
5255
5258
|
count != null && count > 0 && /* @__PURE__ */ jsx38("span", { className: "flex items-center p-2xs rounded-xs bg-filter-chip-badge-bg", children: /* @__PURE__ */ jsx38("span", { className: "text-[10px] font-medium leading-2xs text-filter-chip-badge-text", children: count }) })
|
|
5256
5259
|
]
|
|
5257
5260
|
}
|
|
@@ -6192,7 +6195,7 @@ var InteractiveFilterChip = ({
|
|
|
6192
6195
|
{
|
|
6193
6196
|
className: cn(
|
|
6194
6197
|
"inline-flex items-center overflow-clip",
|
|
6195
|
-
"bg-filter-chip-bg border border-filter-chip-border rounded-md",
|
|
6198
|
+
"bg-filter-chip-bg border border-filter-chip-border rounded-md shadow-sm",
|
|
6196
6199
|
className
|
|
6197
6200
|
),
|
|
6198
6201
|
children: [
|
|
@@ -6314,69 +6317,83 @@ var InteractiveFilterChip = ({
|
|
|
6314
6317
|
InteractiveFilterChip.displayName = "InteractiveFilterChip";
|
|
6315
6318
|
|
|
6316
6319
|
// src/components/ui/filter/filter-system.tsx
|
|
6317
|
-
import * as
|
|
6320
|
+
import * as React48 from "react";
|
|
6321
|
+
import { Icon as Icon33, faXmarkOutline as faXmarkOutline4 } from "@l3mpire/icons";
|
|
6318
6322
|
|
|
6319
6323
|
// src/components/ui/filter/advanced-chip.tsx
|
|
6320
6324
|
import * as React43 from "react";
|
|
6321
6325
|
import { Icon as Icon29, faXmarkOutline as faXmarkOutline2 } from "@l3mpire/icons";
|
|
6322
|
-
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
|
+
];
|
|
6323
6335
|
var AdvancedChip = React43.forwardRef(
|
|
6324
|
-
({ className, count, onClear, onClick, ...props }, ref) => /* @__PURE__ */ jsxs41(
|
|
6325
|
-
|
|
6326
|
-
|
|
6327
|
-
|
|
6328
|
-
|
|
6329
|
-
|
|
6330
|
-
|
|
6331
|
-
|
|
6332
|
-
|
|
6333
|
-
|
|
6334
|
-
"
|
|
6335
|
-
{
|
|
6336
|
-
ref,
|
|
6337
|
-
type: "button",
|
|
6338
|
-
onClick,
|
|
6339
|
-
className: "flex items-center gap-sm px-base py-sm cursor-pointer transition-colors hover:bg-[var(--color-primary)]/10",
|
|
6340
|
-
...props,
|
|
6341
|
-
children: [
|
|
6342
|
-
/* @__PURE__ */ jsx46("span", { className: "text-sm font-medium leading-sm whitespace-nowrap text-[var(--color-primary)]", children: "Advanced filter" }),
|
|
6343
|
-
/* @__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 }) })
|
|
6344
|
-
]
|
|
6345
|
-
}
|
|
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"
|
|
6346
6347
|
),
|
|
6347
|
-
|
|
6348
|
-
|
|
6349
|
-
/* @__PURE__ */ jsx46(
|
|
6350
|
-
|
|
6351
|
-
|
|
6352
|
-
|
|
6353
|
-
|
|
6354
|
-
|
|
6355
|
-
|
|
6356
|
-
|
|
6357
|
-
|
|
6358
|
-
|
|
6359
|
-
|
|
6360
|
-
|
|
6361
|
-
|
|
6362
|
-
|
|
6363
|
-
|
|
6364
|
-
|
|
6365
|
-
|
|
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
|
+
] })
|
|
6366
6373
|
);
|
|
6367
6374
|
AdvancedChip.displayName = "AdvancedChip";
|
|
6368
6375
|
|
|
6369
6376
|
// src/components/ui/filter/advanced-popover.tsx
|
|
6370
6377
|
import * as React45 from "react";
|
|
6371
6378
|
import * as PopoverPrimitive10 from "@radix-ui/react-popover";
|
|
6379
|
+
import { Icon as Icon31, faPlusOutline as faPlusOutline2 } from "@l3mpire/icons";
|
|
6372
6380
|
|
|
6373
6381
|
// src/components/ui/filter/advanced-row.tsx
|
|
6374
6382
|
import * as React44 from "react";
|
|
6375
6383
|
import * as PopoverPrimitive9 from "@radix-ui/react-popover";
|
|
6376
|
-
import { Icon as Icon30,
|
|
6384
|
+
import { Icon as Icon30, faXmarkOutline as faXmarkOutline3, faRefreshOutline, faChevronDownOutline as faChevronDownOutline2 } from "@l3mpire/icons";
|
|
6377
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
|
+
];
|
|
6378
6394
|
var AdvancedRow = ({
|
|
6379
6395
|
connector,
|
|
6396
|
+
onConnectorToggle,
|
|
6380
6397
|
propertyDef,
|
|
6381
6398
|
condition,
|
|
6382
6399
|
properties,
|
|
@@ -6385,7 +6402,6 @@ var AdvancedRow = ({
|
|
|
6385
6402
|
onDelete
|
|
6386
6403
|
}) => {
|
|
6387
6404
|
const [operatorOpen, setOperatorOpen] = React44.useState(false);
|
|
6388
|
-
const [valueOpen, setValueOpen] = React44.useState(false);
|
|
6389
6405
|
const [propertyOpen, setPropertyOpen] = React44.useState(false);
|
|
6390
6406
|
const handleOperatorSelect = (op) => {
|
|
6391
6407
|
if (isNoValueOperator(op)) {
|
|
@@ -6400,46 +6416,36 @@ var AdvancedRow = ({
|
|
|
6400
6416
|
onUpdate({ ...condition, value: val });
|
|
6401
6417
|
};
|
|
6402
6418
|
const displayValue = condition.value == null ? "" : typeof condition.value === "string" ? condition.value : String(condition.value);
|
|
6403
|
-
|
|
6404
|
-
|
|
6405
|
-
|
|
6406
|
-
const arr = map.get(p.group) ?? [];
|
|
6407
|
-
arr.push(p);
|
|
6408
|
-
map.set(p.group, arr);
|
|
6409
|
-
}
|
|
6410
|
-
return map;
|
|
6411
|
-
}, [properties]);
|
|
6412
|
-
return /* @__PURE__ */ jsxs42("div", { className: "group flex items-center gap-base py-xs", children: [
|
|
6413
|
-
/* @__PURE__ */ jsx47(
|
|
6414
|
-
"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",
|
|
6415
6422
|
{
|
|
6423
|
+
type: "button",
|
|
6424
|
+
onClick: onConnectorToggle,
|
|
6416
6425
|
className: cn(
|
|
6417
|
-
"shrink-0
|
|
6418
|
-
|
|
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)]"
|
|
6419
6432
|
),
|
|
6420
|
-
children:
|
|
6433
|
+
children: [
|
|
6421
6434
|
connector,
|
|
6422
|
-
|
|
6423
|
-
]
|
|
6435
|
+
/* @__PURE__ */ jsx47(Icon30, { icon: faRefreshOutline, size: "xs", className: "text-[var(--color-foreground)]" })
|
|
6436
|
+
]
|
|
6424
6437
|
}
|
|
6425
6438
|
),
|
|
6426
6439
|
/* @__PURE__ */ jsxs42(PopoverPrimitive9.Root, { open: propertyOpen, onOpenChange: setPropertyOpen, children: [
|
|
6427
|
-
/* @__PURE__ */ jsx47(PopoverPrimitive9.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs42(
|
|
6428
|
-
"
|
|
6429
|
-
{
|
|
6430
|
-
|
|
6431
|
-
|
|
6432
|
-
|
|
6433
|
-
|
|
6434
|
-
|
|
6435
|
-
|
|
6436
|
-
" \u203A ",
|
|
6437
|
-
propertyDef.label
|
|
6438
|
-
] }),
|
|
6439
|
-
/* @__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" }) })
|
|
6440
|
-
]
|
|
6441
|
-
}
|
|
6442
|
-
) }),
|
|
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
|
+
] }) }),
|
|
6443
6449
|
/* @__PURE__ */ jsx47(PopoverPrimitive9.Portal, { children: /* @__PURE__ */ jsx47(
|
|
6444
6450
|
PopoverPrimitive9.Content,
|
|
6445
6451
|
{
|
|
@@ -6452,7 +6458,7 @@ var AdvancedRow = ({
|
|
|
6452
6458
|
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0",
|
|
6453
6459
|
"min-w-[200px]"
|
|
6454
6460
|
),
|
|
6455
|
-
children:
|
|
6461
|
+
children: properties.map((p) => /* @__PURE__ */ jsxs42(
|
|
6456
6462
|
"button",
|
|
6457
6463
|
{
|
|
6458
6464
|
type: "button",
|
|
@@ -6471,22 +6477,15 @@ var AdvancedRow = ({
|
|
|
6471
6477
|
]
|
|
6472
6478
|
},
|
|
6473
6479
|
p.id
|
|
6474
|
-
))
|
|
6480
|
+
))
|
|
6475
6481
|
}
|
|
6476
6482
|
) })
|
|
6477
6483
|
] }),
|
|
6478
6484
|
/* @__PURE__ */ jsxs42(PopoverPrimitive9.Root, { open: operatorOpen, onOpenChange: setOperatorOpen, children: [
|
|
6479
|
-
/* @__PURE__ */ jsx47(PopoverPrimitive9.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs42(
|
|
6480
|
-
"
|
|
6481
|
-
{
|
|
6482
|
-
|
|
6483
|
-
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",
|
|
6484
|
-
children: [
|
|
6485
|
-
/* @__PURE__ */ jsx47("span", { className: "text-sm font-regular leading-sm text-[var(--color-foreground)] whitespace-nowrap", children: condition.operator ?? "select" }),
|
|
6486
|
-
/* @__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" }) })
|
|
6487
|
-
]
|
|
6488
|
-
}
|
|
6489
|
-
) }),
|
|
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
|
+
] }) }),
|
|
6490
6489
|
/* @__PURE__ */ jsx47(PopoverPrimitive9.Portal, { children: /* @__PURE__ */ jsx47(
|
|
6491
6490
|
PopoverPrimitive9.Content,
|
|
6492
6491
|
{
|
|
@@ -6516,9 +6515,10 @@ var AdvancedRow = ({
|
|
|
6516
6515
|
type: "text",
|
|
6517
6516
|
value: displayValue,
|
|
6518
6517
|
onChange: (e) => handleValueChange(e.target.value),
|
|
6519
|
-
placeholder: "
|
|
6518
|
+
placeholder: "Placeholder",
|
|
6520
6519
|
className: cn(
|
|
6521
|
-
"
|
|
6520
|
+
"w-[160px] shrink-0 px-base py-sm rounded-md",
|
|
6521
|
+
"border border-[var(--color-input)]",
|
|
6522
6522
|
"bg-[var(--color-background)] text-sm font-regular leading-sm text-[var(--color-foreground)]",
|
|
6523
6523
|
"placeholder:text-[var(--color-muted-foreground)]",
|
|
6524
6524
|
"focus:outline-none focus:ring-2 focus:ring-[var(--color-ring)] focus:ring-offset-0"
|
|
@@ -6530,9 +6530,9 @@ var AdvancedRow = ({
|
|
|
6530
6530
|
{
|
|
6531
6531
|
type: "button",
|
|
6532
6532
|
onClick: onDelete,
|
|
6533
|
-
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)]",
|
|
6534
6534
|
"aria-label": "Remove filter",
|
|
6535
|
-
children: /* @__PURE__ */ jsx47(Icon30, { icon:
|
|
6535
|
+
children: /* @__PURE__ */ jsx47(Icon30, { icon: faXmarkOutline3, size: "sm", className: "text-[var(--color-foreground)]" })
|
|
6536
6536
|
}
|
|
6537
6537
|
)
|
|
6538
6538
|
] });
|
|
@@ -6541,6 +6541,14 @@ AdvancedRow.displayName = "AdvancedRow";
|
|
|
6541
6541
|
|
|
6542
6542
|
// src/components/ui/filter/advanced-popover.tsx
|
|
6543
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
|
+
];
|
|
6544
6552
|
var AdvancedPopover = ({
|
|
6545
6553
|
filters,
|
|
6546
6554
|
properties,
|
|
@@ -6550,6 +6558,7 @@ var AdvancedPopover = ({
|
|
|
6550
6558
|
children
|
|
6551
6559
|
}) => {
|
|
6552
6560
|
const [addSelectorOpen, setAddSelectorOpen] = React45.useState(false);
|
|
6561
|
+
const [logicOps, setLogicOps] = React45.useState({});
|
|
6553
6562
|
const getPropertyDef = (propertyId) => properties.find((p) => p.id === propertyId);
|
|
6554
6563
|
const handleUpdateFilter = (updated) => {
|
|
6555
6564
|
onFiltersChange(filters.map((f) => f.id === updated.id ? updated : f));
|
|
@@ -6572,6 +6581,12 @@ var AdvancedPopover = ({
|
|
|
6572
6581
|
onFiltersChange([]);
|
|
6573
6582
|
onOpenChange?.(false);
|
|
6574
6583
|
};
|
|
6584
|
+
const toggleLogicOp = (filterId) => {
|
|
6585
|
+
setLogicOps((prev) => ({
|
|
6586
|
+
...prev,
|
|
6587
|
+
[filterId]: (prev[filterId] ?? "and") === "and" ? "or" : "and"
|
|
6588
|
+
}));
|
|
6589
|
+
};
|
|
6575
6590
|
return /* @__PURE__ */ jsxs43(PopoverPrimitive10.Root, { open, onOpenChange, children: [
|
|
6576
6591
|
/* @__PURE__ */ jsx48(PopoverPrimitive10.Trigger, { asChild: true, children }),
|
|
6577
6592
|
/* @__PURE__ */ jsx48(PopoverPrimitive10.Portal, { children: /* @__PURE__ */ jsxs43(
|
|
@@ -6580,22 +6595,22 @@ var AdvancedPopover = ({
|
|
|
6580
6595
|
sideOffset: 4,
|
|
6581
6596
|
align: "start",
|
|
6582
6597
|
className: cn(
|
|
6583
|
-
"z-50 flex flex-col
|
|
6584
|
-
"bg-[var(--color-
|
|
6598
|
+
"z-50 flex flex-col",
|
|
6599
|
+
"bg-[var(--color-background)] rounded-md shadow-lg",
|
|
6585
6600
|
"data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
|
|
6586
6601
|
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
|
|
6587
|
-
"data-[side=bottom]:slide-in-from-top-2"
|
|
6588
|
-
"min-w-[520px] max-w-[90vw]"
|
|
6602
|
+
"data-[side=bottom]:slide-in-from-top-2"
|
|
6589
6603
|
),
|
|
6590
6604
|
children: [
|
|
6591
|
-
/* @__PURE__ */ jsxs43("div", { className: "flex flex-col
|
|
6605
|
+
/* @__PURE__ */ jsxs43("div", { className: "flex flex-col gap-base p-base", children: [
|
|
6592
6606
|
filters.map((filter, i) => {
|
|
6593
6607
|
const propDef = getPropertyDef(filter.propertyId);
|
|
6594
6608
|
if (!propDef) return null;
|
|
6595
6609
|
return /* @__PURE__ */ jsx48(
|
|
6596
6610
|
AdvancedRow,
|
|
6597
6611
|
{
|
|
6598
|
-
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,
|
|
6599
6614
|
propertyDef: propDef,
|
|
6600
6615
|
condition: filter,
|
|
6601
6616
|
properties,
|
|
@@ -6608,7 +6623,7 @@ var AdvancedPopover = ({
|
|
|
6608
6623
|
}),
|
|
6609
6624
|
filters.length === 0 && /* @__PURE__ */ jsx48("p", { className: "py-base text-sm text-[var(--color-muted-foreground)]", children: "No advanced filters yet." })
|
|
6610
6625
|
] }),
|
|
6611
|
-
/* @__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: [
|
|
6612
6627
|
/* @__PURE__ */ jsx48(
|
|
6613
6628
|
PropertySelector,
|
|
6614
6629
|
{
|
|
@@ -6616,22 +6631,165 @@ var AdvancedPopover = ({
|
|
|
6616
6631
|
onSelect: handleAddFilter,
|
|
6617
6632
|
open: addSelectorOpen,
|
|
6618
6633
|
onOpenChange: setAddSelectorOpen,
|
|
6619
|
-
children: /* @__PURE__ */
|
|
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
|
+
] })
|
|
6638
|
+
}
|
|
6639
|
+
),
|
|
6640
|
+
/* @__PURE__ */ jsx48(
|
|
6641
|
+
"button",
|
|
6642
|
+
{
|
|
6643
|
+
type: "button",
|
|
6644
|
+
onClick: handleClearAll,
|
|
6645
|
+
className: "text-sm font-medium leading-sm text-[var(--color-foreground)] cursor-pointer transition-colors hover:opacity-70 px-base py-sm",
|
|
6646
|
+
children: "Clear all filters"
|
|
6647
|
+
}
|
|
6648
|
+
)
|
|
6649
|
+
] })
|
|
6650
|
+
]
|
|
6651
|
+
}
|
|
6652
|
+
) })
|
|
6653
|
+
] });
|
|
6654
|
+
};
|
|
6655
|
+
AdvancedPopover.displayName = "AdvancedPopover";
|
|
6656
|
+
|
|
6657
|
+
// src/components/ui/filter/summary-chip.tsx
|
|
6658
|
+
import * as React46 from "react";
|
|
6659
|
+
import * as PopoverPrimitive11 from "@radix-ui/react-popover";
|
|
6660
|
+
import { Icon as Icon32, faSlidersOutline as faSlidersOutline2, faPlusOutline as faPlusOutline3 } from "@l3mpire/icons";
|
|
6661
|
+
import { jsx as jsx49, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
6662
|
+
var SummaryChip = ({
|
|
6663
|
+
count,
|
|
6664
|
+
filters,
|
|
6665
|
+
properties,
|
|
6666
|
+
onFiltersChange,
|
|
6667
|
+
onClearAll,
|
|
6668
|
+
className
|
|
6669
|
+
}) => {
|
|
6670
|
+
const [open, setOpen] = React46.useState(false);
|
|
6671
|
+
const [addSelectorOpen, setAddSelectorOpen] = React46.useState(false);
|
|
6672
|
+
const [logicOps, setLogicOps] = React46.useState({});
|
|
6673
|
+
const getPropertyDef = (propertyId) => properties.find((p) => p.id === propertyId);
|
|
6674
|
+
const handleUpdateFilter = (updated) => {
|
|
6675
|
+
onFiltersChange(filters.map((f) => f.id === updated.id ? updated : f));
|
|
6676
|
+
};
|
|
6677
|
+
const handleDeleteFilter = (id) => {
|
|
6678
|
+
const next = filters.filter((f) => f.id !== id);
|
|
6679
|
+
onFiltersChange(next);
|
|
6680
|
+
if (next.length === 0) setOpen(false);
|
|
6681
|
+
};
|
|
6682
|
+
const handlePropertyChange = (filterId, newProp) => {
|
|
6683
|
+
const newCondition = createFilterWithDefaults(newProp.id, newProp.type);
|
|
6684
|
+
onFiltersChange(
|
|
6685
|
+
filters.map((f) => f.id === filterId ? { ...newCondition, id: filterId } : f)
|
|
6686
|
+
);
|
|
6687
|
+
};
|
|
6688
|
+
const handleAddFilter = (property) => {
|
|
6689
|
+
const newFilter = createFilterWithDefaults(property.id, property.type);
|
|
6690
|
+
onFiltersChange([...filters, newFilter]);
|
|
6691
|
+
setAddSelectorOpen(false);
|
|
6692
|
+
};
|
|
6693
|
+
return /* @__PURE__ */ jsxs44(PopoverPrimitive11.Root, { open, onOpenChange: setOpen, children: [
|
|
6694
|
+
/* @__PURE__ */ jsx49(PopoverPrimitive11.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs44(
|
|
6695
|
+
"button",
|
|
6696
|
+
{
|
|
6697
|
+
type: "button",
|
|
6698
|
+
className: cn(
|
|
6699
|
+
"inline-flex items-center gap-sm px-base py-sm",
|
|
6700
|
+
"min-h-[32px] max-h-[32px]",
|
|
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)]",
|
|
6705
|
+
className
|
|
6706
|
+
),
|
|
6707
|
+
children: [
|
|
6708
|
+
/* @__PURE__ */ jsx49(
|
|
6709
|
+
Icon32,
|
|
6710
|
+
{
|
|
6711
|
+
icon: faSlidersOutline2,
|
|
6712
|
+
size: "sm",
|
|
6713
|
+
className: "shrink-0 text-[var(--color-foreground)]"
|
|
6714
|
+
}
|
|
6715
|
+
),
|
|
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 }) })
|
|
6718
|
+
]
|
|
6719
|
+
}
|
|
6720
|
+
) }),
|
|
6721
|
+
/* @__PURE__ */ jsx49(PopoverPrimitive11.Portal, { children: /* @__PURE__ */ jsxs44(
|
|
6722
|
+
PopoverPrimitive11.Content,
|
|
6723
|
+
{
|
|
6724
|
+
sideOffset: 4,
|
|
6725
|
+
align: "start",
|
|
6726
|
+
className: cn(
|
|
6727
|
+
"z-50 flex flex-col overflow-clip",
|
|
6728
|
+
"bg-[var(--color-dropdown-bg)] border border-[var(--color-dropdown-border)] rounded-md shadow-lg",
|
|
6729
|
+
"data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
|
|
6730
|
+
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
|
|
6731
|
+
"data-[side=bottom]:slide-in-from-top-2",
|
|
6732
|
+
"min-w-[420px] max-w-[90vw]"
|
|
6733
|
+
),
|
|
6734
|
+
children: [
|
|
6735
|
+
/* @__PURE__ */ jsxs44("div", { className: "flex flex-col gap-base p-base", children: [
|
|
6736
|
+
filters.map((filter, i) => {
|
|
6737
|
+
const propDef = getPropertyDef(filter.propertyId);
|
|
6738
|
+
if (!propDef) return null;
|
|
6739
|
+
return /* @__PURE__ */ jsx49(
|
|
6740
|
+
AdvancedRow,
|
|
6741
|
+
{
|
|
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,
|
|
6744
|
+
propertyDef: propDef,
|
|
6745
|
+
condition: filter,
|
|
6746
|
+
properties,
|
|
6747
|
+
onUpdate: handleUpdateFilter,
|
|
6748
|
+
onPropertyChange: (p) => handlePropertyChange(filter.id, p),
|
|
6749
|
+
onDelete: () => handleDeleteFilter(filter.id)
|
|
6750
|
+
},
|
|
6751
|
+
filter.id
|
|
6752
|
+
);
|
|
6753
|
+
}),
|
|
6754
|
+
filters.length === 0 && /* @__PURE__ */ jsx49("p", { className: "py-base text-sm text-[var(--color-muted-foreground)]", children: "No active filters." })
|
|
6755
|
+
] }),
|
|
6756
|
+
/* @__PURE__ */ jsxs44("div", { className: "flex items-center justify-between p-base border-t border-[var(--color-border)]", children: [
|
|
6757
|
+
/* @__PURE__ */ jsx49(
|
|
6758
|
+
PropertySelector,
|
|
6759
|
+
{
|
|
6760
|
+
properties,
|
|
6761
|
+
onSelect: handleAddFilter,
|
|
6762
|
+
open: addSelectorOpen,
|
|
6763
|
+
onOpenChange: setAddSelectorOpen,
|
|
6764
|
+
children: /* @__PURE__ */ jsxs44(
|
|
6620
6765
|
"button",
|
|
6621
6766
|
{
|
|
6622
6767
|
type: "button",
|
|
6623
|
-
className:
|
|
6624
|
-
|
|
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
|
+
),
|
|
6776
|
+
children: [
|
|
6777
|
+
/* @__PURE__ */ jsx49(Icon32, { icon: faPlusOutline3, size: "sm", className: "text-[var(--color-foreground)]" }),
|
|
6778
|
+
"Add filter"
|
|
6779
|
+
]
|
|
6625
6780
|
}
|
|
6626
6781
|
)
|
|
6627
6782
|
}
|
|
6628
6783
|
),
|
|
6629
|
-
/* @__PURE__ */
|
|
6784
|
+
filters.length > 0 && /* @__PURE__ */ jsx49(
|
|
6630
6785
|
"button",
|
|
6631
6786
|
{
|
|
6632
6787
|
type: "button",
|
|
6633
|
-
onClick:
|
|
6634
|
-
|
|
6788
|
+
onClick: () => {
|
|
6789
|
+
onClearAll();
|
|
6790
|
+
setOpen(false);
|
|
6791
|
+
},
|
|
6792
|
+
className: "text-sm font-medium leading-sm text-[var(--color-foreground)] cursor-pointer transition-colors hover:opacity-70 px-base py-sm",
|
|
6635
6793
|
children: "Clear all filters"
|
|
6636
6794
|
}
|
|
6637
6795
|
)
|
|
@@ -6641,22 +6799,45 @@ var AdvancedPopover = ({
|
|
|
6641
6799
|
) })
|
|
6642
6800
|
] });
|
|
6643
6801
|
};
|
|
6644
|
-
|
|
6802
|
+
SummaryChip.displayName = "SummaryChip";
|
|
6803
|
+
|
|
6804
|
+
// src/components/ui/filter/use-filter-bar-mode.ts
|
|
6805
|
+
import * as React47 from "react";
|
|
6806
|
+
function useFilterBarMode(ref, override) {
|
|
6807
|
+
const [mode, setMode] = React47.useState("default");
|
|
6808
|
+
React47.useEffect(() => {
|
|
6809
|
+
if (override) return;
|
|
6810
|
+
const el = ref.current;
|
|
6811
|
+
if (!el) return;
|
|
6812
|
+
const observer = new ResizeObserver((entries) => {
|
|
6813
|
+
const width = entries[0]?.contentRect.width ?? 0;
|
|
6814
|
+
setMode(width > 600 ? "default" : "minimal");
|
|
6815
|
+
});
|
|
6816
|
+
observer.observe(el);
|
|
6817
|
+
return () => observer.disconnect();
|
|
6818
|
+
}, [ref, override]);
|
|
6819
|
+
return override ?? mode;
|
|
6820
|
+
}
|
|
6645
6821
|
|
|
6646
6822
|
// src/components/ui/filter/filter-system.tsx
|
|
6647
|
-
import { jsx as
|
|
6823
|
+
import { Fragment as Fragment4, jsx as jsx50, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
6648
6824
|
var FilterSystem = ({
|
|
6649
6825
|
properties,
|
|
6650
6826
|
filterState,
|
|
6651
6827
|
onFilterStateChange,
|
|
6652
6828
|
sortFields,
|
|
6829
|
+
mode: modeOverride,
|
|
6653
6830
|
children,
|
|
6654
6831
|
actions,
|
|
6655
6832
|
className
|
|
6656
6833
|
}) => {
|
|
6657
|
-
const
|
|
6658
|
-
const
|
|
6659
|
-
const [
|
|
6834
|
+
const containerRef = React48.useRef(null);
|
|
6835
|
+
const mode = useFilterBarMode(containerRef, modeOverride);
|
|
6836
|
+
const [propertySelectorOpen, setPropertySelectorOpen] = React48.useState(false);
|
|
6837
|
+
const [advancedOpen, setAdvancedOpen] = React48.useState(false);
|
|
6838
|
+
const [pendingFilterId, setPendingFilterId] = React48.useState(null);
|
|
6839
|
+
const allFilters = [...filterState.basicFilters, ...filterState.advancedFilters];
|
|
6840
|
+
const totalCount = allFilters.length;
|
|
6660
6841
|
const handleAddFilter = (property) => {
|
|
6661
6842
|
const newFilter = createFilterWithDefaults(property.id, property.type);
|
|
6662
6843
|
if (newFilter.operator && isNoValueOperator(newFilter.operator)) {
|
|
@@ -6711,106 +6892,152 @@ var FilterSystem = ({
|
|
|
6711
6892
|
});
|
|
6712
6893
|
};
|
|
6713
6894
|
const handleAdvancedFiltersChange = (filters) => {
|
|
6714
|
-
onFilterStateChange({
|
|
6715
|
-
...filterState,
|
|
6716
|
-
advancedFilters: filters
|
|
6717
|
-
});
|
|
6895
|
+
onFilterStateChange({ ...filterState, advancedFilters: filters });
|
|
6718
6896
|
};
|
|
6719
6897
|
const handleClearAdvanced = () => {
|
|
6898
|
+
onFilterStateChange({ ...filterState, advancedFilters: [] });
|
|
6899
|
+
};
|
|
6900
|
+
const handleClearAll = () => {
|
|
6720
6901
|
onFilterStateChange({
|
|
6721
6902
|
...filterState,
|
|
6903
|
+
basicFilters: [],
|
|
6722
6904
|
advancedFilters: []
|
|
6723
6905
|
});
|
|
6724
6906
|
};
|
|
6725
6907
|
const handleSortChange = (field, direction) => {
|
|
6726
|
-
onFilterStateChange({
|
|
6727
|
-
...filterState,
|
|
6728
|
-
sort: { field, direction }
|
|
6729
|
-
});
|
|
6908
|
+
onFilterStateChange({ ...filterState, sort: { field, direction } });
|
|
6730
6909
|
};
|
|
6731
6910
|
const getPropertyDef = (propertyId) => properties.find((p) => p.id === propertyId);
|
|
6732
6911
|
const hasAdvanced = filterState.advancedFilters.length > 0;
|
|
6733
|
-
|
|
6734
|
-
|
|
6912
|
+
const isMinimal = mode === "minimal";
|
|
6913
|
+
return /* @__PURE__ */ jsxs45(FilterBar, { ref: containerRef, className, children: [
|
|
6914
|
+
/* @__PURE__ */ jsxs45(FilterBarLeft, { children: [
|
|
6735
6915
|
children,
|
|
6736
|
-
sortFields && filterState.sort && /* @__PURE__ */
|
|
6916
|
+
sortFields && filterState.sort && /* @__PURE__ */ jsx50(
|
|
6737
6917
|
SortButton,
|
|
6738
6918
|
{
|
|
6739
6919
|
fields: sortFields,
|
|
6740
6920
|
activeField: filterState.sort.field,
|
|
6741
6921
|
direction: filterState.sort.direction,
|
|
6742
|
-
onChange: handleSortChange
|
|
6743
|
-
|
|
6744
|
-
),
|
|
6745
|
-
hasAdvanced && /* @__PURE__ */ jsx49(
|
|
6746
|
-
AdvancedPopover,
|
|
6747
|
-
{
|
|
6748
|
-
filters: filterState.advancedFilters,
|
|
6749
|
-
properties,
|
|
6750
|
-
onFiltersChange: handleAdvancedFiltersChange,
|
|
6751
|
-
open: advancedOpen,
|
|
6752
|
-
onOpenChange: setAdvancedOpen,
|
|
6753
|
-
children: /* @__PURE__ */ jsx49(
|
|
6754
|
-
AdvancedChip,
|
|
6755
|
-
{
|
|
6756
|
-
count: filterState.advancedFilters.length,
|
|
6757
|
-
onClick: () => setAdvancedOpen(true),
|
|
6758
|
-
onClear: handleClearAdvanced
|
|
6759
|
-
}
|
|
6760
|
-
)
|
|
6922
|
+
onChange: handleSortChange,
|
|
6923
|
+
iconOnly: isMinimal
|
|
6761
6924
|
}
|
|
6762
6925
|
),
|
|
6763
|
-
|
|
6764
|
-
|
|
6765
|
-
|
|
6766
|
-
|
|
6767
|
-
InteractiveFilterChip,
|
|
6926
|
+
isMinimal ? totalCount > 0 ? (
|
|
6927
|
+
/* Has filters → SummaryChip (interactive popover) */
|
|
6928
|
+
/* @__PURE__ */ jsx50(
|
|
6929
|
+
SummaryChip,
|
|
6768
6930
|
{
|
|
6769
|
-
|
|
6770
|
-
|
|
6931
|
+
count: totalCount,
|
|
6932
|
+
filters: allFilters,
|
|
6771
6933
|
properties,
|
|
6772
|
-
|
|
6773
|
-
|
|
6774
|
-
|
|
6775
|
-
|
|
6776
|
-
|
|
6777
|
-
|
|
6778
|
-
|
|
6779
|
-
|
|
6780
|
-
|
|
6781
|
-
|
|
6782
|
-
|
|
6783
|
-
|
|
6784
|
-
|
|
6785
|
-
|
|
6786
|
-
|
|
6787
|
-
|
|
6788
|
-
|
|
6789
|
-
|
|
6790
|
-
|
|
6934
|
+
onFiltersChange: (filters) => {
|
|
6935
|
+
onFilterStateChange({
|
|
6936
|
+
...filterState,
|
|
6937
|
+
basicFilters: filters,
|
|
6938
|
+
advancedFilters: []
|
|
6939
|
+
});
|
|
6940
|
+
},
|
|
6941
|
+
onClearAll: handleClearAll
|
|
6942
|
+
}
|
|
6943
|
+
)
|
|
6944
|
+
) : (
|
|
6945
|
+
/* No filters → same FilterBarButton as default, icon-only */
|
|
6946
|
+
/* @__PURE__ */ jsx50(
|
|
6947
|
+
PropertySelector,
|
|
6948
|
+
{
|
|
6949
|
+
properties,
|
|
6950
|
+
onSelect: handleAddFilter,
|
|
6951
|
+
open: propertySelectorOpen,
|
|
6952
|
+
onOpenChange: setPropertySelectorOpen,
|
|
6953
|
+
children: /* @__PURE__ */ jsx50(FilterBarButton, { iconOnly: true })
|
|
6954
|
+
}
|
|
6955
|
+
)
|
|
6956
|
+
) : (
|
|
6957
|
+
/* ── DEFAULT MODE ────────────────────────────────────── */
|
|
6958
|
+
/* @__PURE__ */ jsxs45(Fragment4, { children: [
|
|
6959
|
+
hasAdvanced && /* @__PURE__ */ jsx50(
|
|
6960
|
+
AdvancedPopover,
|
|
6961
|
+
{
|
|
6962
|
+
filters: filterState.advancedFilters,
|
|
6963
|
+
properties,
|
|
6964
|
+
onFiltersChange: handleAdvancedFiltersChange,
|
|
6965
|
+
open: advancedOpen,
|
|
6966
|
+
onOpenChange: setAdvancedOpen,
|
|
6967
|
+
children: /* @__PURE__ */ jsx50(
|
|
6968
|
+
AdvancedChip,
|
|
6969
|
+
{
|
|
6970
|
+
count: filterState.advancedFilters.length,
|
|
6971
|
+
onClick: () => setAdvancedOpen(true),
|
|
6972
|
+
onClear: handleClearAdvanced
|
|
6973
|
+
}
|
|
6974
|
+
)
|
|
6975
|
+
}
|
|
6976
|
+
),
|
|
6977
|
+
filterState.basicFilters.map((filter) => {
|
|
6978
|
+
const propDef = getPropertyDef(filter.propertyId);
|
|
6979
|
+
if (!propDef) return null;
|
|
6980
|
+
return /* @__PURE__ */ jsx50(
|
|
6981
|
+
InteractiveFilterChip,
|
|
6982
|
+
{
|
|
6983
|
+
propertyDef: propDef,
|
|
6984
|
+
condition: filter,
|
|
6985
|
+
properties,
|
|
6986
|
+
mode: pendingFilterId === filter.id ? "add" : "edit",
|
|
6987
|
+
autoOpen: pendingFilterId === filter.id,
|
|
6988
|
+
onUpdate: handleUpdateFilter,
|
|
6989
|
+
onPropertyChange: (newProp) => handlePropertyChange(filter.id, newProp),
|
|
6990
|
+
onDelete: () => handleDeleteFilter(filter.id),
|
|
6991
|
+
onConvertToAdvanced: () => handleConvertToAdvanced(filter.id)
|
|
6992
|
+
},
|
|
6993
|
+
filter.id
|
|
6994
|
+
);
|
|
6995
|
+
}),
|
|
6996
|
+
/* @__PURE__ */ jsx50(
|
|
6997
|
+
PropertySelector,
|
|
6791
6998
|
{
|
|
6792
|
-
|
|
6999
|
+
properties,
|
|
7000
|
+
onSelect: handleAddFilter,
|
|
7001
|
+
open: propertySelectorOpen,
|
|
7002
|
+
onOpenChange: setPropertySelectorOpen,
|
|
7003
|
+
children: /* @__PURE__ */ jsx50(
|
|
7004
|
+
FilterBarButton,
|
|
7005
|
+
{
|
|
7006
|
+
count: totalCount || void 0
|
|
7007
|
+
}
|
|
7008
|
+
)
|
|
6793
7009
|
}
|
|
6794
7010
|
)
|
|
6795
|
-
}
|
|
7011
|
+
] })
|
|
6796
7012
|
)
|
|
6797
7013
|
] }),
|
|
6798
|
-
actions && /* @__PURE__ */
|
|
7014
|
+
(actions || totalCount > 0) && /* @__PURE__ */ jsxs45(FilterBarRight, { children: [
|
|
7015
|
+
totalCount > 0 && /* @__PURE__ */ jsx50(
|
|
7016
|
+
"button",
|
|
7017
|
+
{
|
|
7018
|
+
type: "button",
|
|
7019
|
+
onClick: handleClearAll,
|
|
7020
|
+
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)]",
|
|
7021
|
+
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" })
|
|
7022
|
+
}
|
|
7023
|
+
),
|
|
7024
|
+
actions
|
|
7025
|
+
] })
|
|
6799
7026
|
] });
|
|
6800
7027
|
};
|
|
6801
7028
|
FilterSystem.displayName = "FilterSystem";
|
|
6802
7029
|
|
|
6803
7030
|
// src/components/ui/date-picker.tsx
|
|
6804
|
-
import * as
|
|
6805
|
-
import * as
|
|
7031
|
+
import * as React49 from "react";
|
|
7032
|
+
import * as PopoverPrimitive12 from "@radix-ui/react-popover";
|
|
6806
7033
|
import {
|
|
6807
|
-
Icon as
|
|
7034
|
+
Icon as Icon34,
|
|
6808
7035
|
faChevronLeftOutline as faChevronLeftOutline3,
|
|
6809
7036
|
faChevronRightOutline as faChevronRightOutline3,
|
|
6810
7037
|
faArrowRightOutline as faArrowRightOutline2,
|
|
6811
7038
|
faCalendarOutline
|
|
6812
7039
|
} from "@l3mpire/icons";
|
|
6813
|
-
import { jsx as
|
|
7040
|
+
import { jsx as jsx51, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
6814
7041
|
function getDaysInMonth(year, month) {
|
|
6815
7042
|
return new Date(year, month + 1, 0).getDate();
|
|
6816
7043
|
}
|
|
@@ -6842,16 +7069,16 @@ var MONTH_NAMES = [
|
|
|
6842
7069
|
"November",
|
|
6843
7070
|
"December"
|
|
6844
7071
|
];
|
|
6845
|
-
var DatePickerContext =
|
|
7072
|
+
var DatePickerContext = React49.createContext(
|
|
6846
7073
|
null
|
|
6847
7074
|
);
|
|
6848
7075
|
function useDatePickerContext() {
|
|
6849
|
-
const ctx =
|
|
7076
|
+
const ctx = React49.useContext(DatePickerContext);
|
|
6850
7077
|
if (!ctx)
|
|
6851
7078
|
throw new Error("DatePicker compound components must be used within <DatePicker>");
|
|
6852
7079
|
return ctx;
|
|
6853
7080
|
}
|
|
6854
|
-
var DatePicker =
|
|
7081
|
+
var DatePicker = React49.forwardRef(
|
|
6855
7082
|
({
|
|
6856
7083
|
className,
|
|
6857
7084
|
mode = "single",
|
|
@@ -6862,22 +7089,22 @@ var DatePicker = React47.forwardRef(
|
|
|
6862
7089
|
children,
|
|
6863
7090
|
...props
|
|
6864
7091
|
}, ref) => {
|
|
6865
|
-
const today =
|
|
6866
|
-
const initialDate =
|
|
7092
|
+
const today = React49.useMemo(() => startOfDay(/* @__PURE__ */ new Date()), []);
|
|
7093
|
+
const initialDate = React49.useMemo(() => {
|
|
6867
7094
|
if (value) {
|
|
6868
7095
|
if (value instanceof Date) return value;
|
|
6869
7096
|
return value.from;
|
|
6870
7097
|
}
|
|
6871
7098
|
return today;
|
|
6872
7099
|
}, []);
|
|
6873
|
-
const [month, setMonth] =
|
|
7100
|
+
const [month, setMonth] = React49.useState(
|
|
6874
7101
|
defaultMonth ?? initialDate.getMonth()
|
|
6875
7102
|
);
|
|
6876
|
-
const [year, setYear] =
|
|
7103
|
+
const [year, setYear] = React49.useState(
|
|
6877
7104
|
defaultYear ?? initialDate.getFullYear()
|
|
6878
7105
|
);
|
|
6879
|
-
const [hoveredDate, setHoveredDate] =
|
|
6880
|
-
const goToPrevMonth =
|
|
7106
|
+
const [hoveredDate, setHoveredDate] = React49.useState();
|
|
7107
|
+
const goToPrevMonth = React49.useCallback(() => {
|
|
6881
7108
|
setMonth((m) => {
|
|
6882
7109
|
if (m === 0) {
|
|
6883
7110
|
setYear((y) => y - 1);
|
|
@@ -6886,7 +7113,7 @@ var DatePicker = React47.forwardRef(
|
|
|
6886
7113
|
return m - 1;
|
|
6887
7114
|
});
|
|
6888
7115
|
}, []);
|
|
6889
|
-
const goToNextMonth =
|
|
7116
|
+
const goToNextMonth = React49.useCallback(() => {
|
|
6890
7117
|
setMonth((m) => {
|
|
6891
7118
|
if (m === 11) {
|
|
6892
7119
|
setYear((y) => y + 1);
|
|
@@ -6895,7 +7122,7 @@ var DatePicker = React47.forwardRef(
|
|
|
6895
7122
|
return m + 1;
|
|
6896
7123
|
});
|
|
6897
7124
|
}, []);
|
|
6898
|
-
const onSelect =
|
|
7125
|
+
const onSelect = React49.useCallback(
|
|
6899
7126
|
(date) => {
|
|
6900
7127
|
if (mode === "single") {
|
|
6901
7128
|
onValueChange?.(date);
|
|
@@ -6914,7 +7141,7 @@ var DatePicker = React47.forwardRef(
|
|
|
6914
7141
|
},
|
|
6915
7142
|
[mode, value, onValueChange]
|
|
6916
7143
|
);
|
|
6917
|
-
const ctxValue =
|
|
7144
|
+
const ctxValue = React49.useMemo(
|
|
6918
7145
|
() => ({
|
|
6919
7146
|
mode,
|
|
6920
7147
|
selected: value,
|
|
@@ -6941,7 +7168,7 @@ var DatePicker = React47.forwardRef(
|
|
|
6941
7168
|
hoveredDate
|
|
6942
7169
|
]
|
|
6943
7170
|
);
|
|
6944
|
-
return /* @__PURE__ */
|
|
7171
|
+
return /* @__PURE__ */ jsx51(DatePickerContext.Provider, { value: ctxValue, children: /* @__PURE__ */ jsx51(
|
|
6945
7172
|
"div",
|
|
6946
7173
|
{
|
|
6947
7174
|
ref,
|
|
@@ -6964,32 +7191,32 @@ function defaultFormatDate(date) {
|
|
|
6964
7191
|
year: "numeric"
|
|
6965
7192
|
});
|
|
6966
7193
|
}
|
|
6967
|
-
var DatePickerSelects =
|
|
7194
|
+
var DatePickerSelects = React49.forwardRef(({ className, formatDate = defaultFormatDate, ...props }, ref) => {
|
|
6968
7195
|
const { selected } = useDatePickerContext();
|
|
6969
7196
|
const fromDate = selected instanceof Date ? selected : selected?.from;
|
|
6970
7197
|
const toDate = selected instanceof Date ? void 0 : selected?.to;
|
|
6971
|
-
return /* @__PURE__ */
|
|
7198
|
+
return /* @__PURE__ */ jsx51(
|
|
6972
7199
|
"div",
|
|
6973
7200
|
{
|
|
6974
7201
|
ref,
|
|
6975
7202
|
className: cn("flex flex-col items-start pt-lg px-lg", className),
|
|
6976
7203
|
...props,
|
|
6977
|
-
children: /* @__PURE__ */
|
|
6978
|
-
/* @__PURE__ */
|
|
6979
|
-
/* @__PURE__ */
|
|
6980
|
-
/* @__PURE__ */
|
|
7204
|
+
children: /* @__PURE__ */ jsxs46("div", { className: "flex items-center gap-base w-full", children: [
|
|
7205
|
+
/* @__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: [
|
|
7206
|
+
/* @__PURE__ */ jsx51("span", { className: "flex-1 text-sm font-regular leading-sm text-datepicker-header-text truncate", children: fromDate ? formatDate(fromDate) : "Start date" }),
|
|
7207
|
+
/* @__PURE__ */ jsx51(Icon34, { icon: faCalendarOutline, size: "sm", className: "shrink-0 text-datepicker-header-text" })
|
|
6981
7208
|
] }),
|
|
6982
|
-
/* @__PURE__ */
|
|
6983
|
-
|
|
7209
|
+
/* @__PURE__ */ jsx51(
|
|
7210
|
+
Icon34,
|
|
6984
7211
|
{
|
|
6985
7212
|
icon: faArrowRightOutline2,
|
|
6986
7213
|
size: "sm",
|
|
6987
7214
|
className: "shrink-0 text-datepicker-header-weekday"
|
|
6988
7215
|
}
|
|
6989
7216
|
),
|
|
6990
|
-
/* @__PURE__ */
|
|
6991
|
-
/* @__PURE__ */
|
|
6992
|
-
/* @__PURE__ */
|
|
7217
|
+
/* @__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: [
|
|
7218
|
+
/* @__PURE__ */ jsx51("span", { className: "flex-1 text-sm font-regular leading-sm text-datepicker-header-text truncate", children: toDate ? formatDate(toDate) : "End date" }),
|
|
7219
|
+
/* @__PURE__ */ jsx51(Icon34, { icon: faCalendarOutline, size: "sm", className: "shrink-0 text-datepicker-header-text" })
|
|
6993
7220
|
] })
|
|
6994
7221
|
] })
|
|
6995
7222
|
}
|
|
@@ -7005,7 +7232,7 @@ var DatePickerDay = ({ date, isOutside }) => {
|
|
|
7005
7232
|
const inRange = mode === "range" && selected && !(selected instanceof Date) && selected.from && selected.to && !isSelected && isInRange(date, selected.from, selected.to);
|
|
7006
7233
|
const inPreviewRange = mode === "range" && selected && !(selected instanceof Date) && selected.from && !selected.to && hoveredDate && !isSelected && hoveredDate.getTime() > selected.from.getTime() && isInRange(date, selected.from, hoveredDate);
|
|
7007
7234
|
const isInRangeOrPreview = inRange || inPreviewRange;
|
|
7008
|
-
return /* @__PURE__ */
|
|
7235
|
+
return /* @__PURE__ */ jsxs46(
|
|
7009
7236
|
"button",
|
|
7010
7237
|
{
|
|
7011
7238
|
type: "button",
|
|
@@ -7029,14 +7256,14 @@ var DatePickerDay = ({ date, isOutside }) => {
|
|
|
7029
7256
|
),
|
|
7030
7257
|
children: [
|
|
7031
7258
|
date.getDate(),
|
|
7032
|
-
isToday && !isOutside && /* @__PURE__ */
|
|
7259
|
+
isToday && !isOutside && /* @__PURE__ */ jsx51("span", { className: "absolute bottom-0.5 left-1/2 -translate-x-1/2 size-1.5 rounded-full bg-datepicker-day-today" })
|
|
7033
7260
|
]
|
|
7034
7261
|
}
|
|
7035
7262
|
);
|
|
7036
7263
|
};
|
|
7037
|
-
var DatePickerCalendar =
|
|
7264
|
+
var DatePickerCalendar = React49.forwardRef(({ className, header, ...props }, ref) => {
|
|
7038
7265
|
const { month, year, goToPrevMonth, goToNextMonth } = useDatePickerContext();
|
|
7039
|
-
const weeks =
|
|
7266
|
+
const weeks = React49.useMemo(() => {
|
|
7040
7267
|
const firstDay = new Date(year, month, 1);
|
|
7041
7268
|
const startOffset = getWeekdayIndex(firstDay);
|
|
7042
7269
|
const daysInMonth = getDaysInMonth(year, month);
|
|
@@ -7076,7 +7303,7 @@ var DatePickerCalendar = React47.forwardRef(({ className, header, ...props }, re
|
|
|
7076
7303
|
}
|
|
7077
7304
|
return result;
|
|
7078
7305
|
}, [month, year]);
|
|
7079
|
-
return /* @__PURE__ */
|
|
7306
|
+
return /* @__PURE__ */ jsxs46(
|
|
7080
7307
|
"div",
|
|
7081
7308
|
{
|
|
7082
7309
|
ref,
|
|
@@ -7084,38 +7311,38 @@ var DatePickerCalendar = React47.forwardRef(({ className, header, ...props }, re
|
|
|
7084
7311
|
...props,
|
|
7085
7312
|
children: [
|
|
7086
7313
|
header,
|
|
7087
|
-
/* @__PURE__ */
|
|
7088
|
-
/* @__PURE__ */
|
|
7089
|
-
/* @__PURE__ */
|
|
7314
|
+
/* @__PURE__ */ jsxs46("div", { className: "flex flex-col gap-lg p-lg", children: [
|
|
7315
|
+
/* @__PURE__ */ jsxs46("div", { className: "flex items-center justify-between", children: [
|
|
7316
|
+
/* @__PURE__ */ jsxs46("span", { className: "text-base font-medium leading-base text-datepicker-header-text", children: [
|
|
7090
7317
|
MONTH_NAMES[month],
|
|
7091
7318
|
" ",
|
|
7092
7319
|
year
|
|
7093
7320
|
] }),
|
|
7094
|
-
/* @__PURE__ */
|
|
7095
|
-
/* @__PURE__ */
|
|
7321
|
+
/* @__PURE__ */ jsxs46("div", { className: "flex items-center gap-xs", children: [
|
|
7322
|
+
/* @__PURE__ */ jsx51(
|
|
7096
7323
|
"button",
|
|
7097
7324
|
{
|
|
7098
7325
|
type: "button",
|
|
7099
7326
|
onClick: goToPrevMonth,
|
|
7100
7327
|
className: "flex items-center justify-center p-xs rounded-base hover:bg-datepicker-day-bg-hover transition-colors cursor-pointer",
|
|
7101
7328
|
"aria-label": "Previous month",
|
|
7102
|
-
children: /* @__PURE__ */
|
|
7329
|
+
children: /* @__PURE__ */ jsx51(Icon34, { icon: faChevronLeftOutline3, size: "xs", className: "text-datepicker-header-nav" })
|
|
7103
7330
|
}
|
|
7104
7331
|
),
|
|
7105
|
-
/* @__PURE__ */
|
|
7332
|
+
/* @__PURE__ */ jsx51(
|
|
7106
7333
|
"button",
|
|
7107
7334
|
{
|
|
7108
7335
|
type: "button",
|
|
7109
7336
|
onClick: goToNextMonth,
|
|
7110
7337
|
className: "flex items-center justify-center p-xs rounded-base hover:bg-datepicker-day-bg-hover transition-colors cursor-pointer",
|
|
7111
7338
|
"aria-label": "Next month",
|
|
7112
|
-
children: /* @__PURE__ */
|
|
7339
|
+
children: /* @__PURE__ */ jsx51(Icon34, { icon: faChevronRightOutline3, size: "xs", className: "text-datepicker-header-nav" })
|
|
7113
7340
|
}
|
|
7114
7341
|
)
|
|
7115
7342
|
] })
|
|
7116
7343
|
] }),
|
|
7117
|
-
/* @__PURE__ */
|
|
7118
|
-
/* @__PURE__ */
|
|
7344
|
+
/* @__PURE__ */ jsxs46("div", { className: "flex flex-col", children: [
|
|
7345
|
+
/* @__PURE__ */ jsx51("div", { className: "grid grid-cols-7 gap-base py-sm", children: WEEKDAYS.map((day) => /* @__PURE__ */ jsx51(
|
|
7119
7346
|
"span",
|
|
7120
7347
|
{
|
|
7121
7348
|
className: "w-9 text-center text-xs font-regular leading-xs text-datepicker-header-weekday",
|
|
@@ -7123,7 +7350,7 @@ var DatePickerCalendar = React47.forwardRef(({ className, header, ...props }, re
|
|
|
7123
7350
|
},
|
|
7124
7351
|
day
|
|
7125
7352
|
)) }),
|
|
7126
|
-
/* @__PURE__ */
|
|
7353
|
+
/* @__PURE__ */ jsx51("div", { className: "flex flex-col", children: weeks.map((week, wi) => /* @__PURE__ */ jsx51("div", { className: "grid grid-cols-7 gap-base", children: week.map((day, di) => /* @__PURE__ */ jsx51(
|
|
7127
7354
|
DatePickerDay,
|
|
7128
7355
|
{
|
|
7129
7356
|
date: day.date,
|
|
@@ -7138,10 +7365,10 @@ var DatePickerCalendar = React47.forwardRef(({ className, header, ...props }, re
|
|
|
7138
7365
|
);
|
|
7139
7366
|
});
|
|
7140
7367
|
DatePickerCalendar.displayName = "DatePickerCalendar";
|
|
7141
|
-
var DatePickerSuggestions =
|
|
7368
|
+
var DatePickerSuggestions = React49.forwardRef(
|
|
7142
7369
|
({ className, suggestions, formatDate = defaultFormatDate, ...props }, ref) => {
|
|
7143
7370
|
const { onSelect, mode } = useDatePickerContext();
|
|
7144
|
-
const onValueChange =
|
|
7371
|
+
const onValueChange = React49.useContext(DatePickerContext) ? void 0 : void 0;
|
|
7145
7372
|
const ctx = useDatePickerContext();
|
|
7146
7373
|
const handleClick = (suggestion) => {
|
|
7147
7374
|
const val = suggestion.getValue();
|
|
@@ -7163,7 +7390,7 @@ var DatePickerSuggestions = React47.forwardRef(
|
|
|
7163
7390
|
const to = val.to ? formatDate(val.to) : "";
|
|
7164
7391
|
return to ? `${from} - ${to}` : from;
|
|
7165
7392
|
};
|
|
7166
|
-
return /* @__PURE__ */
|
|
7393
|
+
return /* @__PURE__ */ jsxs46(
|
|
7167
7394
|
"div",
|
|
7168
7395
|
{
|
|
7169
7396
|
ref,
|
|
@@ -7173,16 +7400,16 @@ var DatePickerSuggestions = React47.forwardRef(
|
|
|
7173
7400
|
),
|
|
7174
7401
|
...props,
|
|
7175
7402
|
children: [
|
|
7176
|
-
/* @__PURE__ */
|
|
7177
|
-
/* @__PURE__ */
|
|
7403
|
+
/* @__PURE__ */ jsx51("div", { className: "pt-lg px-base", children: /* @__PURE__ */ jsx51("div", { className: "flex items-center p-base rounded-base", children: /* @__PURE__ */ jsx51("span", { className: "flex-1 text-xs font-medium leading-xs text-datepicker-suggestion-heading uppercase truncate", children: "Suggestions" }) }) }),
|
|
7404
|
+
/* @__PURE__ */ jsx51("div", { className: "flex flex-1 flex-col p-base min-w-[222px]", children: suggestions.map((suggestion, i) => /* @__PURE__ */ jsxs46(
|
|
7178
7405
|
"button",
|
|
7179
7406
|
{
|
|
7180
7407
|
type: "button",
|
|
7181
7408
|
onClick: () => handleClick(suggestion),
|
|
7182
7409
|
className: "flex items-center gap-sm p-base rounded-base hover:bg-datepicker-suggestion-hover transition-colors cursor-pointer text-left",
|
|
7183
7410
|
children: [
|
|
7184
|
-
/* @__PURE__ */
|
|
7185
|
-
/* @__PURE__ */
|
|
7411
|
+
/* @__PURE__ */ jsx51("span", { className: "text-sm font-regular leading-sm text-datepicker-suggestion-text truncate shrink-0", children: suggestion.label }),
|
|
7412
|
+
/* @__PURE__ */ jsx51("span", { className: "text-xs font-regular leading-xs text-datepicker-suggestion-date truncate", children: formatSuggestionDate(suggestion) })
|
|
7186
7413
|
]
|
|
7187
7414
|
},
|
|
7188
7415
|
i
|
|
@@ -7193,8 +7420,8 @@ var DatePickerSuggestions = React47.forwardRef(
|
|
|
7193
7420
|
}
|
|
7194
7421
|
);
|
|
7195
7422
|
DatePickerSuggestions.displayName = "DatePickerSuggestions";
|
|
7196
|
-
var DatePickerFooter =
|
|
7197
|
-
({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
7423
|
+
var DatePickerFooter = React49.forwardRef(
|
|
7424
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ jsx51(
|
|
7198
7425
|
"div",
|
|
7199
7426
|
{
|
|
7200
7427
|
ref,
|
|
@@ -7210,8 +7437,8 @@ var DatePickerFooter = React47.forwardRef(
|
|
|
7210
7437
|
)
|
|
7211
7438
|
);
|
|
7212
7439
|
DatePickerFooter.displayName = "DatePickerFooter";
|
|
7213
|
-
var DatePickerPanel =
|
|
7214
|
-
({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
7440
|
+
var DatePickerPanel = React49.forwardRef(
|
|
7441
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ jsx51(
|
|
7215
7442
|
"div",
|
|
7216
7443
|
{
|
|
7217
7444
|
ref,
|
|
@@ -7222,10 +7449,10 @@ var DatePickerPanel = React47.forwardRef(
|
|
|
7222
7449
|
)
|
|
7223
7450
|
);
|
|
7224
7451
|
DatePickerPanel.displayName = "DatePickerPanel";
|
|
7225
|
-
var DatePickerRoot =
|
|
7226
|
-
var DatePickerTrigger =
|
|
7227
|
-
var DatePickerPopover =
|
|
7228
|
-
|
|
7452
|
+
var DatePickerRoot = PopoverPrimitive12.Root;
|
|
7453
|
+
var DatePickerTrigger = PopoverPrimitive12.Trigger;
|
|
7454
|
+
var DatePickerPopover = React49.forwardRef(({ className, sideOffset = 4, align = "start", children, ...props }, ref) => /* @__PURE__ */ jsx51(PopoverPrimitive12.Portal, { children: /* @__PURE__ */ jsx51(
|
|
7455
|
+
PopoverPrimitive12.Content,
|
|
7229
7456
|
{
|
|
7230
7457
|
ref,
|
|
7231
7458
|
sideOffset,
|
|
@@ -7384,6 +7611,7 @@ export {
|
|
|
7384
7611
|
SidebarSection,
|
|
7385
7612
|
SortButton,
|
|
7386
7613
|
StatusCell,
|
|
7614
|
+
SummaryChip,
|
|
7387
7615
|
Switch,
|
|
7388
7616
|
TabContent,
|
|
7389
7617
|
TabList,
|
|
@@ -7438,6 +7666,7 @@ export {
|
|
|
7438
7666
|
toastVariants,
|
|
7439
7667
|
tooltipContentVariants,
|
|
7440
7668
|
typographyVariants,
|
|
7669
|
+
useFilterBarMode,
|
|
7441
7670
|
useSidebarContext
|
|
7442
7671
|
};
|
|
7443
7672
|
//# sourceMappingURL=index.mjs.map
|