@7shifts/sous-chef 3.1.0 → 3.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,26 +1,25 @@
1
1
  import React from 'react';
2
- import type { ButtonTheme, ButtonSize, ButtonType, ButtonTarget } from './types';
3
- declare type Props = {
2
+ import { PositionStyles } from '../../foundation/types';
3
+ declare const _default: React.ForwardRefExoticComponent<{
4
4
  children: React.ReactNode;
5
- type?: ButtonType;
5
+ type?: "button" | "submit" | "reset" | undefined;
6
6
  /** It controls the button theme */
7
- theme?: ButtonTheme;
8
- disabled?: boolean;
9
- onClick?: React.MouseEventHandler;
10
- onKeyDown?: React.KeyboardEventHandler;
11
- id?: string;
12
- loading?: boolean;
7
+ theme?: "default" | "primary" | "danger" | "upsell" | "marketing" | "hollow" | "hollow-contrast" | "link-primary" | "link-danger" | "link-upsell" | "link-toolbar" | "link-contrast" | "link-icon" | undefined;
8
+ disabled?: boolean | undefined;
9
+ onClick?: ((event: React.MouseEvent<Element, MouseEvent>) => void) | undefined;
10
+ onKeyDown?: ((event: React.KeyboardEvent<Element>) => void) | undefined;
11
+ id?: string | undefined;
12
+ loading?: boolean | undefined;
13
13
  /** This will show a black tooltip when the user hover the button */
14
- title?: string;
15
- href?: string;
16
- target?: ButtonTarget;
17
- testId?: string;
14
+ title?: string | undefined;
15
+ href?: string | undefined;
16
+ target?: "_blank" | "_self" | undefined;
17
+ testId?: string | undefined;
18
18
  /**
19
19
  * This prop controls how the button grows having the following options:<br/>
20
20
  * *full-width*: Will grow to fill the size of the container it is placed within.
21
21
  * *min-width-100*: It will have a `min-width: 100` style. It is used for CTA buttons in forms and modals.
22
22
  */
23
- size?: ButtonSize;
24
- };
25
- declare const _default: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLButtonElement | HTMLAnchorElement>>;
23
+ size?: "full-width" | "min-width-100" | undefined;
24
+ } & PositionStyles & React.RefAttributes<HTMLButtonElement | HTMLAnchorElement>>;
26
25
  export default _default;
@@ -0,0 +1,22 @@
1
+ export declare type PositionStyles = {
2
+ /** Shortcut for `margin`. */
3
+ m?: string | number;
4
+ /** Defines the margin around of the element. */
5
+ margin?: string | number;
6
+ /** Shortcut for `marginTop`. */
7
+ mt?: string | number;
8
+ /** Defines the margin on the top of the element. */
9
+ marginTop?: string | number;
10
+ /** Shortcut for `marginRight`. */
11
+ mr?: string | number;
12
+ /** Defines the margin on the right side of the element. */
13
+ marginRight?: string | number;
14
+ /** Shortcut for `marginBottom`. */
15
+ mb?: string | number;
16
+ /** Defines the margin on the bottom of the element. */
17
+ marginBottom?: string | number;
18
+ /** Shortcut for `marginLeft`. */
19
+ ml?: string | number;
20
+ /** Defines the margin on the left side of the element. */
21
+ marginLeft?: string | number;
22
+ };
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import { PositionStyles } from '../foundation/types';
3
+ declare type CSSPositionStyles = Pick<React.CSSProperties, 'margin' | 'marginTop' | 'marginRight' | 'marginBottom' | 'marginLeft'>;
4
+ export declare const usePositionStyles: ({ m, margin, marginTop, mt, marginRight, mr, marginBottom, mb, marginLeft, ml }: PositionStyles) => CSSPositionStyles;
5
+ export {};