@instructure/ui-buttons 11.6.0 → 11.6.1-snapshot-129
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.
- package/CHANGELOG.md +57 -323
- package/es/BaseButton/{index.js → v1/index.js} +2 -2
- package/es/BaseButton/v2/index.js +304 -0
- package/es/BaseButton/v2/props.js +26 -0
- package/es/BaseButton/v2/styles.js +578 -0
- package/es/Button/{index.js → v1/index.js} +2 -2
- package/es/{CondensedButton → Button/v1}/theme.js +1 -1
- package/es/Button/v2/index.js +121 -0
- package/es/Button/v2/props.js +26 -0
- package/es/CloseButton/{index.js → v1/index.js} +2 -2
- package/es/CloseButton/v2/index.js +130 -0
- package/es/CloseButton/v2/props.js +26 -0
- package/es/CloseButton/v2/styles.js +68 -0
- package/es/CondensedButton/{index.js → v1/index.js} +2 -2
- package/es/{Button → CondensedButton/v1}/theme.js +1 -1
- package/es/CondensedButton/v2/index.js +111 -0
- package/es/CondensedButton/v2/props.js +26 -0
- package/es/IconButton/{index.js → v1/index.js} +2 -2
- package/es/IconButton/{theme.js → v1/theme.js} +1 -1
- package/es/IconButton/v2/index.js +121 -0
- package/es/IconButton/v2/props.js +26 -0
- package/es/ToggleButton/{index.js → v1/index.js} +2 -2
- package/es/ToggleButton/v2/index.js +121 -0
- package/es/ToggleButton/v2/props.js +26 -0
- package/es/exports/a.js +29 -0
- package/es/exports/b.js +29 -0
- package/lib/BaseButton/{index.js → v1/index.js} +3 -3
- package/lib/BaseButton/v2/index.js +311 -0
- package/lib/BaseButton/v2/props.js +31 -0
- package/lib/BaseButton/v2/styles.js +584 -0
- package/lib/Button/v1/index.js +128 -0
- package/lib/Button/{theme.js → v1/theme.js} +1 -1
- package/lib/Button/{index.js → v2/index.js} +3 -4
- package/lib/Button/v2/props.js +31 -0
- package/lib/CloseButton/{index.js → v1/index.js} +4 -4
- package/lib/CloseButton/v2/index.js +136 -0
- package/lib/CloseButton/v2/props.js +31 -0
- package/lib/CloseButton/v2/styles.js +74 -0
- package/lib/CondensedButton/{index.js → v1/index.js} +3 -3
- package/lib/CondensedButton/{theme.js → v1/theme.js} +1 -1
- package/lib/CondensedButton/v2/index.js +116 -0
- package/lib/CondensedButton/v2/props.js +31 -0
- package/lib/IconButton/{index.js → v1/index.js} +3 -3
- package/lib/IconButton/{theme.js → v1/theme.js} +1 -1
- package/lib/IconButton/v2/index.js +126 -0
- package/lib/IconButton/v2/props.js +31 -0
- package/lib/ToggleButton/{index.js → v1/index.js} +4 -4
- package/lib/ToggleButton/v2/index.js +127 -0
- package/lib/ToggleButton/v2/props.js +31 -0
- package/lib/{index.js → exports/a.js} +12 -12
- package/lib/exports/b.js +47 -0
- package/package.json +46 -24
- package/src/BaseButton/{index.tsx → v1/index.tsx} +3 -3
- package/src/BaseButton/{props.ts → v1/props.ts} +1 -1
- package/src/BaseButton/v2/README.md +15 -0
- package/src/BaseButton/v2/index.tsx +343 -0
- package/src/BaseButton/v2/props.ts +226 -0
- package/src/BaseButton/v2/styles.ts +640 -0
- package/src/Button/{index.tsx → v1/index.tsx} +2 -2
- package/src/Button/{props.ts → v1/props.ts} +1 -1
- package/src/{CondensedButton → Button/v1}/theme.ts +1 -1
- package/src/Button/v2/README.md +338 -0
- package/src/Button/v2/index.tsx +137 -0
- package/src/Button/v2/props.ts +159 -0
- package/src/CloseButton/{index.tsx → v1/index.tsx} +2 -2
- package/src/CloseButton/{props.ts → v1/props.ts} +1 -1
- package/src/CloseButton/v2/README.md +70 -0
- package/src/CloseButton/v2/index.tsx +142 -0
- package/src/CloseButton/v2/props.ts +148 -0
- package/src/CloseButton/v2/styles.ts +81 -0
- package/src/CondensedButton/{index.tsx → v1/index.tsx} +2 -2
- package/src/CondensedButton/{props.ts → v1/props.ts} +1 -1
- package/src/{Button → CondensedButton/v1}/theme.ts +1 -1
- package/src/CondensedButton/v2/README.md +75 -0
- package/src/CondensedButton/v2/index.tsx +129 -0
- package/src/CondensedButton/v2/props.ts +134 -0
- package/src/IconButton/{index.tsx → v1/index.tsx} +2 -2
- package/src/IconButton/{props.ts → v1/props.ts} +1 -1
- package/src/IconButton/{theme.ts → v1/theme.ts} +1 -1
- package/src/IconButton/v2/README.md +86 -0
- package/src/IconButton/v2/index.tsx +138 -0
- package/src/IconButton/v2/props.ts +166 -0
- package/src/ToggleButton/{index.tsx → v1/index.tsx} +2 -2
- package/src/ToggleButton/{props.ts → v1/props.ts} +1 -1
- package/src/ToggleButton/v2/README.md +85 -0
- package/src/ToggleButton/v2/index.tsx +133 -0
- package/src/ToggleButton/v2/props.ts +143 -0
- package/src/exports/a.ts +40 -0
- package/src/exports/b.ts +40 -0
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/BaseButton/{index.d.ts → v1/index.d.ts} +1 -1
- package/types/BaseButton/v1/index.d.ts.map +1 -0
- package/types/BaseButton/{props.d.ts → v1/props.d.ts} +1 -1
- package/types/BaseButton/v1/props.d.ts.map +1 -0
- package/types/BaseButton/v1/styles.d.ts.map +1 -0
- package/types/BaseButton/v1/theme.d.ts.map +1 -0
- package/types/BaseButton/v2/index.d.ts +48 -0
- package/types/BaseButton/v2/index.d.ts.map +1 -0
- package/types/BaseButton/v2/props.d.ts +118 -0
- package/types/BaseButton/v2/props.d.ts.map +1 -0
- package/types/BaseButton/v2/styles.d.ts +5 -0
- package/types/BaseButton/v2/styles.d.ts.map +1 -0
- package/types/Button/{index.d.ts → v1/index.d.ts} +2 -2
- package/types/Button/v1/index.d.ts.map +1 -0
- package/types/Button/{props.d.ts → v1/props.d.ts} +1 -1
- package/types/Button/v1/props.d.ts.map +1 -0
- package/types/Button/v1/theme.d.ts +2 -0
- package/types/Button/v1/theme.d.ts.map +1 -0
- package/types/Button/v2/index.d.ts +51 -0
- package/types/Button/v2/index.d.ts.map +1 -0
- package/types/Button/v2/props.d.ts +82 -0
- package/types/Button/v2/props.d.ts.map +1 -0
- package/types/CloseButton/{index.d.ts → v1/index.d.ts} +1 -1
- package/types/CloseButton/v1/index.d.ts.map +1 -0
- package/types/CloseButton/{props.d.ts → v1/props.d.ts} +1 -1
- package/types/CloseButton/v1/props.d.ts.map +1 -0
- package/types/CloseButton/v1/styles.d.ts.map +1 -0
- package/types/CloseButton/v1/theme.d.ts.map +1 -0
- package/types/CloseButton/v2/index.d.ts +46 -0
- package/types/CloseButton/v2/index.d.ts.map +1 -0
- package/types/CloseButton/v2/props.d.ts +77 -0
- package/types/CloseButton/v2/props.d.ts.map +1 -0
- package/types/CloseButton/v2/styles.d.ts +15 -0
- package/types/CloseButton/v2/styles.d.ts.map +1 -0
- package/types/CondensedButton/{index.d.ts → v1/index.d.ts} +2 -2
- package/types/CondensedButton/v1/index.d.ts.map +1 -0
- package/types/CondensedButton/{props.d.ts → v1/props.d.ts} +1 -1
- package/types/CondensedButton/v1/props.d.ts.map +1 -0
- package/types/CondensedButton/v1/theme.d.ts +2 -0
- package/types/CondensedButton/v1/theme.d.ts.map +1 -0
- package/types/CondensedButton/v2/index.d.ts +45 -0
- package/types/CondensedButton/v2/index.d.ts.map +1 -0
- package/types/CondensedButton/v2/props.d.ts +69 -0
- package/types/CondensedButton/v2/props.d.ts.map +1 -0
- package/types/IconButton/{index.d.ts → v1/index.d.ts} +2 -2
- package/types/IconButton/v1/index.d.ts.map +1 -0
- package/types/IconButton/{props.d.ts → v1/props.d.ts} +1 -1
- package/types/IconButton/v1/props.d.ts.map +1 -0
- package/types/IconButton/v1/theme.d.ts +2 -0
- package/types/IconButton/v1/theme.d.ts.map +1 -0
- package/types/IconButton/v2/index.d.ts +51 -0
- package/types/IconButton/v2/index.d.ts.map +1 -0
- package/types/IconButton/v2/props.d.ts +85 -0
- package/types/IconButton/v2/props.d.ts.map +1 -0
- package/types/ToggleButton/{index.d.ts → v1/index.d.ts} +1 -1
- package/types/ToggleButton/v1/index.d.ts.map +1 -0
- package/types/ToggleButton/{props.d.ts → v1/props.d.ts} +1 -1
- package/types/ToggleButton/v1/props.d.ts.map +1 -0
- package/types/ToggleButton/v2/index.d.ts +43 -0
- package/types/ToggleButton/v2/index.d.ts.map +1 -0
- package/types/ToggleButton/v2/props.d.ts +75 -0
- package/types/ToggleButton/v2/props.d.ts.map +1 -0
- package/types/exports/a.d.ts +13 -0
- package/types/exports/a.d.ts.map +1 -0
- package/types/exports/b.d.ts +13 -0
- package/types/exports/b.d.ts.map +1 -0
- package/es/index.js +0 -29
- package/src/index.ts +0 -37
- package/types/BaseButton/index.d.ts.map +0 -1
- package/types/BaseButton/props.d.ts.map +0 -1
- package/types/BaseButton/styles.d.ts.map +0 -1
- package/types/BaseButton/theme.d.ts.map +0 -1
- package/types/Button/index.d.ts.map +0 -1
- package/types/Button/props.d.ts.map +0 -1
- package/types/Button/theme.d.ts +0 -2
- package/types/Button/theme.d.ts.map +0 -1
- package/types/CloseButton/index.d.ts.map +0 -1
- package/types/CloseButton/props.d.ts.map +0 -1
- package/types/CloseButton/styles.d.ts.map +0 -1
- package/types/CloseButton/theme.d.ts.map +0 -1
- package/types/CondensedButton/index.d.ts.map +0 -1
- package/types/CondensedButton/props.d.ts.map +0 -1
- package/types/CondensedButton/theme.d.ts +0 -2
- package/types/CondensedButton/theme.d.ts.map +0 -1
- package/types/IconButton/index.d.ts.map +0 -1
- package/types/IconButton/props.d.ts.map +0 -1
- package/types/IconButton/theme.d.ts +0 -2
- package/types/IconButton/theme.d.ts.map +0 -1
- package/types/ToggleButton/index.d.ts.map +0 -1
- package/types/ToggleButton/props.d.ts.map +0 -1
- package/types/index.d.ts +0 -13
- package/types/index.d.ts.map +0 -1
- /package/es/BaseButton/{props.js → v1/props.js} +0 -0
- /package/es/BaseButton/{styles.js → v1/styles.js} +0 -0
- /package/es/BaseButton/{theme.js → v1/theme.js} +0 -0
- /package/es/Button/{props.js → v1/props.js} +0 -0
- /package/es/CloseButton/{props.js → v1/props.js} +0 -0
- /package/es/CloseButton/{styles.js → v1/styles.js} +0 -0
- /package/es/CloseButton/{theme.js → v1/theme.js} +0 -0
- /package/es/CondensedButton/{props.js → v1/props.js} +0 -0
- /package/es/IconButton/{props.js → v1/props.js} +0 -0
- /package/es/ToggleButton/{props.js → v1/props.js} +0 -0
- /package/lib/BaseButton/{props.js → v1/props.js} +0 -0
- /package/lib/BaseButton/{styles.js → v1/styles.js} +0 -0
- /package/lib/BaseButton/{theme.js → v1/theme.js} +0 -0
- /package/lib/Button/{props.js → v1/props.js} +0 -0
- /package/lib/CloseButton/{props.js → v1/props.js} +0 -0
- /package/lib/CloseButton/{styles.js → v1/styles.js} +0 -0
- /package/lib/CloseButton/{theme.js → v1/theme.js} +0 -0
- /package/lib/CondensedButton/{props.js → v1/props.js} +0 -0
- /package/lib/IconButton/{props.js → v1/props.js} +0 -0
- /package/lib/ToggleButton/{props.js → v1/props.js} +0 -0
- /package/src/BaseButton/{README.md → v1/README.md} +0 -0
- /package/src/BaseButton/{styles.ts → v1/styles.ts} +0 -0
- /package/src/BaseButton/{theme.ts → v1/theme.ts} +0 -0
- /package/src/Button/{README.md → v1/README.md} +0 -0
- /package/src/CloseButton/{README.md → v1/README.md} +0 -0
- /package/src/CloseButton/{styles.ts → v1/styles.ts} +0 -0
- /package/src/CloseButton/{theme.ts → v1/theme.ts} +0 -0
- /package/src/CondensedButton/{README.md → v1/README.md} +0 -0
- /package/src/IconButton/{README.md → v1/README.md} +0 -0
- /package/src/ToggleButton/{README.md → v1/README.md} +0 -0
- /package/types/BaseButton/{styles.d.ts → v1/styles.d.ts} +0 -0
- /package/types/BaseButton/{theme.d.ts → v1/theme.d.ts} +0 -0
- /package/types/CloseButton/{styles.d.ts → v1/styles.d.ts} +0 -0
- /package/types/CloseButton/{theme.d.ts → v1/theme.d.ts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/BaseButton/v1/index.tsx"],"names":[],"mappings":"AAwBA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAYjC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAA;AAa3D,OAAO,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAEpE;;;;GAIG;AAEH,cACM,UAAW,SAAQ,SAAS,CAAC,eAAe,CAAC;IACjD,MAAM,CAAC,QAAQ,CAAC,WAAW,gBAAe;IAE1C,MAAM,CAAC,YAAY,0DAAe;IAClC,MAAM,CAAC,YAAY;;;;;;;;;;;;;;MAeT;IAEV,GAAG,EAAE,WAAW,GAAG,IAAI,CAAO;IAE9B,iBAAiB;IAIjB,kBAAkB;IAIlB,IAAI,mBAAmB,IAAI,oBAAoB,CAM9C;IAED,IAAI,kBAAkB,YAGrB;IAED,IAAI,WAAW,0PAEd;IAED,IAAI,WAAW,0DAEd;IAED,IAAI,UAAU,YAEb;IAED,IAAI,UAAU,YAEb;IAED,IAAI,SAAS,YAEZ;IAED,IAAI,UAAU,uBAiBb;IAED,IAAI,OAAO,YAEV;IAED,KAAK;IAIL,gBAAgB,GAAI,IAAI,WAAW,GAAG,IAAI,UAQzC;IAED,WAAW,GAAI,OAAO,KAAK,CAAC,UAAU,CAAC,SAAS,GAAG,OAAO,CAAC,UAa1D;IAED,aAAa,GAAI,OAAO,KAAK,CAAC,aAAa,CAAC,SAAS,GAAG,OAAO,CAAC,UA0B/D;IAED,cAAc;IAgCd,MAAM;CAqFP;AAED,OAAO,EAAE,UAAU,EAAE,CAAA;AACrB,eAAe,UAAU,CAAA"}
|
|
@@ -3,7 +3,7 @@ import type { InteractionType } from '@instructure/ui-react-utils';
|
|
|
3
3
|
import type { Spacing, WithStyleProps, ComponentStyle } from '@instructure/emotion';
|
|
4
4
|
import type { ToProp, AsElementType, BaseButtonTheme, OtherHTMLAttributes } from '@instructure/shared-types';
|
|
5
5
|
import type { Cursor } from '@instructure/shared-types';
|
|
6
|
-
import type { ViewProps } from '@instructure/ui-view';
|
|
6
|
+
import type { ViewProps } from '@instructure/ui-view/v11_6';
|
|
7
7
|
import { Renderable } from '@instructure/shared-types';
|
|
8
8
|
type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AER,KAAK,eAAe,GAAG,cAAc,CACjC,YAAY,GACZ,SAAS,GACT,UAAU,GACV,SAAS,GACT,gBAAgB,GAChB,UAAU,GACV,aAAa,GACb,iBAAiB,CACpB,CAAA;AACD,QAAA,MAAM,YAAY,EAAE,eAsBnB,CAAA;AAED,YAAY,EACV,eAAe,EACf,kBAAkB,EAClB,oBAAoB,EACpB,eAAe,EAChB,CAAA;AACD,OAAO,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/BaseButton/v1/styles.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAChE,OAAO,KAAK,EACV,eAAe,EACf,oBAAoB,EACpB,eAAe,EAChB,MAAM,SAAS,CAAA;AAIhB;;;;;;;;;GASG;AACH,QAAA,MAAM,aAAa,GACjB,gBAAgB,eAAe,EAC/B,OAAO,eAAe,EACtB,OAAO,oBAAoB,KAC1B,eAseF,CAAA;AAED,eAAe,aAAa,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../src/BaseButton/v1/theme.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,KAAK,EAAsB,MAAM,wBAAwB,CAAA;AACvE,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAK3D;;;;GAIG;AACH,QAAA,MAAM,sBAAsB,GAAI,OAAO,KAAK,KAAG,eAgL9C,CAAA;AAED,eAAe,sBAAsB,CAAA"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Component } from 'react';
|
|
2
|
+
import type { ViewProps } from '@instructure/ui-view/latest';
|
|
3
|
+
import type { BaseButtonProps, BaseButtonStyleProps } from './props';
|
|
4
|
+
/**
|
|
5
|
+
---
|
|
6
|
+
category: components/utilities
|
|
7
|
+
---
|
|
8
|
+
**/
|
|
9
|
+
declare class BaseButton extends Component<BaseButtonProps> {
|
|
10
|
+
static readonly componentId = "BaseButton";
|
|
11
|
+
static allowedProps: readonly (keyof import("./props").BaseButtonOwnProps)[];
|
|
12
|
+
static defaultProps: {
|
|
13
|
+
readonly type: "button";
|
|
14
|
+
readonly size: "medium";
|
|
15
|
+
readonly as: "button";
|
|
16
|
+
readonly interaction: undefined;
|
|
17
|
+
readonly color: "secondary";
|
|
18
|
+
readonly shape: "rectangle";
|
|
19
|
+
readonly display: "inline-block";
|
|
20
|
+
readonly textAlign: "start";
|
|
21
|
+
readonly withBackground: true;
|
|
22
|
+
readonly withBorder: true;
|
|
23
|
+
readonly isCondensed: false;
|
|
24
|
+
readonly margin: "0";
|
|
25
|
+
readonly cursor: "pointer";
|
|
26
|
+
};
|
|
27
|
+
ref: HTMLElement | null;
|
|
28
|
+
componentDidMount(): void;
|
|
29
|
+
componentDidUpdate(): void;
|
|
30
|
+
get makeStylesVariables(): BaseButtonStyleProps;
|
|
31
|
+
get hasOnlyIconVisible(): boolean;
|
|
32
|
+
get elementType(): import("react").ComponentClass<any, any> | NonNullable<import("@instructure/shared-types").AsElementType | undefined> | import("react").ComponentClass<Readonly<BaseButtonProps>, any> | import("react").FunctionComponent<Readonly<BaseButtonProps>>;
|
|
33
|
+
get interaction(): import("@instructure/ui-react-utils").InteractionType;
|
|
34
|
+
get isDisabled(): boolean;
|
|
35
|
+
get isReadOnly(): boolean;
|
|
36
|
+
get isEnabled(): boolean;
|
|
37
|
+
get focusColor(): "info" | "inverse";
|
|
38
|
+
get focused(): boolean;
|
|
39
|
+
focus(): void;
|
|
40
|
+
handleElementRef: (el: HTMLElement | null) => void;
|
|
41
|
+
handleClick: (event: React.MouseEvent<ViewProps & Element>) => void;
|
|
42
|
+
handleKeyDown: (event: React.KeyboardEvent<ViewProps & Element>) => void;
|
|
43
|
+
renderChildren(): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
44
|
+
render(): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
45
|
+
}
|
|
46
|
+
export { BaseButton };
|
|
47
|
+
export default BaseButton;
|
|
48
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/BaseButton/v2/index.tsx"],"names":[],"mappings":"AAwBA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAYjC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAA;AAY5D,OAAO,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAoBpE;;;;GAIG;AACH,cACM,UAAW,SAAQ,SAAS,CAAC,eAAe,CAAC;IACjD,MAAM,CAAC,QAAQ,CAAC,WAAW,gBAAe;IAE1C,MAAM,CAAC,YAAY,0DAAe;IAClC,MAAM,CAAC,YAAY;;;;;;;;;;;;;;MAeT;IAEV,GAAG,EAAE,WAAW,GAAG,IAAI,CAAO;IAE9B,iBAAiB;IAIjB,kBAAkB;IAIlB,IAAI,mBAAmB,IAAI,oBAAoB,CAM9C;IAED,IAAI,kBAAkB,YAGrB;IAED,IAAI,WAAW,0PAEd;IAED,IAAI,WAAW,0DAEd;IAED,IAAI,UAAU,YAEb;IAED,IAAI,UAAU,YAEb;IAED,IAAI,SAAS,YAEZ;IAED,IAAI,UAAU,uBAiBb;IAED,IAAI,OAAO,YAEV;IAED,KAAK;IAIL,gBAAgB,GAAI,IAAI,WAAW,GAAG,IAAI,UAQzC;IAED,WAAW,GAAI,OAAO,KAAK,CAAC,UAAU,CAAC,SAAS,GAAG,OAAO,CAAC,UAa1D;IAED,aAAa,GAAI,OAAO,KAAK,CAAC,aAAa,CAAC,SAAS,GAAG,OAAO,CAAC,UA0B/D;IAED,cAAc;IAoCd,MAAM;CAqFP;AAED,OAAO,EAAE,UAAU,EAAE,CAAA;AACrB,eAAe,UAAU,CAAA"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { InteractionType } from '@instructure/ui-react-utils';
|
|
3
|
+
import type { Spacing, WithStyleProps, ComponentStyle } from '@instructure/emotion';
|
|
4
|
+
import type { ToProp, AsElementType, BaseButtonTheme, OtherHTMLAttributes } from '@instructure/shared-types';
|
|
5
|
+
import type { Cursor } from '@instructure/shared-types';
|
|
6
|
+
import type { ViewProps } from '@instructure/ui-view/latest';
|
|
7
|
+
import { Renderable } from '@instructure/shared-types';
|
|
8
|
+
type BaseButtonOwnProps = {
|
|
9
|
+
/**
|
|
10
|
+
* Specifies the `Button` children.
|
|
11
|
+
*/
|
|
12
|
+
children?: React.ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* Specifies the type of the `Button`'s underlying html element.
|
|
15
|
+
*/
|
|
16
|
+
type?: 'button' | 'submit' | 'reset';
|
|
17
|
+
/**
|
|
18
|
+
* The size of the `Button`
|
|
19
|
+
*/
|
|
20
|
+
size?: 'small' | 'medium' | 'large' | 'condensedSmall' | 'condensedMedium';
|
|
21
|
+
/**
|
|
22
|
+
* Provides a reference to the `Button`'s underlying html element.
|
|
23
|
+
*/
|
|
24
|
+
elementRef?: (element: HTMLElement | null) => void;
|
|
25
|
+
/**
|
|
26
|
+
* The element to render as the component root, `Button` by default.
|
|
27
|
+
*/
|
|
28
|
+
as?: AsElementType;
|
|
29
|
+
/**
|
|
30
|
+
* Specifies if interaction with the `Button` is enabled, disabled, or readonly.
|
|
31
|
+
*/
|
|
32
|
+
interaction?: InteractionType;
|
|
33
|
+
/**
|
|
34
|
+
* Specifies the color for the `Button`.
|
|
35
|
+
*/
|
|
36
|
+
color?: 'primary' | 'primary-inverse' | 'secondary' | 'success' | 'danger' | 'ai-primary' | 'ai-secondary';
|
|
37
|
+
/**
|
|
38
|
+
* Override the `Button`'s default focus outline color.
|
|
39
|
+
*/
|
|
40
|
+
focusColor?: 'info' | 'inverse';
|
|
41
|
+
/**
|
|
42
|
+
* The `Button` display property. When set to `inline-block`, the `Button` displays inline with other elements.
|
|
43
|
+
* When set to block, the `Button` expands to fill the width of the container.
|
|
44
|
+
*/
|
|
45
|
+
display?: 'inline-block' | 'block';
|
|
46
|
+
/**
|
|
47
|
+
* Sets the alignment of the `Button` children and/or icon.
|
|
48
|
+
*/
|
|
49
|
+
textAlign?: 'start' | 'center';
|
|
50
|
+
/**
|
|
51
|
+
* Specifies if the `Button` shape should be a circle or rectangle.
|
|
52
|
+
*/
|
|
53
|
+
shape?: 'rectangle' | 'circle';
|
|
54
|
+
/**
|
|
55
|
+
* Specifies if the `Button` should render with a solid background. When false, the background is transparent.
|
|
56
|
+
*/
|
|
57
|
+
withBackground?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Specifies if the `Button` should render with a border.
|
|
60
|
+
*/
|
|
61
|
+
withBorder?: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Designates if the `Button` should render without padding. This option should only be set when `withBorder` and
|
|
64
|
+
* `withBackground` are also set to false.
|
|
65
|
+
*/
|
|
66
|
+
isCondensed?: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Valid values are `0`, `none`, `auto`, `xxx-small`, `xx-small`, `x-small`,
|
|
69
|
+
* `small`, `medium`, `large`, `x-large`, `xx-large`. Apply these values via
|
|
70
|
+
* familiar CSS-like shorthand. For example: `margin="small auto large"`.
|
|
71
|
+
*/
|
|
72
|
+
margin?: Spacing;
|
|
73
|
+
/**
|
|
74
|
+
* Specify a mouse cursor to use when hovering over the button.
|
|
75
|
+
* The `pointer` cursor is used by default.
|
|
76
|
+
*/
|
|
77
|
+
cursor?: Cursor;
|
|
78
|
+
/**
|
|
79
|
+
* Specifies an href attribute for the `Button`'s underlying html element.
|
|
80
|
+
*/
|
|
81
|
+
href?: string;
|
|
82
|
+
/**
|
|
83
|
+
* Callback fired when the `Button` is clicked.
|
|
84
|
+
*/
|
|
85
|
+
onClick?: (event: React.KeyboardEvent<ViewProps> | React.MouseEvent<ViewProps>) => void;
|
|
86
|
+
/**
|
|
87
|
+
* Callback fired when the `Button` receives a keydown event.
|
|
88
|
+
*/
|
|
89
|
+
onKeyDown?: (event: React.KeyboardEvent<ViewProps>) => void;
|
|
90
|
+
/**
|
|
91
|
+
* An icon, or function that returns an icon.
|
|
92
|
+
*/
|
|
93
|
+
renderIcon?: Renderable;
|
|
94
|
+
/**
|
|
95
|
+
* Specifies the tabindex of the `Button`.
|
|
96
|
+
*/
|
|
97
|
+
tabIndex?: number;
|
|
98
|
+
/**
|
|
99
|
+
* Manually control if the `Button` should display a focus outline.
|
|
100
|
+
*
|
|
101
|
+
* When left `undefined` (which is the default) the focus outline will display
|
|
102
|
+
* if this component is focusable and receives focus.
|
|
103
|
+
*/
|
|
104
|
+
withFocusOutline?: boolean;
|
|
105
|
+
};
|
|
106
|
+
type BaseButtonStyleProps = {
|
|
107
|
+
isDisabled: boolean;
|
|
108
|
+
hasOnlyIconVisible: boolean;
|
|
109
|
+
isEnabled: boolean;
|
|
110
|
+
};
|
|
111
|
+
type PropKeys = keyof BaseButtonOwnProps;
|
|
112
|
+
type AllowedPropKeys = Readonly<Array<PropKeys>>;
|
|
113
|
+
type BaseButtonProps = BaseButtonOwnProps & WithStyleProps<BaseButtonTheme, BaseButtonStyle> & OtherHTMLAttributes<BaseButtonOwnProps> & ToProp;
|
|
114
|
+
type BaseButtonStyle = ComponentStyle<'baseButton' | 'content' | 'children' | 'iconSVG' | 'childrenLayout' | 'iconOnly' | 'iconWrapper' | 'childrenWrapper'>;
|
|
115
|
+
declare const allowedProps: AllowedPropKeys;
|
|
116
|
+
export type { BaseButtonProps, BaseButtonOwnProps, BaseButtonStyleProps, BaseButtonStyle };
|
|
117
|
+
export { allowedProps };
|
|
118
|
+
//# sourceMappingURL=props.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../src/BaseButton/v2/props.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB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Y,EAAE,eAsBnB,CAAA;AAED,YAAY,EACV,eAAe,EACf,kBAAkB,EAClB,oBAAoB,EACpB,eAAe,EAChB,CAAA;AACD,OAAO,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { NewComponentTypes, SharedTokens } from '@instructure/ui-themes';
|
|
2
|
+
import type { BaseButtonProps, BaseButtonStyleProps, BaseButtonStyle } from './props';
|
|
3
|
+
declare const generateStyle: (componentTheme: NewComponentTypes["BaseButton"], params: BaseButtonProps, _sharedTokens: SharedTokens, extraArgs: BaseButtonStyleProps) => BaseButtonStyle;
|
|
4
|
+
export default generateStyle;
|
|
5
|
+
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/BaseButton/v2/styles.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAC7E,OAAO,KAAK,EACV,eAAe,EACf,oBAAoB,EACpB,eAAe,EAChB,MAAM,SAAS,CAAA;AAEhB,QAAA,MAAM,aAAa,GACjB,gBAAgB,iBAAiB,CAAC,YAAY,CAAC,EAC/C,QAAQ,eAAe,EACvB,eAAe,YAAY,EAC3B,WAAW,oBAAoB,KAC9B,eAylBF,CAAA;AAED,eAAe,aAAa,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Component } from 'react';
|
|
2
|
-
import { BaseButton } from '
|
|
2
|
+
import { BaseButton } from '../../BaseButton/v1';
|
|
3
3
|
import type { ButtonProps } from './props';
|
|
4
4
|
/**
|
|
5
5
|
---
|
|
@@ -24,7 +24,7 @@ declare class Button extends Component<ButtonProps> {
|
|
|
24
24
|
cursor?: import("@instructure/shared-types").Cursor;
|
|
25
25
|
href?: string;
|
|
26
26
|
renderIcon?: React.ReactNode | (() => React.ReactNode);
|
|
27
|
-
onClick?: (event: React.KeyboardEvent<import("@instructure/ui-view").ViewProps> | React.MouseEvent<import("@instructure/ui-view").ViewProps>) => void;
|
|
27
|
+
onClick?: (event: React.KeyboardEvent<import("@instructure/ui-view/types/exports/a.js").ViewProps> | React.MouseEvent<import("@instructure/ui-view/types/exports/a.js").ViewProps>) => void;
|
|
28
28
|
})[];
|
|
29
29
|
static defaultProps: {
|
|
30
30
|
type: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Button/v1/index.tsx"],"names":[],"mappings":"AAwBA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAOjC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAGhD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1C;;;;GAIG;AAEH,cACM,MAAO,SAAQ,SAAS,CAAC,WAAW,CAAC;IACzC,MAAM,CAAC,QAAQ,CAAC,WAAW,YAAW;IAEtC,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,GAAI,IAAI,OAAO,GAAG,IAAI,UAQrC;IAED,eAAe,GAAI,WAAW,UAAU,GAAG,IAAI,UAE9C;IAED,MAAM;CAgDP;AAED,eAAe,MAAM,CAAA;AACrB,OAAO,EAAE,MAAM,EAAE,CAAA"}
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import type { Spacing, WithStyleProps } from '@instructure/emotion';
|
|
3
3
|
import type { ToProp, AsElementType, BaseButtonTheme, OtherHTMLAttributes } from '@instructure/shared-types';
|
|
4
4
|
import type { Cursor } from '@instructure/shared-types';
|
|
5
|
-
import type { ViewProps } from '@instructure/ui-view';
|
|
5
|
+
import type { ViewProps } from '@instructure/ui-view/v11_6';
|
|
6
6
|
type ButtonOwnProps = {
|
|
7
7
|
/**
|
|
8
8
|
* Specifies the `Button` children.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../src/Button/v1/props.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACnE,OAAO,KAAK,EACV,MAAM,EACN,aAAa,EACb,eAAe,EACf,mBAAmB,EACpB,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAA;AAE3D,KAAK,cAAc,GAAG;IACpB;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAE1B;;OAEG;IACH,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAA;IAEpC;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAA;IAEnC;;OAEG;IACH,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,KAAK,IAAI,CAAA;IAE9C;;OAEG;IACH,EAAE,CAAC,EAAE,aAAa,CAAA;IAElB;;OAEG;IACH,WAAW,CAAC,EAAE,SAAS,GAAG,UAAU,GAAG,UAAU,CAAA;IAEjD;;OAEG;IACH,KAAK,CAAC,EACF,SAAS,GACT,iBAAiB,GACjB,WAAW,GACX,SAAS,GACT,QAAQ,GACR,YAAY,GACZ,cAAc,CAAA;IAElB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAE/B;;;OAGG;IACH,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAA;IAElC;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAA;IAE9B;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,CAAA;IAExB;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAEhB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IAEf;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IAEb;;OAEG;IACH,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,CAAC,MAAM,KAAK,CAAC,SAAS,CAAC,CAAA;IAEtD;;OAEG;IACH,OAAO,CAAC,EAAE,CACR,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC,UAAU,CAAC,SAAS,CAAC,KAChE,IAAI,CAAA;CACV,CAAA;AAED,KAAK,QAAQ,GAAG,MAAM,cAAc,CAAA;AAEpC,KAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,KAAK,WAAW,GAAG,cAAc,GAC/B,cAAc,CAAC,eAAe,EAAE,IAAI,CAAC,GACrC,mBAAmB,CAAC,cAAc,CAAC,GACnC,MAAM,CAAA;AACR,QAAA,MAAM,YAAY,EAAE,eAiBnB,CAAA;AAED,YAAY,EAAE,WAAW,EAAE,CAAA;AAC3B,OAAO,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../src/Button/v1/theme.ts"],"names":[],"mappings":"AAwBA,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Component } from 'react';
|
|
2
|
+
import { BaseButton } from '../../BaseButton/v2';
|
|
3
|
+
import type { ButtonProps } from './props';
|
|
4
|
+
/**
|
|
5
|
+
---
|
|
6
|
+
category: components
|
|
7
|
+
---
|
|
8
|
+
**/
|
|
9
|
+
declare class Button extends Component<ButtonProps> {
|
|
10
|
+
static readonly componentId = "Button";
|
|
11
|
+
static allowedProps: readonly (keyof {
|
|
12
|
+
children?: React.ReactNode;
|
|
13
|
+
type?: "button" | "submit" | "reset";
|
|
14
|
+
size?: "small" | "medium" | "large" | "condensedSmall" | "condensedMedium";
|
|
15
|
+
elementRef?: (element: Element | null) => void;
|
|
16
|
+
as?: import("@instructure/shared-types").AsElementType;
|
|
17
|
+
interaction?: "enabled" | "disabled" | "readonly";
|
|
18
|
+
color?: "primary" | "primary-inverse" | "secondary" | "success" | "danger" | "ai-primary" | "ai-secondary";
|
|
19
|
+
focusColor?: "info" | "inverse";
|
|
20
|
+
display?: "inline-block" | "block";
|
|
21
|
+
textAlign?: "start" | "center";
|
|
22
|
+
withBackground?: boolean;
|
|
23
|
+
margin?: import("@instructure/emotion").Spacing;
|
|
24
|
+
cursor?: import("@instructure/shared-types").Cursor;
|
|
25
|
+
href?: string;
|
|
26
|
+
renderIcon?: React.ReactNode | (() => React.ReactNode);
|
|
27
|
+
onClick?: (event: React.KeyboardEvent<import("@instructure/ui-view/types/exports/b.js").ViewProps> | React.MouseEvent<import("@instructure/ui-view/types/exports/b.js").ViewProps>) => void;
|
|
28
|
+
})[];
|
|
29
|
+
static defaultProps: {
|
|
30
|
+
type: string;
|
|
31
|
+
size: string;
|
|
32
|
+
as: string;
|
|
33
|
+
interaction: undefined;
|
|
34
|
+
color: string;
|
|
35
|
+
display: string;
|
|
36
|
+
textAlign: string;
|
|
37
|
+
withBackground: boolean;
|
|
38
|
+
margin: string;
|
|
39
|
+
cursor: string;
|
|
40
|
+
};
|
|
41
|
+
_buttonComponent: BaseButton | null;
|
|
42
|
+
ref: Element | null;
|
|
43
|
+
get focused(): boolean | null;
|
|
44
|
+
focus(): void;
|
|
45
|
+
handleElementRef: (el: Element | null) => void;
|
|
46
|
+
handleButtonRef: (component: BaseButton | null) => void;
|
|
47
|
+
render(): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
48
|
+
}
|
|
49
|
+
export default Button;
|
|
50
|
+
export { Button };
|
|
51
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Button/v2/index.tsx"],"names":[],"mappings":"AAwBA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAKjC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAGhD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1C;;;;GAIG;AAEH,cACM,MAAO,SAAQ,SAAS,CAAC,WAAW,CAAC;IACzC,MAAM,CAAC,QAAQ,CAAC,WAAW,YAAW;IAEtC,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,GAAI,IAAI,OAAO,GAAG,IAAI,UAQrC;IAED,eAAe,GAAI,WAAW,UAAU,GAAG,IAAI,UAE9C;IAED,MAAM;CAgDP;AAED,eAAe,MAAM,CAAA;AACrB,OAAO,EAAE,MAAM,EAAE,CAAA"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Spacing, WithStyleProps } from '@instructure/emotion';
|
|
3
|
+
import type { ToProp, AsElementType, BaseButtonTheme, OtherHTMLAttributes } from '@instructure/shared-types';
|
|
4
|
+
import type { Cursor } from '@instructure/shared-types';
|
|
5
|
+
import type { ViewProps } from '@instructure/ui-view/latest';
|
|
6
|
+
type ButtonOwnProps = {
|
|
7
|
+
/**
|
|
8
|
+
* Specifies the `Button` children.
|
|
9
|
+
*/
|
|
10
|
+
children?: React.ReactNode;
|
|
11
|
+
/**
|
|
12
|
+
* Specifies the type of the `Button`'s underlying html element.
|
|
13
|
+
*/
|
|
14
|
+
type?: 'button' | 'submit' | 'reset';
|
|
15
|
+
/**
|
|
16
|
+
* The size of the `Button`
|
|
17
|
+
*/
|
|
18
|
+
size?: 'small' | 'medium' | 'large' | 'condensedSmall' | 'condensedMedium';
|
|
19
|
+
/**
|
|
20
|
+
* Provides a reference to the `Button`'s underlying html element.
|
|
21
|
+
*/
|
|
22
|
+
elementRef?: (element: Element | null) => void;
|
|
23
|
+
/**
|
|
24
|
+
* The element to render as the component root, `Button` by default.
|
|
25
|
+
*/
|
|
26
|
+
as?: AsElementType;
|
|
27
|
+
/**
|
|
28
|
+
* Specifies if interaction with the `Button` is enabled, disabled, or readonly.
|
|
29
|
+
*/
|
|
30
|
+
interaction?: 'enabled' | 'disabled' | 'readonly';
|
|
31
|
+
/**
|
|
32
|
+
* Specifies the color for the `Button`.
|
|
33
|
+
*/
|
|
34
|
+
color?: 'primary' | 'primary-inverse' | 'secondary' | 'success' | 'danger' | 'ai-primary' | 'ai-secondary';
|
|
35
|
+
/**
|
|
36
|
+
* Override the `Button`'s default focus outline color.
|
|
37
|
+
*/
|
|
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
|
+
*/
|
|
43
|
+
display?: 'inline-block' | 'block';
|
|
44
|
+
/**
|
|
45
|
+
* Sets the alignment of the `Button` children and/or icon.
|
|
46
|
+
*/
|
|
47
|
+
textAlign?: 'start' | 'center';
|
|
48
|
+
/**
|
|
49
|
+
* Specifies if the `Button` should render with a solid background. When false, the background is transparent.
|
|
50
|
+
*/
|
|
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
|
+
*/
|
|
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
|
+
*/
|
|
62
|
+
cursor?: Cursor;
|
|
63
|
+
/**
|
|
64
|
+
* Specifies an href attribute for the `Button`'s underlying html element.
|
|
65
|
+
*/
|
|
66
|
+
href?: string;
|
|
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;
|
|
75
|
+
};
|
|
76
|
+
type PropKeys = keyof ButtonOwnProps;
|
|
77
|
+
type AllowedPropKeys = Readonly<Array<PropKeys>>;
|
|
78
|
+
type ButtonProps = ButtonOwnProps & WithStyleProps<BaseButtonTheme, null> & OtherHTMLAttributes<ButtonOwnProps> & ToProp;
|
|
79
|
+
declare const allowedProps: AllowedPropKeys;
|
|
80
|
+
export type { ButtonProps };
|
|
81
|
+
export { allowedProps };
|
|
82
|
+
//# sourceMappingURL=props.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../src/Button/v2/props.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACnE,OAAO,KAAK,EACV,MAAM,EACN,aAAa,EACb,eAAe,EACf,mBAAmB,EACpB,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,EAAE,MAAM,EA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Aa,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC,UAAU,CAAC,SAAS,CAAC,KAChE,IAAI,CAAA;CACV,CAAA;AAED,KAAK,QAAQ,GAAG,MAAM,cAAc,CAAA;AAEpC,KAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,KAAK,WAAW,GAAG,cAAc,GAC/B,cAAc,CAAC,eAAe,EAAE,IAAI,CAAC,GACrC,mBAAmB,CAAC,cAAc,CAAC,GACnC,MAAM,CAAA;AACR,QAAA,MAAM,YAAY,EAAE,eAiBnB,CAAA;AAED,YAAY,EAAE,WAAW,EAAE,CAAA;AAC3B,OAAO,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -13,7 +13,7 @@ declare class CloseButton extends Component<CloseButtonProps> {
|
|
|
13
13
|
interaction?: "enabled" | "disabled" | "readonly";
|
|
14
14
|
elementRef?: (element: Element | null) => void;
|
|
15
15
|
size?: "small" | "medium" | "large";
|
|
16
|
-
onClick?: (event: React.KeyboardEvent<import("@instructure/ui-view").ViewProps> | React.MouseEvent<import("@instructure/ui-view").ViewProps>) => void;
|
|
16
|
+
onClick?: (event: React.KeyboardEvent<import("@instructure/ui-view/types/exports/a.js").ViewProps> | React.MouseEvent<import("@instructure/ui-view/types/exports/a.js").ViewProps>) => void;
|
|
17
17
|
margin?: import("@instructure/emotion").Spacing;
|
|
18
18
|
placement?: "start" | "end" | "static";
|
|
19
19
|
offset?: "none" | "x-small" | "small" | "medium";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/CloseButton/v1/index.tsx"],"names":[],"mappings":"AAwBA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAajC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAE/C;;;;GAIG;AACH,cACM,WAAY,SAAQ,SAAS,CAAC,gBAAgB,CAAC;IACnD,MAAM,CAAC,QAAQ,CAAC,WAAW,iBAAgB;IAE3C,MAAM,CAAC,YAAY;;;;;;;;;;;;;;;SAAe;IAClC,MAAM,CAAC,YAAY;;;;;;;;;MAUlB;IAED,GAAG,EAAE,OAAO,GAAG,IAAI,CAAO;IAE1B,SAAS,GAAI,IAAI,OAAO,GAAG,IAAI,UAK9B;IAED,iBAAiB;IAIjB,kBAAkB;IAIlB,IAAI,WAAW,0DAEd;IAED,IAAI,KAAK,gDAIR;IAED,MAAM;CAgDP;AAED,eAAe,WAAW,CAAA;AAC1B,OAAO,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import type { Spacing, WithStyleProps, ComponentStyle } from '@instructure/emotion';
|
|
3
3
|
import type { ToProp, AsElementType, CloseButtonTheme, OtherHTMLAttributes } from '@instructure/shared-types';
|
|
4
4
|
import type { Cursor } from '@instructure/shared-types';
|
|
5
|
-
import type { ViewProps } from '@instructure/ui-view';
|
|
5
|
+
import type { ViewProps } from '@instructure/ui-view/v11_6';
|
|
6
6
|
type CloseButtonOwnProps = {
|
|
7
7
|
/**
|
|
8
8
|
* An accessible label for the `CloseButton` (required)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../src/CloseButton/v1/props.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,KAAK,EACV,OAAO,EACP,cAAc,EACd,cAAc,EACf,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EACV,MAAM,EACN,aAAa,EACb,gBAAgB,EAChB,mBAAmB,EACpB,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAA;AAE3D,KAAK,mBAAmB,GAAG;IACzB;;OAEG;IACH,iBAAiB,EAAE,KAAK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AK,gBAAgB,GAAG,cAAc,CAAC,aAAa,CAAC,CAAA;AACrD,QAAA,MAAM,YAAY,EAAE,eAenB,CAAA;AAED,YAAY,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,CAAA;AAClD,OAAO,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/CloseButton/v1/styles.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAEjE;;;;;;;;;GASG;AACH,QAAA,MAAM,aAAa,GACjB,gBAAgB,gBAAgB,EAChC,OAAO,gBAAgB,KACtB,gBAqCF,CAAA;AAED,eAAe,aAAa,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../src/CloseButton/v1/theme.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAE5D;;;;GAIG;AACH,QAAA,MAAM,sBAAsB,GAAI,OAAO,KAAK,KAAG,gBAa9C,CAAA;AAED,eAAe,sBAAsB,CAAA"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Component } from 'react';
|
|
2
|
+
import type { CloseButtonProps } from './props';
|
|
3
|
+
/**
|
|
4
|
+
---
|
|
5
|
+
category: components
|
|
6
|
+
---
|
|
7
|
+
**/
|
|
8
|
+
declare class CloseButton extends Component<CloseButtonProps> {
|
|
9
|
+
static readonly componentId = "CloseButton";
|
|
10
|
+
static allowedProps: readonly (keyof {
|
|
11
|
+
screenReaderLabel: React.ReactNode;
|
|
12
|
+
color?: "primary" | "primary-inverse";
|
|
13
|
+
interaction?: "enabled" | "disabled" | "readonly";
|
|
14
|
+
elementRef?: (element: Element | null) => void;
|
|
15
|
+
size?: "small" | "medium" | "large";
|
|
16
|
+
onClick?: (event: React.KeyboardEvent<import("@instructure/ui-view/types/exports/b.js").ViewProps> | React.MouseEvent<import("@instructure/ui-view/types/exports/b.js").ViewProps>) => void;
|
|
17
|
+
margin?: import("@instructure/emotion").Spacing;
|
|
18
|
+
placement?: "start" | "end" | "static";
|
|
19
|
+
offset?: "none" | "x-small" | "small" | "medium";
|
|
20
|
+
type?: "button" | "submit" | "reset";
|
|
21
|
+
as?: import("@instructure/shared-types").AsElementType;
|
|
22
|
+
href?: string;
|
|
23
|
+
cursor?: import("@instructure/shared-types").Cursor;
|
|
24
|
+
tabIndex?: number;
|
|
25
|
+
})[];
|
|
26
|
+
static defaultProps: {
|
|
27
|
+
interaction: undefined;
|
|
28
|
+
type: string;
|
|
29
|
+
placement: string;
|
|
30
|
+
offset: string;
|
|
31
|
+
size: string;
|
|
32
|
+
margin: string;
|
|
33
|
+
as: string;
|
|
34
|
+
cursor: string;
|
|
35
|
+
};
|
|
36
|
+
ref: Element | null;
|
|
37
|
+
handleRef: (el: Element | null) => void;
|
|
38
|
+
componentDidMount(): void;
|
|
39
|
+
componentDidUpdate(): void;
|
|
40
|
+
get interaction(): import("@instructure/ui-react-utils").InteractionType;
|
|
41
|
+
get color(): "primary-inverse" | "secondary" | undefined;
|
|
42
|
+
render(): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
43
|
+
}
|
|
44
|
+
export default CloseButton;
|
|
45
|
+
export { CloseButton };
|
|
46
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/CloseButton/v2/index.tsx"],"names":[],"mappings":"AAwBA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAYjC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAE/C;;;;GAIG;AACH,cACM,WAAY,SAAQ,SAAS,CAAC,gBAAgB,CAAC;IACnD,MAAM,CAAC,QAAQ,CAAC,WAAW,iBAAgB;IAE3C,MAAM,CAAC,YAAY;;;;;;;;;;;;;;;SAAe;IAClC,MAAM,CAAC,YAAY;;;;;;;;;MAUlB;IAED,GAAG,EAAE,OAAO,GAAG,IAAI,CAAO;IAE1B,SAAS,GAAI,IAAI,OAAO,GAAG,IAAI,UAK9B;IAED,iBAAiB;IAIjB,kBAAkB;IAIlB,IAAI,WAAW,0DAEd;IAED,IAAI,KAAK,gDAIR;IAED,MAAM;CAmDP;AAED,eAAe,WAAW,CAAA;AAC1B,OAAO,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Spacing, WithStyleProps, ComponentStyle } from '@instructure/emotion';
|
|
3
|
+
import type { ToProp, AsElementType, BaseButtonTheme, OtherHTMLAttributes } from '@instructure/shared-types';
|
|
4
|
+
import type { Cursor } from '@instructure/shared-types';
|
|
5
|
+
import type { ViewProps } from '@instructure/ui-view/latest';
|
|
6
|
+
type CloseButtonOwnProps = {
|
|
7
|
+
/**
|
|
8
|
+
* An accessible label for the `CloseButton` (required)
|
|
9
|
+
*/
|
|
10
|
+
screenReaderLabel: React.ReactNode;
|
|
11
|
+
/**
|
|
12
|
+
* Specifies the color for the `CloseButton`.
|
|
13
|
+
*/
|
|
14
|
+
color?: 'primary' | 'primary-inverse';
|
|
15
|
+
/**
|
|
16
|
+
* Specifies if interaction with the `CloseButton` is enabled, disabled, or readonly.
|
|
17
|
+
*/
|
|
18
|
+
interaction?: 'enabled' | 'disabled' | 'readonly';
|
|
19
|
+
/**
|
|
20
|
+
* Provides a reference to the `CloseButton`'s underlying html element.
|
|
21
|
+
*/
|
|
22
|
+
elementRef?: (element: Element | null) => void;
|
|
23
|
+
/**
|
|
24
|
+
* The size of the `CloseButton`
|
|
25
|
+
*/
|
|
26
|
+
size?: 'small' | 'medium' | 'large';
|
|
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
|
+
*/
|
|
36
|
+
margin?: Spacing;
|
|
37
|
+
/**
|
|
38
|
+
* Specifies the placement of the `CloseButton`
|
|
39
|
+
*/
|
|
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
|
+
*/
|
|
47
|
+
offset?: 'none' | 'x-small' | 'small' | 'medium';
|
|
48
|
+
/**
|
|
49
|
+
* Specifies the type of the `Button`'s underlying html element.
|
|
50
|
+
*/
|
|
51
|
+
type?: 'button' | 'submit' | 'reset';
|
|
52
|
+
/**
|
|
53
|
+
* The element to render as the component root, `CloseButton` by default.
|
|
54
|
+
*/
|
|
55
|
+
as?: AsElementType;
|
|
56
|
+
/**
|
|
57
|
+
* Specifies an href attribute for the `CloseButton`'s underlying html element.
|
|
58
|
+
*/
|
|
59
|
+
href?: string;
|
|
60
|
+
/**
|
|
61
|
+
* Specify a mouse cursor to use when hovering over the `CloseButton`.
|
|
62
|
+
*/
|
|
63
|
+
cursor?: Cursor;
|
|
64
|
+
/**
|
|
65
|
+
* Specifies the tabindex of the `CloseButton`.
|
|
66
|
+
*
|
|
67
|
+
*/
|
|
68
|
+
tabIndex?: number;
|
|
69
|
+
};
|
|
70
|
+
type PropKeys = keyof CloseButtonOwnProps;
|
|
71
|
+
type AllowedPropKeys = Readonly<Array<PropKeys>>;
|
|
72
|
+
type CloseButtonProps = CloseButtonOwnProps & WithStyleProps<BaseButtonTheme, CloseButtonStyle> & OtherHTMLAttributes<CloseButtonOwnProps> & ToProp;
|
|
73
|
+
type CloseButtonStyle = ComponentStyle<'closeButton'>;
|
|
74
|
+
declare const allowedProps: AllowedPropKeys;
|
|
75
|
+
export type { CloseButtonProps, CloseButtonStyle };
|
|
76
|
+
export { allowedProps };
|
|
77
|
+
//# sourceMappingURL=props.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../src/CloseButton/v2/props.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,KAAK,EACV,OAAO,EACP,cAAc,EACd,cAAc,EACf,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EACV,MAAM,EACN,aAAa,EACb,eAAe,EACf,mBAAmB,EACpB,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAA;AAE5D,KAAK,mBAAmB,GAAG;IACzB;;OAEG;IACH,iBAAiB,EAAE,KAAK,CAAC,SAAS,CAAA;IAElC;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,GAAG,iBAAiB,CAAA;IAErC;;OAEG;IACH,WAAW,CAAC,EAAE,SAAS,GAAG,UAAU,GAAG,UAAU,CAAA;IAEjD;;OAEG;IACH,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,KAAK,IAAI,CAAA;IAE9C;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAA;IAEnC;;OAEG;IACH,OAAO,CAAC,EAAE,CACR,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC,UAAU,CAAC,SAAS,CAAC,KAChE,IAAI,CAAA;IAET;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAEhB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,GAAG,KAAK,GAAG,QAAQ,CAAA;IAEtC;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,CAAA;IAEhD;;OAEG;IACH,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAA;IAEpC;;OAEG;IACH,EAAE,CAAC,EAAE,aAAa,CAAA;IAElB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IAEb;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IAEf;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,KAAK,QAAQ,GAAG,MAAM,mBAAmB,CAAA;AAEzC,KAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,KAAK,gBAAgB,GAAG,mBAAmB,GACzC,cAAc,CAAC,eAAe,EAAE,gBAAgB,CAAC,GACjD,mBAAmB,CAAC,mBAAmB,CAAC,GACxC,MAAM,CAAA;AAER,KAAK,gBAAgB,GAAG,cAAc,CAAC,aAAa,CAAC,CAAA;AACrD,QAAA,MAAM,YAAY,EAAE,eAenB,CAAA;AAED,YAAY,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,CAAA;AAClD,OAAO,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { NewComponentTypes, SharedTokens } from '@instructure/ui-themes';
|
|
2
|
+
import type { CloseButtonProps, CloseButtonStyle } from './props';
|
|
3
|
+
/**
|
|
4
|
+
* ---
|
|
5
|
+
* private: true
|
|
6
|
+
* ---
|
|
7
|
+
* Generates the style object from the theme and provided additional information
|
|
8
|
+
* @param {Object} _componentTheme The theme variable object.
|
|
9
|
+
* @param {Object} props the props of the component, the style is applied to
|
|
10
|
+
* @param {Object} sharedTokens the shared design tokens
|
|
11
|
+
* @return {Object} The final style object, which will be used in the component
|
|
12
|
+
*/
|
|
13
|
+
declare const generateStyle: (_componentTheme: NewComponentTypes["BaseButton"], props: CloseButtonProps, sharedTokens: SharedTokens) => CloseButtonStyle;
|
|
14
|
+
export default generateStyle;
|
|
15
|
+
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/CloseButton/v2/styles.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAC7E,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAEjE;;;;;;;;;GASG;AACH,QAAA,MAAM,aAAa,GACjB,iBAAiB,iBAAiB,CAAC,YAAY,CAAC,EAChD,OAAO,gBAAgB,EACvB,cAAc,YAAY,KACzB,gBAqCF,CAAA;AAED,eAAe,aAAa,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Component } from 'react';
|
|
2
|
-
import { BaseButton } from '
|
|
2
|
+
import { BaseButton } from '../../BaseButton/v1';
|
|
3
3
|
import type { CondensedButtonProps } from './props';
|
|
4
4
|
/**
|
|
5
5
|
---
|
|
@@ -20,7 +20,7 @@ declare class CondensedButton extends Component<CondensedButtonProps> {
|
|
|
20
20
|
cursor?: import("@instructure/shared-types").Cursor;
|
|
21
21
|
href?: string;
|
|
22
22
|
renderIcon?: React.ReactNode | (() => React.ReactNode);
|
|
23
|
-
onClick?: (event: React.KeyboardEvent<import("@instructure/ui-view").ViewProps> | React.MouseEvent<import("@instructure/ui-view").ViewProps>) => void;
|
|
23
|
+
onClick?: (event: React.KeyboardEvent<import("@instructure/ui-view/types/exports/a.js").ViewProps> | React.MouseEvent<import("@instructure/ui-view/types/exports/a.js").ViewProps>) => void;
|
|
24
24
|
display?: "inline-block" | "block";
|
|
25
25
|
})[];
|
|
26
26
|
static defaultProps: {
|