Iterate MapPopup: consistent hierarchy, clickable card, icon badge

- Hierarchy now matches MiniCard: title → meta → price
- Whole card is clickable (onClick prop) — removed View details link
- Verified badge → icon-only circle in image (matches MiniCard)
- Name truncated at 1 line with tooltip on hover
- No-image fallback shows inline verified icon + text
- Added keyboard support (Enter/Space) and focus ring

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-06 20:59:55 +10:00
parent c457ee8b0d
commit 723cdf908a
2 changed files with 131 additions and 77 deletions

View File

@@ -20,6 +20,9 @@ const meta: Meta<typeof MapPopup> = {
values: [{ name: 'map', value: '#E5E3DF' }],
},
},
argTypes: {
onClick: { action: 'clicked' },
},
};
export default meta;
@@ -34,7 +37,6 @@ export const VerifiedProvider: Story = {
location: 'Wollongong',
rating: 4.8,
verified: true,
onViewDetails: () => {},
},
};
@@ -44,7 +46,6 @@ export const UnverifiedProvider: Story = {
name: 'Smith & Sons Funeral Services',
price: 1200,
location: 'Sutherland',
onViewDetails: () => {},
},
};
@@ -56,23 +57,31 @@ export const Venue: Story = {
price: 450,
location: 'Albany Creek',
capacity: 120,
onViewDetails: () => {},
},
};
/** Minimal — just name and view details */
/** Long name — truncated at 1 line, tooltip on hover */
export const LongName: Story = {
args: {
name: 'Botanical Funerals by Ian Allison — Sustainable & Eco-Friendly Services',
imageUrl: IMG_PROVIDER,
price: 1200,
location: 'Northern Beaches',
verified: true,
},
};
/** Minimal — just name */
export const Minimal: Story = {
args: {
name: 'Local Funeral Provider',
onViewDetails: () => {},
},
};
/** No view details link — display only */
export const DisplayOnly: Story = {
/** Verified without image — inline verified indicator */
export const VerifiedNoImage: Story = {
args: {
name: 'H.Parsons Funeral Directors',
imageUrl: IMG_PROVIDER,
price: 900,
location: 'Wollongong',
verified: true,
@@ -87,7 +96,6 @@ export const CustomPriceLabel: Story = {
priceLabel: 'Price on application',
location: 'Sydney CBD',
verified: true,
onViewDetails: () => {},
},
};
@@ -122,7 +130,7 @@ export const WithPin: Story = {
location="Wollongong"
rating={4.8}
verified
onViewDetails={() => {}}
onClick={() => {}}
/>
<MapPin name="H.Parsons" price={900} verified active />
</>