Skip to content

Commit

Permalink
types
Browse files Browse the repository at this point in the history
  • Loading branch information
jgdevelopment committed Jun 12, 2023
1 parent f1cb661 commit fd90e2e
Show file tree
Hide file tree
Showing 126 changed files with 436 additions and 316 deletions.
2 changes: 1 addition & 1 deletion build.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const esbuildConf = (format) => ({
'src/components/Button/index.ts',
'src/components/Icons/index.ts',
'src/components/CodeInput/index.ts',
'src/components/CustomCircularProgress/index.ts'
'src/components/CircularProgress/index.ts'
],
splitting: format === 'esm',
bundle: true,
Expand Down
1 change: 1 addition & 0 deletions built/src/components/Avatar/Avatar.types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ interface BaseAvatarProps {
onClick?: (e: React.MouseEvent) => void;
}
export type AvatarProps = RequireOnlyOne<BaseAvatarProps, 'label' | 'icon'>;
export type AvatarComponent = React.ReactElement<AvatarProps>;
export type SizeStyles = {
avatarSize: number;
borderRadius: number;
Expand Down
2 changes: 1 addition & 1 deletion built/src/components/Avatar/Avatar.types.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 0 additions & 11 deletions built/src/components/Avatar/Avatar.utils.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import { ThemeMode } from '../../types';
import { Color } from '../../utils/colorUtils';
import { Icon } from '../Icons';
import { TypographyProps } from '../Typography';
/**
* Takes a potentially undefined label and icon
* Returns an object that can be spread into avatar as a prop (prioritizing icon)
Expand All @@ -15,14 +12,6 @@ export declare const getAvatarIconOrLabel: (label: string | undefined, icon: Ico
label: string;
icon?: undefined;
};
/**
* Returns the main avatar color and the background color
* @param {Color | undefined} color
* @param {boolean | undefined} disabled
* @param {string | undefined} label
* @param {ThemeMode | undefined} forceTheme
*/
export declare const getAvatarColors: (color?: Color, disabled?: boolean, label?: string, forceTheme?: ThemeMode) => [TypographyProps['color'], string];
/**
* Strips emojis from a string by removing all non-ASCII characters
* @param {string} str - Text with emojis
Expand Down
2 changes: 1 addition & 1 deletion built/src/components/Avatar/Avatar.utils.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion built/src/components/Avatar/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export { default } from './Avatar';
export { AvatarProps } from './Avatar.types';
export { AvatarComponent, AvatarProps } from './Avatar.types';
export { getAvatarIconOrLabel } from './Avatar.utils';
//# sourceMappingURL=index.d.ts.map
2 changes: 1 addition & 1 deletion built/src/components/Avatar/index.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions built/src/components/Banner/Banner.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { BannerProps } from "./Banner.types";
export default function Banner({ label, color, ctas, icon, forceTheme, onClose, }: BannerProps): JSX.Element;
import { BannerProps } from './Banner.types';
export default function Banner({ label, color, ctas, icon, forceTheme, onClose }: BannerProps): JSX.Element;
//# sourceMappingURL=Banner.d.ts.map
2 changes: 1 addition & 1 deletion built/src/components/Banner/Banner.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 0 additions & 30 deletions built/src/components/Button/IconButton/IconButton.constants.d.ts
Original file line number Diff line number Diff line change
@@ -1,33 +1,3 @@
/// <reference types="react" />
import { HTMLMotionProps } from 'framer-motion';
import { ThemeMode, Type } from '../../../types';
import { IconColor, IconProps } from '../../Icons';
import { TooltipLabelProps } from '../../Tooltip';
import { ButtonSize } from '../Button.constants';
export type IconButtonType = Type;
export interface IconButtonProps {
/** Icon name */
icon: IconProps['icon'];
/** On button click */
onClick: (e: React.MouseEvent) => void | Promise<void>;
active?: boolean;
animationProps?: HTMLMotionProps<'div'>;
/** Overrides default icon color */
iconColor?: IconColor;
/** Indicator for e2e tests */
dataTest?: string;
/** Disable button */
disabled?: boolean;
filled?: boolean;
floatRight?: boolean;
forceTheme?: ThemeMode;
fullHeight?: boolean;
id?: string;
/** Icon button size */
size?: ButtonSize;
tooltip?: TooltipLabelProps | string;
type?: IconButtonType;
}
export declare const BUTTON_SIZE_BORDER_RADIUS: {
small: number;
medium: number;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion built/src/components/Button/IconButton/IconButton.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import { IconButtonProps } from './IconButton.constants';
import { IconButtonProps } from './IconButton.types';
declare const _default: React.ForwardRefExoticComponent<IconButtonProps & React.RefAttributes<HTMLDivElement | null>>;
export default _default;
//# sourceMappingURL=IconButton.d.ts.map
2 changes: 1 addition & 1 deletion built/src/components/Button/IconButton/IconButton.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 15 additions & 2 deletions built/src/components/Button/IconButton/IconButton.styles.d.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,22 @@
import { ThemeMode } from '../../../types';
import { IconButtonType } from './IconButton.constants';
import { FilledVariant, ThemeMode, Type } from '../../../types';
import { IconButtonType } from './IconButton.types';
export declare const GHOST_ICON_BUTTON_CSS: ({ $type, $forceTheme }: {
$type: IconButtonType;
$forceTheme?: ThemeMode | undefined;
}) => import("styled-components").FlattenInterpolation<import("styled-components").ThemedStyledProps<{
$forceTheme?: ThemeMode | undefined;
}, any>>;
export declare const ICON_BUTTON_VARIANT_CSS: ({ $variant }: {
$variant: FilledVariant;
}) => (({ $type }: {
$type: Type;
$forceTheme?: ThemeMode | undefined;
}) => ({ $forceTheme }: {
$forceTheme?: ThemeMode | undefined;
}) => import("styled-components").FlattenSimpleInterpolation) | (({ $type, $forceTheme }: {
$type: IconButtonType;
$forceTheme?: ThemeMode | undefined;
}) => import("styled-components").FlattenInterpolation<import("styled-components").ThemedStyledProps<{
$forceTheme?: ThemeMode | undefined;
}, any>>);
//# sourceMappingURL=IconButton.styles.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 33 additions & 0 deletions built/src/components/Button/IconButton/IconButton.types.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/// <reference types="react" />
import { HTMLMotionProps } from 'framer-motion';
import { FilledVariant, ThemeMode, Type } from '../../../types';
import { Icon } from '../../Icons';
import { IconComponent } from '../../IconText';
import { TooltipLabelProps } from '../../Tooltip';
import { ButtonSize } from '../Button.constants';
export type IconButtonType = Type;
export interface IconButtonProps {
icon: Icon | IconComponent;
/** On button click */
onClick: (e: React.MouseEvent) => void | Promise<void>;
animationProps?: HTMLMotionProps<'div'>;
/** For styled components */
className?: string;
/** Indicator for e2e tests */
dataTest?: string;
/** Disable button */
disabled?: boolean;
/** IconButton theme */
forceTheme?: ThemeMode;
id?: string;
/** Icon button size */
size?: ButtonSize;
/** For customization */
style?: React.CSSProperties;
/** IconButton tooltip text */
tooltip?: TooltipLabelProps | string;
type?: IconButtonType;
/** Filled or unfilled */
variant?: FilledVariant;
}
//# sourceMappingURL=IconButton.types.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 2 additions & 36 deletions built/src/components/Button/TextButton/TextButton.constants.d.ts
Original file line number Diff line number Diff line change
@@ -1,42 +1,8 @@
/// <reference types="react" />
import { ThemeMode, Type } from '../../../types';
import { IconProps } from '../../Icons';
import { TypographySize } from '../../Typography';
import { ButtonSize } from '../Button.constants';
type SizeStyles = {
horizontalPadding: number;
gap: number;
};
export interface ButtonProps {
/** Button text */
children: string;
active?: boolean;
/** Indicator for e2e tests */
dataTest?: string;
/** Disable button */
disabled?: boolean;
/** Float button to the right of the container */
floatRight?: boolean;
forceTheme?: ThemeMode;
fullWidth?: boolean;
iconColor?: IconProps['color'];
id?: string;
loading?: boolean;
/** The size for the button */
size?: ButtonSize;
/** Button icon component */
startIcon?: IconProps['icon'] | JSX.Element;
tooltip?: string;
/** The type for the button */
type?: Type;
/** Gets called when the user clicks on the button */
onClick: (e: React.MouseEvent) => void | Promise<void>;
/** Compact styling */
compact?: boolean;
}
import { TextButtonSizeStyles } from './TextButton.types';
/** Maps button size to typography size */
export declare const TYPOGRAPHY_SIZE: Record<ButtonSize, TypographySize>;
/** Maps button size to size-specific styles -- padding and gap */
export declare const SIZE_STYLES: Record<ButtonSize, SizeStyles>;
export {};
export declare const SIZE_STYLES: Record<ButtonSize, TextButtonSizeStyles>;
//# sourceMappingURL=TextButton.constants.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion built/src/components/Button/TextButton/TextButton.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import { ButtonProps } from './TextButton.constants';
import { ButtonProps } from './TextButton.types';
declare const _default: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLDivElement>>;
export default _default;
//# sourceMappingURL=TextButton.d.ts.map
2 changes: 1 addition & 1 deletion built/src/components/Button/TextButton/TextButton.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit fd90e2e

Please sign in to comment.