@teamimpact/veda-ui-blocks 0.1.0-beta.7 → 0.1.0-beta.8

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.
Files changed (35) hide show
  1. package/README.md +2 -3
  2. package/dist/default.css +1388 -407
  3. package/dist/default.css.map +1 -1
  4. package/dist/disasters.css +1137 -151
  5. package/dist/disasters.css.map +1 -1
  6. package/dist/index.d.ts +110 -40
  7. package/dist/index.js +484 -54
  8. package/package.json +4 -6
  9. package/src/styles/components/banner.scss +0 -18
  10. package/src/styles/components/card-cta.scss +0 -90
  11. package/src/styles/components/card-detailed.scss +0 -164
  12. package/src/styles/components/card-mini.scss +0 -81
  13. package/src/styles/components/card-simple.scss +0 -79
  14. package/src/styles/components/card.scss +0 -284
  15. package/src/styles/components/compare-map.scss +0 -15
  16. package/src/styles/components/footer.scss +0 -256
  17. package/src/styles/components/header.scss +0 -212
  18. package/src/styles/components/index.scss +0 -11
  19. package/src/styles/components/tag.scss +0 -89
  20. package/src/styles/default/index.scss +0 -10
  21. package/src/styles/default/theme-tokens.scss +0 -84
  22. package/src/styles/disasters/card-cta.scss +0 -31
  23. package/src/styles/disasters/card-mini.scss +0 -4
  24. package/src/styles/disasters/card-simple.scss +0 -13
  25. package/src/styles/disasters/card.scss +0 -13
  26. package/src/styles/disasters/compare-map.scss +0 -3
  27. package/src/styles/disasters/fonts.scss +0 -29
  28. package/src/styles/disasters/footer.scss +0 -9
  29. package/src/styles/disasters/header.scss +0 -10
  30. package/src/styles/disasters/index.scss +0 -22
  31. package/src/styles/disasters/tag.scss +0 -6
  32. package/src/styles/disasters/theme-tokens.scss +0 -150
  33. package/src/styles/earthgov/footer.scss +0 -15
  34. package/src/styles/earthgov/index.scss +0 -12
  35. package/src/styles/earthgov/theme-tokens.scss +0 -104
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import React$1, { ReactNode, ButtonHTMLAttributes, ReactElement, ImgHTMLAttributes, SVGProps, VideoHTMLAttributes, CanvasHTMLAttributes, ComponentProps } from 'react';
2
+ import { ReactNode, ButtonHTMLAttributes, ReactElement, ImgHTMLAttributes, SVGProps, VideoHTMLAttributes, CanvasHTMLAttributes, ComponentProps } from 'react';
3
3
  import { ButtonProps as ButtonProps$1 } from '@trussworks/react-uswds';
4
4
  import { StyleSpecification } from 'maplibre-gl';
5
5
  import { ViewState } from 'react-map-gl/maplibre';
