@jackbernnie/hiyf 0.3.1 → 0.3.3

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.
@@ -0,0 +1,27 @@
1
+ /**
2
+ * MapEmbed — the closed, sanctioned way to render an embedded location map.
3
+ *
4
+ * Raw <iframe> map embeds are an off-system escape hatch: every provider URL,
5
+ * viewport shape, loading behavior, and frame treatment would be up for grabs.
6
+ * This wrapper closes it:
7
+ * - Location is expressed only as decimal latitude/longitude with an
8
+ * enumerated map view and clamped zoom.
9
+ * - The embed always uses the approved responsive 16:9 frame, rounded
10
+ * corners, muted loading surface, and Google Maps embed URL.
11
+ * - NO `className`/`style` escape hatch. Need a new map affordance? Add it
12
+ * here so every map stays on-system.
13
+ */
14
+ export interface MapEmbedProps {
15
+ /** Latitude in decimal degrees. */
16
+ lat: number;
17
+ /** Longitude in decimal degrees. */
18
+ lon: number;
19
+ /** Zoom level 1-21. Defaults to 14. */
20
+ zoom?: number;
21
+ /** 'satellite' (default) or 'map'. */
22
+ view?: 'map' | 'satellite';
23
+ /** Accessible title for the embed. Defaults to 'Map'. */
24
+ title?: string;
25
+ }
26
+ /** Closed responsive map embed — no className/style. */
27
+ export declare function MapEmbed({ lat, lon, zoom, view, title, }: MapEmbedProps): import("react").JSX.Element | null;
@@ -0,0 +1,30 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { AspectRatio } from './ui/aspect-ratio.js';
3
+
4
+ function MapEmbed({
5
+ lat,
6
+ lon,
7
+ zoom = 14,
8
+ view = "satellite",
9
+ title = "Map"
10
+ }) {
11
+ if (!Number.isFinite(lat) || !Number.isFinite(lon)) {
12
+ return null;
13
+ }
14
+ const zoomValue = Number.isNaN(zoom) ? 14 : zoom;
15
+ const clampedZoom = Math.min(21, Math.max(1, zoomValue));
16
+ const src = `https://maps.google.com/maps?ll=${lat},${lon}&q=${lat},${lon}&z=${clampedZoom}&t=${view === "map" ? "m" : "k"}&output=embed`;
17
+ return /* @__PURE__ */ jsx("div", { className: "w-full overflow-hidden rounded-lg bg-muted", children: /* @__PURE__ */ jsx(AspectRatio, { ratio: 16 / 9, children: /* @__PURE__ */ jsx(
18
+ "iframe",
19
+ {
20
+ src,
21
+ title,
22
+ loading: "lazy",
23
+ referrerPolicy: "no-referrer-when-downgrade",
24
+ allowFullScreen: true,
25
+ className: "size-full border-0"
26
+ }
27
+ ) }) });
28
+ }
29
+
30
+ export { MapEmbed };
@@ -88,7 +88,7 @@ function HeaderMenu({
88
88
  onSelect: () => onSortChange?.({ key: column.key, direction: "asc" }),
89
89
  children: [
90
90
  /* @__PURE__ */ jsx(CheckGlyph, { visible: activeSort?.direction === "asc" }),
91
- "Sort ascending"
91
+ "Ascending"
92
92
  ]
93
93
  }
94
94
  ),
@@ -98,7 +98,7 @@ function HeaderMenu({
98
98
  onSelect: () => onSortChange?.({ key: column.key, direction: "desc" }),
99
99
  children: [
100
100
  /* @__PURE__ */ jsx(CheckGlyph, { visible: activeSort?.direction === "desc" }),
101
- "Sort descending"
101
+ "Descending"
102
102
  ]
103
103
  }
104
104
  )
package/dist/index.d.ts CHANGED
@@ -64,6 +64,8 @@ export { Image } from './components/Image';
64
64
  export type { ImageProps, ImageRadius, ImageFit } from './components/Image';
65
65
  export { Kbd } from './components/Kbd';
66
66
  export type { KbdProps } from './components/Kbd';
67
+ export { MapEmbed } from './components/MapEmbed';
68
+ export type { MapEmbedProps } from './components/MapEmbed';
67
69
  export { Empty } from './components/Empty';
68
70
  export type { EmptyProps } from './components/Empty';
69
71
  export { Toaster } from './components/Toaster';
package/dist/index.js CHANGED
@@ -31,6 +31,7 @@ export { Spinner } from './components/Spinner.js';
31
31
  export { Avatar } from './components/Avatar.js';
32
32
  export { Image } from './components/Image.js';
33
33
  export { Kbd } from './components/Kbd.js';
34
+ export { MapEmbed } from './components/MapEmbed.js';
34
35
  export { Empty } from './components/Empty.js';
35
36
  export { Toaster } from './components/Toaster.js';
36
37
  export { Separator } from './components/Separator.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jackbernnie/hiyf",
3
- "version": "0.3.1",
3
+ "version": "0.3.3",
4
4
  "description": "human-in-your-face — an AI design protocol (a locked, LLM-safe design system). Forked from Polar's Orbit (Apache-2.0).",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",