diff --git a/src/components/atoms/DialogShell/DialogShell.tsx b/src/components/atoms/DialogShell/DialogShell.tsx index 02ff898..d2aad62 100644 --- a/src/components/atoms/DialogShell/DialogShell.tsx +++ b/src/components/atoms/DialogShell/DialogShell.tsx @@ -108,7 +108,7 @@ export const DialogShell = React.forwardRef( display: 'flex', alignItems: 'center', justifyContent: 'space-between', - px: 3, + px: 5, pt: 2.5, pb: 2, flexShrink: 0, @@ -149,7 +149,7 @@ export const DialogShell = React.forwardRef( {/* Scrollable body */} ( {footer && ( <> - {footer} + {footer} )} diff --git a/src/components/molecules/FilterPanel/FilterPanel.tsx b/src/components/molecules/FilterPanel/FilterPanel.tsx index b4d3493..84a63d7 100644 --- a/src/components/molecules/FilterPanel/FilterPanel.tsx +++ b/src/components/molecules/FilterPanel/FilterPanel.tsx @@ -5,7 +5,6 @@ import type { SxProps, Theme } from '@mui/material/styles'; import { DialogShell } from '../../atoms/DialogShell'; import { Button } from '../../atoms/Button'; import { Badge } from '../../atoms/Badge'; -import { Link } from '../../atoms/Link'; // ─── Types ─────────────────────────────────────────────────────────────────── @@ -75,25 +74,18 @@ export const FilterPanel = React.forwardRef( - {label} - {onClear && activeCount > 0 && ( - onClear()} - underline="hover" - sx={{ fontSize: (theme: Theme) => theme.typography.caption.fontSize }} - > - Clear all - - )} - - } + title={label} footer={ - + + {onClear && activeCount > 0 ? ( + + ) : ( + + )} } diff --git a/src/components/pages/ProvidersStep/ProvidersStep.stories.tsx b/src/components/pages/ProvidersStep/ProvidersStep.stories.tsx index c07ead0..0dd074d 100644 --- a/src/components/pages/ProvidersStep/ProvidersStep.stories.tsx +++ b/src/components/pages/ProvidersStep/ProvidersStep.stories.tsx @@ -140,10 +140,10 @@ export const Default: Story = { // ─── With active filters ──────────────────────────────────────────────────── -/** Filters pre-applied — verified only + price cap */ +/** Filters pre-applied — location, tradition, type, verified, price cap */ export const WithActiveFilters: Story = { render: () => { - const [query, setQuery] = useState(''); + const [query, setQuery] = useState('Wollongong, NSW'); const [filters, setFilters] = useState({ tradition: 'Catholic', funeralTypes: ['service_and_cremation'], diff --git a/src/components/pages/ProvidersStep/ProvidersStep.tsx b/src/components/pages/ProvidersStep/ProvidersStep.tsx index 3ee517b..ee76e41 100644 --- a/src/components/pages/ProvidersStep/ProvidersStep.tsx +++ b/src/components/pages/ProvidersStep/ProvidersStep.tsx @@ -15,7 +15,7 @@ import { Switch } from '../../atoms/Switch'; import { Typography } from '../../atoms/Typography'; import { Divider } from '../../atoms/Divider'; -// ──�� Types ─────────────────���───────────────────────────────────────────────── +// ─── Types ─────────────────────────────────────────────────────────────────── /** Provider data for display in the list */ export interface ProviderData { @@ -105,9 +105,10 @@ export interface ProvidersStepProps { sx?: SxProps; } -// ─── Defaults ────��──────────────────────��─────────────────────────────────── +// ─── Defaults ──────────────────────────────────────────────────────────────── const DEFAULT_TRADITIONS = [ + 'None', 'Anglican', "Bahá'í", 'Baptist', @@ -147,7 +148,28 @@ export const EMPTY_FILTER_VALUES: ProviderFilterValues = { priceRange: [0, 15000], }; -// ──��� Component ─────────────────────────────────────────────────────���───────── +// ─── Shared styles ─────────────────────────────────────────────────────────── + +/** Section heading inside the filter panel */ +const sectionHeadingSx = { + mb: 1.5, + display: 'block', + fontWeight: 600, + color: 'text.primary', +} as const; + +/** Horizontal scrolling chip row — hides scrollbar, no wrap */ +const chipScrollSx = { + display: 'flex', + gap: 1, + overflowX: 'auto', + flexWrap: 'nowrap', + pb: 0.5, + '&::-webkit-scrollbar': { display: 'none' }, + scrollbarWidth: 'none', +} as const; + +// ─── Component ─────────────────────────────────────────────────────────────── /** * Step 2 — Provider selection page for the FA arrangement wizard. @@ -159,9 +181,9 @@ export const EMPTY_FILTER_VALUES: ProviderFilterValues = { * Click-to-navigate (D-D): clicking a provider card triggers * navigation directly — no selection state or Continue button. * - * Filters: service tradition (autocomplete), funeral type (chips), - * verified only (switch), online arrangements (switch), price range - * (dual-knob slider with editable inputs). + * Filters: location (chip + search), service tradition (autocomplete), + * funeral type (horizontal scroll chips), verified only (switch), + * online arrangements (switch), price range (slider + compact inputs). * * Pure presentation component — props in, callbacks out. * @@ -219,6 +241,7 @@ export const ProvidersStep: React.FC = ({ // ─── Active filter count ─── const activeCount = + (searchQuery.trim() ? 1 : 0) + (filterValues.tradition ? 1 : 0) + filterValues.funeralTypes.length + (filterValues.verifiedOnly ? 1 : 0) + @@ -226,6 +249,7 @@ export const ProvidersStep: React.FC = ({ (filterValues.priceRange[0] !== minPrice || filterValues.priceRange[1] !== maxPrice ? 1 : 0); const handleClear = () => { + onSearchChange(''); onFilterChange({ ...EMPTY_FILTER_VALUES, priceRange: [minPrice, maxPrice], @@ -318,9 +342,49 @@ export const ProvidersStep: React.FC = ({ {/* Filters — right-aligned below search */} + {/* ── Location ── */} + + + Location + + {searchQuery.trim() && ( + + onSearchChange('')} + variant="filled" + color="primary" + size="small" + /> + + )} + onSearchChange(e.target.value)} + onKeyDown={(e) => { + if (e.key === 'Enter' && onSearch) { + e.preventDefault(); + onSearch(searchQuery); + } + }} + fullWidth + size="small" + InputProps={{ + startAdornment: ( + + + + ), + }} + /> + + + + {/* ── Service tradition ── */} - + Service tradition = ({ {/* ── Funeral type ── */} - + Funeral type - + {funeralTypeOptions.map((option) => ( = ({ onClick={() => handleFuneralTypeToggle(option.value)} variant="outlined" size="small" + sx={{ flexShrink: 0 }} /> ))} @@ -390,10 +455,10 @@ export const ProvidersStep: React.FC = ({ {/* ── Price range ── */} - + Price range - + @@ -410,7 +475,7 @@ export const ProvidersStep: React.FC = ({ color="primary" /> - + = ({ inputProps={{ inputMode: 'numeric', 'aria-label': 'Minimum price', + style: { padding: '6px 0' }, }} - sx={{ flex: 1 }} + sx={{ flex: 1, '& .MuiOutlinedInput-root': { fontSize: '0.875rem' } }} /> - + = ({ inputProps={{ inputMode: 'numeric', 'aria-label': 'Maximum price', + style: { padding: '6px 0' }, }} - sx={{ flex: 1 }} + sx={{ flex: 1, '& .MuiOutlinedInput-root': { fontSize: '0.875rem' } }} />