You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[WB-1852.2] Remove Button.light variant, modify actionStyles to support Button instances (#2563)
## Summary:
This PR mainly removes the `light` prop from the `Button` component and its
associated styles. The `light` prop was used to apply a light theme to the
button, but it is no longer maintained and has been removed to simplify the
codebase.
The `inverse` action style can now be used as a replacement for these kind of
scenarhos.
### Details:
- Button:
- Removed the `light` prop as it is no longer maintained.
- Simplified pseudo-states (e.g. `:hover`, `:active`), instead of using `:hover:not("aria-disabled=true)`.
- Styles: Adjusted `actionStyles.inverse` to account for `Button` instances.
Issue: https://khanacademy.atlassian.net/browse/WB-1852
## Test plan:
Navigate to the `Button` component in storybook and verify that the `light` prop
is no longer available.
Test the `inverse` action style in storybook to ensure it looks as expected with
`Button` instances.
Author: jandrade
Reviewers: jandrade, beaesguerra
Required Reviewers:
Approved By: beaesguerra
Checks: ✅ 12 checks were successful, ⏭️ 2 checks have been skipped
Pull Request URL: #2563
- Primary buttons have background colors.\n- Secondary buttons have a border and no background color.\n- Tertiary buttons have no background or border.
68
-
`,
69
-
},
70
-
},
71
-
},
72
-
light: {
73
-
description: "Whether the button is on a dark/colored background.",
74
-
control: {type: "boolean"},
75
-
table: {
76
-
category: "Theming",
77
-
type: {
78
-
summary: "boolean",
79
-
detail: "Sets primary button background color to white, and secondary and tertiary button title to color.",
description: "Set the tabindex attribute on the rendered element.",
126
-
control: {type: "number",min: -1},
127
-
table: {
128
-
type: {
129
-
summary: "number",
130
-
},
131
-
},
132
-
},
133
40
style: {
134
-
description: "Optional custom styles.",
135
41
table: {
136
42
category: "Layout",
137
43
type: {
@@ -140,7 +46,6 @@ export default {
140
46
},
141
47
},
142
48
labelStyle: {
143
-
description: "Optional custom styles for the inner label.",
144
49
table: {
145
50
category: "Layout",
146
51
type: {
@@ -149,7 +54,6 @@ export default {
149
54
},
150
55
},
151
56
className: {
152
-
description: "Adds CSS classes to the Button.",
153
57
control: {type: "text"},
154
58
table: {
155
59
category: "Layout",
@@ -163,9 +67,6 @@ export default {
163
67
*/
164
68
onClick: {
165
69
action: "clicked",
166
-
description: `Function to call when button is clicked.
167
-
This callback should be used for things like marking BigBingo conversions. It should NOT be used to redirect to a different URL or to prevent navigation via e.preventDefault(). The event passed to this handler will have its preventDefault() and stopPropagation() methods stubbed out.
168
-
`,
169
70
table: {
170
71
category: "Events",
171
72
type: {
@@ -179,39 +80,24 @@ export default {
179
80
* Navigation
180
81
*/
181
82
skipClientNav: {
182
-
description: `Whether to avoid using client-side navigation. If the URL passed to href is local to the client-side, e.g. /math/algebra/eval-exprs, then it tries to use react-router-dom's Link component which handles the client-side navigation. You can set "skipClientNav" to true avoid using client-side nav entirely.`,
183
83
control: {type: "boolean"},
184
84
table: {
185
85
category: "Navigation",
186
-
type: {
187
-
summary: "Note",
188
-
detail: "All URLs containing a protocol are considered external, e.g. https://khanacademy.org/math/algebra/eval-exprs will trigger a full page reload.",
189
-
},
190
86
},
191
87
},
192
88
rel: {
193
-
description: `Specifies the type of relationship between the current document and the linked document. Should only be used when "href" is specified. This defaults to "noopener noreferrer" when target="_blank", but can be overridden by setting this prop to something else.`,
194
89
control: {type: "text"},
195
90
table: {
196
91
category: "Navigation",
197
-
type: {
198
-
summary: "string",
199
-
},
200
92
},
201
93
},
202
94
target: {
203
-
description: `A target destination window for a link to open in. Should only be used
204
-
* when "href" is specified.`,
205
95
control: {type: "text"},
206
96
table: {
207
97
category: "Navigation",
208
-
type: {
209
-
summary: "string",
210
-
},
211
98
},
212
99
},
213
100
href: {
214
-
description: "URL to navigate to.",
215
101
control: {type: "text"},
216
102
table: {
217
103
category: "Navigation",
@@ -222,7 +108,6 @@ export default {
222
108
},
223
109
},
224
110
beforeNav: {
225
-
description: `Run async code before navigating. If the promise returned rejects then navigation will not occur. If both safeWithNav and beforeNav are provided, beforeNav will be run first and safeWithNav will only be run if beforeNav does not reject.`,
226
111
table: {
227
112
category: "Navigation",
228
113
type: {
@@ -231,7 +116,6 @@ export default {
231
116
},
232
117
},
233
118
safeWithNav: {
234
-
description: `Run async code in the background while client-side navigating. If the browser does a full page load navigation, the callback promise must be settled before the navigation will occur. Errors are ignored so that navigation is guaranteed to succeed.`,
0 commit comments