@@ -73,6 +73,7 @@ type ButtonProps = {
73
73
  declare function Button({ type, secondary, base, accentStyle, outline, inverse, size, unstyled, children, className, ...rest }: ButtonProps): react_jsx_runtime.JSX.Element;
74
74
 
75
75
  type CardMediaElement = ReactElement<ImgHTMLAttributes<HTMLImageElement>, "img"> | ReactElement<SVGProps<SVGSVGElement>, "svg"> | ReactElement<VideoHTMLAttributes<HTMLVideoElement>, "video"> | ReactElement<CanvasHTMLAttributes<HTMLCanvasElement>, "canvas">;
76
+ type LogoMediaElement = ReactElement<ImgHTMLAttributes<HTMLImageElement>, "img"> | ReactElement<SVGProps<SVGSVGElement>, "svg">;
76
77
 
77
78
  type CardProps = {
78
79
  /** Optional: label/tag shown above title. */
@@ -132,33 +133,42 @@ type CardCTAProps = ComponentProps<"a"> & {
132
133
  declare function CardCTA({ title, url, description, accentColor, titleAs, className, style, ...rest }: CardCTAProps): react_jsx_runtime.JSX.Element;
133
134
 
134
135
  type CardDetailedProps = {
135
- /** Small intro text above the title */
136
+ /** Optional: intro text above the title */
136
137
  intro?: string;
137
- /** Main card title (required) */
138
- title: string;
139
- /** Card description/body */
138
+ /** Optional: heading text for the card */
139
+ title?: string | ReactNode;
140
+ /** Optional: body text for the card. */
140
141
  description?: string;
141
- /** Array of tags below description */
142
+ /** Optional: label/tag shown over image */
143
+ tagPrimary?: ReactNode;
144
+ /** Optional: Array of tags below description */
142
145
  tags?: ReactNode[];
143
- /** Content type tag overlayed on image */
144
- contentTypeTag?: ReactNode;
145
- /** Card image/media (required) */
146
+ /** Optional: Call to action for the card. */
147
+ callToAction?: {
148
+ label: string;
149
+ href: string;
150
+ };
151
+ /** Optional: Secondary outlined call to action for the card. */
152
+ callToActionSecondary?: {
153
+ label: string;
154
+ href: string;
155
+ };
156
+ /** Required: media element rendered as either the card background or
157
+ * an image within the card.
158
+ */
146
159
  image: CardMediaElement;
147
- /** Action button (filled or link+icon) */
148
- action?: ReactNode;
149
- /** Position of the image relative to card content */
150
- imagePosition?: "top" | "bottom" | "cover";
151
- /** Show accent bar on top of card */
152
- borderAccent?: boolean;
153
- /** Semantic heading level for the card title */
154
- titleAs?: "h2" | "h3" | "h4";
160
+ /** Optional: position of the image within the card.
161
+ * Images have fixed aspect ratios with content that vary with position.
162
+ * Defaults to "top".
163
+ */
164
+ imagePosition?: "left" | "right" | "top" | "bottom";
155
165
  /** Optional className for custom styling */
156
166
  className?: string;
157
167
  };
158
168
  /**
159
169
  * CardDetailed: Vertical layout, image on top, overlay tag, intro, title, description, tags, action.
160
170
  */
161
- declare function CardDetailed({ intro, title, description, tags, contentTypeTag, image, action, imagePosition, borderAccent, titleAs, className, }: CardDetailedProps): react_jsx_runtime.JSX.Element;
171
+ declare function CardDetailed({ intro, title, description, tags, callToAction, callToActionSecondary, tagPrimary, image, imagePosition, className, }: CardDetailedProps): react_jsx_runtime.JSX.Element;
162
172
 
163
173
  type CardMiniProps = {
164
174
  /** Required: media element rendered as the card image thumbnail. */
@@ -184,8 +194,6 @@ type CardSimpleProps = {
184
194
  url: string;
185
195
  /** Optional: label rendered at the top of the card. Pass a Tag component. */
186
196
  tag?: ReactNode;
187
- /** Whether to render the gradient overlay on top of the media. */
188
- showOverlay?: boolean;
189
197
  /**
190
198
  * `compact` reduces the title font size for half-height slots in a grid.
191
199
  * Defaults to `default`.
@@ -195,7 +203,7 @@ type CardSimpleProps = {
195
203
  titleAs?: "h2" | "h3" | "h4" | "h5" | "h6";
196
204
  className?: string;
197
205
  };
198
- declare function CardSimple({ title, image, url, tag, showOverlay, size, titleAs, className, }: CardSimpleProps): react_jsx_runtime.JSX.Element;
206
+ declare function CardSimple({ title, image, url, tag, size, titleAs, className, }: CardSimpleProps): react_jsx_runtime.JSX.Element;
199
207
 
200
208
  type NavItem$1 = {
201
209
  label: string;
@@ -211,7 +219,7 @@ type ContactItem = {
211
219
  email: string;
212
220
  };
213
221
  type PortalDetails = {
214
- logo?: React$1.ReactElement;
222
+ logo?: LogoMediaElement;
215
223
  contacts?: ContactItem[];
216
224
  tagline?: string | null;
217
225
  title: string;
@@ -281,34 +289,96 @@ type TagProps = {
281
289
  */
282
290
  declare function Tag({ variant, size, color, textColor, icon, onClose, children, className, }: TagProps): react_jsx_runtime.JSX.Element;
283
291
 
284
- type SingleLayerMapProps = {
292
+ /** Temporal filter for STAC queries. ISO 8601 date strings */
293
+ type DateRange = {
294
+ from: string;
295
+ to: string;
296
+ };
297
+ type TileMatrixSet = "WebMercatorQuad" | "GDALWebMercatorQuad" | "WorldCRS84Quad";
298
+ type StacRasterLayerConfig = {
299
+ type: "raster";
300
+ collectionId: string;
301
+ dateRange: DateRange;
302
+ tileMatrixSet?: TileMatrixSet;
303
+ };
304
+ interface GradientLegendProps {
305
+ type: "gradient";
306
+ colorStops: string[];
307
+ title?: string;
308
+ description?: string;
309
+ provider?: string;
310
+ spatialExtent?: string;
311
+ timeDensity?: string;
312
+ unit?: string;
313
+ min: number;
314
+ max: number;
315
+ }
316
+ type LegendProps = GradientLegendProps & {
317
+ initialExpanded?: boolean;
318
+ };
319
+
320
+ declare function Legend({ initialExpanded, ...props }: LegendProps): react_jsx_runtime.JSX.Element;
321
+
322
+ type StacCompareMapProps = {
323
+ /** MapLibre base map style URL or style object. */
324
+ baseMapStyle?: string | StyleSpecification;
325
+ /** Initial map center (longitude/latitude), zoom level, and optional bearing/pitch. MapLibre applies defaults for any properties not provided. */
326
+ initialViewState?: Partial<ViewState>;
327
+ /** Layer config for the left panel. */
328
+ leftLayerConfig: StacRasterLayerConfig;
329
+ /** Layer config for the right panel. */
330
+ rightLayerConfig: StacRasterLayerConfig;
331
+ /** Additional CSS class applied to the root container element. */
332
+ className?: string;
333
+ };
334
+ /**
335
+ * Smart swipe-slider map for comparing two STAC datasets side-by-side.
336
+ *
337
+ * When both panels show the same collection, a single legend appears on the right.
338
+ * When collections differ, each panel shows its own legend on its respective side.
339
+ *
340
+ * Requires a `StacApiProvider` ancestor. Uses flex layout to fill available space,
341
+ * so the parent must be a flex container with defined height.
342
+ *
343
+ * @example
344
+ * ```tsx
345
+ * <StacApiProvider apiUrl="https://stac.example.com">
346
+ * <div style={{ display: "flex", flexDirection: "column", height: "500px" }}>
347
+ * <StacCompareMap
348
+ * leftLayerConfig={{ type: "raster", collectionId: "my-collection", dateRange: { from: "2021-01-01", to: "2021-01-31" } }}
349
+ * rightLayerConfig={{ type: "raster", collectionId: "my-collection", dateRange: { from: "2021-06-01", to: "2021-06-30" } }}
350
+ * />
351
+ * </div>
352
+ * </StacApiProvider>
353
+ * ```
354
+ */
355
+ declare function StacCompareMap({ baseMapStyle, initialViewState, leftLayerConfig, rightLayerConfig, className, }: StacCompareMapProps): react_jsx_runtime.JSX.Element;
356
+
357
+ type StacSingleLayerMapProps = {
285
358
  /** MapLibre base map style URL or style object. Defaults to NASA Blue Marble imagery. */
286
359
  baseMapStyle?: string | StyleSpecification;
287
360
  /** Initial map center (longitude/latitude), zoom level, and optional bearing/pitch. MapLibre applies defaults for any properties not provided. */
288
361
  initialViewState?: Partial<ViewState>;
289
- /** Optional child components to render on the map (e.g., layers, markers, controls). */
290
- children?: ReactNode;
362
+ /** STAC collection and date range to fetch and display as a raster tile layer. */
363
+ layerConfig: StacRasterLayerConfig;
291
364
  };
292
365
  /**
293
- * SingleLayerMap - A lightweight MapLibre GL JS map component for displaying base maps.
366
+ * Smart map container that fetches STAC collection tiles and renders them with a legend overlay.
294
367
  *
295
- * This component provides a foundational map that can be extended with data layers,
296
- * markers, and controls. It uses flex layout to fill available space, so the parent
297
- * component must be a flex container with defined height.
368
+ * Requires a `StacApiProvider` ancestor. Uses flex layout to fill available space,
369
+ * so the parent must be a flex container with defined height.
298
370
  *
299
371
  * @example
300
372
  * ```tsx
301
- * <div style={{ display: "flex", flexDirection: "column", height: "500px" }}>
302
- * <SingleLayerMap
303
- * initialViewState={{
304
- * longitude: -98.5795,
305
- * latitude: 39.8283,
306
- * zoom: 3
307
- * }}
308
- * />
309
- * </div>
373
+ * <StacApiProvider apiUrl="https://stac.example.com">
374
+ * <div style={{ display: "flex", flexDirection: "column", height: "500px" }}>
375
+ * <StacSingleLayerMap
376
+ * layerConfig={{ type: "raster", collectionId: "my-collection", dateRange: { from: "2021-01-01", to: "2021-01-31" } }}
377
+ * />
378
+ * </div>
379
+ * </StacApiProvider>
310
380
  * ```
311
381
  */
312
- declare const SingleLayerMap: ({ baseMapStyle, initialViewState, children, }: SingleLayerMapProps) => react_jsx_runtime.JSX.Element;
382
+ declare function StacSingleLayerMap({ baseMapStyle, initialViewState, layerConfig, }: StacSingleLayerMapProps): react_jsx_runtime.JSX.Element;
313
383
 
314
- export { Banner, type BannerProps, Button, type ButtonProps, Card, CardCTA, type CardCTAProps, CardDetailed, type CardDetailedProps, CardMini, type CardMiniProps, type CardProps, CardSimple, type CardSimpleProps, Footer, type FooterProps, Header, type HeaderProps, SingleLayerMap, type SingleLayerMapProps, Tag, type TagProps };
384
+ export { Banner, type BannerProps, Button, type ButtonProps, Card, CardCTA, type CardCTAProps, CardDetailed, type CardDetailedProps, CardMini, type CardMiniProps, type CardProps, CardSimple, type CardSimpleProps, Footer, type FooterProps, Header, type HeaderProps, Legend, type LegendProps, StacCompareMap, type StacCompareMapProps, StacSingleLayerMap, type StacSingleLayerMapProps, Tag, type TagProps };