@khanacademy/wonder-blocks-button 4.1.9 → 4.2.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.
- package/CHANGELOG.md +14 -0
- package/dist/es/index.js +217 -67
- package/dist/index.js +217 -69
- package/dist/themes/default.d.ts +118 -0
- package/dist/themes/khanmigo.d.ts +103 -0
- package/dist/themes/themed-button.d.ts +114 -0
- package/package.json +1 -1
- package/src/__tests__/__snapshots__/custom-snapshot.test.tsx.snap +264 -264
- package/src/components/button-core.tsx +129 -72
- package/src/components/button.tsx +6 -3
- package/src/themes/default.ts +139 -0
- package/src/themes/khanmigo.ts +43 -0
- package/src/themes/themed-button.tsx +42 -0
- package/tsconfig-build.json +1 -0
- package/tsconfig-build.tsbuildinfo +1 -1
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import defaultTheme from "./default";
|
|
3
|
+
type Props = {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
};
|
|
6
|
+
export type ButtonThemeContract = typeof defaultTheme;
|
|
7
|
+
/**
|
|
8
|
+
* The context that provides the theme to the Button component.
|
|
9
|
+
* This is generally consumed via the `useScopedTheme` hook.
|
|
10
|
+
*/
|
|
11
|
+
export declare const ButtonThemeContext: React.Context<{
|
|
12
|
+
color: {
|
|
13
|
+
bg: {
|
|
14
|
+
action: {
|
|
15
|
+
default: string;
|
|
16
|
+
active: string;
|
|
17
|
+
inverse: string;
|
|
18
|
+
};
|
|
19
|
+
critical: {
|
|
20
|
+
default: string;
|
|
21
|
+
active: string;
|
|
22
|
+
inverse: string;
|
|
23
|
+
};
|
|
24
|
+
primary: {
|
|
25
|
+
default: string;
|
|
26
|
+
disabled: string;
|
|
27
|
+
inverse: string;
|
|
28
|
+
};
|
|
29
|
+
secondary: {
|
|
30
|
+
default: string;
|
|
31
|
+
inverse: string;
|
|
32
|
+
focus: string;
|
|
33
|
+
active: {
|
|
34
|
+
action: string;
|
|
35
|
+
critical: string;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
tertiary: {
|
|
39
|
+
hover: string;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
text: {
|
|
43
|
+
disabled: string;
|
|
44
|
+
inverse: string;
|
|
45
|
+
primary: {
|
|
46
|
+
disabled: string;
|
|
47
|
+
};
|
|
48
|
+
secondary: {
|
|
49
|
+
inverse: string;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
border: {
|
|
53
|
+
disabled: string;
|
|
54
|
+
primary: {
|
|
55
|
+
inverse: string;
|
|
56
|
+
};
|
|
57
|
+
secondary: {
|
|
58
|
+
action: string;
|
|
59
|
+
critical: string;
|
|
60
|
+
inverse: string;
|
|
61
|
+
};
|
|
62
|
+
tertiary: {
|
|
63
|
+
inverse: string;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
border: {
|
|
68
|
+
width: {
|
|
69
|
+
secondary: number;
|
|
70
|
+
focused: number;
|
|
71
|
+
disabled: number;
|
|
72
|
+
};
|
|
73
|
+
radius: {
|
|
74
|
+
default: number;
|
|
75
|
+
tertiary: number;
|
|
76
|
+
small: number;
|
|
77
|
+
large: number;
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
size: {
|
|
81
|
+
width: {
|
|
82
|
+
medium: 24;
|
|
83
|
+
large: 32;
|
|
84
|
+
};
|
|
85
|
+
height: {
|
|
86
|
+
tertiaryHover: 2;
|
|
87
|
+
small: 32;
|
|
88
|
+
medium: number;
|
|
89
|
+
large: number;
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
padding: {
|
|
93
|
+
small: 8;
|
|
94
|
+
medium: 12;
|
|
95
|
+
large: 16;
|
|
96
|
+
xLarge: 32;
|
|
97
|
+
};
|
|
98
|
+
font: {
|
|
99
|
+
size: {
|
|
100
|
+
large: number;
|
|
101
|
+
};
|
|
102
|
+
lineHeight: {
|
|
103
|
+
large: number;
|
|
104
|
+
};
|
|
105
|
+
weight: {
|
|
106
|
+
default: number;
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
}>;
|
|
110
|
+
/**
|
|
111
|
+
* ThemedButton is a component that provides a theme to the <Button/> component.
|
|
112
|
+
*/
|
|
113
|
+
export default function ThemedButton(props: Props): JSX.Element;
|
|
114
|
+
export {};
|