@instructure/ui-buttons 8.13.1-snapshot.41 → 8.13.1-snapshot.47

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.
Files changed (66) hide show
  1. package/es/BaseButton/index.js +64 -43
  2. package/es/BaseButton/props.js +2 -88
  3. package/es/BaseButton/theme.js +1 -1
  4. package/es/Button/index.js +2 -2
  5. package/es/Button/props.js +3 -65
  6. package/es/CloseButton/index.js +23 -18
  7. package/es/CloseButton/props.js +2 -60
  8. package/es/CondensedButton/index.js +2 -2
  9. package/es/CondensedButton/props.js +3 -48
  10. package/es/IconButton/index.js +2 -2
  11. package/es/IconButton/props.js +3 -68
  12. package/es/ToggleButton/index.js +4 -5
  13. package/es/ToggleButton/props.js +1 -58
  14. package/lib/BaseButton/index.js +67 -43
  15. package/lib/BaseButton/props.js +2 -88
  16. package/lib/BaseButton/theme.js +1 -1
  17. package/lib/Button/index.js +2 -2
  18. package/lib/Button/props.js +3 -65
  19. package/lib/CloseButton/index.js +23 -18
  20. package/lib/CloseButton/props.js +2 -60
  21. package/lib/CondensedButton/index.js +2 -2
  22. package/lib/CondensedButton/props.js +3 -48
  23. package/lib/IconButton/index.js +2 -2
  24. package/lib/IconButton/props.js +3 -68
  25. package/lib/ToggleButton/index.js +4 -5
  26. package/lib/ToggleButton/props.js +1 -58
  27. package/package.json +21 -21
  28. package/src/BaseButton/index.tsx +35 -27
  29. package/src/BaseButton/props.ts +103 -72
  30. package/src/BaseButton/theme.ts +1 -6
  31. package/src/Button/index.tsx +4 -8
  32. package/src/Button/props.ts +74 -48
  33. package/src/CloseButton/index.tsx +4 -6
  34. package/src/CloseButton/props.ts +67 -41
  35. package/src/CondensedButton/index.tsx +3 -7
  36. package/src/CondensedButton/props.ts +56 -34
  37. package/src/IconButton/index.tsx +3 -7
  38. package/src/IconButton/props.ts +77 -50
  39. package/src/ToggleButton/index.tsx +8 -15
  40. package/src/ToggleButton/props.ts +65 -39
  41. package/tsconfig.build.tsbuildinfo +1 -1
  42. package/types/BaseButton/index.d.ts +16 -15
  43. package/types/BaseButton/index.d.ts.map +1 -1
  44. package/types/BaseButton/props.d.ts +76 -5
  45. package/types/BaseButton/props.d.ts.map +1 -1
  46. package/types/BaseButton/theme.d.ts.map +1 -1
  47. package/types/Button/index.d.ts +10 -7
  48. package/types/Button/index.d.ts.map +1 -1
  49. package/types/Button/props.d.ts +57 -3
  50. package/types/Button/props.d.ts.map +1 -1
  51. package/types/CloseButton/index.d.ts +4 -3
  52. package/types/CloseButton/index.d.ts.map +1 -1
  53. package/types/CloseButton/props.d.ts +55 -5
  54. package/types/CloseButton/props.d.ts.map +1 -1
  55. package/types/CondensedButton/index.d.ts +9 -6
  56. package/types/CondensedButton/index.d.ts.map +1 -1
  57. package/types/CondensedButton/props.d.ts +44 -3
  58. package/types/CondensedButton/props.d.ts.map +1 -1
  59. package/types/IconButton/index.d.ts +11 -8
  60. package/types/IconButton/index.d.ts.map +1 -1
  61. package/types/IconButton/props.d.ts +60 -4
  62. package/types/IconButton/props.d.ts.map +1 -1
  63. package/types/ToggleButton/index.d.ts +12 -13
  64. package/types/ToggleButton/index.d.ts.map +1 -1
  65. package/types/ToggleButton/props.d.ts +52 -4
  66. package/types/ToggleButton/props.d.ts.map +1 -1
@@ -1,16 +1,18 @@
1
1
  /** @jsx jsx */
2
- import { Component } from 'react';
2
+ import React, { Component } from 'react';
3
+ import type { ViewProps } from '@instructure/ui-view';
3
4
  import { jsx } from '@instructure/emotion';
4
5
  import type { BaseButtonProps, BaseButtonStyleProps } from './props';
5
6
  /**
6
7
  ---
7
8
  category: components/utilities
8
9
  ---
10
+ @tsProps
9
11
  **/
