Skip to content

Commit

Permalink
Merge branch 'master' into improve-chart
Browse files Browse the repository at this point in the history
  • Loading branch information
TahimiLeonBravo committed Feb 2, 2021
2 parents f939cd5 + 36e84e6 commit 17c60ff
Show file tree
Hide file tree
Showing 10 changed files with 66 additions and 115 deletions.
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: nexxtway
12 changes: 6 additions & 6 deletions src/components/Button/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ export interface ButtonProps extends BaseProps {
type?: ButtonType;
disabled?: boolean;
tabIndex?: number | string;
onClick?: (event: MouseEvent<HTMLElement>) => void;
onKeyDown?: (event: KeyboardEvent<HTMLElement>) => void;
onFocus?: (event: FocusEvent<HTMLElement>) => void;
onBlur?: (event: FocusEvent<HTMLElement>) => void;
onMouseEnter?: (event: MouseEvent<HTMLElement>) => void;
onMouseLeave?: (event: MouseEvent<HTMLElement>) => void;
onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
onKeyDown?: (event: KeyboardEvent<HTMLButtonElement>) => void;
onFocus?: (event: FocusEvent<HTMLButtonElement>) => void;
onBlur?: (event: FocusEvent<HTMLButtonElement>) => void;
onMouseEnter?: (event: MouseEvent<HTMLButtonElement>) => void;
onMouseLeave?: (event: MouseEvent<HTMLButtonElement>) => void;
ariaHaspopup?: boolean;
ariaControls?: string;
ariaExpanded?: boolean;
Expand Down
14 changes: 7 additions & 7 deletions src/components/ButtonIcon/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ export interface ButtonIconProps extends BaseProps {
disabled?: boolean;
tabIndex?: number | string;
tooltip?: ReactNode;
onClick?: (event: MouseEvent<HTMLElement>) => void;
onMouseDown?: (event: MouseEvent<HTMLElement>) => void;
onMouseEnter?: (event: MouseEvent<HTMLElement>) => void;
onMouseLeave?: (event: MouseEvent<HTMLElement>) => void;
onKeyDown?: (event: KeyboardEvent<HTMLElement>) => void;
onFocus?: (event: FocusEvent<HTMLElement>) => void;
onBlur?: (event: FocusEvent<HTMLElement>) => void;
onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
onMouseDown?: (event: MouseEvent<HTMLButtonElement>) => void;
onMouseEnter?: (event: MouseEvent<HTMLButtonElement>) => void;
onMouseLeave?: (event: MouseEvent<HTMLButtonElement>) => void;
onKeyDown?: (event: KeyboardEvent<HTMLButtonElement>) => void;
onFocus?: (event: FocusEvent<HTMLButtonElement>) => void;
onBlur?: (event: FocusEvent<HTMLButtonElement>) => void;
assistiveText?: string;
ariaControls?: string;
ariaExpanded?: boolean;
Expand Down
4 changes: 2 additions & 2 deletions src/components/ButtonIcon/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import InternalTooltip from '../InternalTooltip';
import useDefaultTooltipConnector from '../InternalTooltip/hooks/useDefaultTooltipConnector';

/**
* Buttons Icons provide the user with visual iconography that
* ButtonIcons provide the user with a visual iconography that
* is typically used to invoke an event or action.
*/
const ButtonIcon = React.forwardRef((props, ref) => {
Expand Down Expand Up @@ -173,7 +173,7 @@ ButtonIcon.propTypes = {
disabled: PropTypes.bool,
/** Specifies the tab order of an element (when the tab button is used for navigating). */
tabIndex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
/** Text to show when pointer is over the button */
/** Text to show when pointer is over the button. */
tooltip: PropTypes.node,
/** The action that will be run when the button is clicked. */
onClick: PropTypes.func,
Expand Down
122 changes: 36 additions & 86 deletions src/components/ButtonIcon/readme.md
Original file line number Diff line number Diff line change
@@ -1,121 +1,85 @@
##### button icon base
# ButtonIcons variants
##### ButtonIcons change color according to the variant provided. In the examples below, you can find all the variants that we offer you.

```js
import React from 'react';
import { ButtonIcon } from 'react-rainbow-components';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faStar } from '@fortawesome/free-regular-svg-icons';
import { faSlidersH, faSignal, faRedo, faTimes } from '@fortawesome/free-solid-svg-icons';

<div className="rainbow-p-vertical_large rainbow-p-left_x-large rainbow-flex rainbow-align_center">
<div className="rainbow-p-right_large">
<ButtonIcon size="large" icon={<FontAwesomeIcon icon={faStar} />} />
<ButtonIcon variant="base" icon={<FontAwesomeIcon icon={faStar} />} />
</div>
<div className="rainbow-p-right_large">
<ButtonIcon size="medium" icon={<FontAwesomeIcon icon={faSlidersH} />} />
<ButtonIcon variant="outline-brand" icon={<FontAwesomeIcon icon={faStar} />} />
</div>
<div className="rainbow-p-right_large">
<ButtonIcon size="small" icon={<FontAwesomeIcon icon={faSignal} />} />
<ButtonIcon variant="border" icon={<FontAwesomeIcon icon={faStar} />} />
</div>
<div className="rainbow-p-right_large">
<ButtonIcon size="x-small" icon={<FontAwesomeIcon icon={faRedo} />} />
</div>
<ButtonIcon size="xx-small" icon={<FontAwesomeIcon icon={faTimes} />} />
</div>
```

##### button icon border

```js
import React from 'react';
import { ButtonIcon } from 'react-rainbow-components';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faStar } from '@fortawesome/free-regular-svg-icons';
import {
faTrashAlt,
faPencilAlt,
faLocationArrow,
faArrowDown,
} from '@fortawesome/free-solid-svg-icons';

<div className="rainbow-p-vertical_large rainbow-p-left_x-large rainbow-flex rainbow-align_center">
<div className="rainbow-p-right_large">
<ButtonIcon variant="border" size="large" icon={<FontAwesomeIcon icon={faStar} />} />
<ButtonIcon variant="neutral" icon={<FontAwesomeIcon icon={faStar} />} />
</div>
<div className="rainbow-p-right_large">
<ButtonIcon
variant="border"
size="medium"
icon={<FontAwesomeIcon icon={faLocationArrow} />}
/>
<ButtonIcon variant="border-filled" icon={<FontAwesomeIcon icon={faStar} />} />
</div>
<div className="rainbow-p-right_large">
<ButtonIcon variant="border" size="small" icon={<FontAwesomeIcon icon={faPencilAlt} />} />
<ButtonIcon variant="brand" icon={<FontAwesomeIcon icon={faStar} />} />
</div>
<div className="rainbow-p-right_large">
<ButtonIcon variant="border" size="x-small" icon={<FontAwesomeIcon icon={faTrashAlt} />} />
<ButtonIcon variant="success" icon={<FontAwesomeIcon icon={faStar} />} />
</div>
<ButtonIcon variant="border" size="xx-small" icon={<FontAwesomeIcon icon={faArrowDown} />} />
<ButtonIcon variant="destructive" icon={<FontAwesomeIcon icon={faStar} />} />
</div>
```

##### button icon outline-brand
# ButtonIcons with shaded variant
##### The appearance of a ButtonIcon can be changed by implementing the shaded variant, so the whole section will appear with a shadow around it.

```js
import React from 'react';
import { ButtonIcon } from 'react-rainbow-components';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faStar } from '@fortawesome/free-regular-svg-icons';
import {
faTrashAlt,
faPencilAlt,
faLocationArrow,
faArrowDown,
} from '@fortawesome/free-solid-svg-icons';

<div className="rainbow-p-vertical_large rainbow-p-left_x-large rainbow-flex rainbow-align_center">
<div className="rainbow-p-right_large">
<ButtonIcon variant="outline-brand" size="large" icon={<FontAwesomeIcon icon={faStar} />} />
<ButtonIcon shaded variant="border-filled" icon={<FontAwesomeIcon icon={faStar} />} />
</div>
<div className="rainbow-p-right_large">
<ButtonIcon variant="outline-brand" size="medium" icon={<FontAwesomeIcon icon={faLocationArrow} />}/>
<ButtonIcon shaded variant="neutral" icon={<FontAwesomeIcon icon={faStar} />} />
</div>
<div className="rainbow-p-right_large">
<ButtonIcon variant="outline-brand" size="small" icon={<FontAwesomeIcon icon={faPencilAlt} />} />
<ButtonIcon shaded variant="brand" icon={<FontAwesomeIcon icon={faStar} />} />
</div>
<div className="rainbow-p-right_large">
<ButtonIcon variant="outline-brand" size="x-small" icon={<FontAwesomeIcon icon={faTrashAlt} />} />
<ButtonIcon shaded variant="success" icon={<FontAwesomeIcon icon={faStar} />} />
</div>
<div className="rainbow-p-right_large">
<ButtonIcon shaded variant="destructive" icon={<FontAwesomeIcon icon={faStar} />} />
</div>
<ButtonIcon variant="outline-brand" size="xx-small" icon={<FontAwesomeIcon icon={faArrowDown} />} />
</div>
```

##### button icon filled
# ButtonIcons inverse
##### If you want to use a ButtonIcon on a dark background, we suggest you implement the inverse variant.

```js
import React from 'react';
import { ButtonIcon } from 'react-rainbow-components';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faStar } from '@fortawesome/free-regular-svg-icons';

<div className="rainbow-p-vertical_large rainbow-p-left_x-large rainbow-flex rainbow-align_center">
<div className="rainbow-p-right_large">
<ButtonIcon variant="border-filled" icon={<FontAwesomeIcon icon={faStar} />} />
</div>
<div className="rainbow-p-right_large">
<ButtonIcon variant="brand" icon={<FontAwesomeIcon icon={faStar} />} />
</div>
<div className="rainbow-p-right_large">
<ButtonIcon variant="success" icon={<FontAwesomeIcon icon={faStar} />} />
</div>
<InverseContainer className="rainbow-p-vertical_large rainbow-p-left_x-large rainbow-flex rainbow-align_center">
<div className="rainbow-p-right_large">
<ButtonIcon variant="destructive" icon={<FontAwesomeIcon icon={faStar} />} />
<ButtonIcon variant="border-inverse" icon={<FontAwesomeIcon icon={faStar} />} />
</div>
<ButtonIcon variant="neutral" icon={<FontAwesomeIcon icon={faStar} />} />
</div>
<ButtonIcon variant="inverse" icon={<FontAwesomeIcon icon={faStar} />} />
</InverseContainer>
```

##### button icon shaded
# ButtonIcons of different sizes
##### If you need to resize your ButtonIcon, you can do so using the `size` prop.

```js
import React from 'react';
Expand All @@ -125,24 +89,25 @@ import { faStar } from '@fortawesome/free-regular-svg-icons';

<div className="rainbow-p-vertical_large rainbow-p-left_x-large rainbow-flex rainbow-align_center">
<div className="rainbow-p-right_large">
<ButtonIcon shaded variant="border-filled" icon={<FontAwesomeIcon icon={faStar} />} />
<ButtonIcon variant="border" size="large" icon={<FontAwesomeIcon icon={faStar} />} />
</div>
<div className="rainbow-p-right_large">
<ButtonIcon shaded variant="neutral" icon={<FontAwesomeIcon icon={faStar} />} />
<ButtonIcon variant="border" size="medium" icon={<FontAwesomeIcon icon={faStar} />} />
</div>
<div className="rainbow-p-right_large">
<ButtonIcon shaded variant="brand" icon={<FontAwesomeIcon icon={faStar} />} />
<ButtonIcon variant="border" size="small" icon={<FontAwesomeIcon icon={faStar} />} />
</div>
<div className="rainbow-p-right_large">
<ButtonIcon shaded variant="success" icon={<FontAwesomeIcon icon={faStar} />} />
<ButtonIcon variant="border" size="x-small" icon={<FontAwesomeIcon icon={faStar} />} />
</div>
<div className="rainbow-p-right_large">
<ButtonIcon shaded variant="destructive" icon={<FontAwesomeIcon icon={faStar} />} />
<ButtonIcon variant="border" size="xx-small" icon={<FontAwesomeIcon icon={faStar} />} />
</div>
</div>
```

##### button icon disabled
# ButtonIcons disabled
##### ButtonIcons can be displayed as disabled. With the `disabled` prop, all the functionalities will be deactivated.

```js
import React from 'react';
Expand All @@ -161,7 +126,8 @@ import { faStar } from '@fortawesome/free-regular-svg-icons';
</div>
```

##### button icon with tooltip
# ButtonIcons with tooltip
##### If you want to show a tooltip with additional information about your ButtonIcon, just set the `tooltip` prop with the content you want.

```js
import React from 'react';
Expand Down Expand Up @@ -191,19 +157,3 @@ import {
<ButtonIcon variant="border-filled" size="medium" tooltip="Arrow down" icon={<FontAwesomeIcon icon={faArrowDown} />} />
</div>
```

##### button icon inverse

```js
import React from 'react';
import { ButtonIcon } from 'react-rainbow-components';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faStar } from '@fortawesome/free-regular-svg-icons';

<InverseContainer className="rainbow-p-vertical_large rainbow-p-left_x-large rainbow-flex rainbow-align_center">
<div className="rainbow-p-right_large">
<ButtonIcon variant="border-inverse" icon={<FontAwesomeIcon icon={faStar} />} />
</div>
<ButtonIcon variant="inverse" icon={<FontAwesomeIcon icon={faStar} />} />
</InverseContainer>
```
8 changes: 4 additions & 4 deletions src/components/CheckboxToggle/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ export interface CheckboxToggleProps extends BaseProps {
name?: string;
value?: boolean;
disabled?: boolean;
onChange?: (event: ChangeEvent<HTMLElement>) => void;
onClick?: (event: MouseEvent<HTMLElement>) => void;
onFocus?: (event: FocusEvent<HTMLElement>) => void;
onBlur?: (event: FocusEvent<HTMLElement>) => void;
onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
onClick?: (event: MouseEvent<HTMLInputElement>) => void;
onFocus?: (event: FocusEvent<HTMLInputElement>) => void;
onBlur?: (event: FocusEvent<HTMLInputElement>) => void;
id?: string;
labelAlignment?: 'left' | 'right';
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/RadioButtonGroup/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export interface RadioButtonGroupProps extends BaseProps {
name?: string;
value?: string;
variant?: 'default' | 'inverse' | 'brand';
onChange?: (event: ChangeEvent<HTMLElement>) => void;
onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
required?: boolean;
options?: RadioOption[];
error?: ReactNode;
Expand Down
2 changes: 1 addition & 1 deletion src/components/RadioGroup/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export interface RadioGroupProps extends BaseProps {
hideLabel?: boolean;
name?: string;
value?: string;
onChange?: (event: ChangeEvent<HTMLElement>) => void;
onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
required?: boolean;
options?: RadioOption[];
error?: ReactNode;
Expand Down
8 changes: 4 additions & 4 deletions src/components/Select/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ export interface SelectProps extends BaseProps {
label?: ReactNode;
name?: string;
value?: string | number;
onChange?: (event: ChangeEvent<HTMLElement>) => void;
onClick?: (event: MouseEvent<HTMLElement>) => void;
onFocus?: (event: FocusEvent<HTMLElement>) => void;
onBlur?: (event: FocusEvent<HTMLElement>) => void;
onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
onClick?: (event: MouseEvent<HTMLInputElement>) => void;
onFocus?: (event: FocusEvent<HTMLInputElement>) => void;
onBlur?: (event: FocusEvent<HTMLInputElement>) => void;
bottomHelpText?: ReactNode;
error?: ReactNode;
required?: boolean;
Expand Down
8 changes: 4 additions & 4 deletions src/components/Slider/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ export interface SliderProps extends BaseProps {
step?: string | number;
error?: ReactNode;
disabled?: boolean;
onChange?: (event: ChangeEvent<HTMLElement>) => void;
onClick?: (event: MouseEvent<HTMLElement>) => void;
onFocus?: (event: FocusEvent<HTMLElement>) => void;
onBlur?: (event: FocusEvent<HTMLElement>) => void;
onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
onClick?: (event: MouseEvent<HTMLInputElement>) => void;
onFocus?: (event: FocusEvent<HTMLInputElement>) => void;
onBlur?: (event: FocusEvent<HTMLInputElement>) => void;
}

declare const Slider: ComponentType<SliderProps>;
Expand Down

0 comments on commit 17c60ff

Please sign in to comment.