@swisper.ai/web-map 0.0.2 → 0.0.5

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.
@@ -1,6 +1,6 @@
1
1
  import type { Meta, StoryObj } from '@storybook/react-vite';
2
2
 
3
- import { TooltipProvider } from '@swisper.ai/ui';
3
+ import { withTooltip } from '@swisper.ai/ui';
4
4
 
5
5
  import { USER_LOCATION } from './__storybook__/fixtures';
6
6
  import { MapUserLocation } from './map-user-location';
@@ -12,18 +12,17 @@ const meta: Meta<typeof MapUserLocation> = {
12
12
  tags: ['autodocs'],
13
13
  decorators: [
14
14
  (Story) => (
15
- <TooltipProvider>
16
- <div className="h-[500px] w-[700px]">
17
- <MapView
18
- testId="map-user-location-story"
19
- ariaLabel="Your location"
20
- fitPoints={[[USER_LOCATION.longitude, USER_LOCATION.latitude]]}
21
- >
22
- <Story />
23
- </MapView>
24
- </div>
25
- </TooltipProvider>
15
+ <div className="h-[500px] w-[700px]">
16
+ <MapView
17
+ testId="map-user-location-story"
18
+ ariaLabel="Your location"
19
+ fitPoints={[[USER_LOCATION.longitude, USER_LOCATION.latitude]]}
20
+ >
21
+ <Story />
22
+ </MapView>
23
+ </div>
26
24
  ),
25
+ withTooltip,
27
26
  ],
28
27
  args: {
29
28
  coordinates: USER_LOCATION,
package/src/map-view.json CHANGED
@@ -2,6 +2,7 @@
2
2
  "$schema": "../../int-eslint-config/schemas/component.schema.json",
3
3
  "component": "map-view",
4
4
  "purpose": "Interactive map root that frames a set of points and shares controlled selection and hover state with the MapMarkers drawn inside it.",
5
+ "anatomy": ["import { MapView } from '@swisper.ai/web-map';", "", "<MapView />"],
5
6
  "useWhen": [
6
7
  "Showing a set of places (search results, venues, offices) as selectable pins on a map",
7
8
  "A map is paired with a list or cards and selecting in one must highlight the other",
@@ -1,7 +1,7 @@
1
1
  import type { Meta, StoryObj } from '@storybook/react-vite';
2
2
  import { useState } from 'react';
3
3
 
4
- import { TooltipProvider } from '@swisper.ai/ui';
4
+ import { withTooltip } from '@swisper.ai/ui';
5
5
 
6
6
  import { PLACE_POINTS, PLACES, USER_LOCATION } from './__storybook__/fixtures';
7
7
  import { DEFAULT_FIT_BOUNDS_PADDING, DEFAULT_MAP_STYLE_URL } from './constants';
@@ -47,12 +47,11 @@ const meta: Meta<typeof MapViewDemo> = {
47
47
  tags: ['autodocs'],
48
48
  decorators: [
49
49
  (Story) => (
50
- <TooltipProvider>
51
- <div className="h-[600px] w-[800px]">
52
- <Story />
53
- </div>
54
- </TooltipProvider>
50
+ <div className="h-[600px] w-[800px]">
51
+ <Story />
52
+ </div>
55
53
  ),
54
+ withTooltip,
56
55
  ],
57
56
  // `selectedId`, `hoveredId`, `onSelect` and `onHover` stay out of meta args: the demo owns them
58
57
  // in state, and an arg would override it and break selecting a pin. Callbacks are logged through
@@ -2,6 +2,7 @@
2
2
  "$schema": "../../int-eslint-config/schemas/component.schema.json",
3
3
  "component": "user-location-pin",
4
4
  "purpose": "The marker for the user's own position: a blue dot with a white ring, with a tooltip and accessible name.",
5
+ "anatomy": ["import { UserLocationPin } from '@swisper.ai/web-map';", "", "<UserLocationPin />"],
5
6
  "useWhen": [
6
7
  "Rendering the default user-position marker, which web-map/map-user-location does for you",
7
8
  "Showing the user-position dot outside a map, such as in a map legend"
@@ -1,4 +1,5 @@
1
- import { Tooltip, cn } from '@swisper.ai/ui';
1
+ import { Tooltip } from '@swisper.ai/ui';
2
+ import { cn } from '@swisper.ai/web-core';
2
3
 
3
4
  export interface UserLocationPinProps {
4
5
  className?: string;