@l3mpire/ui 2.7.1 → 2.8.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/dist/index.d.mts +25 -5
- package/dist/index.d.ts +25 -5
- package/dist/index.js +337 -133
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +334 -132
- 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,7 +6427,7 @@ 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"));
|
|
6426
6431
|
|
|
6427
6432
|
// src/components/ui/filter/advanced-chip.tsx
|
|
6428
6433
|
var React43 = __toESM(require("react"));
|
|
@@ -6751,20 +6756,182 @@ var AdvancedPopover = ({
|
|
|
6751
6756
|
};
|
|
6752
6757
|
AdvancedPopover.displayName = "AdvancedPopover";
|
|
6753
6758
|
|
|
6754
|
-
// src/components/ui/filter/
|
|
6759
|
+
// src/components/ui/filter/summary-chip.tsx
|
|
6760
|
+
var React46 = __toESM(require("react"));
|
|
6761
|
+
var PopoverPrimitive11 = __toESM(require("@radix-ui/react-popover"));
|
|
6762
|
+
var import_icons32 = require("@l3mpire/icons");
|
|
6755
6763
|
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
6764
|
+
var SummaryChip = ({
|
|
6765
|
+
count,
|
|
6766
|
+
filters,
|
|
6767
|
+
properties,
|
|
6768
|
+
onFiltersChange,
|
|
6769
|
+
onClearAll,
|
|
6770
|
+
className
|
|
6771
|
+
}) => {
|
|
6772
|
+
const [open, setOpen] = React46.useState(false);
|
|
6773
|
+
const [addSelectorOpen, setAddSelectorOpen] = React46.useState(false);
|
|
6774
|
+
const getPropertyDef = (propertyId) => properties.find((p) => p.id === propertyId);
|
|
6775
|
+
const handleUpdateFilter = (updated) => {
|
|
6776
|
+
onFiltersChange(filters.map((f) => f.id === updated.id ? updated : f));
|
|
6777
|
+
};
|
|
6778
|
+
const handleDeleteFilter = (id) => {
|
|
6779
|
+
const next = filters.filter((f) => f.id !== id);
|
|
6780
|
+
onFiltersChange(next);
|
|
6781
|
+
if (next.length === 0) setOpen(false);
|
|
6782
|
+
};
|
|
6783
|
+
const handlePropertyChange = (filterId, newProp) => {
|
|
6784
|
+
const newCondition = createFilterWithDefaults(newProp.id, newProp.type);
|
|
6785
|
+
onFiltersChange(
|
|
6786
|
+
filters.map((f) => f.id === filterId ? { ...newCondition, id: filterId } : f)
|
|
6787
|
+
);
|
|
6788
|
+
};
|
|
6789
|
+
const handleAddFilter = (property) => {
|
|
6790
|
+
const newFilter = createFilterWithDefaults(property.id, property.type);
|
|
6791
|
+
onFiltersChange([...filters, newFilter]);
|
|
6792
|
+
setAddSelectorOpen(false);
|
|
6793
|
+
};
|
|
6794
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(PopoverPrimitive11.Root, { open, onOpenChange: setOpen, children: [
|
|
6795
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(PopoverPrimitive11.Trigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
6796
|
+
"button",
|
|
6797
|
+
{
|
|
6798
|
+
type: "button",
|
|
6799
|
+
className: cn(
|
|
6800
|
+
"inline-flex items-center gap-sm px-base py-sm",
|
|
6801
|
+
"min-h-[32px] max-h-[32px]",
|
|
6802
|
+
count > 0 ? "bg-[var(--color-primary)]/5 border border-[var(--color-primary)]/30 text-[var(--color-primary)]" : "bg-filter-chip-bg border border-filter-chip-border text-[var(--color-foreground)]",
|
|
6803
|
+
"rounded-md text-sm font-medium leading-sm",
|
|
6804
|
+
"cursor-pointer transition-colors hover:opacity-80",
|
|
6805
|
+
className
|
|
6806
|
+
),
|
|
6807
|
+
children: [
|
|
6808
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
6809
|
+
import_icons32.Icon,
|
|
6810
|
+
{
|
|
6811
|
+
icon: import_icons32.faFilterOutline,
|
|
6812
|
+
size: "sm",
|
|
6813
|
+
className: count > 0 ? "text-[var(--color-primary)]" : "text-[var(--color-muted-foreground)]"
|
|
6814
|
+
}
|
|
6815
|
+
),
|
|
6816
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("span", { className: "whitespace-nowrap", children: [
|
|
6817
|
+
"Filters",
|
|
6818
|
+
count > 0 && ` (${count})`
|
|
6819
|
+
] })
|
|
6820
|
+
]
|
|
6821
|
+
}
|
|
6822
|
+
) }),
|
|
6823
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(PopoverPrimitive11.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
6824
|
+
PopoverPrimitive11.Content,
|
|
6825
|
+
{
|
|
6826
|
+
sideOffset: 4,
|
|
6827
|
+
align: "start",
|
|
6828
|
+
className: cn(
|
|
6829
|
+
"z-50 flex flex-col overflow-clip",
|
|
6830
|
+
"bg-[var(--color-dropdown-bg)] border border-[var(--color-dropdown-border)] rounded-md shadow-lg",
|
|
6831
|
+
"data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
|
|
6832
|
+
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
|
|
6833
|
+
"data-[side=bottom]:slide-in-from-top-2",
|
|
6834
|
+
"min-w-[420px] max-w-[90vw]"
|
|
6835
|
+
),
|
|
6836
|
+
children: [
|
|
6837
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex flex-col px-base pt-base", children: [
|
|
6838
|
+
filters.map((filter, i) => {
|
|
6839
|
+
const propDef = getPropertyDef(filter.propertyId);
|
|
6840
|
+
if (!propDef) return null;
|
|
6841
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
6842
|
+
AdvancedRow,
|
|
6843
|
+
{
|
|
6844
|
+
connector: i === 0 ? "Where" : "And",
|
|
6845
|
+
propertyDef: propDef,
|
|
6846
|
+
condition: filter,
|
|
6847
|
+
properties,
|
|
6848
|
+
onUpdate: handleUpdateFilter,
|
|
6849
|
+
onPropertyChange: (p) => handlePropertyChange(filter.id, p),
|
|
6850
|
+
onDelete: () => handleDeleteFilter(filter.id)
|
|
6851
|
+
},
|
|
6852
|
+
filter.id
|
|
6853
|
+
);
|
|
6854
|
+
}),
|
|
6855
|
+
filters.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("p", { className: "py-base text-sm text-[var(--color-muted-foreground)]", children: "No active filters." })
|
|
6856
|
+
] }),
|
|
6857
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex items-center justify-between px-base py-base border-t border-[var(--color-border)]", children: [
|
|
6858
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
6859
|
+
PropertySelector,
|
|
6860
|
+
{
|
|
6861
|
+
properties,
|
|
6862
|
+
onSelect: handleAddFilter,
|
|
6863
|
+
open: addSelectorOpen,
|
|
6864
|
+
onOpenChange: setAddSelectorOpen,
|
|
6865
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
6866
|
+
"button",
|
|
6867
|
+
{
|
|
6868
|
+
type: "button",
|
|
6869
|
+
className: "flex items-center gap-xs text-sm font-regular leading-sm text-[var(--color-muted-foreground)] hover:text-[var(--color-foreground)] cursor-pointer transition-colors",
|
|
6870
|
+
children: [
|
|
6871
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_icons32.Icon, { icon: import_icons32.faPlusOutline, size: "xs" }),
|
|
6872
|
+
"Add filter"
|
|
6873
|
+
]
|
|
6874
|
+
}
|
|
6875
|
+
)
|
|
6876
|
+
}
|
|
6877
|
+
),
|
|
6878
|
+
filters.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
6879
|
+
"button",
|
|
6880
|
+
{
|
|
6881
|
+
type: "button",
|
|
6882
|
+
onClick: () => {
|
|
6883
|
+
onClearAll();
|
|
6884
|
+
setOpen(false);
|
|
6885
|
+
},
|
|
6886
|
+
className: "text-sm font-regular leading-sm text-[var(--color-muted-foreground)] hover:text-[var(--color-foreground)] cursor-pointer transition-colors",
|
|
6887
|
+
children: "Clear all filters"
|
|
6888
|
+
}
|
|
6889
|
+
)
|
|
6890
|
+
] })
|
|
6891
|
+
]
|
|
6892
|
+
}
|
|
6893
|
+
) })
|
|
6894
|
+
] });
|
|
6895
|
+
};
|
|
6896
|
+
SummaryChip.displayName = "SummaryChip";
|
|
6897
|
+
|
|
6898
|
+
// src/components/ui/filter/use-filter-bar-mode.ts
|
|
6899
|
+
var React47 = __toESM(require("react"));
|
|
6900
|
+
function useFilterBarMode(ref, override) {
|
|
6901
|
+
const [mode, setMode] = React47.useState("default");
|
|
6902
|
+
React47.useEffect(() => {
|
|
6903
|
+
if (override) return;
|
|
6904
|
+
const el = ref.current;
|
|
6905
|
+
if (!el) return;
|
|
6906
|
+
const observer = new ResizeObserver((entries) => {
|
|
6907
|
+
const width = entries[0]?.contentRect.width ?? 0;
|
|
6908
|
+
setMode(width > 600 ? "default" : "minimal");
|
|
6909
|
+
});
|
|
6910
|
+
observer.observe(el);
|
|
6911
|
+
return () => observer.disconnect();
|
|
6912
|
+
}, [ref, override]);
|
|
6913
|
+
return override ?? mode;
|
|
6914
|
+
}
|
|
6915
|
+
|
|
6916
|
+
// src/components/ui/filter/filter-system.tsx
|
|
6917
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
6756
6918
|
var FilterSystem = ({
|
|
6757
6919
|
properties,
|
|
6758
6920
|
filterState,
|
|
6759
6921
|
onFilterStateChange,
|
|
6760
6922
|
sortFields,
|
|
6923
|
+
mode: modeOverride,
|
|
6761
6924
|
children,
|
|
6762
6925
|
actions,
|
|
6763
6926
|
className
|
|
6764
6927
|
}) => {
|
|
6765
|
-
const
|
|
6766
|
-
const
|
|
6767
|
-
const [
|
|
6928
|
+
const containerRef = React48.useRef(null);
|
|
6929
|
+
const mode = useFilterBarMode(containerRef, modeOverride);
|
|
6930
|
+
const [propertySelectorOpen, setPropertySelectorOpen] = React48.useState(false);
|
|
6931
|
+
const [advancedOpen, setAdvancedOpen] = React48.useState(false);
|
|
6932
|
+
const [pendingFilterId, setPendingFilterId] = React48.useState(null);
|
|
6933
|
+
const allFilters = [...filterState.basicFilters, ...filterState.advancedFilters];
|
|
6934
|
+
const totalCount = allFilters.length;
|
|
6768
6935
|
const handleAddFilter = (property) => {
|
|
6769
6936
|
const newFilter = createFilterWithDefaults(property.id, property.type);
|
|
6770
6937
|
if (newFilter.operator && isNoValueOperator(newFilter.operator)) {
|
|
@@ -6819,100 +6986,135 @@ var FilterSystem = ({
|
|
|
6819
6986
|
});
|
|
6820
6987
|
};
|
|
6821
6988
|
const handleAdvancedFiltersChange = (filters) => {
|
|
6822
|
-
onFilterStateChange({
|
|
6823
|
-
...filterState,
|
|
6824
|
-
advancedFilters: filters
|
|
6825
|
-
});
|
|
6989
|
+
onFilterStateChange({ ...filterState, advancedFilters: filters });
|
|
6826
6990
|
};
|
|
6827
6991
|
const handleClearAdvanced = () => {
|
|
6992
|
+
onFilterStateChange({ ...filterState, advancedFilters: [] });
|
|
6993
|
+
};
|
|
6994
|
+
const handleClearAll = () => {
|
|
6828
6995
|
onFilterStateChange({
|
|
6829
6996
|
...filterState,
|
|
6997
|
+
basicFilters: [],
|
|
6830
6998
|
advancedFilters: []
|
|
6831
6999
|
});
|
|
6832
7000
|
};
|
|
6833
7001
|
const handleSortChange = (field, direction) => {
|
|
6834
|
-
onFilterStateChange({
|
|
6835
|
-
...filterState,
|
|
6836
|
-
sort: { field, direction }
|
|
6837
|
-
});
|
|
7002
|
+
onFilterStateChange({ ...filterState, sort: { field, direction } });
|
|
6838
7003
|
};
|
|
6839
7004
|
const getPropertyDef = (propertyId) => properties.find((p) => p.id === propertyId);
|
|
6840
7005
|
const hasAdvanced = filterState.advancedFilters.length > 0;
|
|
6841
|
-
|
|
6842
|
-
|
|
7006
|
+
const isMinimal = mode === "minimal";
|
|
7007
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(FilterBar, { ref: containerRef, className, children: [
|
|
7008
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(FilterBarLeft, { children: [
|
|
6843
7009
|
children,
|
|
6844
|
-
sortFields && filterState.sort && /* @__PURE__ */ (0,
|
|
7010
|
+
sortFields && filterState.sort && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
6845
7011
|
SortButton,
|
|
6846
7012
|
{
|
|
6847
7013
|
fields: sortFields,
|
|
6848
7014
|
activeField: filterState.sort.field,
|
|
6849
7015
|
direction: filterState.sort.direction,
|
|
6850
|
-
onChange: handleSortChange
|
|
7016
|
+
onChange: handleSortChange,
|
|
7017
|
+
iconOnly: isMinimal
|
|
6851
7018
|
}
|
|
6852
7019
|
),
|
|
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,
|
|
7020
|
+
isMinimal ? totalCount > 0 ? (
|
|
7021
|
+
/* Has filters → SummaryChip (interactive popover) */
|
|
7022
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
7023
|
+
SummaryChip,
|
|
6876
7024
|
{
|
|
6877
|
-
|
|
6878
|
-
|
|
7025
|
+
count: totalCount,
|
|
7026
|
+
filters: allFilters,
|
|
6879
7027
|
properties,
|
|
6880
|
-
|
|
6881
|
-
|
|
6882
|
-
|
|
6883
|
-
|
|
6884
|
-
|
|
6885
|
-
|
|
6886
|
-
|
|
6887
|
-
|
|
6888
|
-
|
|
6889
|
-
|
|
6890
|
-
|
|
6891
|
-
|
|
6892
|
-
|
|
6893
|
-
|
|
6894
|
-
|
|
6895
|
-
|
|
6896
|
-
|
|
6897
|
-
|
|
6898
|
-
|
|
7028
|
+
onFiltersChange: (filters) => {
|
|
7029
|
+
onFilterStateChange({
|
|
7030
|
+
...filterState,
|
|
7031
|
+
basicFilters: filters,
|
|
7032
|
+
advancedFilters: []
|
|
7033
|
+
});
|
|
7034
|
+
},
|
|
7035
|
+
onClearAll: handleClearAll
|
|
7036
|
+
}
|
|
7037
|
+
)
|
|
7038
|
+
) : (
|
|
7039
|
+
/* No filters → same FilterBarButton as default, icon-only */
|
|
7040
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
7041
|
+
PropertySelector,
|
|
7042
|
+
{
|
|
7043
|
+
properties,
|
|
7044
|
+
onSelect: handleAddFilter,
|
|
7045
|
+
open: propertySelectorOpen,
|
|
7046
|
+
onOpenChange: setPropertySelectorOpen,
|
|
7047
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(FilterBarButton, { iconOnly: true })
|
|
7048
|
+
}
|
|
7049
|
+
)
|
|
7050
|
+
) : (
|
|
7051
|
+
/* ── DEFAULT MODE ────────────────────────────────────── */
|
|
7052
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_jsx_runtime50.Fragment, { children: [
|
|
7053
|
+
hasAdvanced && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
7054
|
+
AdvancedPopover,
|
|
6899
7055
|
{
|
|
6900
|
-
|
|
7056
|
+
filters: filterState.advancedFilters,
|
|
7057
|
+
properties,
|
|
7058
|
+
onFiltersChange: handleAdvancedFiltersChange,
|
|
7059
|
+
open: advancedOpen,
|
|
7060
|
+
onOpenChange: setAdvancedOpen,
|
|
7061
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
7062
|
+
AdvancedChip,
|
|
7063
|
+
{
|
|
7064
|
+
count: filterState.advancedFilters.length,
|
|
7065
|
+
onClick: () => setAdvancedOpen(true),
|
|
7066
|
+
onClear: handleClearAdvanced
|
|
7067
|
+
}
|
|
7068
|
+
)
|
|
7069
|
+
}
|
|
7070
|
+
),
|
|
7071
|
+
filterState.basicFilters.map((filter) => {
|
|
7072
|
+
const propDef = getPropertyDef(filter.propertyId);
|
|
7073
|
+
if (!propDef) return null;
|
|
7074
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
7075
|
+
InteractiveFilterChip,
|
|
7076
|
+
{
|
|
7077
|
+
propertyDef: propDef,
|
|
7078
|
+
condition: filter,
|
|
7079
|
+
properties,
|
|
7080
|
+
mode: pendingFilterId === filter.id ? "add" : "edit",
|
|
7081
|
+
autoOpen: pendingFilterId === filter.id,
|
|
7082
|
+
onUpdate: handleUpdateFilter,
|
|
7083
|
+
onPropertyChange: (newProp) => handlePropertyChange(filter.id, newProp),
|
|
7084
|
+
onDelete: () => handleDeleteFilter(filter.id),
|
|
7085
|
+
onConvertToAdvanced: () => handleConvertToAdvanced(filter.id)
|
|
7086
|
+
},
|
|
7087
|
+
filter.id
|
|
7088
|
+
);
|
|
7089
|
+
}),
|
|
7090
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
7091
|
+
PropertySelector,
|
|
7092
|
+
{
|
|
7093
|
+
properties,
|
|
7094
|
+
onSelect: handleAddFilter,
|
|
7095
|
+
open: propertySelectorOpen,
|
|
7096
|
+
onOpenChange: setPropertySelectorOpen,
|
|
7097
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
7098
|
+
FilterBarButton,
|
|
7099
|
+
{
|
|
7100
|
+
count: totalCount || void 0
|
|
7101
|
+
}
|
|
7102
|
+
)
|
|
6901
7103
|
}
|
|
6902
7104
|
)
|
|
6903
|
-
}
|
|
7105
|
+
] })
|
|
6904
7106
|
)
|
|
6905
7107
|
] }),
|
|
6906
|
-
actions && /* @__PURE__ */ (0,
|
|
7108
|
+
actions && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(FilterBarRight, { children: actions })
|
|
6907
7109
|
] });
|
|
6908
7110
|
};
|
|
6909
7111
|
FilterSystem.displayName = "FilterSystem";
|
|
6910
7112
|
|
|
6911
7113
|
// src/components/ui/date-picker.tsx
|
|
6912
|
-
var
|
|
6913
|
-
var
|
|
6914
|
-
var
|
|
6915
|
-
var
|
|
7114
|
+
var React49 = __toESM(require("react"));
|
|
7115
|
+
var PopoverPrimitive12 = __toESM(require("@radix-ui/react-popover"));
|
|
7116
|
+
var import_icons33 = require("@l3mpire/icons");
|
|
7117
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
6916
7118
|
function getDaysInMonth(year, month) {
|
|
6917
7119
|
return new Date(year, month + 1, 0).getDate();
|
|
6918
7120
|
}
|
|
@@ -6944,16 +7146,16 @@ var MONTH_NAMES = [
|
|
|
6944
7146
|
"November",
|
|
6945
7147
|
"December"
|
|
6946
7148
|
];
|
|
6947
|
-
var DatePickerContext =
|
|
7149
|
+
var DatePickerContext = React49.createContext(
|
|
6948
7150
|
null
|
|
6949
7151
|
);
|
|
6950
7152
|
function useDatePickerContext() {
|
|
6951
|
-
const ctx =
|
|
7153
|
+
const ctx = React49.useContext(DatePickerContext);
|
|
6952
7154
|
if (!ctx)
|
|
6953
7155
|
throw new Error("DatePicker compound components must be used within <DatePicker>");
|
|
6954
7156
|
return ctx;
|
|
6955
7157
|
}
|
|
6956
|
-
var DatePicker =
|
|
7158
|
+
var DatePicker = React49.forwardRef(
|
|
6957
7159
|
({
|
|
6958
7160
|
className,
|
|
6959
7161
|
mode = "single",
|
|
@@ -6964,22 +7166,22 @@ var DatePicker = React47.forwardRef(
|
|
|
6964
7166
|
children,
|
|
6965
7167
|
...props
|
|
6966
7168
|
}, ref) => {
|
|
6967
|
-
const today =
|
|
6968
|
-
const initialDate =
|
|
7169
|
+
const today = React49.useMemo(() => startOfDay(/* @__PURE__ */ new Date()), []);
|
|
7170
|
+
const initialDate = React49.useMemo(() => {
|
|
6969
7171
|
if (value) {
|
|
6970
7172
|
if (value instanceof Date) return value;
|
|
6971
7173
|
return value.from;
|
|
6972
7174
|
}
|
|
6973
7175
|
return today;
|
|
6974
7176
|
}, []);
|
|
6975
|
-
const [month, setMonth] =
|
|
7177
|
+
const [month, setMonth] = React49.useState(
|
|
6976
7178
|
defaultMonth ?? initialDate.getMonth()
|
|
6977
7179
|
);
|
|
6978
|
-
const [year, setYear] =
|
|
7180
|
+
const [year, setYear] = React49.useState(
|
|
6979
7181
|
defaultYear ?? initialDate.getFullYear()
|
|
6980
7182
|
);
|
|
6981
|
-
const [hoveredDate, setHoveredDate] =
|
|
6982
|
-
const goToPrevMonth =
|
|
7183
|
+
const [hoveredDate, setHoveredDate] = React49.useState();
|
|
7184
|
+
const goToPrevMonth = React49.useCallback(() => {
|
|
6983
7185
|
setMonth((m) => {
|
|
6984
7186
|
if (m === 0) {
|
|
6985
7187
|
setYear((y) => y - 1);
|
|
@@ -6988,7 +7190,7 @@ var DatePicker = React47.forwardRef(
|
|
|
6988
7190
|
return m - 1;
|
|
6989
7191
|
});
|
|
6990
7192
|
}, []);
|
|
6991
|
-
const goToNextMonth =
|
|
7193
|
+
const goToNextMonth = React49.useCallback(() => {
|
|
6992
7194
|
setMonth((m) => {
|
|
6993
7195
|
if (m === 11) {
|
|
6994
7196
|
setYear((y) => y + 1);
|
|
@@ -6997,7 +7199,7 @@ var DatePicker = React47.forwardRef(
|
|
|
6997
7199
|
return m + 1;
|
|
6998
7200
|
});
|
|
6999
7201
|
}, []);
|
|
7000
|
-
const onSelect =
|
|
7202
|
+
const onSelect = React49.useCallback(
|
|
7001
7203
|
(date) => {
|
|
7002
7204
|
if (mode === "single") {
|
|
7003
7205
|
onValueChange?.(date);
|
|
@@ -7016,7 +7218,7 @@ var DatePicker = React47.forwardRef(
|
|
|
7016
7218
|
},
|
|
7017
7219
|
[mode, value, onValueChange]
|
|
7018
7220
|
);
|
|
7019
|
-
const ctxValue =
|
|
7221
|
+
const ctxValue = React49.useMemo(
|
|
7020
7222
|
() => ({
|
|
7021
7223
|
mode,
|
|
7022
7224
|
selected: value,
|
|
@@ -7043,7 +7245,7 @@ var DatePicker = React47.forwardRef(
|
|
|
7043
7245
|
hoveredDate
|
|
7044
7246
|
]
|
|
7045
7247
|
);
|
|
7046
|
-
return /* @__PURE__ */ (0,
|
|
7248
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(DatePickerContext.Provider, { value: ctxValue, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
7047
7249
|
"div",
|
|
7048
7250
|
{
|
|
7049
7251
|
ref,
|
|
@@ -7066,32 +7268,32 @@ function defaultFormatDate(date) {
|
|
|
7066
7268
|
year: "numeric"
|
|
7067
7269
|
});
|
|
7068
7270
|
}
|
|
7069
|
-
var DatePickerSelects =
|
|
7271
|
+
var DatePickerSelects = React49.forwardRef(({ className, formatDate = defaultFormatDate, ...props }, ref) => {
|
|
7070
7272
|
const { selected } = useDatePickerContext();
|
|
7071
7273
|
const fromDate = selected instanceof Date ? selected : selected?.from;
|
|
7072
7274
|
const toDate = selected instanceof Date ? void 0 : selected?.to;
|
|
7073
|
-
return /* @__PURE__ */ (0,
|
|
7275
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
7074
7276
|
"div",
|
|
7075
7277
|
{
|
|
7076
7278
|
ref,
|
|
7077
7279
|
className: cn("flex flex-col items-start pt-lg px-lg", className),
|
|
7078
7280
|
...props,
|
|
7079
|
-
children: /* @__PURE__ */ (0,
|
|
7080
|
-
/* @__PURE__ */ (0,
|
|
7081
|
-
/* @__PURE__ */ (0,
|
|
7082
|
-
/* @__PURE__ */ (0,
|
|
7281
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "flex items-center gap-base w-full", children: [
|
|
7282
|
+
/* @__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: [
|
|
7283
|
+
/* @__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" }),
|
|
7284
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_icons33.Icon, { icon: import_icons33.faCalendarOutline, size: "sm", className: "shrink-0 text-datepicker-header-text" })
|
|
7083
7285
|
] }),
|
|
7084
|
-
/* @__PURE__ */ (0,
|
|
7085
|
-
|
|
7286
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
7287
|
+
import_icons33.Icon,
|
|
7086
7288
|
{
|
|
7087
|
-
icon:
|
|
7289
|
+
icon: import_icons33.faArrowRightOutline,
|
|
7088
7290
|
size: "sm",
|
|
7089
7291
|
className: "shrink-0 text-datepicker-header-weekday"
|
|
7090
7292
|
}
|
|
7091
7293
|
),
|
|
7092
|
-
/* @__PURE__ */ (0,
|
|
7093
|
-
/* @__PURE__ */ (0,
|
|
7094
|
-
/* @__PURE__ */ (0,
|
|
7294
|
+
/* @__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: [
|
|
7295
|
+
/* @__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" }),
|
|
7296
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_icons33.Icon, { icon: import_icons33.faCalendarOutline, size: "sm", className: "shrink-0 text-datepicker-header-text" })
|
|
7095
7297
|
] })
|
|
7096
7298
|
] })
|
|
7097
7299
|
}
|
|
@@ -7107,7 +7309,7 @@ var DatePickerDay = ({ date, isOutside }) => {
|
|
|
7107
7309
|
const inRange = mode === "range" && selected && !(selected instanceof Date) && selected.from && selected.to && !isSelected && isInRange(date, selected.from, selected.to);
|
|
7108
7310
|
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
7311
|
const isInRangeOrPreview = inRange || inPreviewRange;
|
|
7110
|
-
return /* @__PURE__ */ (0,
|
|
7312
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
7111
7313
|
"button",
|
|
7112
7314
|
{
|
|
7113
7315
|
type: "button",
|
|
@@ -7131,14 +7333,14 @@ var DatePickerDay = ({ date, isOutside }) => {
|
|
|
7131
7333
|
),
|
|
7132
7334
|
children: [
|
|
7133
7335
|
date.getDate(),
|
|
7134
|
-
isToday && !isOutside && /* @__PURE__ */ (0,
|
|
7336
|
+
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
7337
|
]
|
|
7136
7338
|
}
|
|
7137
7339
|
);
|
|
7138
7340
|
};
|
|
7139
|
-
var DatePickerCalendar =
|
|
7341
|
+
var DatePickerCalendar = React49.forwardRef(({ className, header, ...props }, ref) => {
|
|
7140
7342
|
const { month, year, goToPrevMonth, goToNextMonth } = useDatePickerContext();
|
|
7141
|
-
const weeks =
|
|
7343
|
+
const weeks = React49.useMemo(() => {
|
|
7142
7344
|
const firstDay = new Date(year, month, 1);
|
|
7143
7345
|
const startOffset = getWeekdayIndex(firstDay);
|
|
7144
7346
|
const daysInMonth = getDaysInMonth(year, month);
|
|
@@ -7178,7 +7380,7 @@ var DatePickerCalendar = React47.forwardRef(({ className, header, ...props }, re
|
|
|
7178
7380
|
}
|
|
7179
7381
|
return result;
|
|
7180
7382
|
}, [month, year]);
|
|
7181
|
-
return /* @__PURE__ */ (0,
|
|
7383
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
7182
7384
|
"div",
|
|
7183
7385
|
{
|
|
7184
7386
|
ref,
|
|
@@ -7186,38 +7388,38 @@ var DatePickerCalendar = React47.forwardRef(({ className, header, ...props }, re
|
|
|
7186
7388
|
...props,
|
|
7187
7389
|
children: [
|
|
7188
7390
|
header,
|
|
7189
|
-
/* @__PURE__ */ (0,
|
|
7190
|
-
/* @__PURE__ */ (0,
|
|
7191
|
-
/* @__PURE__ */ (0,
|
|
7391
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "flex flex-col gap-lg p-lg", children: [
|
|
7392
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
7393
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("span", { className: "text-base font-medium leading-base text-datepicker-header-text", children: [
|
|
7192
7394
|
MONTH_NAMES[month],
|
|
7193
7395
|
" ",
|
|
7194
7396
|
year
|
|
7195
7397
|
] }),
|
|
7196
|
-
/* @__PURE__ */ (0,
|
|
7197
|
-
/* @__PURE__ */ (0,
|
|
7398
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "flex items-center gap-xs", children: [
|
|
7399
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
7198
7400
|
"button",
|
|
7199
7401
|
{
|
|
7200
7402
|
type: "button",
|
|
7201
7403
|
onClick: goToPrevMonth,
|
|
7202
7404
|
className: "flex items-center justify-center p-xs rounded-base hover:bg-datepicker-day-bg-hover transition-colors cursor-pointer",
|
|
7203
7405
|
"aria-label": "Previous month",
|
|
7204
|
-
children: /* @__PURE__ */ (0,
|
|
7406
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_icons33.Icon, { icon: import_icons33.faChevronLeftOutline, size: "xs", className: "text-datepicker-header-nav" })
|
|
7205
7407
|
}
|
|
7206
7408
|
),
|
|
7207
|
-
/* @__PURE__ */ (0,
|
|
7409
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
7208
7410
|
"button",
|
|
7209
7411
|
{
|
|
7210
7412
|
type: "button",
|
|
7211
7413
|
onClick: goToNextMonth,
|
|
7212
7414
|
className: "flex items-center justify-center p-xs rounded-base hover:bg-datepicker-day-bg-hover transition-colors cursor-pointer",
|
|
7213
7415
|
"aria-label": "Next month",
|
|
7214
|
-
children: /* @__PURE__ */ (0,
|
|
7416
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_icons33.Icon, { icon: import_icons33.faChevronRightOutline, size: "xs", className: "text-datepicker-header-nav" })
|
|
7215
7417
|
}
|
|
7216
7418
|
)
|
|
7217
7419
|
] })
|
|
7218
7420
|
] }),
|
|
7219
|
-
/* @__PURE__ */ (0,
|
|
7220
|
-
/* @__PURE__ */ (0,
|
|
7421
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "flex flex-col", children: [
|
|
7422
|
+
/* @__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
7423
|
"span",
|
|
7222
7424
|
{
|
|
7223
7425
|
className: "w-9 text-center text-xs font-regular leading-xs text-datepicker-header-weekday",
|
|
@@ -7225,7 +7427,7 @@ var DatePickerCalendar = React47.forwardRef(({ className, header, ...props }, re
|
|
|
7225
7427
|
},
|
|
7226
7428
|
day
|
|
7227
7429
|
)) }),
|
|
7228
|
-
/* @__PURE__ */ (0,
|
|
7430
|
+
/* @__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
7431
|
DatePickerDay,
|
|
7230
7432
|
{
|
|
7231
7433
|
date: day.date,
|
|
@@ -7240,10 +7442,10 @@ var DatePickerCalendar = React47.forwardRef(({ className, header, ...props }, re
|
|
|
7240
7442
|
);
|
|
7241
7443
|
});
|
|
7242
7444
|
DatePickerCalendar.displayName = "DatePickerCalendar";
|
|
7243
|
-
var DatePickerSuggestions =
|
|
7445
|
+
var DatePickerSuggestions = React49.forwardRef(
|
|
7244
7446
|
({ className, suggestions, formatDate = defaultFormatDate, ...props }, ref) => {
|
|
7245
7447
|
const { onSelect, mode } = useDatePickerContext();
|
|
7246
|
-
const onValueChange =
|
|
7448
|
+
const onValueChange = React49.useContext(DatePickerContext) ? void 0 : void 0;
|
|
7247
7449
|
const ctx = useDatePickerContext();
|
|
7248
7450
|
const handleClick = (suggestion) => {
|
|
7249
7451
|
const val = suggestion.getValue();
|
|
@@ -7265,7 +7467,7 @@ var DatePickerSuggestions = React47.forwardRef(
|
|
|
7265
7467
|
const to = val.to ? formatDate(val.to) : "";
|
|
7266
7468
|
return to ? `${from} - ${to}` : from;
|
|
7267
7469
|
};
|
|
7268
|
-
return /* @__PURE__ */ (0,
|
|
7470
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
7269
7471
|
"div",
|
|
7270
7472
|
{
|
|
7271
7473
|
ref,
|
|
@@ -7275,16 +7477,16 @@ var DatePickerSuggestions = React47.forwardRef(
|
|
|
7275
7477
|
),
|
|
7276
7478
|
...props,
|
|
7277
7479
|
children: [
|
|
7278
|
-
/* @__PURE__ */ (0,
|
|
7279
|
-
/* @__PURE__ */ (0,
|
|
7480
|
+
/* @__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" }) }) }),
|
|
7481
|
+
/* @__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
7482
|
"button",
|
|
7281
7483
|
{
|
|
7282
7484
|
type: "button",
|
|
7283
7485
|
onClick: () => handleClick(suggestion),
|
|
7284
7486
|
className: "flex items-center gap-sm p-base rounded-base hover:bg-datepicker-suggestion-hover transition-colors cursor-pointer text-left",
|
|
7285
7487
|
children: [
|
|
7286
|
-
/* @__PURE__ */ (0,
|
|
7287
|
-
/* @__PURE__ */ (0,
|
|
7488
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "text-sm font-regular leading-sm text-datepicker-suggestion-text truncate shrink-0", children: suggestion.label }),
|
|
7489
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "text-xs font-regular leading-xs text-datepicker-suggestion-date truncate", children: formatSuggestionDate(suggestion) })
|
|
7288
7490
|
]
|
|
7289
7491
|
},
|
|
7290
7492
|
i
|
|
@@ -7295,8 +7497,8 @@ var DatePickerSuggestions = React47.forwardRef(
|
|
|
7295
7497
|
}
|
|
7296
7498
|
);
|
|
7297
7499
|
DatePickerSuggestions.displayName = "DatePickerSuggestions";
|
|
7298
|
-
var DatePickerFooter =
|
|
7299
|
-
({ className, children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
7500
|
+
var DatePickerFooter = React49.forwardRef(
|
|
7501
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
7300
7502
|
"div",
|
|
7301
7503
|
{
|
|
7302
7504
|
ref,
|
|
@@ -7312,8 +7514,8 @@ var DatePickerFooter = React47.forwardRef(
|
|
|
7312
7514
|
)
|
|
7313
7515
|
);
|
|
7314
7516
|
DatePickerFooter.displayName = "DatePickerFooter";
|
|
7315
|
-
var DatePickerPanel =
|
|
7316
|
-
({ className, children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
7517
|
+
var DatePickerPanel = React49.forwardRef(
|
|
7518
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
7317
7519
|
"div",
|
|
7318
7520
|
{
|
|
7319
7521
|
ref,
|
|
@@ -7324,10 +7526,10 @@ var DatePickerPanel = React47.forwardRef(
|
|
|
7324
7526
|
)
|
|
7325
7527
|
);
|
|
7326
7528
|
DatePickerPanel.displayName = "DatePickerPanel";
|
|
7327
|
-
var DatePickerRoot =
|
|
7328
|
-
var DatePickerTrigger =
|
|
7329
|
-
var DatePickerPopover =
|
|
7330
|
-
|
|
7529
|
+
var DatePickerRoot = PopoverPrimitive12.Root;
|
|
7530
|
+
var DatePickerTrigger = PopoverPrimitive12.Trigger;
|
|
7531
|
+
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)(
|
|
7532
|
+
PopoverPrimitive12.Content,
|
|
7331
7533
|
{
|
|
7332
7534
|
ref,
|
|
7333
7535
|
sideOffset,
|
|
@@ -7487,6 +7689,7 @@ function getDefaultSuggestions(referenceDate) {
|
|
|
7487
7689
|
SidebarSection,
|
|
7488
7690
|
SortButton,
|
|
7489
7691
|
StatusCell,
|
|
7692
|
+
SummaryChip,
|
|
7490
7693
|
Switch,
|
|
7491
7694
|
TabContent,
|
|
7492
7695
|
TabList,
|
|
@@ -7541,6 +7744,7 @@ function getDefaultSuggestions(referenceDate) {
|
|
|
7541
7744
|
toastVariants,
|
|
7542
7745
|
tooltipContentVariants,
|
|
7543
7746
|
typographyVariants,
|
|
7747
|
+
useFilterBarMode,
|
|
7544
7748
|
useSidebarContext
|
|
7545
7749
|
});
|
|
7546
7750
|
//# sourceMappingURL=index.js.map
|