Skip to content

Commit

Permalink
[chore] Exporting missing types for PlaybackControls (#2650)
Browse files Browse the repository at this point in the history
Signed-off-by: Ihor Dykhta <dikhta.igor@gmail.com>
  • Loading branch information
igorDykhta authored Sep 12, 2024
1 parent edd1fd9 commit e7deb4c
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const DEFAULT_ANIMATE_ITEMS = {
tooltip: 'tooltip.animationByIncremental'
}
};
interface PlaybackControlsProps {
export interface PlaybackControlsProps {
isAnimatable?: boolean;
isAnimating?: boolean;
width?: number;
Expand Down
1 change: 1 addition & 0 deletions src/components/src/common/icon-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import {MouseEvent, ReactNode} from 'react';
import styled from 'styled-components';
import {Button, ButtonProps} from './styled-components';

interface IconButtonProps extends ButtonProps {
collapsed?: boolean;
theme?: object;
Expand Down
10 changes: 7 additions & 3 deletions src/components/src/common/styled-components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ import styled from 'styled-components';
import DatePicker from 'react-date-picker';
import TimePicker from 'react-time-picker';
import ReactTooltip from 'react-tooltip';
import {media} from '@kepler.gl/styles';
import classnames from 'classnames';

import {media} from '@kepler.gl/styles';
import {RGBColor} from '@kepler.gl/types';

export const SelectText = styled.span`
Expand Down Expand Up @@ -185,7 +186,10 @@ export const Tooltip = styled(ReactTooltip)`
}
`;

export interface ButtonProps {
export type ButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {
className?: string;
ref?: React.ForwardedRef<HTMLElement>;
children?: React.ReactNode;
negative?: boolean;
secondary?: boolean;
link?: boolean;
Expand All @@ -196,7 +200,7 @@ export interface ButtonProps {
disabled?: boolean;
width?: string;
inactive?: boolean;
}
};

// this needs to be an actual button to be able to set disabled attribute correctly
export const Button = styled.button.attrs(props => ({
Expand Down
7 changes: 2 additions & 5 deletions src/components/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -297,11 +297,7 @@ export {default as EffectTimeConfiguratorFactory} from './effects/effect-time-co

export {default as HowToButton} from './side-panel/layer-panel/how-to-button';
// eslint-disable-next-line prettier/prettier
export type {
ButtonProps,
StyledPanelHeaderProps,
StyledExportSectionProps
} from './common';
export type {ButtonProps, StyledPanelHeaderProps, StyledExportSectionProps} from './common';

export type {CollapseButtonProps} from './side-panel/side-bar';
export type {PanelTabProps} from './side-panel/panel-tab';
Expand All @@ -324,6 +320,7 @@ export type {
OptionDropdownProps,
FormatterDropdownProps
} from './common/data-table/option-dropdown';
export type {PlaybackControlsProps} from './common/animation-control/playback-controls';
export type {LayerListProps, LayerListFactoryDeps} from './side-panel/layer-panel/layer-list';
export type {MapContainerProps} from './map-container';
export type {MapControlProps} from './map/map-control';
Expand Down
4 changes: 2 additions & 2 deletions src/components/src/side-panel/layer-panel/custom-palette.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
// Copyright contributors to the kepler.gl project

import React, {Component, createRef, MouseEventHandler, MouseEvent, PropsWithChildren} from 'react';
import React, {Component, createRef, MouseEventHandler, PropsWithChildren} from 'react';
import classnames from 'classnames';
import styled, {css} from 'styled-components';
import {
Expand All @@ -27,7 +27,7 @@ type CustomPaletteProps = {
setCustomPalette: (c: NestedPartial<ColorRange>) => void;
onCancel: () => void;
onToggleSketcher: (i: boolean | number) => void;
onApply: (p: ColorRange, e: MouseEvent) => void;
onApply: (p: ColorRange, e: React.MouseEvent) => void;
};

const dragHandleActive = css`
Expand Down

0 comments on commit e7deb4c

Please sign in to comment.