@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.
- package/README.md +2 -3
- package/dist/default.css +1388 -407
- package/dist/default.css.map +1 -1
- package/dist/disasters.css +1137 -151
- package/dist/disasters.css.map +1 -1
- package/dist/index.d.ts +110 -40
- package/dist/index.js +484 -54
- package/package.json +4 -6
- package/src/styles/components/banner.scss +0 -18
- package/src/styles/components/card-cta.scss +0 -90
- package/src/styles/components/card-detailed.scss +0 -164
- package/src/styles/components/card-mini.scss +0 -81
- package/src/styles/components/card-simple.scss +0 -79
- package/src/styles/components/card.scss +0 -284
- package/src/styles/components/compare-map.scss +0 -15
- package/src/styles/components/footer.scss +0 -256
- package/src/styles/components/header.scss +0 -212
- package/src/styles/components/index.scss +0 -11
- package/src/styles/components/tag.scss +0 -89
- package/src/styles/default/index.scss +0 -10
- package/src/styles/default/theme-tokens.scss +0 -84
- package/src/styles/disasters/card-cta.scss +0 -31
- package/src/styles/disasters/card-mini.scss +0 -4
- package/src/styles/disasters/card-simple.scss +0 -13
- package/src/styles/disasters/card.scss +0 -13
- package/src/styles/disasters/compare-map.scss +0 -3
- package/src/styles/disasters/fonts.scss +0 -29
- package/src/styles/disasters/footer.scss +0 -9
- package/src/styles/disasters/header.scss +0 -10
- package/src/styles/disasters/index.scss +0 -22
- package/src/styles/disasters/tag.scss +0 -6
- package/src/styles/disasters/theme-tokens.scss +0 -150
- package/src/styles/earthgov/footer.scss +0 -15
- package/src/styles/earthgov/index.scss +0 -12
- 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
|
|
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
|
-
/**
|
|
136
|
+
/** Optional: intro text above the title */
|
|
136
137
|
intro?: string;
|
|
137
|
-
/**
|
|
138
|
-
title
|
|
139
|
-
/**
|
|
138
|
+
/** Optional: heading text for the card */
|
|
139
|
+
title?: string | ReactNode;
|
|
140
|
+
/** Optional: body text for the card. */
|
|
140
141
|
description?: string;
|
|
141
|
-
/**
|
|
142
|
+
/** Optional: label/tag shown over image */
|
|
143
|
+
tagPrimary?: ReactNode;
|
|
144
|
+
/** Optional: Array of tags below description */
|
|
142
145
|
tags?: ReactNode[];
|
|
143
|
-
/**
|
|
144
|
-
|
|
145
|
-
|
|
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
|
-
/**
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
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,
|
|
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,
|
|
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?:
|
|
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
|
-
|
|
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
|
-
/**
|
|
290
|
-
|
|
362
|
+
/** STAC collection and date range to fetch and display as a raster tile layer. */
|
|
363
|
+
layerConfig: StacRasterLayerConfig;
|
|
291
364
|
};
|
|
292
365
|
/**
|
|
293
|
-
*
|
|
366
|
+
* Smart map container that fetches STAC collection tiles and renders them with a legend overlay.
|
|
294
367
|
*
|
|
295
|
-
*
|
|
296
|
-
*
|
|
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
|
-
* <
|
|
302
|
-
* <
|
|
303
|
-
*
|
|
304
|
-
*
|
|
305
|
-
*
|
|
306
|
-
*
|
|
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
|
|
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,
|
|
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 };
|