@atlaskit/button 16.1.2 → 16.1.6
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 +28 -0
- package/dist/cjs/button.js +10 -15
- package/dist/cjs/custom-theme-button/custom-theme-button.js +5 -3
- package/dist/cjs/custom-theme-button/index.js +4 -4
- package/dist/cjs/custom-theme-button/theme.js +4 -4
- package/dist/cjs/entry-points/custom-theme-button.js +4 -4
- package/dist/cjs/index.js +8 -8
- package/dist/cjs/loading-button.js +3 -1
- package/dist/cjs/shared/button-base.js +22 -4
- package/dist/cjs/shared/colors.js +160 -162
- package/dist/cjs/shared/css.js +4 -4
- package/dist/cjs/shared/loading-spinner.js +3 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/button.js +5 -13
- package/dist/es2019/shared/button-base.js +18 -2
- package/dist/es2019/shared/colors.js +160 -161
- package/dist/es2019/version.json +1 -1
- package/dist/esm/button.js +8 -14
- package/dist/esm/custom-theme-button/custom-theme-button.js +4 -3
- package/dist/esm/custom-theme-button/theme.js +2 -2
- package/dist/esm/loading-button.js +2 -1
- package/dist/esm/shared/button-base.js +20 -3
- package/dist/esm/shared/colors.js +160 -161
- package/dist/esm/shared/css.js +2 -2
- package/dist/esm/shared/loading-spinner.js +2 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/shared/loading-spinner.d.ts +1 -0
- package/package.json +8 -7
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as colors from '@atlaskit/theme/colors';
|
|
2
|
-
import { token } from '@atlaskit/tokens';
|
|
3
2
|
// Hard coding the active rgba color value rather than using a helper to convert it
|
|
4
3
|
// With helper it would be: hex2rgba(colors.B75, 0.6)
|
|
5
4
|
const fadedB75 = 'rgba(179, 212, 255, 0.6)';
|
|
@@ -8,106 +7,106 @@ const values = {
|
|
|
8
7
|
background: {
|
|
9
8
|
default: {
|
|
10
9
|
default: {
|
|
11
|
-
light:
|
|
12
|
-
dark:
|
|
10
|
+
light: `var(--ds-background-neutral, ${colors.N20A})`,
|
|
11
|
+
dark: `var(--ds-background-neutral, ${colors.DN70})`
|
|
13
12
|
},
|
|
14
13
|
hover: {
|
|
15
|
-
light:
|
|
16
|
-
dark:
|
|
14
|
+
light: `var(--ds-background-neutral-hovered, ${colors.N30A})`,
|
|
15
|
+
dark: `var(--ds-background-neutral-hovered, ${colors.DN60})`
|
|
17
16
|
},
|
|
18
17
|
active: {
|
|
19
|
-
light:
|
|
20
|
-
dark:
|
|
18
|
+
light: `var(--ds-background-neutral-pressed, ${fadedB75})`,
|
|
19
|
+
dark: `var(--ds-background-neutral-pressed, ${colors.B75})`
|
|
21
20
|
},
|
|
22
21
|
disabled: {
|
|
23
|
-
light:
|
|
24
|
-
dark:
|
|
22
|
+
light: `var(--ds-background-disabled, ${colors.N20A})`,
|
|
23
|
+
dark: `var(--ds-background-disabled, ${colors.DN70})`
|
|
25
24
|
},
|
|
26
25
|
selected: {
|
|
27
|
-
light:
|
|
28
|
-
dark:
|
|
26
|
+
light: `var(--ds-background-brand, ${colors.N700})`,
|
|
27
|
+
dark: `var(--ds-background-brand, ${colors.DN0})`
|
|
29
28
|
},
|
|
30
29
|
focusSelected: {
|
|
31
|
-
light:
|
|
32
|
-
dark:
|
|
30
|
+
light: `var(--ds-background-brand, ${colors.N700})`,
|
|
31
|
+
dark: `var(--ds-background-brand, ${colors.DN0})`
|
|
33
32
|
}
|
|
34
33
|
},
|
|
35
34
|
primary: {
|
|
36
35
|
default: {
|
|
37
|
-
light:
|
|
38
|
-
dark:
|
|
36
|
+
light: `var(--ds-background-brand-bold, ${colors.B400})`,
|
|
37
|
+
dark: `var(--ds-background-brand-bold, ${colors.B100})`
|
|
39
38
|
},
|
|
40
39
|
hover: {
|
|
41
|
-
light:
|
|
42
|
-
dark:
|
|
40
|
+
light: `var(--ds-background-brand-bold-hovered, ${colors.B300})`,
|
|
41
|
+
dark: `var(--ds-background-brand-bold-hovered, ${colors.B75})`
|
|
43
42
|
},
|
|
44
43
|
active: {
|
|
45
|
-
light:
|
|
46
|
-
dark:
|
|
44
|
+
light: `var(--ds-background-brand-bold-pressed, ${colors.B500})`,
|
|
45
|
+
dark: `var(--ds-background-brand-bold-pressed, ${colors.B200})`
|
|
47
46
|
},
|
|
48
47
|
disabled: {
|
|
49
|
-
light:
|
|
50
|
-
dark:
|
|
48
|
+
light: `var(--ds-background-disabled, ${colors.N20A})`,
|
|
49
|
+
dark: `var(--ds-background-disabled, ${colors.DN70})`
|
|
51
50
|
},
|
|
52
51
|
selected: {
|
|
53
|
-
light:
|
|
54
|
-
dark:
|
|
52
|
+
light: `var(--ds-background-brand, ${colors.N700})`,
|
|
53
|
+
dark: `var(--ds-background-brand, ${colors.DN0})`
|
|
55
54
|
},
|
|
56
55
|
focusSelected: {
|
|
57
|
-
light:
|
|
58
|
-
dark:
|
|
56
|
+
light: `var(--ds-background-brand, ${colors.N700})`,
|
|
57
|
+
dark: `var(--ds-background-brand, ${colors.DN0})`
|
|
59
58
|
}
|
|
60
59
|
},
|
|
61
60
|
warning: {
|
|
62
61
|
default: {
|
|
63
|
-
light:
|
|
64
|
-
dark:
|
|
62
|
+
light: `var(--ds-background-warning-bold, ${colors.Y300})`,
|
|
63
|
+
dark: `var(--ds-background-warning-bold, ${colors.Y300})`
|
|
65
64
|
},
|
|
66
65
|
hover: {
|
|
67
|
-
light:
|
|
68
|
-
dark:
|
|
66
|
+
light: `var(--ds-background-warning-bold-hovered, ${colors.Y200})`,
|
|
67
|
+
dark: `var(--ds-background-warning-bold-hovered, ${colors.Y200})`
|
|
69
68
|
},
|
|
70
69
|
active: {
|
|
71
|
-
light:
|
|
72
|
-
dark:
|
|
70
|
+
light: `var(--ds-background-warning-bold-pressed, ${colors.Y400})`,
|
|
71
|
+
dark: `var(--ds-background-warning-bold-pressed, ${colors.Y400})`
|
|
73
72
|
},
|
|
74
73
|
disabled: {
|
|
75
|
-
light:
|
|
76
|
-
dark:
|
|
74
|
+
light: `var(--ds-background-disabled, ${colors.N20A})`,
|
|
75
|
+
dark: `var(--ds-background-disabled, ${colors.DN70})`
|
|
77
76
|
},
|
|
78
77
|
selected: {
|
|
79
|
-
light:
|
|
80
|
-
dark:
|
|
78
|
+
light: `var(--ds-background-brand, ${colors.Y400})`,
|
|
79
|
+
dark: `var(--ds-background-brand, ${colors.Y400})`
|
|
81
80
|
},
|
|
82
81
|
focusSelected: {
|
|
83
|
-
light:
|
|
84
|
-
dark:
|
|
82
|
+
light: `var(--ds-background-brand, ${colors.Y400})`,
|
|
83
|
+
dark: `var(--ds-background-brand, ${colors.Y400})`
|
|
85
84
|
}
|
|
86
85
|
},
|
|
87
86
|
danger: {
|
|
88
87
|
default: {
|
|
89
|
-
light:
|
|
90
|
-
dark:
|
|
88
|
+
light: `var(--ds-background-danger-bold, ${colors.R400})`,
|
|
89
|
+
dark: `var(--ds-background-danger-bold, ${colors.R400})`
|
|
91
90
|
},
|
|
92
91
|
hover: {
|
|
93
|
-
light:
|
|
94
|
-
dark:
|
|
92
|
+
light: `var(--ds-background-danger-bold-hovered, ${colors.R300})`,
|
|
93
|
+
dark: `var(--ds-background-danger-bold-hovered, ${colors.R300})`
|
|
95
94
|
},
|
|
96
95
|
active: {
|
|
97
|
-
light:
|
|
98
|
-
dark:
|
|
96
|
+
light: `var(--ds-background-danger-bold-pressed, ${colors.R500})`,
|
|
97
|
+
dark: `var(--ds-background-danger-bold-pressed, ${colors.R500})`
|
|
99
98
|
},
|
|
100
99
|
disabled: {
|
|
101
|
-
light:
|
|
102
|
-
dark:
|
|
100
|
+
light: `var(--ds-background-disabled, ${colors.N20A})`,
|
|
101
|
+
dark: `var(--ds-background-disabled, ${colors.DN70})`
|
|
103
102
|
},
|
|
104
103
|
selected: {
|
|
105
|
-
light:
|
|
106
|
-
dark:
|
|
104
|
+
light: `var(--ds-background-brand, ${colors.R500})`,
|
|
105
|
+
dark: `var(--ds-background-brand, ${colors.R500})`
|
|
107
106
|
},
|
|
108
107
|
focusSelected: {
|
|
109
|
-
light:
|
|
110
|
-
dark:
|
|
108
|
+
light: `var(--ds-background-brand, ${colors.R500})`,
|
|
109
|
+
dark: `var(--ds-background-brand, ${colors.R500})`
|
|
111
110
|
}
|
|
112
111
|
},
|
|
113
112
|
link: {
|
|
@@ -116,12 +115,12 @@ const values = {
|
|
|
116
115
|
dark: 'none'
|
|
117
116
|
},
|
|
118
117
|
selected: {
|
|
119
|
-
light:
|
|
120
|
-
dark:
|
|
118
|
+
light: `var(--ds-background-brand, ${colors.N700})`,
|
|
119
|
+
dark: `var(--ds-background-brand, ${colors.N20})`
|
|
121
120
|
},
|
|
122
121
|
focusSelected: {
|
|
123
|
-
light:
|
|
124
|
-
dark:
|
|
122
|
+
light: `var(--ds-background-brand, ${colors.N700})`,
|
|
123
|
+
dark: `var(--ds-background-brand, ${colors.N20})`
|
|
125
124
|
}
|
|
126
125
|
},
|
|
127
126
|
subtle: {
|
|
@@ -130,24 +129,24 @@ const values = {
|
|
|
130
129
|
dark: 'none'
|
|
131
130
|
},
|
|
132
131
|
hover: {
|
|
133
|
-
light:
|
|
134
|
-
dark:
|
|
132
|
+
light: `var(--ds-background-neutral-subtle-hovered, ${colors.N30A})`,
|
|
133
|
+
dark: `var(--ds-background-neutral-subtle-hovered, ${colors.DN60})`
|
|
135
134
|
},
|
|
136
135
|
active: {
|
|
137
|
-
light:
|
|
138
|
-
dark:
|
|
136
|
+
light: `var(--ds-background-neutral-subtle-pressed, ${fadedB75})`,
|
|
137
|
+
dark: `var(--ds-background-neutral-subtle-pressed, ${colors.B75})`
|
|
139
138
|
},
|
|
140
139
|
disabled: {
|
|
141
140
|
light: 'none',
|
|
142
141
|
dark: 'none'
|
|
143
142
|
},
|
|
144
143
|
selected: {
|
|
145
|
-
light:
|
|
146
|
-
dark:
|
|
144
|
+
light: `var(--ds-background-brand, ${colors.N700})`,
|
|
145
|
+
dark: `var(--ds-background-brand, ${colors.DN0})`
|
|
147
146
|
},
|
|
148
147
|
focusSelected: {
|
|
149
|
-
light:
|
|
150
|
-
dark:
|
|
148
|
+
light: `var(--ds-background-brand, ${colors.N700})`,
|
|
149
|
+
dark: `var(--ds-background-brand, ${colors.DN0})`
|
|
151
150
|
}
|
|
152
151
|
},
|
|
153
152
|
'subtle-link': {
|
|
@@ -156,236 +155,236 @@ const values = {
|
|
|
156
155
|
dark: 'none'
|
|
157
156
|
},
|
|
158
157
|
selected: {
|
|
159
|
-
light:
|
|
160
|
-
dark:
|
|
158
|
+
light: `var(--ds-background-brand, ${colors.N700})`,
|
|
159
|
+
dark: `var(--ds-background-brand, ${colors.N20})`
|
|
161
160
|
},
|
|
162
161
|
focusSelected: {
|
|
163
|
-
light:
|
|
164
|
-
dark:
|
|
162
|
+
light: `var(--ds-background-brand, ${colors.N700})`,
|
|
163
|
+
dark: `var(--ds-background-brand, ${colors.N20})`
|
|
165
164
|
}
|
|
166
165
|
}
|
|
167
166
|
},
|
|
168
167
|
boxShadowColor: {
|
|
169
168
|
default: {
|
|
170
169
|
focus: {
|
|
171
|
-
light:
|
|
172
|
-
dark:
|
|
170
|
+
light: `var(--ds-border-focused, ${colors.B100})`,
|
|
171
|
+
dark: `var(--ds-border-focused, ${colors.B75})`
|
|
173
172
|
},
|
|
174
173
|
focusSelected: {
|
|
175
|
-
light:
|
|
176
|
-
dark:
|
|
174
|
+
light: `var(--ds-border-focused, ${colors.B100})`,
|
|
175
|
+
dark: `var(--ds-border-focused, ${colors.B75})`
|
|
177
176
|
}
|
|
178
177
|
},
|
|
179
178
|
primary: {
|
|
180
179
|
focus: {
|
|
181
|
-
light:
|
|
182
|
-
dark:
|
|
180
|
+
light: `var(--ds-border-focused, ${colors.B100})`,
|
|
181
|
+
dark: `var(--ds-border-focused, ${colors.B75})`
|
|
183
182
|
},
|
|
184
183
|
focusSelected: {
|
|
185
|
-
light:
|
|
186
|
-
dark:
|
|
184
|
+
light: `var(--ds-border-focused, ${colors.B100})`,
|
|
185
|
+
dark: `var(--ds-border-focused, ${colors.B75})`
|
|
187
186
|
}
|
|
188
187
|
},
|
|
189
188
|
warning: {
|
|
190
189
|
focus: {
|
|
191
|
-
light:
|
|
192
|
-
dark:
|
|
190
|
+
light: `var(--ds-border-focused, ${colors.Y500})`,
|
|
191
|
+
dark: `var(--ds-border-focused, ${colors.Y500})`
|
|
193
192
|
},
|
|
194
193
|
focusSelected: {
|
|
195
|
-
light:
|
|
196
|
-
dark:
|
|
194
|
+
light: `var(--ds-border-focused, ${colors.Y500})`,
|
|
195
|
+
dark: `var(--ds-border-focused, ${colors.Y500})`
|
|
197
196
|
}
|
|
198
197
|
},
|
|
199
198
|
danger: {
|
|
200
199
|
focus: {
|
|
201
|
-
light:
|
|
202
|
-
dark:
|
|
200
|
+
light: `var(--ds-border-focused, ${colors.R100})`,
|
|
201
|
+
dark: `var(--ds-border-focused, ${colors.R100})`
|
|
203
202
|
},
|
|
204
203
|
focusSelected: {
|
|
205
|
-
light:
|
|
206
|
-
dark:
|
|
204
|
+
light: `var(--ds-border-focused, ${colors.R100})`,
|
|
205
|
+
dark: `var(--ds-border-focused, ${colors.R100})`
|
|
207
206
|
}
|
|
208
207
|
},
|
|
209
208
|
link: {
|
|
210
209
|
focus: {
|
|
211
|
-
light:
|
|
212
|
-
dark:
|
|
210
|
+
light: `var(--ds-border-focused, ${colors.B100})`,
|
|
211
|
+
dark: `var(--ds-border-focused, ${colors.B75})`
|
|
213
212
|
},
|
|
214
213
|
focusSelected: {
|
|
215
|
-
light:
|
|
216
|
-
dark:
|
|
214
|
+
light: `var(--ds-border-focused, ${colors.B100})`,
|
|
215
|
+
dark: `var(--ds-border-focused, ${colors.B75})`
|
|
217
216
|
}
|
|
218
217
|
},
|
|
219
218
|
subtle: {
|
|
220
219
|
focus: {
|
|
221
|
-
light:
|
|
222
|
-
dark:
|
|
220
|
+
light: `var(--ds-border-focused, ${colors.B100})`,
|
|
221
|
+
dark: `var(--ds-border-focused, ${colors.B75})`
|
|
223
222
|
},
|
|
224
223
|
focusSelected: {
|
|
225
|
-
light:
|
|
226
|
-
dark:
|
|
224
|
+
light: `var(--ds-border-focused, ${colors.B100})`,
|
|
225
|
+
dark: `var(--ds-border-focused, ${colors.B75})`
|
|
227
226
|
}
|
|
228
227
|
},
|
|
229
228
|
'subtle-link': {
|
|
230
229
|
focus: {
|
|
231
|
-
light:
|
|
232
|
-
dark:
|
|
230
|
+
light: `var(--ds-border-focused, ${colors.B100})`,
|
|
231
|
+
dark: `var(--ds-border-focused, ${colors.B75})`
|
|
233
232
|
},
|
|
234
233
|
focusSelected: {
|
|
235
|
-
light:
|
|
236
|
-
dark:
|
|
234
|
+
light: `var(--ds-border-focused, ${colors.B100})`,
|
|
235
|
+
dark: `var(--ds-border-focused, ${colors.B75})`
|
|
237
236
|
}
|
|
238
237
|
}
|
|
239
238
|
},
|
|
240
239
|
color: {
|
|
241
240
|
default: {
|
|
242
241
|
default: {
|
|
243
|
-
light:
|
|
244
|
-
dark:
|
|
242
|
+
light: `var(--ds-text, ${colors.N500})`,
|
|
243
|
+
dark: `var(--ds-text, ${colors.DN400})`
|
|
245
244
|
},
|
|
246
245
|
active: {
|
|
247
|
-
light:
|
|
248
|
-
dark:
|
|
246
|
+
light: `var(--ds-text, ${colors.B400})`,
|
|
247
|
+
dark: `var(--ds-text, ${colors.B400})`
|
|
249
248
|
},
|
|
250
249
|
disabled: {
|
|
251
|
-
light:
|
|
252
|
-
dark:
|
|
250
|
+
light: `var(--ds-text-disabled, ${colors.N70})`,
|
|
251
|
+
dark: `var(--ds-text-disabled, ${colors.DN30})`
|
|
253
252
|
},
|
|
254
253
|
selected: {
|
|
255
|
-
light:
|
|
256
|
-
dark:
|
|
254
|
+
light: `var(--ds-text-brand, ${colors.N20})`,
|
|
255
|
+
dark: `var(--ds-text-brand, ${colors.DN400})`
|
|
257
256
|
},
|
|
258
257
|
focusSelected: {
|
|
259
|
-
light:
|
|
260
|
-
dark:
|
|
258
|
+
light: `var(--ds-text-brand, ${colors.N20})`,
|
|
259
|
+
dark: `var(--ds-text-brand, ${colors.DN400})`
|
|
261
260
|
}
|
|
262
261
|
},
|
|
263
262
|
primary: {
|
|
264
263
|
default: {
|
|
265
|
-
light:
|
|
266
|
-
dark:
|
|
264
|
+
light: `var(--ds-text-inverse, ${colors.N0})`,
|
|
265
|
+
dark: `var(--ds-text-inverse, ${colors.DN30})`
|
|
267
266
|
},
|
|
268
267
|
disabled: {
|
|
269
|
-
light:
|
|
270
|
-
dark:
|
|
268
|
+
light: `var(--ds-text-disabled, ${colors.N70})`,
|
|
269
|
+
dark: `var(--ds-text-disabled, ${colors.DN30})`
|
|
271
270
|
},
|
|
272
271
|
selected: {
|
|
273
|
-
light:
|
|
274
|
-
dark:
|
|
272
|
+
light: `var(--ds-text-brand, ${colors.N20})`,
|
|
273
|
+
dark: `var(--ds-text-brand, ${colors.DN400})`
|
|
275
274
|
},
|
|
276
275
|
focusSelected: {
|
|
277
|
-
light:
|
|
278
|
-
dark:
|
|
276
|
+
light: `var(--ds-text-brand, ${colors.N20})`,
|
|
277
|
+
dark: `var(--ds-text-brand, ${colors.DN400})`
|
|
279
278
|
}
|
|
280
279
|
},
|
|
281
280
|
warning: {
|
|
282
281
|
default: {
|
|
283
|
-
light:
|
|
284
|
-
dark:
|
|
282
|
+
light: `var(--ds-text-warning-inverse, ${colors.N800})`,
|
|
283
|
+
dark: `var(--ds-text-warning-inverse, ${colors.N800})`
|
|
285
284
|
},
|
|
286
285
|
disabled: {
|
|
287
|
-
light:
|
|
288
|
-
dark:
|
|
286
|
+
light: `var(--ds-text-disabled, ${colors.N70})`,
|
|
287
|
+
dark: `var(--ds-text-disabled, ${colors.DN30})`
|
|
289
288
|
},
|
|
290
289
|
selected: {
|
|
291
|
-
light:
|
|
292
|
-
dark:
|
|
290
|
+
light: `var(--ds-text-brand, ${colors.N800})`,
|
|
291
|
+
dark: `var(--ds-text-brand, ${colors.N800})`
|
|
293
292
|
},
|
|
294
293
|
focusSelected: {
|
|
295
|
-
light:
|
|
296
|
-
dark:
|
|
294
|
+
light: `var(--ds-text-brand, ${colors.N800})`,
|
|
295
|
+
dark: `var(--ds-text-brand, ${colors.N800})`
|
|
297
296
|
}
|
|
298
297
|
},
|
|
299
298
|
danger: {
|
|
300
299
|
default: {
|
|
301
|
-
light:
|
|
302
|
-
dark:
|
|
300
|
+
light: `var(--ds-text-inverse, ${colors.N0})`,
|
|
301
|
+
dark: `var(--ds-text-inverse, ${colors.N0})`
|
|
303
302
|
},
|
|
304
303
|
disabled: {
|
|
305
|
-
light:
|
|
306
|
-
dark:
|
|
304
|
+
light: `var(--ds-text-disabled, ${colors.N70})`,
|
|
305
|
+
dark: `var(--ds-text-disabled, ${colors.DN30})`
|
|
307
306
|
},
|
|
308
307
|
selected: {
|
|
309
|
-
light:
|
|
310
|
-
dark:
|
|
308
|
+
light: `var(--ds-text-brand, ${colors.N0})`,
|
|
309
|
+
dark: `var(--ds-text-brand, ${colors.N0})`
|
|
311
310
|
},
|
|
312
311
|
focusSelected: {
|
|
313
|
-
light:
|
|
314
|
-
dark:
|
|
312
|
+
light: `var(--ds-text-brand, ${colors.N0})`,
|
|
313
|
+
dark: `var(--ds-text-brand, ${colors.N0})`
|
|
315
314
|
}
|
|
316
315
|
},
|
|
317
316
|
link: {
|
|
318
317
|
default: {
|
|
319
|
-
light:
|
|
320
|
-
dark:
|
|
318
|
+
light: `var(--ds-link, ${colors.B400})`,
|
|
319
|
+
dark: `var(--ds-link, ${colors.B100})`
|
|
321
320
|
},
|
|
322
321
|
hover: {
|
|
323
|
-
light:
|
|
324
|
-
dark:
|
|
322
|
+
light: `var(--ds-link, ${colors.B300})`,
|
|
323
|
+
dark: `var(--ds-link, ${colors.B75})`
|
|
325
324
|
},
|
|
326
325
|
active: {
|
|
327
|
-
light:
|
|
328
|
-
dark:
|
|
326
|
+
light: `var(--ds-link-pressed, ${colors.B500})`,
|
|
327
|
+
dark: `var(--ds-link-pressed, ${colors.B200})`
|
|
329
328
|
},
|
|
330
329
|
disabled: {
|
|
331
|
-
light:
|
|
332
|
-
dark:
|
|
330
|
+
light: `var(--ds-text-disabled, ${colors.N70})`,
|
|
331
|
+
dark: `var(--ds-text-disabled, ${colors.DN100})`
|
|
333
332
|
},
|
|
334
333
|
selected: {
|
|
335
|
-
light:
|
|
336
|
-
dark:
|
|
334
|
+
light: `var(--ds-text-brand, ${colors.N20})`,
|
|
335
|
+
dark: `var(--ds-text-brand, ${colors.N700})`
|
|
337
336
|
},
|
|
338
337
|
focusSelected: {
|
|
339
|
-
light:
|
|
340
|
-
dark:
|
|
338
|
+
light: `var(--ds-text-brand, ${colors.N20})`,
|
|
339
|
+
dark: `var(--ds-text-brand, ${colors.N700})`
|
|
341
340
|
}
|
|
342
341
|
},
|
|
343
342
|
subtle: {
|
|
344
343
|
default: {
|
|
345
|
-
light:
|
|
346
|
-
dark:
|
|
344
|
+
light: `var(--ds-text, ${colors.N500})`,
|
|
345
|
+
dark: `var(--ds-text, ${colors.DN400})`
|
|
347
346
|
},
|
|
348
347
|
active: {
|
|
349
|
-
light:
|
|
350
|
-
dark:
|
|
348
|
+
light: `var(--ds-text, ${colors.B400})`,
|
|
349
|
+
dark: `var(--ds-text, ${colors.B400})`
|
|
351
350
|
},
|
|
352
351
|
disabled: {
|
|
353
|
-
light:
|
|
354
|
-
dark:
|
|
352
|
+
light: `var(--ds-text-disabled, ${colors.N70})`,
|
|
353
|
+
dark: `var(--ds-text-disabled, ${colors.DN100})`
|
|
355
354
|
},
|
|
356
355
|
selected: {
|
|
357
|
-
light:
|
|
358
|
-
dark:
|
|
356
|
+
light: `var(--ds-text-brand, ${colors.N20})`,
|
|
357
|
+
dark: `var(--ds-text-brand, ${colors.DN400})`
|
|
359
358
|
},
|
|
360
359
|
focusSelected: {
|
|
361
|
-
light:
|
|
362
|
-
dark:
|
|
360
|
+
light: `var(--ds-text-brand, ${colors.N20})`,
|
|
361
|
+
dark: `var(--ds-text-brand, ${colors.DN400})`
|
|
363
362
|
}
|
|
364
363
|
},
|
|
365
364
|
'subtle-link': {
|
|
366
365
|
default: {
|
|
367
|
-
light:
|
|
368
|
-
dark:
|
|
366
|
+
light: `var(--ds-text-subtle, ${colors.N200})`,
|
|
367
|
+
dark: `var(--ds-text-subtle, ${colors.DN400})`
|
|
369
368
|
},
|
|
370
369
|
hover: {
|
|
371
|
-
light:
|
|
372
|
-
dark:
|
|
370
|
+
light: `var(--ds-text-subtle, ${colors.N90})`,
|
|
371
|
+
dark: `var(--ds-text-subtle, ${colors.B50})`
|
|
373
372
|
},
|
|
374
373
|
active: {
|
|
375
|
-
light:
|
|
376
|
-
dark:
|
|
374
|
+
light: `var(--ds-text, ${colors.N400})`,
|
|
375
|
+
dark: `var(--ds-text, ${colors.DN300})`
|
|
377
376
|
},
|
|
378
377
|
disabled: {
|
|
379
|
-
light:
|
|
380
|
-
dark:
|
|
378
|
+
light: `var(--ds-text-disabled, ${colors.N70})`,
|
|
379
|
+
dark: `var(--ds-text-disabled, ${colors.DN100})`
|
|
381
380
|
},
|
|
382
381
|
selected: {
|
|
383
|
-
light:
|
|
384
|
-
dark:
|
|
382
|
+
light: `var(--ds-text-brand, ${colors.N20})`,
|
|
383
|
+
dark: `var(--ds-text-brand, ${colors.DN400})`
|
|
385
384
|
},
|
|
386
385
|
focusSelected: {
|
|
387
|
-
light:
|
|
388
|
-
dark:
|
|
386
|
+
light: `var(--ds-text-brand, ${colors.N20})`,
|
|
387
|
+
dark: `var(--ds-text-brand, ${colors.DN400})`
|
|
389
388
|
}
|
|
390
389
|
}
|
|
391
390
|
}
|
package/dist/es2019/version.json
CHANGED
package/dist/esm/button.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
|
+
var _excluded = ["onMouseDown", "onMouseUp"];
|
|
4
5
|
import React, { useCallback, useMemo, useState } from 'react';
|
|
5
|
-
import
|
|
6
|
+
import { useGlobalTheme } from '@atlaskit/theme/components';
|
|
6
7
|
import ButtonBase from './shared/button-base';
|
|
7
8
|
import { getCss } from './shared/css';
|
|
8
9
|
import getIsOnlySingleIcon from './shared/get-is-only-single-icon';
|
|
@@ -10,13 +11,15 @@ import getIsOnlySingleIcon from './shared/get-is-only-single-icon';
|
|
|
10
11
|
function noop() {}
|
|
11
12
|
|
|
12
13
|
var isFirefox = typeof navigator !== 'undefined' && navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
-
_ref$onMouseDown = _ref.onMouseDown,
|
|
14
|
+
var Button = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function Button(_ref, ref) {
|
|
15
|
+
var _ref$onMouseDown = _ref.onMouseDown,
|
|
16
16
|
providedOnMouseDown = _ref$onMouseDown === void 0 ? noop : _ref$onMouseDown,
|
|
17
17
|
_ref$onMouseUp = _ref.onMouseUp,
|
|
18
18
|
providedOnMouseUp = _ref$onMouseUp === void 0 ? noop : _ref$onMouseUp,
|
|
19
|
-
rest = _objectWithoutProperties(_ref,
|
|
19
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
20
|
+
|
|
21
|
+
var _useGlobalTheme = useGlobalTheme(),
|
|
22
|
+
mode = _useGlobalTheme.mode;
|
|
20
23
|
|
|
21
24
|
var appearance = rest.appearance || 'default';
|
|
22
25
|
var spacing = rest.spacing || 'default';
|
|
@@ -64,15 +67,6 @@ var ButtonWithMode = /*#__PURE__*/React.forwardRef(function ButtonWithMode(_ref,
|
|
|
64
67
|
onMouseDown: onMouseDown,
|
|
65
68
|
onMouseUp: onMouseUp
|
|
66
69
|
}));
|
|
67
|
-
});
|
|
68
|
-
var Button = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function Button(props, ref) {
|
|
69
|
-
return /*#__PURE__*/React.createElement(GlobalTheme.Consumer, null, function (_ref2) {
|
|
70
|
-
var mode = _ref2.mode;
|
|
71
|
-
return /*#__PURE__*/React.createElement(ButtonWithMode, _extends({}, props, {
|
|
72
|
-
ref: ref,
|
|
73
|
-
mode: mode
|
|
74
|
-
}));
|
|
75
|
-
});
|
|
76
70
|
})); // Tools including enzyme rely on components having a display name
|
|
77
71
|
|
|
78
72
|
Button.displayName = 'Button';
|