Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Floating SearchFilterDrawer #616

Merged
merged 1 commit into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@ export const SearchFilterDrawer: React.FC<SearchFilterDrawerProps> = ({
}, [actions, dispatch]);

return (
<Drawer isOpen={open} onRequestClose={closeDrawer} {...drawerProps}>
<Drawer
floating
isOpen={open}
onRequestClose={closeDrawer}
{...drawerProps}
>
<Column
height={"100%"}
borderRadius={"var(--swui-border-radius)"}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import * as React from "react";
import { ReactNode } from "react";
import { FlatButton, stenaTimes } from "@stenajs-webui/elements";
import { Heading, Row, Space, Spacing } from "@stenajs-webui/core";
import { cssColor } from "@stenajs-webui/theme";

interface SearchFilterPanelHeaderProps {
onRequestClose: () => void;
Expand All @@ -13,7 +14,12 @@ export const SearchFilterPanelHeader: React.FC<
SearchFilterPanelHeaderProps
> = ({ onRequestClose, header = "Filter", contentRight }) => {
return (
<Spacing>
<Spacing
position={"sticky"}
top={0}
background={cssColor("--lhds-color-ui-50")}
zIndex={100}
>
<Row
justifyContent={"space-between"}
alignItems={"center"}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Box, Heading, Indent, Row, useBoolean } from "@stenajs-webui/core";
import {
Card,
FlatButton,
PrimaryButton,
stenaCalendar,
Expand Down Expand Up @@ -332,49 +331,49 @@ export const Demo = () => {

return (
<SearchFilterContext state={state} actions={actions} dispatch={dispatch}>
<Card>
<Row
alignItems={"center"}
justifyContent={"space-between"}
indent={2}
spacing
minHeight={"56px"}
>
<Row alignItems={"center"}>
<SearchFilterButton />
<Indent num={0.5} />
<SearchFilterChips>
<SectionChips
sectionId={"comparisonDate"}
emptyChipLabel={"No dates"}
{...createChipsPropsForDateRange(
state.formModel,
"startDate",
"endDate"
)}
/>
<SectionChips
sectionId={"divisions"}
emptyChipLabel={"All divisions"}
{...createChipsPropsForBooleanRecord(
state.formModel,
"divisions",
divisionOptions
)}
/>
<SectionChips
sectionId={"categories"}
emptyChipLabel={"All categories"}
{...createChipsPropsForBooleanRecord(
state.formModel,
"categories",
categoryOptions
)}
/>
</SearchFilterChips>
</Row>
<Row
alignItems={"center"}
justifyContent={"space-between"}
indent={2}
spacing
minHeight={"56px"}
shadow={"box"}
>
<Row alignItems={"center"}>
<SearchFilterButton />
<Indent num={0.5} />
<SearchFilterChips>
<SectionChips
sectionId={"comparisonDate"}
emptyChipLabel={"No dates"}
{...createChipsPropsForDateRange(
state.formModel,
"startDate",
"endDate"
)}
/>
<SectionChips
sectionId={"divisions"}
emptyChipLabel={"All divisions"}
{...createChipsPropsForBooleanRecord(
state.formModel,
"divisions",
divisionOptions
)}
/>
<SectionChips
sectionId={"categories"}
emptyChipLabel={"All categories"}
{...createChipsPropsForBooleanRecord(
state.formModel,
"categories",
categoryOptions
)}
/>
</SearchFilterChips>
</Row>
</Card>
</Row>

<SearchFilterDrawer headerContentRight={<SearchFilterClearButton />}>
<DateRangeCalendarSection
label={"Date"}
Expand Down Expand Up @@ -453,51 +452,51 @@ export const WithStickyFooter = () => {

return (
<SearchFilterContext state={state} actions={actions} dispatch={dispatch}>
<Card>
<Row
alignItems={"center"}
justifyContent={"space-between"}
indent={2}
spacing
minHeight={"56px"}
>
<Row alignItems={"center"}>
<Heading style={{ whiteSpace: "nowrap" }}>App name</Heading>
<Indent />
<SearchFilterButton />
<Indent num={0.5} />
<SearchFilterChips>
<SectionChips
sectionId={"comparisonDate"}
emptyChipLabel={"No dates"}
{...createChipsPropsForDateRange(
state.formModel,
"startDate",
"endDate"
)}
/>
<SectionChips
sectionId={"divisions"}
emptyChipLabel={"All divisions"}
{...createChipsPropsForBooleanRecord(
state.formModel,
"divisions",
divisionOptions
)}
/>
<SectionChips
sectionId={"categories"}
emptyChipLabel={"All categories"}
{...createChipsPropsForBooleanRecord(
state.formModel,
"categories",
categoryOptions
)}
/>
</SearchFilterChips>
</Row>
<Row
alignItems={"center"}
justifyContent={"space-between"}
indent={2}
spacing
minHeight={"56px"}
shadow={"box"}
>
<Row alignItems={"center"}>
<Heading style={{ whiteSpace: "nowrap" }}>App name</Heading>
<Indent />
<SearchFilterButton />
<Indent num={0.5} />
<SearchFilterChips>
<SectionChips
sectionId={"comparisonDate"}
emptyChipLabel={"No dates"}
{...createChipsPropsForDateRange(
state.formModel,
"startDate",
"endDate"
)}
/>
<SectionChips
sectionId={"divisions"}
emptyChipLabel={"All divisions"}
{...createChipsPropsForBooleanRecord(
state.formModel,
"divisions",
divisionOptions
)}
/>
<SectionChips
sectionId={"categories"}
emptyChipLabel={"All categories"}
{...createChipsPropsForBooleanRecord(
state.formModel,
"categories",
categoryOptions
)}
/>
</SearchFilterChips>
</Row>
</Card>
</Row>

<SearchFilterDrawer>
<Box overflow={"auto"}>
<DateRangeCalendarSection
Expand Down Expand Up @@ -573,51 +572,51 @@ export const WithClearFiltersInHeader = () => {

return (
<SearchFilterContext state={state} actions={actions} dispatch={dispatch}>
<Card>
<Row
alignItems={"center"}
justifyContent={"space-between"}
indent={2}
spacing
minHeight={"56px"}
>
<Row alignItems={"center"}>
<Heading style={{ whiteSpace: "nowrap" }}>App name</Heading>
<Indent />
<SearchFilterButton />
<Indent num={0.5} />
<SearchFilterChips>
<SectionChips
sectionId={"comparisonDate"}
emptyChipLabel={"No dates"}
{...createChipsPropsForDateRange(
state.formModel,
"startDate",
"endDate"
)}
/>
<SectionChips
sectionId={"divisions"}
emptyChipLabel={"All divisions"}
{...createChipsPropsForBooleanRecord(
state.formModel,
"divisions",
divisionOptions
)}
/>
<SectionChips
sectionId={"categories"}
emptyChipLabel={"All categories"}
{...createChipsPropsForBooleanRecord(
state.formModel,
"categories",
categoryOptions
)}
/>
</SearchFilterChips>
</Row>
<Row
alignItems={"center"}
justifyContent={"space-between"}
indent={2}
spacing
minHeight={"56px"}
shadow={"box"}
>
<Row alignItems={"center"}>
<Heading style={{ whiteSpace: "nowrap" }}>App name</Heading>
<Indent />
<SearchFilterButton />
<Indent num={0.5} />
<SearchFilterChips>
<SectionChips
sectionId={"comparisonDate"}
emptyChipLabel={"No dates"}
{...createChipsPropsForDateRange(
state.formModel,
"startDate",
"endDate"
)}
/>
<SectionChips
sectionId={"divisions"}
emptyChipLabel={"All divisions"}
{...createChipsPropsForBooleanRecord(
state.formModel,
"divisions",
divisionOptions
)}
/>
<SectionChips
sectionId={"categories"}
emptyChipLabel={"All categories"}
{...createChipsPropsForBooleanRecord(
state.formModel,
"categories",
categoryOptions
)}
/>
</SearchFilterChips>
</Row>
</Card>
</Row>

<SearchFilterDrawer headerContentRight={<ClearFiltersButton />}>
<DateRangeCalendarSection
contentRight={
Expand Down Expand Up @@ -707,34 +706,34 @@ export const ManyChips = () => {

return (
<SearchFilterContext state={state} actions={actions} dispatch={dispatch}>
<Card>
<Row
alignItems={"center"}
justifyContent={"space-between"}
indent={2}
spacing
minHeight={"56px"}
>
<Row alignItems={"center"}>
<Heading style={{ whiteSpace: "nowrap" }}>App name</Heading>
<Indent />
<SearchFilterButton />
<Indent num={0.5} />
<SearchFilterChips>
<SectionChips
sectionId={"divisions"}
emptyChipLabel={"All divisions"}
{...createChipsPropsForBooleanRecord(
state.formModel,
"divisions",
divisionOptions
)}
chips={divisionOptions}
/>
</SearchFilterChips>
</Row>
<Row
alignItems={"center"}
justifyContent={"space-between"}
indent={2}
spacing
minHeight={"56px"}
shadow={"box"}
>
<Row alignItems={"center"}>
<Heading style={{ whiteSpace: "nowrap" }}>App name</Heading>
<Indent />
<SearchFilterButton />
<Indent num={0.5} />
<SearchFilterChips>
<SectionChips
sectionId={"divisions"}
emptyChipLabel={"All divisions"}
{...createChipsPropsForBooleanRecord(
state.formModel,
"divisions",
divisionOptions
)}
chips={divisionOptions}
/>
</SearchFilterChips>
</Row>
</Card>
</Row>

<SearchFilterDrawer>
<ChipMultiSelectSection
sectionId={"divisions"}
Expand Down
Loading
Loading