Upgrade react-zen and migrate UI components to its updated APIs

This commit is contained in:
Mike Cao committed 2026-07-30 22:35:20 -07:00
1 parent f054830292
commit 6ac2b9377c
83 files changed
+1337 -506

No files matched your search

@@ -180,14 +180,11 @@ export function PropertyFilterRecord({
aria-label={filter.propertyName}
items={filteredValues}
inputValue={filter.value}
style={{ width: '100%' }}
onInputChange={v => {
className="w-full"
onInputValueChange={(v: string) => {
setSearch(v);
onChange({ ...filter, value: v });
}}
formValue="text"
allowsEmptyCollection
allowsCustomValue
renderEmptyState={() =>
isLoading ? (
<Loading placement="center" icon="dots" />
@@ -267,7 +264,7 @@ function DateValuePicker({
>
<DateDisplay startDate={selectedDate} endDate={selectedDate} />
</Button>
<Popover placement="bottom start" shouldFlip isNonModal>
<Popover side="bottom" align="start" isNonModal>
<Dialog>
<Column gap>
<Calendar
@@ -39,14 +39,13 @@ export function PropertyFilters({
}) {
const { t, messages } = useMessages();
const { isMobile } = useMobile();
const { data: queriedFields, isLoading, isFetching } = usePropertyFieldsQuery(
source,
websiteId,
eventName,
{
enabled: !providedFields,
},
);
const {
data: queriedFields,
isLoading,
isFetching,
} = usePropertyFieldsQuery(source, websiteId, eventName, {
enabled: !providedFields,
});
const fields = providedFields ?? queriedFields ?? [];
const handleAdd = (propertyName: string) => {
@@ -97,13 +96,14 @@ export function PropertyFilters({
<Plus />
</Icon>
</Button>
<Popover placement="bottom start" shouldFlip>
<Menu
onAction={key => handleAdd(key.toString())}
style={{ maxHeight: 'calc(100vh - 2rem)', overflowY: 'auto' }}
>
<Popover side="bottom" align="start">
<Menu style={{ maxHeight: 'calc(100vh - 2rem)', overflowY: 'auto' }}>
{(fields as any[]).map(field => (
<MenuItem key={`${field.propertyName}:${field.dataType}`} id={field.propertyName}>
<MenuItem
key={`${field.propertyName}:${field.dataType}`}
id={field.propertyName}
onAction={key => handleAdd(key.toString())}
>
{field.propertyName}
</MenuItem>
))}
@@ -118,9 +118,13 @@ export function PropertyFilters({
marginRight="6"
alignSelf="stretch"
>
<List onAction={key => handleAdd(key.toString())}>
<List>
{(fields as any[]).map(field => (
<ListItem key={`${field.propertyName}:${field.dataType}`} id={field.propertyName}>
<ListItem
key={`${field.propertyName}:${field.dataType}`}
id={field.propertyName}
onClick={() => handleAdd(field.propertyName)}
>
{field.propertyName}
</ListItem>
))}