@nypl/design-system-react-components 3.3.0 → 3.3.1
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,5 +1,5 @@
|
|
|
1
|
-
import { ChakraComponent } from "@chakra-ui/react";
|
|
2
1
|
import React from "react";
|
|
2
|
+
import { ChakraComponent } from "@chakra-ui/react";
|
|
3
3
|
import { LayoutTypes } from "../../helpers/types";
|
|
4
4
|
import { ComponentImageProps } from "../Image/Image";
|
|
5
5
|
interface CardBaseProps {
|
|
@@ -4,9 +4,9 @@ import { DimensionTypes } from "../../helpers/types";
|
|
|
4
4
|
export declare const imageRatiosArray: readonly ["fourByThree", "oneByTwo", "original", "sixteenByNine", "square", "threeByFour", "threeByTwo", "twoByOne"];
|
|
5
5
|
export declare const imageSizesArray: readonly ["default", "xxxsmall", "xxsmall", "xsmall", "small", "medium", "large"];
|
|
6
6
|
export declare const imageTypesArray: readonly ["default", "circle"];
|
|
7
|
-
export type ImageRatios = typeof imageRatiosArray[number];
|
|
8
|
-
export type ImageSizes = typeof imageSizesArray[number];
|
|
9
|
-
export type ImageTypes = typeof imageTypesArray[number];
|
|
7
|
+
export type ImageRatios = (typeof imageRatiosArray)[number];
|
|
8
|
+
export type ImageSizes = (typeof imageSizesArray)[number];
|
|
9
|
+
export type ImageTypes = (typeof imageTypesArray)[number];
|
|
10
10
|
export interface ComponentImageProps extends Partial<HTMLImageElement> {
|
|
11
11
|
/** String value used to populate the `alt` attribute of the internal `Image`
|
|
12
12
|
* component's `img` element. @NOTE if an image is used, this value must be passed. */
|
|
@@ -22,6 +22,8 @@ export interface ComponentImageProps extends Partial<HTMLImageElement> {
|
|
|
22
22
|
credit?: string;
|
|
23
23
|
/** Fallback image path or URL. */
|
|
24
24
|
fallbackSrc?: string;
|
|
25
|
+
/** ID that other components can cross reference for accessibility purposes. */
|
|
26
|
+
id?: string;
|
|
25
27
|
/** Flag to set the internal `Image` component to `isLazy` mode. */
|
|
26
28
|
isLazy?: boolean;
|
|
27
29
|
/** Additional action to perform in the `img`'s `onerror` attribute function. */
|
|
@@ -40,6 +42,8 @@ interface ImageWrapperProps {
|
|
|
40
42
|
};
|
|
41
43
|
/** ClassName you can add in addition to 'image' */
|
|
42
44
|
className?: string;
|
|
45
|
+
/** ID that other components can cross reference for accessibility purposes. */
|
|
46
|
+
id?: string;
|
|
43
47
|
/** Optional value to control the aspect ratio of the card image; default
|
|
44
48
|
* value is `"original"` */
|
|
45
49
|
ratio?: ImageRatios;
|
|
@@ -13,6 +13,10 @@ export interface TooltipProps {
|
|
|
13
13
|
isDisabled?: boolean;
|
|
14
14
|
/** Wraps the children of the tooltip in `ComponentWrapper` with `tabIndex=0` when true. */
|
|
15
15
|
shouldWrapChildren?: boolean;
|
|
16
|
+
/** The placement of the tooltip relative to its children. */
|
|
17
|
+
placement?: "top" | "left" | "bottom" | "right" | "auto";
|
|
18
|
+
/** The main and cross-axis offset to displace the tooltip from its reference element. */
|
|
19
|
+
offset?: [number, number];
|
|
16
20
|
}
|
|
17
21
|
export declare const Tooltip: ChakraComponent<React.ForwardRefExoticComponent<React.PropsWithChildren<TooltipProps> & React.RefAttributes<HTMLDivElement>>, React.PropsWithChildren<TooltipProps>>;
|
|
18
22
|
export default Tooltip;
|