@teamimpact/veda-ui-blocks 0.1.0-beta.7 → 0.1.0-beta.9
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 +6 -3
- package/dist/default.css +11280 -10085
- package/dist/default.css.map +1 -1
- package/dist/disasters.css +11278 -10083
- package/dist/disasters.css.map +1 -1
- package/dist/index.d.ts +169 -68
- package/dist/index.js +713 -152
- package/package.json +5 -7
- 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,6 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import
|
|
3
|
-
import { ButtonProps as ButtonProps$1 } from '@trussworks/react-uswds';
|
|
2
|
+
import { ReactNode, ReactElement, ImgHTMLAttributes, SVGProps, VideoHTMLAttributes, CanvasHTMLAttributes, ComponentProps, ElementType, ComponentPropsWithRef } from 'react';
|
|
4
3
|
import { StyleSpecification } from 'maplibre-gl';
|
|
5
4
|
import { ViewState } from 'react-map-gl/maplibre';
|
|
6
5
|
|
|
@@ -48,31 +47,8 @@ type BannerProps = {
|
|
|
48
47
|
*/
|
|
49
48
|
declare function Banner({ ariaLabel, bannerHeaderText, bannerHeaderActionText, bannerIcon, bannerExpandedContent, className, }: BannerProps): react_jsx_runtime.JSX.Element;
|
|
50
49
|
|
|
51
|
-
type ButtonProps = {
|
|
52
|
-
/**
|
|
53
|
-
* USWDS Button variants. Only one of these should be true at a time.
|
|
54
|
-
* See: https://trussworks.github.io/react-uswds/?path=/docs/components-button--docs
|
|
55
|
-
*/
|
|
56
|
-
secondary?: boolean;
|
|
57
|
-
base?: boolean;
|
|
58
|
-
accentStyle?: "cool" | "warm";
|
|
59
|
-
outline?: boolean;
|
|
60
|
-
inverse?: boolean;
|
|
61
|
-
size?: "big";
|
|
62
|
-
unstyled?: boolean;
|
|
63
|
-
children: ReactNode;
|
|
64
|
-
/**
|
|
65
|
-
* Button type attribute. Defaults to 'button'.
|
|
66
|
-
*/
|
|
67
|
-
type?: "button" | "submit" | "reset";
|
|
68
|
-
} & Omit<ButtonProps$1, "children" | "type"> & ButtonHTMLAttributes<HTMLButtonElement>;
|
|
69
|
-
/**
|
|
70
|
-
* Our custom Button wrapper for react-uswds.
|
|
71
|
-
* Allows us to control the surface area and extend as needed.
|
|
72
|
-
*/
|
|
73
|
-
declare function Button({ type, secondary, base, accentStyle, outline, inverse, size, unstyled, children, className, ...rest }: ButtonProps): react_jsx_runtime.JSX.Element;
|
|
74
|
-
|
|
75
50
|
type CardMediaElement = ReactElement<ImgHTMLAttributes<HTMLImageElement>, "img"> | ReactElement<SVGProps<SVGSVGElement>, "svg"> | ReactElement<VideoHTMLAttributes<HTMLVideoElement>, "video"> | ReactElement<CanvasHTMLAttributes<HTMLCanvasElement>, "canvas">;
|
|
51
|
+
type LogoMediaElement = ReactElement<ImgHTMLAttributes<HTMLImageElement>, "img"> | ReactElement<SVGProps<SVGSVGElement>, "svg">;
|
|
76
52
|
|
|
77
53
|
type CardProps = {
|
|
78
54
|
/** Optional: label/tag shown above title. */
|
|
@@ -132,33 +108,42 @@ type CardCTAProps = ComponentProps<"a"> & {
|
|
|
132
108
|
declare function CardCTA({ title, url, description, accentColor, titleAs, className, style, ...rest }: CardCTAProps): react_jsx_runtime.JSX.Element;
|
|
133
109
|
|
|
134
110
|
type CardDetailedProps = {
|
|
135
|
-
/**
|
|
111
|
+
/** Optional: intro text above the title */
|
|
136
112
|
intro?: string;
|
|
137
|
-
/**
|
|
138
|
-
title
|
|
139
|
-
/**
|
|
113
|
+
/** Optional: heading text for the card */
|
|
114
|
+
title?: string | ReactNode;
|
|
115
|
+
/** Optional: body text for the card. */
|
|
140
116
|
description?: string;
|
|
141
|
-
/**
|
|
117
|
+
/** Optional: label/tag shown over image */
|
|
118
|
+
tagPrimary?: ReactNode;
|
|
119
|
+
/** Optional: Array of tags below description */
|
|
142
120
|
tags?: ReactNode[];
|
|
143
|
-
/**
|
|
144
|
-
|
|
145
|
-
|
|
121
|
+
/** Optional: Call to action for the card. */
|
|
122
|
+
callToAction?: {
|
|
123
|
+
label: string;
|
|
124
|
+
href: string;
|
|
125
|
+
};
|
|
126
|
+
/** Optional: Secondary outlined call to action for the card. */
|
|
127
|
+
callToActionSecondary?: {
|
|
128
|
+
label: string;
|
|
129
|
+
href: string;
|
|
130
|
+
};
|
|
131
|
+
/** Required: media element rendered as either the card background or
|
|
132
|
+
* an image within the card.
|
|
133
|
+
*/
|
|
146
134
|
image: CardMediaElement;
|
|
147
|
-
/**
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
borderAccent?: boolean;
|
|
153
|
-
/** Semantic heading level for the card title */
|
|
154
|
-
titleAs?: "h2" | "h3" | "h4";
|
|
135
|
+
/** Optional: position of the image within the card.
|
|
136
|
+
* Images have fixed aspect ratios with content that vary with position.
|
|
137
|
+
* Defaults to "top".
|
|
138
|
+
*/
|
|
139
|
+
imagePosition?: "left" | "right" | "top" | "bottom";
|
|
155
140
|
/** Optional className for custom styling */
|
|
156
141
|
className?: string;
|
|
157
142
|
};
|
|
158
143
|
/**
|
|
159
144
|
* CardDetailed: Vertical layout, image on top, overlay tag, intro, title, description, tags, action.
|
|
160
145
|
*/
|
|
161
|
-
declare function CardDetailed({ intro, title, description, tags,
|
|
146
|
+
declare function CardDetailed({ intro, title, description, tags, callToAction, callToActionSecondary, tagPrimary, image, imagePosition, className, }: CardDetailedProps): react_jsx_runtime.JSX.Element;
|
|
162
147
|
|
|
163
148
|
type CardMiniProps = {
|
|
164
149
|
/** Required: media element rendered as the card image thumbnail. */
|
|
@@ -184,8 +169,6 @@ type CardSimpleProps = {
|
|
|
184
169
|
url: string;
|
|
185
170
|
/** Optional: label rendered at the top of the card. Pass a Tag component. */
|
|
186
171
|
tag?: ReactNode;
|
|
187
|
-
/** Whether to render the gradient overlay on top of the media. */
|
|
188
|
-
showOverlay?: boolean;
|
|
189
172
|
/**
|
|
190
173
|
* `compact` reduces the title font size for half-height slots in a grid.
|
|
191
174
|
* Defaults to `default`.
|
|
@@ -195,7 +178,7 @@ type CardSimpleProps = {
|
|
|
195
178
|
titleAs?: "h2" | "h3" | "h4" | "h5" | "h6";
|
|
196
179
|
className?: string;
|
|
197
180
|
};
|
|
198
|
-
declare function CardSimple({ title, image, url, tag,
|
|
181
|
+
declare function CardSimple({ title, image, url, tag, size, titleAs, className, }: CardSimpleProps): react_jsx_runtime.JSX.Element;
|
|
199
182
|
|
|
200
183
|
type NavItem$1 = {
|
|
201
184
|
label: string;
|
|
@@ -211,7 +194,7 @@ type ContactItem = {
|
|
|
211
194
|
email: string;
|
|
212
195
|
};
|
|
213
196
|
type PortalDetails = {
|
|
214
|
-
logo?:
|
|
197
|
+
logo?: LogoMediaElement;
|
|
215
198
|
contacts?: ContactItem[];
|
|
216
199
|
tagline?: string | null;
|
|
217
200
|
title: string;
|
|
@@ -249,6 +232,47 @@ interface HeaderProps {
|
|
|
249
232
|
}
|
|
250
233
|
declare function Header(props: HeaderProps): react_jsx_runtime.JSX.Element;
|
|
251
234
|
|
|
235
|
+
declare const LINK_VARIANTS: readonly ["text", "button", "button-outline", "arrow"];
|
|
236
|
+
declare const LINK_SIZES: readonly ["md", "lg"];
|
|
237
|
+
type LinkVariant = (typeof LINK_VARIANTS)[number];
|
|
238
|
+
type LinkSize = (typeof LINK_SIZES)[number];
|
|
239
|
+
|
|
240
|
+
type LinkProps<T extends ElementType = "a"> = {
|
|
241
|
+
/**
|
|
242
|
+
* Optional visual treatment. Defaults to text.
|
|
243
|
+
*/
|
|
244
|
+
variant?: LinkVariant;
|
|
245
|
+
/**
|
|
246
|
+
* Optional size. Defaults to md.
|
|
247
|
+
*/
|
|
248
|
+
size?: LinkSize;
|
|
249
|
+
/**
|
|
250
|
+
* Optional parameter to define Link as external to site.
|
|
251
|
+
* Adds visual indication and native link properties target and rel.
|
|
252
|
+
*/
|
|
253
|
+
isExternal?: boolean;
|
|
254
|
+
/** The element or component to render as (e.g. "a", "button", RouterLink) */
|
|
255
|
+
as?: T;
|
|
256
|
+
children: Exclude<ReactNode, null | undefined>;
|
|
257
|
+
} & Omit<ComponentPropsWithRef<T>, "as">;
|
|
258
|
+
/**
|
|
259
|
+
* Polymorphic Link — renders as any element or component via the `as` prop.
|
|
260
|
+
*
|
|
261
|
+
* @example
|
|
262
|
+
* // Native anchor (default)
|
|
263
|
+
* <Link href="https://example.com">Visit</Link>
|
|
264
|
+
*
|
|
265
|
+
* // React Router / TanStack Router
|
|
266
|
+
* <Link as={RouterLink} to="/about">About</Link>
|
|
267
|
+
*
|
|
268
|
+
* // Next.js
|
|
269
|
+
* <Link as={NextLink} href="/dashboard">Dashboard</Link>
|
|
270
|
+
*
|
|
271
|
+
* // Button
|
|
272
|
+
* <Link as="button" onClick={handleClick}>Click me</Link>
|
|
273
|
+
*/
|
|
274
|
+
declare function Link<T extends ElementType = "a">({ variant, size, isExternal, className, as, children, ...rest }: LinkProps<T>): react_jsx_runtime.JSX.Element;
|
|
275
|
+
|
|
252
276
|
type TagProps = {
|
|
253
277
|
/**
|
|
254
278
|
* Visual treatment for the tag.
|
|
@@ -256,11 +280,19 @@ type TagProps = {
|
|
|
256
280
|
variant?: "solid" | "outline" | "text";
|
|
257
281
|
size?: "default" | "big";
|
|
258
282
|
/**
|
|
259
|
-
* Custom color used as the fill, outline, or text color depending on the chosen variant.
|
|
283
|
+
* Custom color used as the fill (solid variant), outline and text (outline variant), or text only (text variant) color depending on the chosen variant.
|
|
260
284
|
*/
|
|
261
285
|
color?: string;
|
|
262
286
|
/**
|
|
263
|
-
* Optional override for the tag
|
|
287
|
+
* Optional override for the tag border color independent of variant.
|
|
288
|
+
*/
|
|
289
|
+
borderColor?: string;
|
|
290
|
+
/**
|
|
291
|
+
* Optional override for the tag bg color independent of variant.
|
|
292
|
+
*/
|
|
293
|
+
bgColor?: string;
|
|
294
|
+
/**
|
|
295
|
+
* Optional override for the tag text color independent of variant.
|
|
264
296
|
*/
|
|
265
297
|
textColor?: string;
|
|
266
298
|
/**
|
|
@@ -279,36 +311,105 @@ type TagProps = {
|
|
|
279
311
|
* Public style contract: `.blocks-tag`, modifiers (`--solid`, `--outline`, `--text`, `--big`, `--icon`, `--x-close`),
|
|
280
312
|
* and elements (`__icon`, `__close-button`, `__close-icon`).
|
|
281
313
|
*/
|
|
282
|
-
declare function Tag({ variant, size, color, textColor, icon, onClose, children, className, }: TagProps): react_jsx_runtime.JSX.Element;
|
|
314
|
+
declare function Tag({ variant, size, color, bgColor, borderColor, textColor, icon, onClose, children, className, }: TagProps): react_jsx_runtime.JSX.Element;
|
|
283
315
|
|
|
284
|
-
|
|
316
|
+
interface GeoConfigProviderProps {
|
|
317
|
+
stacApiUrl?: string;
|
|
318
|
+
titilerBaseUrl?: string;
|
|
319
|
+
children: ReactNode;
|
|
320
|
+
}
|
|
321
|
+
declare function GeoConfigProvider({ stacApiUrl, titilerBaseUrl, children, }: GeoConfigProviderProps): react_jsx_runtime.JSX.Element;
|
|
322
|
+
|
|
323
|
+
/** Temporal filter for STAC queries. ISO 8601 date strings */
|
|
324
|
+
type DateRange = {
|
|
325
|
+
from: string;
|
|
326
|
+
to: string;
|
|
327
|
+
};
|
|
328
|
+
type TileMatrixSet = "WebMercatorQuad" | "GDALWebMercatorQuad" | "WorldCRS84Quad";
|
|
329
|
+
type StacRasterLayerConfig = {
|
|
330
|
+
type: "raster";
|
|
331
|
+
collectionId: string;
|
|
332
|
+
dateRange: DateRange;
|
|
333
|
+
tileMatrixSet?: TileMatrixSet;
|
|
334
|
+
};
|
|
335
|
+
interface GradientLegendProps {
|
|
336
|
+
type: "gradient";
|
|
337
|
+
colorStops: string[];
|
|
338
|
+
title?: string;
|
|
339
|
+
description?: string;
|
|
340
|
+
provider?: string;
|
|
341
|
+
spatialExtent?: string;
|
|
342
|
+
timeDensity?: string;
|
|
343
|
+
unit?: string;
|
|
344
|
+
min: number;
|
|
345
|
+
max: number;
|
|
346
|
+
}
|
|
347
|
+
type LegendProps = GradientLegendProps & {
|
|
348
|
+
initialExpanded?: boolean;
|
|
349
|
+
};
|
|
350
|
+
|
|
351
|
+
declare function Legend({ initialExpanded, ...props }: LegendProps): react_jsx_runtime.JSX.Element;
|
|
352
|
+
|
|
353
|
+
type StacCompareMapProps = {
|
|
354
|
+
/** MapLibre base map style URL or style object. */
|
|
355
|
+
baseMapStyle?: string | StyleSpecification;
|
|
356
|
+
/** Initial map center (longitude/latitude), zoom level, and optional bearing/pitch. MapLibre applies defaults for any properties not provided. */
|
|
357
|
+
initialViewState?: Partial<ViewState>;
|
|
358
|
+
/** Layer config for the left panel. */
|
|
359
|
+
leftLayerConfig: StacRasterLayerConfig;
|
|
360
|
+
/** Layer config for the right panel. */
|
|
361
|
+
rightLayerConfig: StacRasterLayerConfig;
|
|
362
|
+
/** Additional CSS class applied to the root container element. */
|
|
363
|
+
className?: string;
|
|
364
|
+
};
|
|
365
|
+
/**
|
|
366
|
+
* Smart swipe-slider map for comparing two STAC datasets side-by-side.
|
|
367
|
+
*
|
|
368
|
+
* When both panels show the same collection, a single legend appears on the right.
|
|
369
|
+
* When collections differ, each panel shows its own legend on its respective side.
|
|
370
|
+
*
|
|
371
|
+
* Requires a `StacApiProvider` ancestor. Uses flex layout to fill available space,
|
|
372
|
+
* so the parent must be a flex container with defined height.
|
|
373
|
+
*
|
|
374
|
+
* @example
|
|
375
|
+
* ```tsx
|
|
376
|
+
* <StacApiProvider apiUrl="https://stac.example.com">
|
|
377
|
+
* <div style={{ display: "flex", flexDirection: "column", height: "500px" }}>
|
|
378
|
+
* <StacCompareMap
|
|
379
|
+
* leftLayerConfig={{ type: "raster", collectionId: "my-collection", dateRange: { from: "2021-01-01", to: "2021-01-31" } }}
|
|
380
|
+
* rightLayerConfig={{ type: "raster", collectionId: "my-collection", dateRange: { from: "2021-06-01", to: "2021-06-30" } }}
|
|
381
|
+
* />
|
|
382
|
+
* </div>
|
|
383
|
+
* </StacApiProvider>
|
|
384
|
+
* ```
|
|
385
|
+
*/
|
|
386
|
+
declare function StacCompareMap({ baseMapStyle, initialViewState, leftLayerConfig, rightLayerConfig, className, }: StacCompareMapProps): react_jsx_runtime.JSX.Element;
|
|
387
|
+
|
|
388
|
+
type StacSingleLayerMapProps = {
|
|
285
389
|
/** MapLibre base map style URL or style object. Defaults to NASA Blue Marble imagery. */
|
|
286
390
|
baseMapStyle?: string | StyleSpecification;
|
|
287
391
|
/** Initial map center (longitude/latitude), zoom level, and optional bearing/pitch. MapLibre applies defaults for any properties not provided. */
|
|
288
392
|
initialViewState?: Partial<ViewState>;
|
|
289
|
-
/**
|
|
290
|
-
|
|
393
|
+
/** STAC collection and date range to fetch and display as a raster tile layer. */
|
|
394
|
+
layerConfig: StacRasterLayerConfig;
|
|
291
395
|
};
|
|
292
396
|
/**
|
|
293
|
-
*
|
|
397
|
+
* Smart map container that fetches STAC collection tiles and renders them with a legend overlay.
|
|
294
398
|
*
|
|
295
|
-
*
|
|
296
|
-
*
|
|
297
|
-
* component must be a flex container with defined height.
|
|
399
|
+
* Requires a `StacApiProvider` ancestor. Uses flex layout to fill available space,
|
|
400
|
+
* so the parent must be a flex container with defined height.
|
|
298
401
|
*
|
|
299
402
|
* @example
|
|
300
403
|
* ```tsx
|
|
301
|
-
* <
|
|
302
|
-
* <
|
|
303
|
-
*
|
|
304
|
-
*
|
|
305
|
-
*
|
|
306
|
-
*
|
|
307
|
-
*
|
|
308
|
-
* />
|
|
309
|
-
* </div>
|
|
404
|
+
* <StacApiProvider apiUrl="https://stac.example.com">
|
|
405
|
+
* <div style={{ display: "flex", flexDirection: "column", height: "500px" }}>
|
|
406
|
+
* <StacSingleLayerMap
|
|
407
|
+
* layerConfig={{ type: "raster", collectionId: "my-collection", dateRange: { from: "2021-01-01", to: "2021-01-31" } }}
|
|
408
|
+
* />
|
|
409
|
+
* </div>
|
|
410
|
+
* </StacApiProvider>
|
|
310
411
|
* ```
|
|
311
412
|
*/
|
|
312
|
-
declare
|
|
413
|
+
declare function StacSingleLayerMap({ baseMapStyle, initialViewState, layerConfig, }: StacSingleLayerMapProps): react_jsx_runtime.JSX.Element;
|
|
313
414
|
|
|
314
|
-
export { Banner, type BannerProps,
|
|
415
|
+
export { Banner, type BannerProps, Card, CardCTA, type CardCTAProps, CardDetailed, type CardDetailedProps, CardMini, type CardMiniProps, type CardProps, CardSimple, type CardSimpleProps, Footer, type FooterProps, GeoConfigProvider, type GeoConfigProviderProps, Header, type HeaderProps, Legend, type LegendProps, Link, type LinkProps, StacCompareMap, type StacCompareMapProps, StacSingleLayerMap, type StacSingleLayerMapProps, Tag, type TagProps };
|