@databiosphere/findable-ui 40.0.0 → 41.0.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/.release-please-manifest.json +1 -1
- package/CHANGELOG.md +22 -0
- package/lib/common/entities.d.ts +8 -0
- package/lib/common/entities.js +4 -1
- package/lib/components/DataDictionary/components/Description/description.js +2 -2
- package/lib/components/DataDictionary/components/Description/description.styles.d.ts +1 -1
- package/lib/components/DataDictionary/components/Description/description.styles.js +2 -2
- package/lib/components/DataDictionary/components/Entity/entity.styles.js +5 -0
- package/lib/components/DataDictionary/components/Filters/components/ColumnFilterTags/columnFilterTags.js +4 -1
- package/lib/components/DataDictionary/components/Filters/components/ColumnFilters/columnFilters.js +6 -1
- package/lib/components/DataDictionary/components/Filters/filters.styles.js +0 -5
- package/lib/components/DataDictionary/components/Filters/stories/constants.d.ts +1 -0
- package/lib/components/DataDictionary/components/Filters/stories/constants.js +1 -0
- package/lib/components/DataDictionary/components/Filters/stories/filters.stories.js +9 -3
- package/lib/components/DataDictionary/components/Filters/stories/utils.d.ts +7 -0
- package/lib/components/DataDictionary/components/Filters/stories/utils.js +12 -0
- package/lib/components/DataDictionary/components/Layout/components/EntitiesLayout/entitiesLayout.styles.js +2 -2
- package/lib/components/DataDictionary/components/Layout/components/FiltersLayout/filtersLayout.styles.js +6 -2
- package/lib/components/DataDictionary/components/Layout/components/OutlineLayout/outlineLayout.styles.js +2 -2
- package/lib/components/DataDictionary/components/Layout/components/TitleLayout/titleLayout.styles.js +6 -2
- package/lib/components/DataDictionary/components/Table/table.js +7 -4
- package/lib/components/DataDictionary/components/Table/table.styles.d.ts +1 -1
- package/lib/components/DataDictionary/components/Table/table.styles.js +2 -2
- package/lib/components/DataDictionary/components/Title/title.styles.js +2 -2
- package/lib/components/DataDictionary/dataDictionary.styles.d.ts +0 -1
- package/lib/components/DataDictionary/dataDictionary.styles.js +8 -8
- package/lib/components/Detail/components/Table/components/TableRows/components/CollapsableRows/collapsableRows.js +2 -2
- package/lib/components/Filter/components/Filter/filter.d.ts +3 -2
- package/lib/components/Filter/components/Filter/filter.js +13 -11
- package/lib/components/Filter/components/Filter/filter.styles.d.ts +3 -5
- package/lib/components/Filter/components/Filter/filter.styles.js +16 -19
- package/lib/components/Filter/components/Filter/stories/args.js +3 -2
- package/lib/components/Filter/components/FilterLabel/filterLabel.d.ts +3 -1
- package/lib/components/Filter/components/FilterLabel/filterLabel.js +3 -3
- package/lib/components/Filter/components/FilterLabel/filterLabel.stories.d.ts +3 -1
- package/lib/components/Filter/components/FilterLabel/filterLabel.stories.js +2 -0
- package/lib/components/Filter/components/FilterLabel/filterLabel.styles.d.ts +3 -6
- package/lib/components/Filter/components/FilterLabel/filterLabel.styles.js +16 -13
- package/lib/components/Filter/components/FilterList/filterList.styles.d.ts +1 -1
- package/lib/components/Filter/components/FilterList/filterList.styles.js +1 -1
- package/lib/components/Filter/components/FilterMenu/filterMenu.d.ts +3 -2
- package/lib/components/Filter/components/FilterMenu/filterMenu.js +11 -11
- package/lib/components/Filter/components/FilterMenu/filterMenu.stories.d.ts +3 -2
- package/lib/components/Filter/components/FilterMenu/filterMenu.stories.js +2 -1
- package/lib/components/Filter/components/FilterMenu/filterMenu.styles.d.ts +2 -6
- package/lib/components/Filter/components/FilterMenu/filterMenu.styles.js +7 -17
- package/lib/components/Filter/components/FilterMenuSearch/filterMenuSearch.d.ts +3 -1
- package/lib/components/Filter/components/FilterMenuSearch/filterMenuSearch.js +3 -3
- package/lib/components/Filter/components/FilterMenuSearch/filterMenuSearch.styles.d.ts +3 -2
- package/lib/components/Filter/components/FilterMenuSearch/filterMenuSearch.styles.js +9 -5
- package/lib/components/Filter/components/FilterRange/filterRange.d.ts +1 -1
- package/lib/components/Filter/components/FilterRange/filterRange.js +7 -8
- package/lib/components/Filter/components/FilterRange/filterRange.styles.d.ts +2 -1
- package/lib/components/Filter/components/FilterRange/filterRange.styles.js +20 -16
- package/lib/components/Filter/components/FilterRange/stories/args.js +2 -1
- package/lib/components/Filter/components/FilterRange/types.d.ts +2 -1
- package/lib/components/Filter/components/Filters/filters.d.ts +5 -2
- package/lib/components/Filter/components/Filters/filters.js +7 -8
- package/lib/components/Filter/components/Filters/filters.styles.d.ts +6 -5
- package/lib/components/Filter/components/Filters/filters.styles.js +11 -11
- package/lib/components/Filter/components/SearchAllFilters/components/VariableSizeList/VariableSizeList.js +2 -2
- package/lib/components/Filter/components/VariableSizeList/VariableSizeList.d.ts +3 -2
- package/lib/components/Filter/components/VariableSizeList/VariableSizeList.js +9 -8
- package/lib/components/Filter/components/adapters/tanstack/ColumnFiltersAdapter/columnFiltersAdapter.d.ts +3 -0
- package/lib/components/Filter/components/adapters/tanstack/ColumnFiltersAdapter/columnFiltersAdapter.js +24 -0
- package/lib/components/Filter/components/adapters/tanstack/ColumnFiltersAdapter/types.d.ts +6 -0
- package/lib/components/Filter/components/adapters/tanstack/ColumnFiltersAdapter/types.js +1 -0
- package/lib/components/Filter/components/adapters/tanstack/ColumnFiltersAdapter/utils.d.ts +14 -0
- package/lib/components/Filter/components/adapters/tanstack/ColumnFiltersAdapter/utils.js +67 -0
- package/lib/components/Filter/components/controls/Controls/controls.d.ts +6 -0
- package/lib/components/Filter/components/controls/Controls/controls.js +14 -0
- package/lib/components/Filter/components/controls/Controls/controls.styles.d.ts +7 -0
- package/lib/components/Filter/components/controls/Controls/controls.styles.js +9 -0
- package/lib/components/Filter/components/surfaces/drawer/Drawer/constants.d.ts +2 -0
- package/lib/components/Filter/components/surfaces/drawer/Drawer/constants.js +5 -0
- package/lib/components/Filter/components/surfaces/drawer/Drawer/drawer.d.ts +2 -0
- package/lib/components/Filter/components/surfaces/drawer/Drawer/drawer.js +17 -0
- package/lib/components/Filter/components/surfaces/drawer/Drawer/drawer.styles.d.ts +3 -0
- package/lib/components/Filter/components/surfaces/drawer/Drawer/drawer.styles.js +19 -0
- package/lib/components/Filter/components/surfaces/drawer/Drawer/types.d.ts +7 -0
- package/lib/components/Filter/components/surfaces/drawer/Drawer/types.js +1 -0
- package/lib/components/Filter/components/surfaces/drawer/components/Button/button.d.ts +7 -0
- package/lib/components/Filter/components/surfaces/drawer/components/Button/button.js +16 -0
- package/lib/components/Filter/components/surfaces/drawer/components/ButtonBase/buttonBase.d.ts +6 -0
- package/lib/components/Filter/components/surfaces/drawer/components/ButtonBase/buttonBase.js +14 -0
- package/lib/components/Filter/components/surfaces/drawer/components/ButtonBase/buttonBase.styles.d.ts +5 -0
- package/lib/components/Filter/components/surfaces/drawer/components/ButtonBase/buttonBase.styles.js +12 -0
- package/lib/components/Filter/components/surfaces/drawer/components/IconButton/constants.d.ts +3 -0
- package/lib/components/Filter/components/surfaces/drawer/components/IconButton/constants.js +9 -0
- package/lib/components/Filter/components/surfaces/drawer/components/IconButton/iconButton.d.ts +6 -0
- package/lib/components/Filter/components/surfaces/drawer/components/IconButton/iconButton.js +13 -0
- package/lib/components/Filter/components/surfaces/drawer/components/IconButton/iconButton.styles.d.ts +5 -0
- package/lib/components/Filter/components/surfaces/drawer/components/IconButton/iconButton.styles.js +9 -0
- package/lib/components/Filter/components/surfaces/types.d.ts +11 -0
- package/lib/components/Filter/components/surfaces/types.js +5 -0
- package/lib/components/Filter/components/views/select/SelectListItem/selectListItem.d.ts +3 -0
- package/lib/components/Filter/components/views/select/SelectListItem/selectListItem.js +9 -0
- package/lib/components/Filter/components/views/select/SelectListItem/types.d.ts +12 -0
- package/lib/components/Filter/components/views/select/SelectListItem/types.js +1 -0
- package/lib/components/Filter/components/views/select/components/Checkbox/checkbox.d.ts +3 -0
- package/lib/components/Filter/components/views/select/components/Checkbox/checkbox.js +7 -0
- package/lib/components/Filter/components/views/select/components/ListItemButton/listItemButton.d.ts +7 -0
- package/lib/components/Filter/components/views/select/components/ListItemButton/listItemButton.js +5 -0
- package/lib/components/Filter/components/views/select/components/ListItemButton/listItemButton.styles.d.ts +5 -0
- package/lib/components/Filter/components/views/select/components/ListItemButton/listItemButton.styles.js +11 -0
- package/lib/components/Filter/components/views/select/components/ListItemText/components/Count/count.d.ts +3 -0
- package/lib/components/Filter/components/views/select/components/ListItemText/components/Count/count.js +6 -0
- package/lib/components/Filter/components/views/select/components/ListItemText/components/Term/term.d.ts +3 -0
- package/lib/components/Filter/components/views/select/components/ListItemText/components/Term/term.js +6 -0
- package/lib/components/Filter/components/views/select/components/ListItemText/listItemText.d.ts +3 -0
- package/lib/components/Filter/components/views/select/components/ListItemText/listItemText.js +26 -0
- package/lib/components/Filter/components/views/select/components/ListItemText/listItemText.styles.d.ts +3 -0
- package/lib/components/Filter/components/views/select/components/ListItemText/listItemText.styles.js +12 -0
- package/lib/components/Table/components/TableFeatures/ColumnFilter/columnFilter.js +23 -8
- package/lib/components/Table/components/TableFeatures/ColumnFilter/constants.js +5 -0
- package/lib/components/common/Button/constants.js +4 -0
- package/lib/components/common/Drawer/provider/provider.d.ts +2 -4
- package/lib/components/common/Drawer/provider/provider.js +4 -2
- package/lib/components/common/Drawer/provider/types.d.ts +5 -1
- package/lib/hooks/useCategoryFilter.d.ts +2 -2
- package/lib/styles/common/mixins/breakpoints.d.ts +2 -0
- package/lib/styles/common/mixins/breakpoints.js +2 -0
- package/lib/styles/common/mui/typography.js +2 -0
- package/lib/utils/typeGuards.d.ts +6 -0
- package/lib/utils/typeGuards.js +8 -0
- package/lib/views/ExploreView/exploreView.js +4 -1
- package/package.json +1 -1
- package/src/common/entities.ts +10 -0
- package/src/components/DataDictionary/components/Description/description.styles.ts +2 -2
- package/src/components/DataDictionary/components/Description/description.tsx +3 -6
- package/src/components/DataDictionary/components/Entity/entity.styles.ts +5 -0
- package/src/components/DataDictionary/components/Filters/components/ColumnFilterTags/columnFilterTags.tsx +4 -1
- package/src/components/DataDictionary/components/Filters/components/ColumnFilters/columnFilters.tsx +12 -1
- package/src/components/DataDictionary/components/Filters/filters.styles.ts +0 -5
- package/src/components/DataDictionary/components/Filters/stories/constants.ts +2 -0
- package/src/components/DataDictionary/components/Filters/stories/filters.stories.tsx +11 -4
- package/src/components/DataDictionary/components/Filters/stories/utils.ts +15 -0
- package/src/components/DataDictionary/components/Layout/components/EntitiesLayout/entitiesLayout.styles.ts +2 -2
- package/src/components/DataDictionary/components/Layout/components/FiltersLayout/filtersLayout.styles.ts +9 -2
- package/src/components/DataDictionary/components/Layout/components/OutlineLayout/outlineLayout.styles.ts +2 -2
- package/src/components/DataDictionary/components/Layout/components/TitleLayout/titleLayout.styles.ts +9 -2
- package/src/components/DataDictionary/components/Table/table.styles.ts +2 -2
- package/src/components/DataDictionary/components/Table/table.tsx +8 -4
- package/src/components/DataDictionary/components/Title/title.styles.ts +2 -2
- package/src/components/DataDictionary/dataDictionary.styles.ts +11 -9
- package/src/components/Detail/components/Table/components/TableRows/components/CollapsableRows/collapsableRows.tsx +1 -1
- package/src/components/Filter/components/Filter/filter.styles.ts +18 -20
- package/src/components/Filter/components/Filter/filter.tsx +17 -19
- package/src/components/Filter/components/Filter/stories/args.ts +3 -2
- package/src/components/Filter/components/FilterLabel/filterLabel.stories.tsx +2 -0
- package/src/components/Filter/components/FilterLabel/filterLabel.styles.ts +20 -19
- package/src/components/Filter/components/FilterLabel/filterLabel.tsx +7 -3
- package/src/components/Filter/components/FilterList/filterList.styles.ts +1 -1
- package/src/components/Filter/components/FilterMenu/filterMenu.stories.tsx +2 -1
- package/src/components/Filter/components/FilterMenu/filterMenu.styles.ts +9 -18
- package/src/components/Filter/components/FilterMenu/filterMenu.tsx +15 -19
- package/src/components/Filter/components/FilterMenuSearch/filterMenuSearch.styles.ts +11 -5
- package/src/components/Filter/components/FilterMenuSearch/filterMenuSearch.tsx +5 -1
- package/src/components/Filter/components/FilterRange/filterRange.styles.ts +25 -19
- package/src/components/Filter/components/FilterRange/filterRange.tsx +8 -12
- package/src/components/Filter/components/FilterRange/stories/args.ts +2 -1
- package/src/components/Filter/components/FilterRange/types.ts +2 -1
- package/src/components/Filter/components/Filters/filters.styles.ts +16 -16
- package/src/components/Filter/components/Filters/filters.tsx +19 -13
- package/src/components/Filter/components/SearchAllFilters/components/VariableSizeList/VariableSizeList.tsx +2 -2
- package/src/components/Filter/components/VariableSizeList/VariableSizeList.tsx +10 -9
- package/src/components/Filter/components/adapters/tanstack/ColumnFiltersAdapter/columnFiltersAdapter.tsx +44 -0
- package/src/components/Filter/components/adapters/tanstack/ColumnFiltersAdapter/types.ts +7 -0
- package/src/components/Filter/components/adapters/tanstack/ColumnFiltersAdapter/utils.ts +90 -0
- package/src/components/Filter/components/controls/Controls/controls.styles.ts +10 -0
- package/src/components/Filter/components/controls/Controls/controls.tsx +31 -0
- package/src/components/Filter/components/surfaces/drawer/Drawer/constants.ts +7 -0
- package/src/components/Filter/components/surfaces/drawer/Drawer/drawer.styles.ts +20 -0
- package/src/components/Filter/components/surfaces/drawer/Drawer/drawer.tsx +46 -0
- package/src/components/Filter/components/surfaces/drawer/Drawer/types.ts +11 -0
- package/src/components/Filter/components/surfaces/drawer/components/Button/button.tsx +40 -0
- package/src/components/Filter/components/surfaces/drawer/components/ButtonBase/buttonBase.styles.ts +13 -0
- package/src/components/Filter/components/surfaces/drawer/components/ButtonBase/buttonBase.tsx +25 -0
- package/src/components/Filter/components/surfaces/drawer/components/IconButton/constants.ts +12 -0
- package/src/components/Filter/components/surfaces/drawer/components/IconButton/iconButton.styles.ts +10 -0
- package/src/components/Filter/components/surfaces/drawer/components/IconButton/iconButton.tsx +28 -0
- package/src/components/Filter/components/surfaces/types.ts +13 -0
- package/src/components/Filter/components/views/select/SelectListItem/selectListItem.tsx +19 -0
- package/src/components/Filter/components/views/select/SelectListItem/types.ts +14 -0
- package/src/components/Filter/components/views/select/components/Checkbox/checkbox.tsx +19 -0
- package/src/components/Filter/components/views/select/components/ListItemButton/listItemButton.styles.ts +12 -0
- package/src/components/Filter/components/views/select/components/ListItemButton/listItemButton.tsx +25 -0
- package/src/components/Filter/components/views/select/components/ListItemText/components/Count/count.tsx +20 -0
- package/src/components/Filter/components/views/select/components/ListItemText/components/Term/term.tsx +19 -0
- package/src/components/Filter/components/views/select/components/ListItemText/listItemText.styles.ts +13 -0
- package/src/components/Filter/components/views/select/components/ListItemText/listItemText.tsx +48 -0
- package/src/components/Table/components/TableFeatures/ColumnFilter/columnFilter.tsx +34 -35
- package/src/components/Table/components/TableFeatures/ColumnFilter/constants.ts +5 -0
- package/src/components/common/Button/constants.ts +4 -0
- package/src/components/common/Drawer/provider/provider.tsx +7 -8
- package/src/components/common/Drawer/provider/types.ts +6 -4
- package/src/hooks/useCategoryFilter.ts +2 -1
- package/src/styles/common/mixins/breakpoints.ts +6 -0
- package/src/styles/common/mui/typography.ts +2 -0
- package/src/utils/typeGuards.ts +8 -0
- package/src/views/ExploreView/exploreView.tsx +4 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { OnFilterFn } from "../../../../hooks/useCategoryFilter";
|
|
2
|
+
import { CategoryFilter } from "../Filters/filters";
|
|
3
|
+
|
|
4
|
+
export interface SurfaceProps {
|
|
5
|
+
categoryFilters: CategoryFilter[];
|
|
6
|
+
count?: number;
|
|
7
|
+
onFilter: OnFilterFn;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export enum SURFACE_TYPE {
|
|
11
|
+
DRAWER = "DRAWER",
|
|
12
|
+
MENU = "MENU",
|
|
13
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React, { forwardRef } from "react";
|
|
2
|
+
import { Checkbox } from "../components/Checkbox/checkbox";
|
|
3
|
+
import { ListItemButton } from "../components/ListItemButton/listItemButton";
|
|
4
|
+
import { ListItemText } from "../components/ListItemText/listItemText";
|
|
5
|
+
import { SelectListItemProps } from "./types";
|
|
6
|
+
|
|
7
|
+
export const SelectListItem = forwardRef<HTMLDivElement, SelectListItemProps>(
|
|
8
|
+
function SelectListItem(
|
|
9
|
+
{ slotProps }: SelectListItemProps,
|
|
10
|
+
ref
|
|
11
|
+
): JSX.Element {
|
|
12
|
+
return (
|
|
13
|
+
<ListItemButton ref={ref} {...slotProps.listItemButton}>
|
|
14
|
+
<Checkbox {...slotProps.checkbox} />
|
|
15
|
+
<ListItemText {...slotProps.listItemText} />
|
|
16
|
+
</ListItemButton>
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
import { Checkbox } from "../components/Checkbox/checkbox";
|
|
3
|
+
import { ListItemButton } from "../components/ListItemButton/listItemButton";
|
|
4
|
+
import { ListItemText } from "../components/ListItemText/listItemText";
|
|
5
|
+
|
|
6
|
+
export interface SelectListItemProps {
|
|
7
|
+
slotProps: SlotProps;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface SlotProps {
|
|
11
|
+
checkbox: ComponentProps<typeof Checkbox>;
|
|
12
|
+
listItemButton: ComponentProps<typeof ListItemButton>;
|
|
13
|
+
listItemText: ComponentProps<typeof ListItemText>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { CheckboxProps, Checkbox as MCheckbox } from "@mui/material";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { CheckedIcon } from "../../../../../../common/CustomIcon/components/CheckedIcon/checkedIcon";
|
|
4
|
+
import { UncheckedIcon } from "../../../../../../common/CustomIcon/components/UncheckedIcon/uncheckedIcon";
|
|
5
|
+
import { BaseComponentProps } from "../../../../../../types";
|
|
6
|
+
|
|
7
|
+
export const Checkbox = ({
|
|
8
|
+
className,
|
|
9
|
+
...props /* MuiCheckboxProps */
|
|
10
|
+
}: BaseComponentProps & CheckboxProps): JSX.Element => {
|
|
11
|
+
return (
|
|
12
|
+
<MCheckbox
|
|
13
|
+
className={className}
|
|
14
|
+
checkedIcon={<CheckedIcon />}
|
|
15
|
+
icon={<UncheckedIcon />}
|
|
16
|
+
{...props}
|
|
17
|
+
/>
|
|
18
|
+
);
|
|
19
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import styled from "@emotion/styled";
|
|
2
|
+
import { ListItemButton } from "@mui/material";
|
|
3
|
+
import { PALETTE } from "../../../../../../../styles/common/constants/palette";
|
|
4
|
+
|
|
5
|
+
export const StyledListItemButton = styled(ListItemButton)`
|
|
6
|
+
gap: 8px;
|
|
7
|
+
|
|
8
|
+
&.Mui-disabled {
|
|
9
|
+
color: ${PALETTE.SMOKE_MAIN};
|
|
10
|
+
opacity: 1;
|
|
11
|
+
}
|
|
12
|
+
`;
|
package/src/components/Filter/components/views/select/components/ListItemButton/listItemButton.tsx
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ListItemButtonProps } from "@mui/material";
|
|
2
|
+
import React, { forwardRef } from "react";
|
|
3
|
+
import { BaseComponentProps, TestIdProps } from "../../../../../../types";
|
|
4
|
+
import { StyledListItemButton } from "./listItemButton.styles";
|
|
5
|
+
|
|
6
|
+
export const ListItemButton = forwardRef<
|
|
7
|
+
HTMLDivElement,
|
|
8
|
+
BaseComponentProps & ListItemButtonProps & TestIdProps
|
|
9
|
+
>(function ListItemButton(
|
|
10
|
+
{
|
|
11
|
+
className,
|
|
12
|
+
testId,
|
|
13
|
+
...props /* MuiListItemButtonProps */
|
|
14
|
+
}: BaseComponentProps & ListItemButtonProps & TestIdProps,
|
|
15
|
+
ref
|
|
16
|
+
): JSX.Element {
|
|
17
|
+
return (
|
|
18
|
+
<StyledListItemButton
|
|
19
|
+
className={className}
|
|
20
|
+
data-testid={testId}
|
|
21
|
+
ref={ref}
|
|
22
|
+
{...props}
|
|
23
|
+
/>
|
|
24
|
+
);
|
|
25
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Typography, TypographyProps } from "@mui/material";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { TYPOGRAPHY_PROPS } from "../../../../../../../../../styles/common/mui/typography";
|
|
4
|
+
import { BaseComponentProps, TestIdProps } from "../../../../../../../../types";
|
|
5
|
+
|
|
6
|
+
export const Count = ({
|
|
7
|
+
className,
|
|
8
|
+
testId,
|
|
9
|
+
...props /* MuiTypographyProps */
|
|
10
|
+
}: BaseComponentProps & TestIdProps & TypographyProps): JSX.Element => {
|
|
11
|
+
return (
|
|
12
|
+
<Typography
|
|
13
|
+
className={className}
|
|
14
|
+
color={TYPOGRAPHY_PROPS.COLOR.INK_LIGHT}
|
|
15
|
+
data-testid={testId}
|
|
16
|
+
variant={TYPOGRAPHY_PROPS.VARIANT.TEXT_BODY_SMALL_400}
|
|
17
|
+
{...props}
|
|
18
|
+
/>
|
|
19
|
+
);
|
|
20
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Typography, TypographyProps } from "@mui/material";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { TYPOGRAPHY_PROPS } from "../../../../../../../../../styles/common/mui/typography";
|
|
4
|
+
import { BaseComponentProps, TestIdProps } from "../../../../../../../../types";
|
|
5
|
+
|
|
6
|
+
export const Term = ({
|
|
7
|
+
className,
|
|
8
|
+
testId,
|
|
9
|
+
...props /* MuiTypographyProps */
|
|
10
|
+
}: BaseComponentProps & TestIdProps & TypographyProps): JSX.Element => {
|
|
11
|
+
return (
|
|
12
|
+
<Typography
|
|
13
|
+
className={className}
|
|
14
|
+
data-testid={testId}
|
|
15
|
+
variant={TYPOGRAPHY_PROPS.VARIANT.TEXT_BODY_400}
|
|
16
|
+
{...props}
|
|
17
|
+
/>
|
|
18
|
+
);
|
|
19
|
+
};
|
package/src/components/Filter/components/views/select/components/ListItemText/listItemText.styles.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import styled from "@emotion/styled";
|
|
2
|
+
import { ListItemText } from "@mui/material";
|
|
3
|
+
|
|
4
|
+
export const StyledListItemText = styled(ListItemText)`
|
|
5
|
+
align-items: center;
|
|
6
|
+
display: grid;
|
|
7
|
+
gap: 8px;
|
|
8
|
+
grid-template-columns: 1fr auto;
|
|
9
|
+
|
|
10
|
+
> span {
|
|
11
|
+
min-width: 0; /* required; flexbox child min-width property is "auto" by default making overflow-wrap ineffectual */
|
|
12
|
+
}
|
|
13
|
+
`;
|
package/src/components/Filter/components/views/select/components/ListItemText/listItemText.tsx
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { ListItemTextProps } from "@mui/material";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { isValueString } from "../../../../../../../utils/typeGuards";
|
|
4
|
+
import { BaseComponentProps } from "../../../../../../types";
|
|
5
|
+
import { Count } from "./components/Count/count";
|
|
6
|
+
import { Term } from "./components/Term/term";
|
|
7
|
+
import { StyledListItemText } from "./listItemText.styles";
|
|
8
|
+
|
|
9
|
+
export const ListItemText = ({
|
|
10
|
+
className,
|
|
11
|
+
primary,
|
|
12
|
+
secondary,
|
|
13
|
+
...props /* MuiListItemTextProps */
|
|
14
|
+
}: BaseComponentProps & ListItemTextProps): JSX.Element => {
|
|
15
|
+
return (
|
|
16
|
+
<StyledListItemText
|
|
17
|
+
className={className}
|
|
18
|
+
disableTypography
|
|
19
|
+
primary={renderPrimary(primary)}
|
|
20
|
+
secondary={renderSecondary(secondary)}
|
|
21
|
+
{...props}
|
|
22
|
+
/>
|
|
23
|
+
);
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Render the primary prop for the ListItemText component.
|
|
28
|
+
* Default fallback for "string" values is <Term> component.
|
|
29
|
+
* @param primary - Primary prop.
|
|
30
|
+
* @returns primary prop.
|
|
31
|
+
*/
|
|
32
|
+
function renderPrimary(
|
|
33
|
+
primary: ListItemTextProps["primary"]
|
|
34
|
+
): ListItemTextProps["primary"] {
|
|
35
|
+
return isValueString(primary) ? <Term>{primary}</Term> : primary;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Render the secondary prop for the ListItemText component.
|
|
40
|
+
* Default fallback for "string" values is <Count> component.
|
|
41
|
+
* @param secondary - Secondary prop.
|
|
42
|
+
* @returns secondary prop.
|
|
43
|
+
*/
|
|
44
|
+
function renderSecondary(
|
|
45
|
+
secondary: ListItemTextProps["secondary"]
|
|
46
|
+
): ListItemTextProps["secondary"] {
|
|
47
|
+
return isValueString(secondary) ? <Count>{secondary}</Count> : secondary;
|
|
48
|
+
}
|
|
@@ -1,19 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Checkbox,
|
|
3
|
-
Grid,
|
|
4
|
-
ListItemButton,
|
|
5
|
-
ListItemText,
|
|
6
|
-
Typography,
|
|
7
|
-
} from "@mui/material";
|
|
1
|
+
import { Grid, Typography } from "@mui/material";
|
|
8
2
|
import { RowData } from "@tanstack/react-table";
|
|
9
|
-
import React, { Fragment } from "react";
|
|
3
|
+
import React, { Fragment, useCallback } from "react";
|
|
10
4
|
import { SVG_ICON_PROPS } from "../../../../../styles/common/mui/svgIcon";
|
|
11
5
|
import { TYPOGRAPHY_PROPS } from "../../../../../styles/common/mui/typography";
|
|
12
|
-
import { CheckedIcon } from "../../../../common/CustomIcon/components/CheckedIcon/checkedIcon";
|
|
13
|
-
import { UncheckedIcon } from "../../../../common/CustomIcon/components/UncheckedIcon/uncheckedIcon";
|
|
14
6
|
import { DropDownIcon } from "../../../../common/Form/components/Select/components/DropDownIcon/dropDownIcon";
|
|
15
7
|
import { useMenu } from "../../../../common/Menu/hooks/useMenu";
|
|
16
8
|
import { FilterCountChip } from "../../../../Filter/components/FilterCountChip/filterCountChip";
|
|
9
|
+
import { ListItemButton } from "../../../../Filter/components/views/select/components/ListItemButton/listItemButton";
|
|
10
|
+
import { SelectListItem } from "../../../../Filter/components/views/select/SelectListItem/selectListItem";
|
|
17
11
|
import { getColumnHeader } from "../../../common/utils";
|
|
18
12
|
import { getSortedFacetedValues } from "../../../featureOptions/facetedColumn/utils";
|
|
19
13
|
import { StyledButton, StyledMenu } from "./columnFilter.styles";
|
|
@@ -33,13 +27,26 @@ export const ColumnFilter = <T extends RowData>({
|
|
|
33
27
|
...props /* MuiMenuProps */
|
|
34
28
|
}: ColumnFilterProps<T>): JSX.Element => {
|
|
35
29
|
const { anchorEl, onClose, onOpen, open } = useMenu();
|
|
30
|
+
|
|
31
|
+
// Grab the unique values for the column.
|
|
36
32
|
const facetedUniqueValues = column.getFacetedUniqueValues();
|
|
33
|
+
|
|
34
|
+
// Sort the values.
|
|
37
35
|
const sortedValues = getSortedFacetedValues(facetedUniqueValues);
|
|
36
|
+
|
|
37
|
+
// Get the filter values.
|
|
38
38
|
const filterValue = (column.getFilterValue() || []) as unknown[];
|
|
39
|
+
|
|
40
|
+
const onFilter = useCallback(
|
|
41
|
+
(value: unknown) => {
|
|
42
|
+
column.setFilterValue(updater(value));
|
|
43
|
+
},
|
|
44
|
+
[column]
|
|
45
|
+
);
|
|
46
|
+
|
|
39
47
|
return (
|
|
40
48
|
<Fragment>
|
|
41
49
|
<Button
|
|
42
|
-
key={column.id}
|
|
43
50
|
disabled={sortedValues.length === 0}
|
|
44
51
|
endIcon={<DropDownIcon color={SVG_ICON_PROPS.COLOR.INK_LIGHT} />}
|
|
45
52
|
onClick={onOpen}
|
|
@@ -58,31 +65,23 @@ export const ColumnFilter = <T extends RowData>({
|
|
|
58
65
|
onClose={onClose}
|
|
59
66
|
open={open}
|
|
60
67
|
>
|
|
61
|
-
{sortedValues.map(([value, occurrence]) =>
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
secondary={
|
|
76
|
-
<Typography
|
|
77
|
-
color={TYPOGRAPHY_PROPS.COLOR.INK_LIGHT}
|
|
78
|
-
variant={TYPOGRAPHY_PROPS.VARIANT.TEXT_BODY_SMALL_400}
|
|
79
|
-
>
|
|
80
|
-
{occurrence}
|
|
81
|
-
</Typography>
|
|
82
|
-
}
|
|
68
|
+
{sortedValues.map(([value, occurrence]) => {
|
|
69
|
+
const checked = filterValue.includes(value);
|
|
70
|
+
const onClick = (): void => onFilter(value);
|
|
71
|
+
const primary = String(value);
|
|
72
|
+
const secondary = String(occurrence);
|
|
73
|
+
const selected = checked;
|
|
74
|
+
return (
|
|
75
|
+
<SelectListItem
|
|
76
|
+
key={primary}
|
|
77
|
+
slotProps={{
|
|
78
|
+
checkbox: { checked },
|
|
79
|
+
listItemButton: { onClick, selected },
|
|
80
|
+
listItemText: { primary, secondary },
|
|
81
|
+
}}
|
|
83
82
|
/>
|
|
84
|
-
|
|
85
|
-
)
|
|
83
|
+
);
|
|
84
|
+
})}
|
|
86
85
|
<ListItemButton
|
|
87
86
|
disabled={!column.getIsFiltered()}
|
|
88
87
|
onClick={() => column.setFilterValue(undefined)}
|
|
@@ -12,8 +12,13 @@ export const MENU_PROPS: Omit<MenuProps, "anchorEl" | "onClose" | "open"> = {
|
|
|
12
12
|
horizontal: "right",
|
|
13
13
|
vertical: "bottom",
|
|
14
14
|
},
|
|
15
|
+
/* Prevents the browser from auto‑focusing the menu on open, which can trigger a scrollIntoView jump when the viewport has `scroll-padding-top` (e.g., on <html>). */
|
|
16
|
+
disableAutoFocus: true,
|
|
17
|
+
/* Skips restoring focus to the trigger on close to avoid a similar scroll adjustment with `scroll-padding-top`. */
|
|
18
|
+
disableRestoreFocus: true,
|
|
15
19
|
marginThreshold: 8,
|
|
16
20
|
slotProps: {
|
|
21
|
+
list: { component: "div" },
|
|
17
22
|
paper: { variant: "menu" },
|
|
18
23
|
},
|
|
19
24
|
transformOrigin: {
|
|
@@ -16,6 +16,10 @@ export const BUTTON_PROPS: Record<string, Partial<ButtonOwnProps>> = {
|
|
|
16
16
|
size: MUI_BUTTON_PROPS.SIZE.MEDIUM,
|
|
17
17
|
variant: MUI_BUTTON_PROPS.VARIANT.CONTAINED,
|
|
18
18
|
},
|
|
19
|
+
PRIMARY_TEXT: {
|
|
20
|
+
color: MUI_BUTTON_PROPS.COLOR.PRIMARY,
|
|
21
|
+
variant: MUI_BUTTON_PROPS.VARIANT.TEXT,
|
|
22
|
+
},
|
|
19
23
|
SECONDARY_CONTAINED: {
|
|
20
24
|
color: MUI_BUTTON_PROPS.COLOR.SECONDARY,
|
|
21
25
|
variant: MUI_BUTTON_PROPS.VARIANT.CONTAINED,
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { useCallback, useState } from "react";
|
|
2
2
|
import { DrawerContext } from "./context";
|
|
3
|
+
import { DrawerProviderProps } from "./types";
|
|
3
4
|
|
|
4
|
-
export function DrawerProvider({
|
|
5
|
-
|
|
6
|
-
}: {
|
|
7
|
-
children: ReactNode | ReactNode[];
|
|
8
|
-
}): JSX.Element {
|
|
9
|
-
const [open, setOpen] = useState(false);
|
|
5
|
+
export function DrawerProvider({ children }: DrawerProviderProps): JSX.Element {
|
|
6
|
+
const [open, setOpen] = useState<boolean>(false);
|
|
10
7
|
|
|
11
8
|
const onClose = useCallback(() => setOpen(false), []);
|
|
12
9
|
|
|
@@ -14,7 +11,9 @@ export function DrawerProvider({
|
|
|
14
11
|
|
|
15
12
|
return (
|
|
16
13
|
<DrawerContext.Provider value={{ onClose, onOpen, open }}>
|
|
17
|
-
{children
|
|
14
|
+
{typeof children === "function"
|
|
15
|
+
? children({ onClose, onOpen, open })
|
|
16
|
+
: children}
|
|
18
17
|
</DrawerContext.Provider>
|
|
19
18
|
);
|
|
20
19
|
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { DrawerProps } from "@mui/material";
|
|
2
|
+
import { ReactNode } from "react";
|
|
2
3
|
|
|
3
|
-
export type DrawerContextProps = Omit<
|
|
4
|
-
DrawerProps,
|
|
5
|
-
"onClose" | "onOpen" | "open"
|
|
6
|
-
> & {
|
|
4
|
+
export type DrawerContextProps = Omit<DrawerProps, "onClose"> & {
|
|
7
5
|
onClose: () => void;
|
|
8
6
|
onOpen: () => void;
|
|
9
7
|
open: boolean;
|
|
10
8
|
};
|
|
9
|
+
|
|
10
|
+
export type DrawerProviderProps = {
|
|
11
|
+
children: ReactNode | ((props: DrawerContextProps) => ReactNode);
|
|
12
|
+
};
|
|
@@ -10,6 +10,7 @@ import { COLLATOR_CASE_INSENSITIVE } from "../common/constants";
|
|
|
10
10
|
import {
|
|
11
11
|
CategoryKey,
|
|
12
12
|
CategoryValueKey,
|
|
13
|
+
ClearAll,
|
|
13
14
|
Filters,
|
|
14
15
|
SelectCategory,
|
|
15
16
|
SelectCategoryValue,
|
|
@@ -27,7 +28,7 @@ export type FilterState = Filters;
|
|
|
27
28
|
* Function invoked when selected state of a category value is toggled or range is selected.
|
|
28
29
|
*/
|
|
29
30
|
export type OnFilterFn = (
|
|
30
|
-
categoryKey: CategoryKey,
|
|
31
|
+
categoryKey: CategoryKey | ClearAll,
|
|
31
32
|
selectedCategoryValue: CategoryValueKey,
|
|
32
33
|
selected: boolean,
|
|
33
34
|
categorySection?: string,
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { DESKTOP, DESKTOP_SM, TABLET } from "../../../theme/common/breakpoints";
|
|
2
2
|
import { ThemeProps } from "../../../theme/theme";
|
|
3
3
|
|
|
4
|
+
export const bpDown820 = ({ theme }: ThemeProps): string =>
|
|
5
|
+
theme.breakpoints.down(820);
|
|
6
|
+
|
|
7
|
+
export const bpDown1024 = ({ theme }: ThemeProps): string =>
|
|
8
|
+
theme.breakpoints.down(1024);
|
|
9
|
+
|
|
4
10
|
export const mediaDesktopSmallDown = ({ theme }: ThemeProps): string =>
|
|
5
11
|
theme.breakpoints.down(DESKTOP_SM);
|
|
6
12
|
|
|
@@ -18,11 +18,13 @@ const VARIANT: Record<string, TypographyOwnProps["variant"]> = {
|
|
|
18
18
|
TEXT_BODY_400: "text-body-400",
|
|
19
19
|
TEXT_BODY_400_2_LINES: "text-body-400-2lines",
|
|
20
20
|
TEXT_BODY_500: "text-body-500",
|
|
21
|
+
TEXT_BODY_LARGE_500: "text-body-large-500",
|
|
21
22
|
TEXT_BODY_SMALL_400: "text-body-small-400",
|
|
22
23
|
TEXT_BODY_SMALL_500: "text-body-small-500",
|
|
23
24
|
TEXT_HEADING_LARGE: "text-heading-large",
|
|
24
25
|
TEXT_HEADING_SMALL: "text-heading-small",
|
|
25
26
|
TEXT_HEADING_XSMALL: "text-heading-xsmall",
|
|
27
|
+
TEXT_UPPERCASE_500: "text-uppercase-500",
|
|
26
28
|
};
|
|
27
29
|
|
|
28
30
|
export const TYPOGRAPHY_PROPS: TypographyPropsOptions = {
|
|
@@ -11,12 +11,14 @@ import {
|
|
|
11
11
|
Filters,
|
|
12
12
|
} from "../../components/Filter/components/Filters/filters";
|
|
13
13
|
import { SearchAllFilters } from "../../components/Filter/components/SearchAllFilters/searchAllFilters";
|
|
14
|
+
import { SURFACE_TYPE } from "../../components/Filter/components/surfaces/types";
|
|
14
15
|
import { Index as IndexView } from "../../components/Index/index";
|
|
15
16
|
import { SidebarLabel } from "../../components/Layout/components/Sidebar/components/SidebarLabel/sidebarLabel";
|
|
16
17
|
import { SidebarTools } from "../../components/Layout/components/Sidebar/components/SidebarTools/sidebarTools.styles";
|
|
17
18
|
import { Sidebar } from "../../components/Layout/components/Sidebar/sidebar";
|
|
18
19
|
import { CategoryGroup } from "../../config/entities";
|
|
19
20
|
import { useStateSyncManager } from "../../hooks/stateSyncManager/hook";
|
|
21
|
+
import { useBreakpoint } from "../../hooks/useBreakpoint";
|
|
20
22
|
import { useConfig } from "../../hooks/useConfig";
|
|
21
23
|
import { useEntityList } from "../../hooks/useEntityList";
|
|
22
24
|
import { useExploreState } from "../../hooks/useExploreState";
|
|
@@ -33,6 +35,7 @@ export interface ExploreViewProps extends AzulEntitiesStaticResponse {
|
|
|
33
35
|
}
|
|
34
36
|
|
|
35
37
|
export const ExploreView = (props: ExploreViewProps): JSX.Element => {
|
|
38
|
+
const { mdDown } = useBreakpoint();
|
|
36
39
|
const { config, entityConfig } = useConfig(); // Get app level config.
|
|
37
40
|
const { exploreDispatch, exploreState } = useExploreState(); // Get the useReducer state and dispatch for "Explore".
|
|
38
41
|
const { trackingConfig } = config;
|
|
@@ -137,6 +140,7 @@ export const ExploreView = (props: ExploreViewProps): JSX.Element => {
|
|
|
137
140
|
<Filters
|
|
138
141
|
categoryFilters={categoryFilters}
|
|
139
142
|
onFilter={onFilterChange.bind(null, false)}
|
|
143
|
+
surfaceType={mdDown ? SURFACE_TYPE.DRAWER : SURFACE_TYPE.MENU}
|
|
140
144
|
trackFilterOpened={trackingConfig?.trackFilterOpened}
|
|
141
145
|
/>
|
|
142
146
|
</Sidebar>
|