@workday/canvas-kit-react
Version:
The parent module that contains all Workday Canvas Kit React components
57 lines • 2.41 kB
TypeScript
import { HTMLAttributes } from 'react';
import { CanvasExpressiveIcon } from '@workday/canvas-expressive-icons-web';
import { CSProps } from '@workday/canvas-kit-styling';
import { CanvasIconTypes, CanvasSystemIcon } from '@workday/canvas-system-icons-web';
import { CanvasIcon as LegacyCanvasIcon, CanvasIconTypes as LegacyIconTypes } from '@workday/design-assets-types';
export interface SvgProps extends CSProps, HTMLAttributes<HTMLSpanElement> {
src: CanvasSystemIcon | CanvasExpressiveIcon | LegacyCanvasIcon;
type: CanvasIconTypes | LegacyIconTypes;
/**
* If set to `true`, transform the SVG's x-axis to mirror the graphic. Use this if you want to
* always mirror the icon regardless of the content direction. If the SVG should mirror only when
* in an right-to-left language, use `shouldMirrorInRTL` instead.
* @default false
*/
shouldMirror?: boolean;
/**
* If set to `true`, transform the SVG's x-axis to mirror the graphic when the content direction
* is `rtl`. Icons don't have enough context to know if they should be mirrored in all cases.
* Setting this to `true` indicates the icon should be mirrored in right-to-left languages.
* @default false
*/
shouldMirrorInRTL?: boolean;
}
export declare const svgStencil: import("@workday/canvas-kit-styling").Stencil<{
shouldMirror: {
true: {
transform: string;
};
};
shouldMirrorInRTL: {
true: {
'&:dir(rtl)': {
transform: string;
};
};
};
}, {}, {
/** sets width of svg element
* @deprecated use size instead or svg selector
*/
width: string;
/** sets height of svg element
* @deprecated use size instead or svg selector
*/
height: string;
/** sets width and height of svg element */
size: string;
}, never, never>;
/**
* Resolves the size of the SVG based on the size token or string / numeric (px) value.
* @param size - The size variant or string / numeric (px) value.
* @param tokens - The tokens to use to resolve the size.
* @returns The resolved size.
*/
export declare const resolveSize: <T extends string>(size: string | number | T | undefined, tokens: Record<T, string>) => string;
export declare const Svg: import("@workday/canvas-kit-react/common").ElementComponent<"span", SvgProps>;
//# sourceMappingURL=Svg.d.ts.map