10
12
  declare class BaseButton extends Component<BaseButtonProps> {
11
13
  static readonly componentId = "BaseButton";
12
14
  static propTypes: import("@instructure/shared-types/types/UtilityTypes").PropValidators<keyof {
13
- children?: import("react").ReactNode;
15
+ children?: React.ReactNode;
14
16
  type?: "button" | "submit" | "reset" | undefined;
15
17
  size?: "small" | "medium" | "large" | undefined;
16
18
  elementRef?: ((element: Element | null) => void) | undefined;
@@ -27,13 +29,13 @@ declare class BaseButton extends Component<BaseButtonProps> {
27
29
  margin?: import("@instructure/emotion/types/styleUtils/ThemeablePropValues").Spacing | undefined;
28
30
  cursor?: import("@instructure/ui-prop-types/types/cursor").Cursor | undefined;
29
31
  href?: string | undefined;
30
- onClick?: ((...args: any[]) => any) | undefined;
31
- onKeyDown?: ((...args: any[]) => any) | undefined;
32
- renderIcon?: import("react").ReactNode | ((...args: any[]) => any);
32
+ onClick?: ((event: React.KeyboardEvent<ViewProps> | React.MouseEvent<ViewProps, MouseEvent>) => void) | undefined;
33
+ onKeyDown?: ((event: React.KeyboardEvent<ViewProps>) => void) | undefined;
34
+ renderIcon?: React.ReactNode | (() => React.ReactNode);
33
35
  tabIndex?: string | number | undefined;
34
36
  }>;
35
37
  static allowedProps: readonly (keyof {
36
- children?: import("react").ReactNode;
38
+ children?: React.ReactNode;
37
39
  type?: "button" | "submit" | "reset" | undefined;
38
40
  size?: "small" | "medium" | "large" | undefined;
39
41
  elementRef?: ((element: Element | null) => void) | undefined;
@@ -50,17 +52,16 @@ declare class BaseButton extends Component<BaseButtonProps> {
50
52
  margin?: import("@instructure/emotion/types/styleUtils/ThemeablePropValues").Spacing | undefined;
51
53
  cursor?: import("@instructure/ui-prop-types/types/cursor").Cursor | undefined;
52
54
  href?: string | undefined;
53
- onClick?: ((...args: any[]) => any) | undefined;
54
- onKeyDown?: ((...args: any[]) => any) | undefined;
55
- renderIcon?: import("react").ReactNode | ((...args: any[]) => any);
55
+ onClick?: ((event: React.KeyboardEvent<ViewProps> | React.MouseEvent<ViewProps, MouseEvent>) => void) | undefined;
56
+ onKeyDown?: ((event: React.KeyboardEvent<ViewProps>) => void) | undefined;
57
+ renderIcon?: React.ReactNode | (() => React.ReactNode);
56
58
  tabIndex?: string | number | undefined;
57
59
  })[];
58
60
  static defaultProps: {
59
- readonly children: null;
60
61
  readonly type: "button";
61
62
  readonly size: "medium";
62
- readonly elementRef: (el: any) => void;
63
63
  readonly as: "button";
64
+ readonly interaction: undefined;
64
65
  readonly color: "secondary";
65
66
  readonly shape: "rectangle";
66
67
  readonly display: "inline-block";
@@ -70,11 +71,10 @@ declare class BaseButton extends Component<BaseButtonProps> {
70
71
  readonly isCondensed: false;
71
72
  readonly margin: "0";
72
73
  readonly cursor: "pointer";
73
- readonly onKeyDown: (event: any) => void;
74
74
  };
75
75
  ref: Element | null;
76
76
  componentDidMount(): void;
77
- componentDidUpdate(prevProps: any, prevState: any, snapshot: any): void;
77
+ componentDidUpdate(): void;
78
78
  get _rootElement(): Element | null;
79
79
  get makeStylesVariables(): BaseButtonStyleProps;
80
80
  get hasOnlyIconVisible(): boolean;
@@ -83,12 +83,13 @@ declare class BaseButton extends Component<BaseButtonProps> {
83
83
  get isDisabled(): boolean;
84
84
  get isReadOnly(): boolean;
85
85
  get isEnabled(): boolean;
86
+ get tabIndex(): number | undefined;
86
87
  get focusColor(): "info" | "inverse";
87
88
  get focused(): boolean;
88
89
  focus(): void;
89
90
  handleElementRef: (el: Element | null) => void;
90
- handleClick: (event: any) => void;
91
- handleKeyDown: (event: any) => void;
91
+ handleClick: (event: React.MouseEvent<ViewProps>) => void;
92
+ handleKeyDown: (event: React.KeyboardEvent<ViewProps>) => void;
92
93
  renderChildren(): jsx.JSX.Element;
93
94
  render(): jsx.JSX.Element;
94
95
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/BaseButton/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAcjC,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAMrD,OAAO,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAEpE;;;;GAIG;AAEH,cAEM,UAAW,SAAQ,SAAS,CAAC,eAAe,CAAC;IACjD,MAAM,CAAC,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;;;;;;;;;;;;;;;;;;;;OAAY;IAC5B,MAAM,CAAC,YAAY;;;;;;;;;;;;;;;;;;;;;;SAAe;IAClC,MAAM,CAAC,YAAY;;;;;;;;;;;;;;MAeT;IAEV,GAAG,EAAE,OAAO,GAAG,IAAI,CAAO;IAE1B,iBAAiB;IAIjB,kBAAkB;IAIlB,IAAI,YAAY,mBAMf;IAED,IAAI,mBAAmB,IAAI,oBAAoB,CAK9C;IAED,IAAI,kBAAkB,YAGrB;IAED,IAAI,WAAW,wEAEd;IAED,IAAI,WAAW,0DAEd;IAED,IAAI,UAAU,YAEb;IAED,IAAI,UAAU,YAEb;IAED,IAAI,SAAS,YAEZ;IAGD,IAAI,QAAQ,uBAWX;IAED,IAAI,UAAU,uBAiBb;IAED,IAAI,OAAO,YAEV;IAED,KAAK;IAIL,gBAAgB,OAAQ,OAAO,GAAG,IAAI,UAQrC;IAED,WAAW,UAAW,gBAAgB,CAAC,SAAS,CAAC,UAahD;IAED,aAAa,UAAW,mBAAmB,CAAC,SAAS,CAAC,UA0BrD;IAED,cAAc;IAgCd,MAAM;CAyDP;AAED,OAAO,EAAE,UAAU,EAAE,CAAA;AACrB,eAAe,UAAU,CAAA"}
@@ -1,29 +1,100 @@
1
1
  import React from 'react';
2
2
  import type { InteractionType } from '@instructure/ui-react-utils';
3
3
  import type { Spacing, WithStyleProps, ComponentStyle } from '@instructure/emotion';
4
- import type { AsElementType, BaseButtonTheme, OtherHTMLAttributes, PropValidators } from '@instructure/shared-types';
4
+ import type { ToProp, AsElementType, BaseButtonTheme, OtherHTMLAttributes, PropValidators } from '@instructure/shared-types';
5
5
  import type { Cursor } from '@instructure/ui-prop-types';
6
+ import type { ViewProps } from '@instructure/ui-view';
6
7
  declare type BaseButtonOwnProps = {
8
+ /**
9
+ * Specifies the `Button` children.
10
+ */
7
11
  children?: React.ReactNode;
12
+ /**
13
+ * Specifies the type of the `Button`'s underlying html element.
14
+ */
8
15
  type?: 'button' | 'submit' | 'reset';
16
+ /**
17
+ * The size of the `Button`
18
+ */
9
19
  size?: 'small' | 'medium' | 'large';
20
+ /**
21
+ * Provides a reference to the `Button`'s underlying html element.
22
+ */
10
23
  elementRef?: (element: Element | null) => void;
24
+ /**
25
+ * The element to render as the component root, `Button` by default.
26
+ */
11
27
  as?: AsElementType;
28
+ /**
29
+ * Specifies if interaction with the `Button` is enabled, disabled, or readonly.
30
+ */
12
31
  interaction?: InteractionType;
32
+ /**
33
+ * Specifies the color for the `Button`.
34
+ */
13
35
  color?: 'primary' | 'primary-inverse' | 'secondary' | 'success' | 'danger';
36
+ /**
37
+ * Override the `Button`'s default focus outline color.
38
+ */
14
39
  focusColor?: 'info' | 'inverse';
40
+ /**
41
+ * The `Button` display property. When set to `inline-block`, the `Button` displays inline with other elements.
42
+ * When set to block, the `Button` expands to fill the width of the container.
43
+ */
15
44
  display?: 'inline-block' | 'block';
45
+ /**
46
+ * Sets the alignment of the `Button` children and/or icon.
47
+ */
16
48
  textAlign?: 'start' | 'center';
49
+ /**
50
+ * Specifies if the `Button` shape should be a circle or rectangle.
51
+ */
17
52
  shape?: 'rectangle' | 'circle';
53
+ /**
54
+ * Specifies if the `Button` should render with a solid background. When false, the background is transparent.
55
+ */
18
56
  withBackground?: boolean;
57
+ /**
58
+ * Specifies if the `Button` should render with a border.
59
+ */
19
60
  withBorder?: boolean;
61
+ /**
62
+ * Designates if the `Button` should render without padding. This option should only be set when `withBorder` and
63
+ * `withBackground` are also set to false.
64
+ */
20
65
  isCondensed?: boolean;
66
+ /**
67
+ * Valid values are `0`, `none`, `auto`, `xxx-small`, `xx-small`, `x-small`,
68
+ * `small`, `medium`, `large`, `x-large`, `xx-large`. Apply these values via
69
+ * familiar CSS-like shorthand. For example: `margin="small auto large"`.
70
+ */
21
71
  margin?: Spacing;
72
+ /**
73
+ * Specify a mouse cursor to use when hovering over the button.
74
+ * The `pointer` cursor is used by default.
75
+ */
22
76
  cursor?: Cursor;
77
+ /**
78
+ * Specifies an href attribute for the `Button`'s underlying html element.
79
+ */
23
80
  href?: string;
24
- onClick?: (...args: any[]) => any;
25
- onKeyDown?: (...args: any[]) => any;
26
- renderIcon?: React.ReactNode | ((...args: any[]) => any);
81
+ /**
82
+ * Callback fired when the `Button` is clicked.
83
+ */
84
+ onClick?: (event: React.KeyboardEvent<ViewProps> | React.MouseEvent<ViewProps>) => void;
85
+ /**
86
+ * Callback fired when the `Button` receives a keydown event.
87
+ */
88
+ onKeyDown?: (event: React.KeyboardEvent<ViewProps>) => void;
89
+ /**
90
+ * An icon, or function that returns an icon.
91
+ */
92
+ renderIcon?: React.ReactNode | (() => React.ReactNode);
93
+ /**
94
+ * Specifies the tabindex of the `Button`.
95
+ *
96
+ * (`string` type is __deprecated__, use `number`)
97
+ */
27
98
  tabIndex?: number | string;
28
99
  };
29
100
  declare type BaseButtonStyleProps = {
@@ -32,7 +103,7 @@ declare type BaseButtonStyleProps = {
32
103
  };
33
104
  declare type PropKeys = keyof BaseButtonOwnProps;
34
105
  declare type AllowedPropKeys = Readonly<Array<PropKeys>>;
35
- declare type BaseButtonProps = BaseButtonOwnProps & WithStyleProps<BaseButtonTheme, BaseButtonStyle> & OtherHTMLAttributes<BaseButtonOwnProps>;
106
+ declare type BaseButtonProps = BaseButtonOwnProps & WithStyleProps<BaseButtonTheme, BaseButtonStyle> & OtherHTMLAttributes<BaseButtonOwnProps> & ToProp;
36
107
  declare type BaseButtonStyle = ComponentStyle<'baseButton' | 'content' | 'children' | 'iconSVG' | 'childrenLayout' | 'iconOnly' | 'iconWrapper' | 'childrenWrapper'>;
37
108
  declare const propTypes: PropValidators<PropKeys>;
38
109
  declare const allowedProps: AllowedPropKeys;
@@ -1 +1 @@
1
- {"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/BaseButton/props.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAA;AAClE,OAAO,KAAK,EACV,OAA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AE,MAAM,2BAA2B,CAAA;AAqE3D;;;;GAIG;AACH,QAAA,MAAM,sBAAsB,UAAW,KAAK,KAAG,eAgI9C,CAAA;AAED,eAAe,sBAAsB,CAAA"}
1
+ {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/BaseButton/theme.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,KAAK,EAAsB,MAAM,wBAAwB,CAAA;AACvE,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAgE3D;;;;GAIG;AACH,QAAA,MAAM,sBAAsB,UAAW,KAAK,KAAG,eAgI9C,CAAA;AAED,eAAe,sBAAsB,CAAA"}
@@ -1,9 +1,11 @@
1
1
  import React, { Component } from 'react';
2
+ import { BaseButton } from '../BaseButton';
2
3
  import type { ButtonProps } from './props';
3
4
  /**
4
5
  ---
5
6
  category: components
6
7
  ---
8
+ @tsProps
7
9
  **/
8
10
  declare class Button extends Component<ButtonProps> {
9
11
  static readonly componentId = "Button";
@@ -22,7 +24,8 @@ declare class Button extends Component<ButtonProps> {
22
24
  margin?: import("@instructure/emotion/types/styleUtils/ThemeablePropValues").Spacing | undefined;
23
25
  cursor?: import("@instructure/ui-prop-types/types/cursor").Cursor | undefined;
24
26
  href?: string | undefined;
25
- renderIcon?: React.ReactNode | ((...args: any[]) => any);
27
+ renderIcon?: React.ReactNode | (() => React.ReactNode);
28
+ onClick?: ((event: React.KeyboardEvent<import("@instructure/ui-view/types/View/props").ViewProps> | React.MouseEvent<import("@instructure/ui-view/types/View/props").ViewProps, MouseEvent>) => void) | undefined;
26
29
  }>;
27
30
  static allowedProps: readonly (keyof {
28
31
  children?: React.ReactNode;
@@ -39,14 +42,14 @@ declare class Button extends Component<ButtonProps> {
39
42
  margin?: import("@instructure/emotion/types/styleUtils/ThemeablePropValues").Spacing | undefined;
40
43
  cursor?: import("@instructure/ui-prop-types/types/cursor").Cursor | undefined;
41
44
  href?: string | undefined;
42
- renderIcon?: React.ReactNode | ((...args: any[]) => any);
45
+ renderIcon?: React.ReactNode | (() => React.ReactNode);
46
+ onClick?: ((event: React.KeyboardEvent<import("@instructure/ui-view/types/View/props").ViewProps> | React.MouseEvent<import("@instructure/ui-view/types/View/props").ViewProps, MouseEvent>) => void) | undefined;
43
47
  })[];
44
48
  static defaultProps: {
45
- children: null;
46
49
  type: string;
47
50
  size: string;
48
- elementRef: (el: any) => void;
49
51
  as: string;
52
+ interaction: undefined;
50
53
  color: string;
51
54
  display: string;
52
55
  textAlign: string;
@@ -54,12 +57,12 @@ declare class Button extends Component<ButtonProps> {
54
57
  margin: string;
55
58
  cursor: string;
56
59
  };
57
- _buttonComponent: null;
60
+ _buttonComponent: BaseButton | null;
58
61
  ref: Element | null;
59
- get focused(): null;
62
+ get focused(): boolean | null;
60
63
  focus(): void;
61
64
  handleElementRef: (el: Element | null) => void;
62
- handleButtonRef: (component: any) => void;
65
+ handleButtonRef: (component: BaseButton | null) => void;
63
66
  render(): JSX.Element;
64
67
  }
65
68
  export default Button;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Button/index.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAWxC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1C;;;;GAIG;AAEH,cAEM,MAAO,SAAQ,SAAS,CAAC,WAAW,CAAC;IACzC,MAAM,CAAC,QAAQ,CAAC,WAAW,YAAW;IAEtC,MAAM,CAAC,SAAS;;;;;;;;;;;;;;;;OAAY;IAC5B,MAAM,CAAC,YAAY;;;;;;;;;;;;;;;;SAAe;IAClC,MAAM,CAAC,YAAY;;;;;;;;;;;;MAclB;IAED,gBAAgB,OAAO;IAEvB,GAAG,EAAE,OAAO,GAAG,IAAI,CAAO;IAE1B,IAAI,OAAO,SAGV;IAED,KAAK;IAKL,gBAAgB,OAAQ,OAAO,GAAG,IAAI,UAQrC;IAGD,eAAe,2BAEd;IAED,MAAM;CA4CP;AAED,eAAe,MAAM,CAAA;AACrB,OAAO,EAAE,MAAM,EAAE,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Button/index.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAQxC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAG1C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1C;;;;;GAKG;AAEH,cAEM,MAAO,SAAQ,SAAS,CAAC,WAAW,CAAC;IACzC,MAAM,CAAC,QAAQ,CAAC,WAAW,YAAW;IAEtC,MAAM,CAAC,SAAS;;;;;;;;;;;;;;;;;OAAY;IAC5B,MAAM,CAAC,YAAY;;;;;;;;;;;;;;;;;SAAe;IAClC,MAAM,CAAC,YAAY;;;;;;;;;;;MAYlB;IAED,gBAAgB,EAAE,UAAU,GAAG,IAAI,CAAO;IAE1C,GAAG,EAAE,OAAO,GAAG,IAAI,CAAO;IAE1B,IAAI,OAAO,mBAEV;IAED,KAAK;IAIL,gBAAgB,OAAQ,OAAO,GAAG,IAAI,UAQrC;IAED,eAAe,cAAe,UAAU,GAAG,IAAI,UAE9C;IAED,MAAM;CA4CP;AAED,eAAe,MAAM,CAAA;AACrB,OAAO,EAAE,MAAM,EAAE,CAAA"}
@@ -1,27 +1,81 @@
1
1
  import React from 'react';
2
2
  import type { Spacing, WithStyleProps } from '@instructure/emotion';
3
- import type { AsElementType, PropValidators, BaseButtonTheme, OtherHTMLAttributes } from '@instructure/shared-types';
3
+ import type { ToProp, AsElementType, PropValidators, BaseButtonTheme, OtherHTMLAttributes } from '@instructure/shared-types';
4
4
  import type { Cursor } from '@instructure/ui-prop-types';
5
+ import type { ViewProps } from '@instructure/ui-view';
5
6
  declare type ButtonOwnProps = {
7
+ /**
8
+ * Specifies the `Button` children.
9
+ */
6
10
  children?: React.ReactNode;
11
+ /**
12
+ * Specifies the type of the `Button`'s underlying html element.
13
+ */
7
14
  type?: 'button' | 'submit' | 'reset';
15
+ /**
16
+ * The size of the `Button`
17
+ */
8
18
  size?: 'small' | 'medium' | 'large';
19
+ /**
20
+ * Provides a reference to the `Button`'s underlying html element.
21
+ */
9
22
  elementRef?: (element: Element | null) => void;
23
+ /**
24
+ * The element to render as the component root, `Button` by default.
25
+ */
10
26
  as?: AsElementType;
27
+ /**
28
+ * Specifies if interaction with the `Button` is enabled, disabled, or readonly.
29
+ */
11
30
  interaction?: 'enabled' | 'disabled' | 'readonly';
31
+ /**
32
+ * Specifies the color for the `Button`.
33
+ */
12
34
  color?: 'primary' | 'primary-inverse' | 'secondary' | 'success' | 'danger';
35
+ /**
36
+ * Override the `Button`'s default focus outline color.
37
+ */
13
38
  focusColor?: 'info' | 'inverse';
39
+ /**
40
+ * The `Button` display property. When set to `inline-block`, the `Button` displays inline with other elements.
41
+ * When set to block, the `Button` expands to fill the width of the container.
42
+ */
14
43
  display?: 'inline-block' | 'block';
44
+ /**
45
+ * Sets the alignment of the `Button` children and/or icon.
46
+ */
15
47
  textAlign?: 'start' | 'center';
48
+ /**
49
+ * Specifies if the `Button` should render with a solid background. When false, the background is transparent.
50
+ */
16
51
  withBackground?: boolean;
52
+ /**
53
+ * Valid values are `0`, `none`, `auto`, `xxx-small`, `xx-small`, `x-small`,
54
+ * `small`, `medium`, `large`, `x-large`, `xx-large`. Apply these values via
55
+ * familiar CSS-like shorthand. For example: `margin="small auto large"`.
56
+ */
17
57
  margin?: Spacing;
58
+ /**
59
+ * Specify a mouse cursor to use when hovering over the button.
60
+ * The `pointer` cursor is used by default.
61
+ */
18
62
  cursor?: Cursor;
63
+ /**
64
+ * Specifies an href attribute for the `Button`'s underlying html element.
65
+ */
19
66
  href?: string;
20
- renderIcon?: React.ReactNode | ((...args: any[]) => any);
67
+ /**
68
+ * An icon, or function that returns an icon.
69
+ */
70
+ renderIcon?: React.ReactNode | (() => React.ReactNode);
71
+ /**
72
+ * Callback fired when the `Button` is clicked.
73
+ */
74
+ onClick?: (event: React.KeyboardEvent<ViewProps> | React.MouseEvent<ViewProps>) => void;
21
75
  };
22
76
  declare type PropKeys = keyof ButtonOwnProps;
23
77
  declare type AllowedPropKeys = Readonly<Array<PropKeys>>;
24
- declare type ButtonProps = ButtonOwnProps & WithStyleProps<BaseButtonTheme, null> & OtherHTMLAttributes<ButtonOwnProps>;
78
+ declare type ButtonProps = ButtonOwnProps & WithStyleProps<BaseButtonTheme, null> & OtherHTMLAttributes<ButtonOwnProps> & ToProp;
25
79
  declare const propTypes: PropValidators<PropKeys>;
26
80
  declare const allowedProps: AllowedPropKeys;
27
81
  export type { ButtonProps };
@@ -1 +1 @@
1
- {"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/Button/props.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACnE,OAAO,KAAK,EACV,aAAa,EACb,cAAc,EACd,eAAe,EACf,mBAAmB,EACpB,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAExD,aAAK,cAAc,GAAG;IACpB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAA;IACpC,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAA;IACnC,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,KAAK,IAAI,CAAA;IAC9C,EAAE,CAAC,EAAE,aAAa,CAAA;IAClB,WAAW,CAAC,EAAE,SAAS,GAAG,UAAU,GAAG,UAAU,CAAA;IACjD,KAAK,CAAC,EAAE,SAAS,GAAG,iBAAiB,GAAG,WAAW,GAAG,SAAS,GAAG,QAAQ,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M,cAAc,CAAA;AAEpC,aAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,aAAK,WAAW,GAAG,cAAc,GAC/B,cAAc,CAAC,eAAe,EAAE,IAAI,CAAC,GACrC,mBAAmB,CAAC,cAAc,CAAC,GACnC,MAAM,CAAA;AAER,QAAA,MAAM,SAAS,EAAE,cAAc,CAAC,QAAQ,CAuBvC,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,eAiBnB,CAAA;AAED,YAAY,EAAE,WAAW,EAAE,CAAA;AAC3B,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAA"}
@@ -6,6 +6,7 @@ import type { CloseButtonProps } from './props';
6
6
  ---
7
7
  category: components
8
8
  ---
9
+ @tsProps
9
10
  **/
10
11
  declare class CloseButton extends Component<CloseButtonProps> {
11
12
  static readonly componentId = "CloseButton";
@@ -15,7 +16,7 @@ declare class CloseButton extends Component<CloseButtonProps> {
15
16
  interaction?: "enabled" | "disabled" | "readonly" | undefined;
16
17
  elementRef?: ((element: Element | null) => void) | undefined;
17
18
  size?: "small" | "medium" | "large" | undefined;
18
- onClick?: ((...args: any[]) => any) | undefined;
19
+ onClick?: ((event: import("react").KeyboardEvent<import("@instructure/ui-view/types/View/props").ViewProps> | import("react").MouseEvent<import("@instructure/ui-view/types/View/props").ViewProps, MouseEvent>) => void) | undefined;
19
20
  margin?: import("@instructure/emotion/types/styleUtils/ThemeablePropValues").Spacing | undefined;
20
21
  placement?: "start" | "end" | "static" | undefined;
21
22
  offset?: "small" | "medium" | "none" | "x-small" | undefined;
@@ -31,7 +32,7 @@ declare class CloseButton extends Component<CloseButtonProps> {
31
32
  interaction?: "enabled" | "disabled" | "readonly" | undefined;
32
33
  elementRef?: ((element: Element | null) => void) | undefined;
33
34
  size?: "small" | "medium" | "large" | undefined;
34
- onClick?: ((...args: any[]) => any) | undefined;
35
+ onClick?: ((event: import("react").KeyboardEvent<import("@instructure/ui-view/types/View/props").ViewProps> | import("react").MouseEvent<import("@instructure/ui-view/types/View/props").ViewProps, MouseEvent>) => void) | undefined;
35
36
  margin?: import("@instructure/emotion/types/styleUtils/ThemeablePropValues").Spacing | undefined;
36
37
  placement?: "start" | "end" | "static" | undefined;
37
38
  offset?: "small" | "medium" | "none" | "x-small" | undefined;
@@ -42,7 +43,7 @@ declare class CloseButton extends Component<CloseButtonProps> {
42
43
  tabIndex?: string | number | undefined;
43
44
  })[];
44
45
  static defaultProps: {
45
- onClick: (event: any) => void;
46
+ interaction: undefined;
46
47
  type: string;
47
48
  placement: string;
48
49
  offset: string;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/CloseButton/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAOjC,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAOrD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAE/C;;;;GAIG;AACH,cAEM,WAAY,SAAQ,SAAS,CAAC,gBAAgB,CAAC;IACnD,MAAM,CAAC,QAAQ,CAAC,WAAW,iBAAgB;IAE3C,MAAM,CAAC,SAAS;;;;;;;;;;;;;;;OAAY;IAC5B,MAAM,CAAC,YAAY;;;;;;;;;;;;;;;SAAe;IAClC,MAAM,CAAC,YAAY;;;;;;;;;MAWlB;IAED,GAAG,EAAE,OAAO,GAAG,IAAI,CAAO;IAE1B,SAAS,OAAQ,OAAO,GAAG,IAAI,UAQ9B;IAED,iBAAiB;IAKjB,kBAAkB;IAKlB,IAAI,WAAW,0DAEd;IAED,IAAI,KAAK,gDAIR;IAED,MAAM;CAyCP;AAED,eAAe,WAAW,CAAA;AAC1B,OAAO,EAAE,WAAW,EAAE,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/CloseButton/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAOjC,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAOrD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAE/C;;;;;GAKG;AACH,cAEM,WAAY,SAAQ,SAAS,CAAC,gBAAgB,CAAC;IACnD,MAAM,CAAC,QAAQ,CAAC,WAAW,iBAAgB;IAE3C,MAAM,CAAC,SAAS;;;;;;;;;;;;;;;OAAY;IAC5B,MAAM,CAAC,YAAY;;;;;;;;;;;;;;;SAAe;IAClC,MAAM,CAAC,YAAY;;;;;;;;;MAUlB;IAED,GAAG,EAAE,OAAO,GAAG,IAAI,CAAO;IAE1B,SAAS,OAAQ,OAAO,GAAG,IAAI,UAQ9B;IAED,iBAAiB;IAIjB,kBAAkB;IAIlB,IAAI,WAAW,0DAEd;IAED,IAAI,KAAK,gDAIR;IAED,MAAM;CAyCP;AAED,eAAe,WAAW,CAAA;AAC1B,OAAO,EAAE,WAAW,EAAE,CAAA"}
@@ -1,26 +1,76 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import type { Spacing, WithStyleProps, ComponentStyle } from '@instructure/emotion';
3
- import type { AsElementType, CloseButtonTheme, OtherHTMLAttributes, PropValidators } from '@instructure/shared-types';
3
+ import type { ToProp, AsElementType, CloseButtonTheme, OtherHTMLAttributes, PropValidators } from '@instructure/shared-types';
4
4
  import type { Cursor } from '@instructure/ui-prop-types';
5
+ import type { ViewProps } from '@instructure/ui-view';
5
6
  declare type CloseButtonOwnProps = {
6
- screenReaderLabel: string | React.ReactNode;
7
+ /**
8
+ * An accessible label for the `CloseButton` (required)
9
+ */
10
+ screenReaderLabel: React.ReactNode;
11
+ /**
12
+ * Specifies the color for the `CloseButton`.
13
+ */
7
14
  color?: 'primary' | 'primary-inverse';
15
+ /**
16
+ * Specifies if interaction with the `CloseButton` is enabled, disabled, or readonly.
17
+ */
8
18
  interaction?: 'enabled' | 'disabled' | 'readonly';
19
+ /**
20
+ * Provides a reference to the `CloseButton`'s underlying html element.
21
+ */
9
22
  elementRef?: (element: Element | null) => void;
23
+ /**
24
+ * The size of the `CloseButton`
25
+ */
10
26
  size?: 'small' | 'medium' | 'large';
11
- onClick?: (...args: any[]) => any;
27
+ /**
28
+ * Callback fired when the `CloseButton` is clicked.
29
+ */
30
+ onClick?: (event: React.KeyboardEvent<ViewProps> | React.MouseEvent<ViewProps>) => void;
31
+ /**
32
+ * Valid values are `0`, `none`, `auto`, `xxx-small`, `xx-small`, `x-small`,
33
+ * `small`, `medium`, `large`, `x-large`, `xx-large`. Apply these values via
34
+ * familiar CSS-like shorthand. For example: `margin="small auto large"`.
35
+ */
12
36
  margin?: Spacing;
37
+ /**
38
+ * Specifies the placement of the `CloseButton`
39
+ */
13
40
  placement?: 'start' | 'end' | 'static';
41
+ /**
42
+ * Specifies the offset distance for the `CloseButton` with respect to both the top and start/end of the container.
43
+ * Note that for this property to have an effect, the `placement` prop must be set to either `start` or `end`. The
44
+ * offset will also be created with respect to a positioned parent. If it does not appear to be working, try setting
45
+ * the `position` of the parent container to `relative`.
46
+ */
14
47
  offset?: 'none' | 'x-small' | 'small' | 'medium';
48
+ /**
49
+ * Specifies the type of the `Button`'s underlying html element.
50
+ */
15
51
  type?: 'button' | 'submit' | 'reset';
52
+ /**
53
+ * The element to render as the component root, `CloseButton` by default.
54
+ */
16
55
  as?: AsElementType;
56
+ /**
57
+ * Specifies an href attribute for the `CloseButton`'s underlying html element.
58
+ */
17
59
  href?: string;
60
+ /**
61
+ * Specify a mouse cursor to use when hovering over the `CloseButton`.
62
+ */
18
63
  cursor?: Cursor;
64
+ /**
65
+ * Specifies the tabindex of the `CloseButton`.
66
+ *
67
+ * (`string` type is __deprecated__, use `number`)
68
+ */
19
69
  tabIndex?: number | string;
20
70
  };
21
71
  declare type PropKeys = keyof CloseButtonOwnProps;
22
72
  declare type AllowedPropKeys = Readonly<Array<PropKeys>>;
23
- declare type CloseButtonProps = CloseButtonOwnProps & WithStyleProps<CloseButtonTheme, CloseButtonStyle> & OtherHTMLAttributes<CloseButtonOwnProps>;
73
+ declare type CloseButtonProps = CloseButtonOwnProps & WithStyleProps<CloseButtonTheme, CloseButtonStyle> & OtherHTMLAttributes<CloseButtonOwnProps> & ToProp;
24
74
  declare type CloseButtonStyle = ComponentStyle<'closeButton'>;
25
75
  declare const propTypes: PropValidators<PropKeys>;
26
76
  declare const allowedProps: AllowedPropKeys;
@@ -1 +1 @@
1
- {"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/CloseButton/props.ts"],"names":[],"mappings":";AA2BA,OAAO,KAAK,EACV,OAAO,EACP,cAAc,EACd,cAAc,EACf,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EACV,aAAa,EACb,gBAAgB,EAChB,mBAAmB,EACnB,cAAc,EACf,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAExD,aAAK,mBAAmB,GAAG;IACzB,iBAAiB,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAA;IAC3C,KAAK,CAAC,EAAE,SAAS,GAAG,iBAAiB,CAAA;IACrC,WAAW,CAAC,EAAE,SAAS,GAAG,UAAU,GAAG,UAAU,CAAA;IACjD,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,KAAK,IAAI,CAAA;IAC9C,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAA;IACnC,OAAO,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAA;IACjC,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,SAAS,CAAC,EAAE,OAAO,GAAG,KAAK,GAAG,QAAQ,CAAA;IACtC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,CAAA;IAChD,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,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D,QAAA,MAAM,SAAS,EAAE,cAAc,CAAC,QAAQ,CAkBvC,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,eAenB,CAAA;AAED,YAAY,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,CAAA;AAClD,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAA"}
@@ -1,9 +1,11 @@
1
1
  import React, { Component } from 'react';
2
+ import { BaseButton } from '../BaseButton';
2
3
  import type { CondensedButtonProps } from './props';
3
4
  /**
4
5
  ---
5
6
  category: components
6
7
  ---
8
+ @tsProps
7
9
  **/
8
10
  declare class CondensedButton extends Component<CondensedButtonProps> {
9
11
  static readonly componentId = "CondensedButton";
@@ -18,7 +20,8 @@ declare class CondensedButton extends Component<CondensedButtonProps> {
18
20
  margin?: import("@instructure/emotion/types/styleUtils/ThemeablePropValues").Spacing | undefined;
19
21
  cursor?: import("@instructure/ui-prop-types/types/cursor").Cursor | undefined;
20
22
  href?: string | undefined;
21
- renderIcon?: React.ReactNode | ((...args: any[]) => any);
23
+ renderIcon?: React.ReactNode | (() => React.ReactNode);
24
+ onClick?: ((event: React.KeyboardEvent<import("@instructure/ui-view/types/View/props").ViewProps> | React.MouseEvent<import("@instructure/ui-view/types/View/props").ViewProps, MouseEvent>) => void) | undefined;
22
25
  }>;
23
26
  static allowedProps: readonly (keyof {
24
27
  children?: React.ReactNode;
@@ -31,22 +34,22 @@ declare class CondensedButton extends Component<CondensedButtonProps> {
31
34
  margin?: import("@instructure/emotion/types/styleUtils/ThemeablePropValues").Spacing | undefined;
32
35
  cursor?: import("@instructure/ui-prop-types/types/cursor").Cursor | undefined;
33
36
  href?: string | undefined;
34
- renderIcon?: React.ReactNode | ((...args: any[]) => any);
37
+ renderIcon?: React.ReactNode | (() => React.ReactNode);
38
+ onClick?: ((event: React.KeyboardEvent<import("@instructure/ui-view/types/View/props").ViewProps> | React.MouseEvent<import("@instructure/ui-view/types/View/props").ViewProps, MouseEvent>) => void) | undefined;
35
39
  })[];
36
40
  static defaultProps: {
37
- children: null;
38
41
  type: string;
39
42
  size: string;
40
- elementRef: (el: any) => void;
41
43
  as: string;
44
+ interaction: undefined;
42
45
  color: string;
43
46
  margin: string;
44
47
  cursor: string;
45
48
  };
46
- _baseButton: null;
49
+ _baseButton: BaseButton | null;
47
50
  ref: Element | null;
48
51
  handleRef: (el: Element | null) => void;
49
- get focused(): null;
52
+ get focused(): boolean | null;
50
53
  focus(): void;
51
54
  render(): JSX.Element;
52
55
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/CondensedButton/index.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAWxC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAEnD;;;;GAIG;AAEH,cAEM,eAAgB,SAAQ,SAAS,CAAC,oBAAoB,CAAC;IAC3D,MAAM,CAAC,QAAQ,CAAC,WAAW,qBAAoB;IAE/C,MAAM,CAAC,SAAS;;;;;;;;;;;;OAAY;IAC5B,MAAM,CAAC,YAAY;;;;;;;;;;;;SAAe;IAClC,MAAM,CAAC,YAAY;;;;;;;;;MAWlB;IAED,WAAW,OAAO;IAElB,GAAG,EAAE,OAAO,GAAG,IAAI,CAAO;IAE1B,SAAS,OAAQ,OAAO,GAAG,IAAI,UAQ9B;IAED,IAAI,OAAO,SAGV;IAED,KAAK;IAKL,MAAM;CA4CP;AAED,eAAe,eAAe,CAAA;AAC9B,OAAO,EAAE,eAAe,EAAE,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/CondensedButton/index.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAQxC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAG1C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAEnD;;;;;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