Skip to content

Commit

Permalink
fix(StepIndicator): fix TypeScript spacing types
Browse files Browse the repository at this point in the history
  • Loading branch information
tujoworker committed Feb 27, 2023
1 parent 8c532bf commit 89dd4b6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 55 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as React from 'react';
import { SpacingProps } from '../../shared/types';
import StepIndicatorSidebar from './StepIndicatorSidebar';
export type StepIndicatorMode = 'static' | 'strict' | 'loose';
export type StepIndicatorData =
Expand All @@ -25,43 +26,16 @@ export type StepIndicatorCurrentStep = string | number;
export type StepIndicatorHideNumbers = string | boolean;
export type StepIndicatorNoAnimation = string | boolean;
export type StepIndicatorSkeleton = string | boolean;
export type StepIndicatorSpace =
| string
| number
| boolean
| {
/**
* Use spacing values like: `small`, `1rem`, `1` or , `16px`. Will use `margin-top`.
*/
top?: string | number | boolean;

/**
* Use spacing values like: `small`, `1rem`, `1` or , `16px`. will use `margin-right`.
*/
right?: string | number | boolean;

/**
* Use spacing values like: `small`, `1rem`, `1` or , `16px`. will use `margin-bottom`.
*/
bottom?: string | number | boolean;

/**
* Use spacing values like: `small`, `1rem`, `1` or , `16px`. will use `margin-left`.
*/
left?: string | number | boolean;
};
export type StepIndicatorTop = string | number | boolean;
export type StepIndicatorRight = string | number | boolean;
export type StepIndicatorBottom = string | number | boolean;
export type StepIndicatorLeft = string | number | boolean;
export type StepIndicatorChildren =
| React.ReactNode
| ((...args: any[]) => any);
/**
* NB: Do not change the docs (comments) in here. The docs are updated during build time by "generateTypes.js" and "fetchPropertiesFromDocs.js".
*/

export interface StepIndicatorProps extends React.HTMLProps<HTMLElement> {
export interface StepIndicatorProps
extends React.HTMLProps<HTMLElement>,
SpacingProps {
/**
* <em>(required)</em> a unique string-based ID in order to bind together the main component and the sidebar (`<StepIndicator.Sidebar />`). Both have to get the same ID.
*/
Expand Down Expand Up @@ -113,30 +87,6 @@ export interface StepIndicatorProps extends React.HTMLProps<HTMLElement> {
no_animation?: StepIndicatorNoAnimation;
skeleton?: StepIndicatorSkeleton;

/**
* Has to be an object with either: `top`, `right`, `bottom` or `left`. Use spacing values like: `small`, `1rem`, `1` or , `16px`.
*/
space?: StepIndicatorSpace;

/**
* Use spacing values like: `small`, `1rem`, `1` or , `16px`. Will use `margin-top`.
*/
top?: StepIndicatorTop;

/**
* Use spacing values like: `small`, `1rem`, `1` or , `16px`. will use `margin-right`.
*/
right?: StepIndicatorRight;

/**
* Use spacing values like: `small`, `1rem`, `1` or , `16px`. will use `margin-bottom`.
*/
bottom?: StepIndicatorBottom;

/**
* Use spacing values like: `small`, `1rem`, `1` or , `16px`. will use `margin-left`.
*/
left?: StepIndicatorLeft;
class?: string;
className?: string;
children?: StepIndicatorChildren;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as React from 'react';
import { SpacingProps } from '../../shared/types';
export type StepIndicatorSidebarMode = 'static' | 'strict' | 'loose';
export type StepIndicatorSidebarCurrentStep = string | number;
export type StepIndicatorSidebarData =
Expand All @@ -23,7 +24,8 @@ export type StepIndicatorSidebarData =
*/

export interface StepIndicatorSidebarProps
extends React.HTMLProps<HTMLElement> {
extends React.HTMLProps<HTMLElement>,
SpacingProps {
/**
* <em>(required)</em> a unique string-based ID in order to bind together the main component and the sidebar (`<StepIndicator.Sidebar />`). Both have to get the same ID.
*/
Expand Down

0 comments on commit 89dd4b6

Please sign in to comment.