@atlaskit/button 23.5.3 → 23.6.0
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 +19 -0
- package/dist/cjs/new-button/containers/split-button/split-button.compiled.css +2 -6
- package/dist/cjs/new-button/containers/split-button/split-button.js +7 -14
- package/dist/cjs/new-button/variants/default/link.compiled.css +41 -68
- package/dist/cjs/new-button/variants/default/link.js +12 -22
- package/dist/cjs/new-button/variants/icon/link.compiled.css +30 -52
- package/dist/cjs/new-button/variants/icon/link.js +9 -17
- package/dist/cjs/new-button/variants/shared/button-base.compiled.css +14 -25
- package/dist/cjs/new-button/variants/shared/button-base.js +11 -17
- package/dist/cjs/old-button/shared/button-base.js +1 -1
- package/dist/cjs/old-button/shared/css.js +46 -129
- package/dist/es2019/new-button/containers/split-button/split-button.compiled.css +2 -6
- package/dist/es2019/new-button/containers/split-button/split-button.js +7 -14
- package/dist/es2019/new-button/variants/default/link.compiled.css +41 -68
- package/dist/es2019/new-button/variants/default/link.js +12 -22
- package/dist/es2019/new-button/variants/icon/link.compiled.css +30 -52
- package/dist/es2019/new-button/variants/icon/link.js +9 -17
- package/dist/es2019/new-button/variants/shared/button-base.compiled.css +14 -25
- package/dist/es2019/new-button/variants/shared/button-base.js +11 -17
- package/dist/es2019/old-button/shared/button-base.js +1 -1
- package/dist/es2019/old-button/shared/css.js +32 -132
- package/dist/esm/new-button/containers/split-button/split-button.compiled.css +2 -6
- package/dist/esm/new-button/containers/split-button/split-button.js +7 -14
- package/dist/esm/new-button/variants/default/link.compiled.css +41 -68
- package/dist/esm/new-button/variants/default/link.js +12 -22
- package/dist/esm/new-button/variants/icon/link.compiled.css +30 -52
- package/dist/esm/new-button/variants/icon/link.js +9 -17
- package/dist/esm/new-button/variants/shared/button-base.compiled.css +14 -25
- package/dist/esm/new-button/variants/shared/button-base.js +11 -17
- package/dist/esm/old-button/shared/button-base.js +1 -1
- package/dist/esm/old-button/shared/css.js +46 -129
- package/dist/types/old-button/shared/css.d.ts +1 -1
- package/dist/types-ts4.5/old-button/shared/css.d.ts +1 -1
- package/package.json +8 -11
- package/dist/cjs/old-button/shared/colors.js +0 -328
- package/dist/es2019/old-button/shared/colors.js +0 -320
- package/dist/esm/old-button/shared/colors.js +0 -320
- package/dist/types/old-button/shared/colors.d.ts +0 -23
- package/dist/types-ts4.5/old-button/shared/colors.d.ts +0 -23
|
@@ -119,7 +119,7 @@ const ButtonBase = /*#__PURE__*/React.forwardRef(function ButtonBase(props, ref)
|
|
|
119
119
|
action: 'clicked',
|
|
120
120
|
componentName: 'button',
|
|
121
121
|
packageName: "@atlaskit/button",
|
|
122
|
-
packageVersion: "
|
|
122
|
+
packageVersion: "0.0.0-development",
|
|
123
123
|
analyticsData: analyticsContext
|
|
124
124
|
});
|
|
125
125
|
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
2
2
|
import { css } from '@emotion/react';
|
|
3
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
|
-
import colors from './colors';
|
|
5
3
|
const gridSize = 8;
|
|
6
4
|
const HAS_DISABLED_BACKGROUND = ['default', 'primary', 'danger', 'warning'];
|
|
7
5
|
|
|
@@ -59,17 +57,17 @@ const defaultAfterStyles = {
|
|
|
59
57
|
};
|
|
60
58
|
const defaultStyles = {
|
|
61
59
|
background: "var(--ds-background-neutral-subtle, #00000000)",
|
|
62
|
-
color: "var(--ds-text, #
|
|
60
|
+
color: "var(--ds-text, #292A2E)",
|
|
63
61
|
'&::after': {
|
|
64
62
|
...defaultAfterStyles,
|
|
65
63
|
content: '""',
|
|
66
|
-
borderColor: "var(--ds-border, #
|
|
64
|
+
borderColor: "var(--ds-border, #0B120E24)"
|
|
67
65
|
},
|
|
68
66
|
'&:hover': {
|
|
69
|
-
background: "var(--ds-background-neutral-hovered, #
|
|
67
|
+
background: "var(--ds-background-neutral-hovered, #0B120E24)"
|
|
70
68
|
},
|
|
71
69
|
'&:active': {
|
|
72
|
-
background: "var(--ds-background-neutral-pressed, #
|
|
70
|
+
background: "var(--ds-background-neutral-pressed, #080F214A)"
|
|
73
71
|
},
|
|
74
72
|
'&[data-has-overlay="true"]:not([disabled]):hover': {
|
|
75
73
|
background: "var(--ds-background-neutral-subtle, #00000000)"
|
|
@@ -85,38 +83,38 @@ const defaultStyles = {
|
|
|
85
83
|
}
|
|
86
84
|
};
|
|
87
85
|
const primaryStyles = {
|
|
88
|
-
background: "var(--ds-background-brand-bold, #
|
|
86
|
+
background: "var(--ds-background-brand-bold, #1868DB)",
|
|
89
87
|
color: "var(--ds-text-inverse, #FFFFFF)",
|
|
90
88
|
'&:hover': {
|
|
91
|
-
background: "var(--ds-background-brand-bold-hovered, #
|
|
89
|
+
background: "var(--ds-background-brand-bold-hovered, #1558BC)"
|
|
92
90
|
},
|
|
93
91
|
'&:active': {
|
|
94
|
-
background: "var(--ds-background-brand-bold-pressed, #
|
|
92
|
+
background: "var(--ds-background-brand-bold-pressed, #144794)"
|
|
95
93
|
},
|
|
96
94
|
'&[data-has-overlay="true"]:not([disabled]):hover': {
|
|
97
|
-
background: "var(--ds-background-brand-bold, #
|
|
95
|
+
background: "var(--ds-background-brand-bold, #1868DB)"
|
|
98
96
|
}
|
|
99
97
|
};
|
|
100
98
|
const linkStyles = {
|
|
101
99
|
background: 'transparent',
|
|
102
|
-
color: "var(--ds-link, #
|
|
100
|
+
color: "var(--ds-link, #1868DB)",
|
|
103
101
|
'&:hover': {
|
|
104
|
-
color: "var(--ds-link, #
|
|
102
|
+
color: "var(--ds-link, #1868DB)",
|
|
105
103
|
textDecoration: 'underline'
|
|
106
104
|
},
|
|
107
105
|
'&:active': {
|
|
108
|
-
color: "var(--ds-link-pressed, #
|
|
106
|
+
color: "var(--ds-link-pressed, #1558BC)",
|
|
109
107
|
textDecoration: 'underline'
|
|
110
108
|
}
|
|
111
109
|
};
|
|
112
110
|
const subtleStyles = {
|
|
113
111
|
background: 'transparent',
|
|
114
|
-
color: "var(--ds-text-subtle, #
|
|
112
|
+
color: "var(--ds-text-subtle, #505258)",
|
|
115
113
|
'&:hover': {
|
|
116
|
-
background: "var(--ds-background-neutral-subtle-hovered, #
|
|
114
|
+
background: "var(--ds-background-neutral-subtle-hovered, #0515240F)"
|
|
117
115
|
},
|
|
118
116
|
'&:active': {
|
|
119
|
-
background: "var(--ds-background-neutral-subtle-pressed, #
|
|
117
|
+
background: "var(--ds-background-neutral-subtle-pressed, #0B120E24)"
|
|
120
118
|
},
|
|
121
119
|
'&[data-has-overlay="true"]:not([disabled]):hover': {
|
|
122
120
|
background: 'transparent'
|
|
@@ -124,29 +122,29 @@ const subtleStyles = {
|
|
|
124
122
|
};
|
|
125
123
|
const subtleLinkStyles = {
|
|
126
124
|
background: 'transparent',
|
|
127
|
-
color: "var(--ds-text-subtle, #
|
|
125
|
+
color: "var(--ds-text-subtle, #505258)",
|
|
128
126
|
'&:hover': {
|
|
129
127
|
background: 'transparent',
|
|
130
|
-
color: "var(--ds-text-subtle, #
|
|
128
|
+
color: "var(--ds-text-subtle, #505258)",
|
|
131
129
|
textDecoration: 'underline'
|
|
132
130
|
},
|
|
133
131
|
'&:active': {
|
|
134
132
|
background: 'transparent',
|
|
135
|
-
color: "var(--ds-text, #
|
|
133
|
+
color: "var(--ds-text, #292A2E)",
|
|
136
134
|
textDecoration: 'underline'
|
|
137
135
|
}
|
|
138
136
|
};
|
|
139
137
|
const warningStyles = {
|
|
140
|
-
background: "var(--ds-background-warning-bold, #
|
|
141
|
-
color: "var(--ds-text-warning-inverse, #
|
|
138
|
+
background: "var(--ds-background-warning-bold, #FBC828)",
|
|
139
|
+
color: "var(--ds-text-warning-inverse, #292A2E)",
|
|
142
140
|
'&:hover': {
|
|
143
|
-
background: "var(--ds-background-warning-bold-hovered, #
|
|
141
|
+
background: "var(--ds-background-warning-bold-hovered, #FCA700)"
|
|
144
142
|
},
|
|
145
143
|
'&:active': {
|
|
146
|
-
background: "var(--ds-background-warning-bold-pressed, #
|
|
144
|
+
background: "var(--ds-background-warning-bold-pressed, #F68909)"
|
|
147
145
|
},
|
|
148
146
|
'&[data-has-overlay="true"]:not([disabled]):hover': {
|
|
149
|
-
background: "var(--ds-background-warning-bold, #
|
|
147
|
+
background: "var(--ds-background-warning-bold, #FBC828)"
|
|
150
148
|
}
|
|
151
149
|
};
|
|
152
150
|
const dangerStyles = {
|
|
@@ -156,19 +154,19 @@ const dangerStyles = {
|
|
|
156
154
|
background: "var(--ds-background-danger-bold-hovered, #AE2E24)"
|
|
157
155
|
},
|
|
158
156
|
'&:active': {
|
|
159
|
-
background: "var(--ds-background-danger-bold-pressed, #
|
|
157
|
+
background: "var(--ds-background-danger-bold-pressed, #872821)"
|
|
160
158
|
},
|
|
161
159
|
'&[data-has-overlay="true"]:not([disabled]):hover': {
|
|
162
160
|
background: "var(--ds-background-danger-bold, #C9372C)"
|
|
163
161
|
}
|
|
164
162
|
};
|
|
165
163
|
const selectedStyles = {
|
|
166
|
-
background: "var(--ds-background-selected, #
|
|
167
|
-
color: "var(--ds-text-selected, #
|
|
164
|
+
background: "var(--ds-background-selected, #E9F2FE)",
|
|
165
|
+
color: "var(--ds-text-selected, #1868DB)",
|
|
168
166
|
'&:not([disabled])::after': {
|
|
169
167
|
...defaultAfterStyles,
|
|
170
168
|
content: '""',
|
|
171
|
-
borderColor: "var(--ds-border-selected, #
|
|
169
|
+
borderColor: "var(--ds-border-selected, #1868DB)"
|
|
172
170
|
}
|
|
173
171
|
};
|
|
174
172
|
const hasOverlayStyles = {
|
|
@@ -177,46 +175,13 @@ const hasOverlayStyles = {
|
|
|
177
175
|
textDecoration: 'none'
|
|
178
176
|
}
|
|
179
177
|
};
|
|
180
|
-
function getColor({
|
|
181
|
-
group,
|
|
182
|
-
key,
|
|
183
|
-
mode
|
|
184
|
-
}) {
|
|
185
|
-
const rule = group[key] || group.default;
|
|
186
|
-
return rule[mode];
|
|
187
|
-
}
|
|
188
|
-
function getColors({
|
|
189
|
-
appearance,
|
|
190
|
-
key,
|
|
191
|
-
mode
|
|
192
|
-
}) {
|
|
193
|
-
return {
|
|
194
|
-
background: getColor({
|
|
195
|
-
group: colors.background[appearance],
|
|
196
|
-
key,
|
|
197
|
-
mode
|
|
198
|
-
}),
|
|
199
|
-
// Needing to add !important to overcome specificity issue caused by deprecated AtlaskitThemeProvider
|
|
200
|
-
color: `${getColor({
|
|
201
|
-
group: colors.color[appearance],
|
|
202
|
-
key,
|
|
203
|
-
mode
|
|
204
|
-
})} !important`
|
|
205
|
-
};
|
|
206
|
-
}
|
|
207
178
|
export function getCss({
|
|
208
179
|
appearance,
|
|
209
180
|
spacing,
|
|
210
|
-
mode,
|
|
211
181
|
isSelected,
|
|
212
182
|
shouldFitContainer,
|
|
213
183
|
isOnlySingleIcon
|
|
214
184
|
}) {
|
|
215
|
-
const baseColors = getColors({
|
|
216
|
-
appearance,
|
|
217
|
-
key: isSelected ? 'selected' : 'default',
|
|
218
|
-
mode
|
|
219
|
-
});
|
|
220
185
|
return {
|
|
221
186
|
// 0px margin added to css-reset
|
|
222
187
|
alignItems: 'baseline',
|
|
@@ -237,8 +202,6 @@ export function getCss({
|
|
|
237
202
|
textDecoration: 'none',
|
|
238
203
|
transition: 'background 0.1s ease-out, box-shadow 0.15s cubic-bezier(0.47, 0.03, 0.49, 1.38)',
|
|
239
204
|
whiteSpace: 'nowrap',
|
|
240
|
-
// dynamic styles
|
|
241
|
-
...(!fg('platform-component-visual-refresh') && baseColors),
|
|
242
205
|
cursor: 'pointer',
|
|
243
206
|
height: heights[spacing],
|
|
244
207
|
lineHeight: lineHeights[spacing],
|
|
@@ -247,70 +210,7 @@ export function getCss({
|
|
|
247
210
|
width: shouldFitContainer ? '100%' : 'auto',
|
|
248
211
|
// justifyContent required for shouldFitContainer buttons with an icon inside
|
|
249
212
|
justifyContent: 'center',
|
|
250
|
-
|
|
251
|
-
// That would be easy for styling, but it would start letting events through on disabled buttons
|
|
252
|
-
|
|
253
|
-
...(!fg('platform-component-visual-refresh') && {
|
|
254
|
-
// Disabling visited styles (just using the base colors)
|
|
255
|
-
'&:visited': {
|
|
256
|
-
...baseColors
|
|
257
|
-
},
|
|
258
|
-
'&:hover': {
|
|
259
|
-
...getColors({
|
|
260
|
-
appearance,
|
|
261
|
-
key: isSelected ? 'selected' : 'hover',
|
|
262
|
-
mode
|
|
263
|
-
}),
|
|
264
|
-
textDecoration: !isSelected && (appearance === 'link' || appearance === 'subtle-link') ? 'underline' : 'inherit',
|
|
265
|
-
// background, box-shadow
|
|
266
|
-
transitionDuration: '0s, 0.15s'
|
|
267
|
-
},
|
|
268
|
-
// giving active styles preference by listing them after focus
|
|
269
|
-
'&:active': {
|
|
270
|
-
...getColors({
|
|
271
|
-
appearance,
|
|
272
|
-
key: isSelected ? 'selected' : 'active',
|
|
273
|
-
mode
|
|
274
|
-
}),
|
|
275
|
-
// background, box-shadow
|
|
276
|
-
transitionDuration: '0s, 0s'
|
|
277
|
-
},
|
|
278
|
-
// preventDefault prevents regular active styles from applying in Firefox
|
|
279
|
-
'&[data-firefox-is-active="true"]': {
|
|
280
|
-
...getColors({
|
|
281
|
-
appearance,
|
|
282
|
-
key: isSelected ? 'selected' : 'active',
|
|
283
|
-
mode
|
|
284
|
-
}),
|
|
285
|
-
// background, box-shadow
|
|
286
|
-
transitionDuration: '0s, 0s'
|
|
287
|
-
},
|
|
288
|
-
// Giving disabled styles preference over active by listing them after.
|
|
289
|
-
// Not using '&:disabled' because :disabled is not a valid state for all element types
|
|
290
|
-
// so we are targeting the attribute
|
|
291
|
-
// Attributes have the same specificity a pseudo classes so we are overriding :disabled here
|
|
292
|
-
'&[disabled]': {
|
|
293
|
-
// always using 'disabled' even when selected
|
|
294
|
-
...getColors({
|
|
295
|
-
appearance,
|
|
296
|
-
key: 'disabled',
|
|
297
|
-
mode
|
|
298
|
-
}),
|
|
299
|
-
cursor: 'not-allowed',
|
|
300
|
-
textDecoration: 'none'
|
|
301
|
-
},
|
|
302
|
-
...hasOverlayStyles,
|
|
303
|
-
// disabling hover and active color changes when there is an overlay, but the button is not disabled
|
|
304
|
-
'&[data-has-overlay="true"]:not([disabled]):hover, &[data-has-overlay="true"]:not([disabled]):active': {
|
|
305
|
-
...getColors({
|
|
306
|
-
appearance,
|
|
307
|
-
key: isSelected ? 'selected' : 'default',
|
|
308
|
-
mode
|
|
309
|
-
})
|
|
310
|
-
}
|
|
311
|
-
}),
|
|
312
|
-
// dynamic colours for visual refresh:
|
|
313
|
-
...(fg('platform-component-visual-refresh') && (isSelected ? selectedStyles : {
|
|
213
|
+
...(isSelected ? selectedStyles : {
|
|
314
214
|
...(appearance === 'default' && defaultStyles),
|
|
315
215
|
...(appearance === 'primary' && primaryStyles),
|
|
316
216
|
...(appearance === 'link' && linkStyles),
|
|
@@ -319,19 +219,19 @@ export function getCss({
|
|
|
319
219
|
...(appearance === 'warning' && warningStyles),
|
|
320
220
|
...(appearance === 'danger' && dangerStyles),
|
|
321
221
|
'&[disabled]': {
|
|
322
|
-
color: "var(--ds-text-disabled, #
|
|
323
|
-
backgroundColor: HAS_DISABLED_BACKGROUND.includes(appearance) ? "var(--ds-background-disabled, #
|
|
222
|
+
color: "var(--ds-text-disabled, #080F214A)",
|
|
223
|
+
backgroundColor: HAS_DISABLED_BACKGROUND.includes(appearance) ? "var(--ds-background-disabled, #17171708)" : 'transparent',
|
|
324
224
|
cursor: 'not-allowed',
|
|
325
225
|
textDecoration: 'none',
|
|
326
226
|
'&:hovered': {
|
|
327
|
-
backgroundColor: HAS_DISABLED_BACKGROUND.includes(appearance) ? "var(--ds-background-disabled, #
|
|
227
|
+
backgroundColor: HAS_DISABLED_BACKGROUND.includes(appearance) ? "var(--ds-background-disabled, #17171708)" : 'transparent'
|
|
328
228
|
},
|
|
329
229
|
'&:active': {
|
|
330
|
-
backgroundColor: HAS_DISABLED_BACKGROUND.includes(appearance) ? "var(--ds-background-disabled, #
|
|
230
|
+
backgroundColor: HAS_DISABLED_BACKGROUND.includes(appearance) ? "var(--ds-background-disabled, #17171708)" : 'transparent'
|
|
331
231
|
}
|
|
332
232
|
},
|
|
333
233
|
...hasOverlayStyles
|
|
334
|
-
})
|
|
234
|
+
}),
|
|
335
235
|
'&::-moz-focus-inner': {
|
|
336
236
|
border: 0,
|
|
337
237
|
margin: 0,
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
._2rkofajl{border-radius:var(--ds-radius-small,3px)}
|
|
3
3
|
._195g1h5n{margin-inline:-.03125rem}
|
|
4
4
|
._195g1n1a{margin-inline:-1px}
|
|
5
|
-
._1mouu2gc{margin-block:var(--ds-space-100,8px)}.
|
|
6
|
-
.
|
|
5
|
+
._1mouu2gc{margin-block:var(--ds-space-100,8px)}._12ji1l7x{outline-color:var(--ds-border,#0b120e24)}
|
|
6
|
+
._12jibk0g{outline-color:var(--ds-border-disabled,#0515240f)}
|
|
7
7
|
._12y3t94y{outline-width:1px}
|
|
8
8
|
._1553idpf button{border-end-start-radius:0}
|
|
9
9
|
._1bsbe4h9{width:var(--ds-border-width,1px)}
|
|
@@ -22,18 +22,14 @@
|
|
|
22
22
|
._80om13gf{cursor:not-allowed}
|
|
23
23
|
._anlpidpf button{border-end-end-radius:0}
|
|
24
24
|
._bepvidpf button{border-start-end-radius:0}
|
|
25
|
-
._bfhk15cr{background-color:var(--ds-text-inverse,#fff)}
|
|
26
|
-
._bfhk1fxt{background-color:var(--ds-text,#172b4d)}
|
|
27
25
|
._bfhk9xzm{background-color:var(--ds-border-disabled,#091e4224)}
|
|
28
26
|
._bfhkdud1{background-color:var(--ds-text-subtle,#0052cc)}
|
|
29
27
|
._bfhkmuej{background-color:var(--ds-border,#091e4224)}
|
|
30
|
-
._bfhkojnm{background-color:var(--ds-text-disabled,#091e4224)}
|
|
31
28
|
._bfhkveue{background-color:var(--ds-border-inverse,#fff)}
|
|
32
29
|
._kqswh2mm{position:relative}
|
|
33
30
|
._o5721q9c{white-space:nowrap}
|
|
34
31
|
._p9ykidpf a{border-start-end-radius:0}
|
|
35
32
|
._traeidpf a{border-end-end-radius:0}
|
|
36
33
|
._tzy419lr{opacity:.62}
|
|
37
|
-
._tzy41uwv{opacity:.51}
|
|
38
34
|
._tzy41wzo{opacity:.64}
|
|
39
35
|
._y1n3idpf button{border-start-start-radius:0}
|
|
@@ -2,21 +2,14 @@
|
|
|
2
2
|
import "./split-button.compiled.css";
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
5
|
import { SplitButtonContext } from './split-button-context';
|
|
7
6
|
import { getActions } from './utils';
|
|
8
7
|
var dividerStyles = {
|
|
9
8
|
baseDivider: "_1bsbe4h9 _kqswh2mm _1pbykb7n",
|
|
10
|
-
dividerDisabled: "
|
|
11
|
-
|
|
12
|
-
dividerOffsetRefreshed: "_195g1n1a"
|
|
9
|
+
dividerDisabled: "_bfhk9xzm _80om13gf",
|
|
10
|
+
dividerOffset: "_195g1n1a"
|
|
13
11
|
};
|
|
14
12
|
var dividerAppearanceStyles = {
|
|
15
|
-
default: "_bfhk1fxt _tzy41uwv",
|
|
16
|
-
primary: "_bfhk15cr _tzy41wzo",
|
|
17
|
-
navigation: "_1mouu2gc _195g1h5n _4t3i7vkz _bfhkdud1 _tzy419lr"
|
|
18
|
-
};
|
|
19
|
-
var dividerRefreshedAppearanceStyles = {
|
|
20
13
|
default: "_bfhkmuej",
|
|
21
14
|
primary: "_bfhkveue _tzy41wzo",
|
|
22
15
|
navigation: "_1mouu2gc _195g1h5n _4t3i7vkz _bfhkdud1 _tzy419lr"
|
|
@@ -41,17 +34,17 @@ export var Divider = function Divider(_ref) {
|
|
|
41
34
|
spacing = _ref.spacing,
|
|
42
35
|
_ref$isDisabled = _ref.isDisabled,
|
|
43
36
|
isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled;
|
|
44
|
-
var isDefaultDivider = appearance === 'default' && !isDisabled
|
|
37
|
+
var isDefaultDivider = appearance === 'default' && !isDisabled;
|
|
45
38
|
return /*#__PURE__*/React.createElement("div", {
|
|
46
|
-
className: ax([dividerStyles.baseDivider, isDefaultDivider && defaultDividerHeightStyles[spacing], !isDefaultDivider && dividerHeightStyles[spacing], isDisabled &&
|
|
39
|
+
className: ax([dividerStyles.baseDivider, isDefaultDivider && defaultDividerHeightStyles[spacing], !isDefaultDivider && dividerHeightStyles[spacing], isDisabled && dividerStyles.dividerDisabled, !isDisabled && dividerAppearanceStyles[appearance], dividerStyles.dividerOffset])
|
|
47
40
|
});
|
|
48
41
|
};
|
|
49
42
|
var buttonStyles = {
|
|
50
43
|
splitButton: "_1e0c116y _kqswh2mm _4cvr1h6o _o5721q9c",
|
|
51
44
|
primaryButton: "_traeidpf _anlpidpf _p9ykidpf _bepvidpf",
|
|
52
45
|
secondaryButton: "_1j4hidpf _1553idpf _1qgbidpf _y1n3idpf",
|
|
53
|
-
defaultAppearanceContainer: "_2rkofajl
|
|
54
|
-
defaultAppearanceDisabledContainer: "
|
|
46
|
+
defaultAppearanceContainer: "_2rkofajl _12ji1l7x _1cwg1n1a _1qu2nqa1 _12y3t94y",
|
|
47
|
+
defaultAppearanceDisabledContainer: "_12jibk0g"
|
|
55
48
|
};
|
|
56
49
|
|
|
57
50
|
/**
|
|
@@ -63,7 +56,7 @@ export var SplitButtonContainer = function SplitButtonContainer(_ref2) {
|
|
|
63
56
|
_ref2$isDisabled = _ref2.isDisabled,
|
|
64
57
|
isDisabled = _ref2$isDisabled === void 0 ? false : _ref2$isDisabled;
|
|
65
58
|
return /*#__PURE__*/React.createElement("div", {
|
|
66
|
-
className: ax([appearance === 'default' &&
|
|
59
|
+
className: ax([appearance === 'default' && buttonStyles.defaultAppearanceContainer, appearance === 'default' && isDisabled && buttonStyles.defaultAppearanceDisabledContainer, buttonStyles.splitButton])
|
|
67
60
|
}, children);
|
|
68
61
|
};
|
|
69
62
|
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
._1rjcv77o{padding-block:var(--ds-space-025,2px)}
|
|
10
10
|
._1tv3nqa1:after{border-style:solid}
|
|
11
11
|
._39yqe4h9:after{border-width:var(--ds-border-width,1px)}
|
|
12
|
-
.
|
|
13
|
-
.
|
|
12
|
+
._8l3m1l7x:after{border-color:var(--ds-border,#0b120e24)}
|
|
13
|
+
._8l3mq98m:after{border-color:var(--ds-border-selected,#1868db)}
|
|
14
14
|
._11fnglyw:after{pointer-events:none}
|
|
15
15
|
._18postnw:after{position:absolute}
|
|
16
16
|
._1bah1h6o{justify-content:center}
|
|
@@ -27,19 +27,13 @@
|
|
|
27
27
|
._aetrb3bt:after{content:""}
|
|
28
28
|
._aetrglyw:after{content:none}
|
|
29
29
|
._ajmmvv82{text-decoration-style:solid!important}
|
|
30
|
-
.
|
|
31
|
-
.
|
|
32
|
-
.
|
|
33
|
-
.
|
|
34
|
-
._bfhk1vbi{background-color:var(--ds-background-discovery-bold,#5243aa)}
|
|
35
|
-
._bfhk7btw{background-color:var(--ds-background-selected,#253858)}
|
|
36
|
-
._bfhkbeib{background-color:var(--ds-background-selected,#bf2600)}
|
|
37
|
-
._bfhkfg4m{background-color:var(--ds-background-selected,#e9f2ff)}
|
|
38
|
-
._bfhkomb0{background-color:var(--ds-background-brand-bold,#0052cc)}
|
|
39
|
-
._bfhkqtfy{background-color:var(--ds-background-neutral-subtle,transparent)}
|
|
30
|
+
._bfhk15s3{background-color:var(--ds-background-selected,#e9f2fe)}
|
|
31
|
+
._bfhk1856{background-color:var(--ds-background-brand-bold,#1868db)}
|
|
32
|
+
._bfhk1kmu{background-color:var(--ds-background-warning-bold,#fbc828)}
|
|
33
|
+
._bfhkby5v{background-color:var(--ds-background-disabled,#17171708)}
|
|
40
34
|
._bfhksm61{background-color:var(--ds-background-neutral-subtle,#00000000)}
|
|
41
|
-
.
|
|
42
|
-
.
|
|
35
|
+
._bfhku5tj{background-color:var(--ds-background-discovery-bold,#964ac0)}
|
|
36
|
+
._bfhkybec{background-color:var(--ds-background-danger-bold,#c9372c)}
|
|
43
37
|
._bozgu2gc{padding-inline-start:var(--ds-space-100,8px)}
|
|
44
38
|
._bozgutpp{padding-inline-start:var(--ds-space-150,9pt)}
|
|
45
39
|
._gy1p1b66{column-gap:var(--ds-space-050,4px)}
|
|
@@ -47,74 +41,53 @@
|
|
|
47
41
|
._kqswh2mm{position:relative}
|
|
48
42
|
._p12f1osq{max-width:100%}
|
|
49
43
|
._s7n4nkob{vertical-align:middle}
|
|
50
|
-
._syaz10s3{color:var(--ds-text,#42526e)}
|
|
51
44
|
._syaz15cr{color:var(--ds-text-inverse,#fff)}
|
|
52
|
-
.
|
|
53
|
-
.
|
|
54
|
-
.
|
|
55
|
-
.
|
|
56
|
-
._syaz1pke{color:var(--ds-text-selected,#f4f5f7)}
|
|
57
|
-
._syazal3n{color:var(--ds-text-warning-inverse,#172b4d)}
|
|
45
|
+
._syaz1gmx{color:var(--ds-text-disabled,#080f214a)}
|
|
46
|
+
._syaz1yd3{color:var(--ds-text-warning-inverse,#292a2e)}
|
|
47
|
+
._syaz6x5g{color:var(--ds-text-selected,#1868db)}
|
|
48
|
+
._syazazsu{color:var(--ds-text-subtle,#505258)}
|
|
58
49
|
._vchhusvi{box-sizing:border-box}
|
|
59
50
|
._y3gn1h6o{text-align:center}
|
|
60
51
|
._y4tiu2gc{padding-inline-end:var(--ds-space-100,8px)}
|
|
61
|
-
._y4tiutpp{padding-inline-end:var(--ds-space-150,9pt)}.
|
|
62
|
-
.
|
|
63
|
-
.
|
|
64
|
-
.
|
|
65
|
-
._10531pke:visited{color:var(--ds-text-selected,#f4f5f7)}
|
|
66
|
-
._1053al3n:visited{color:var(--ds-text-warning-inverse,#172b4d)}
|
|
52
|
+
._y4tiutpp{padding-inline-end:var(--ds-space-150,9pt)}._105315cr:visited{color:var(--ds-text-inverse,#fff)}
|
|
53
|
+
._10531yd3:visited{color:var(--ds-text-warning-inverse,#292a2e)}
|
|
54
|
+
._10536x5g:visited{color:var(--ds-text-selected,#1868db)}
|
|
55
|
+
._1053azsu:visited{color:var(--ds-text-subtle,#505258)}
|
|
67
56
|
._1a3b1r31:focus{text-decoration-color:currentColor}
|
|
68
57
|
._4fprglyw:focus{text-decoration-line:none}
|
|
69
58
|
._5goinqa1:focus{text-decoration-style:solid}
|
|
70
|
-
._f8pj10s3:focus{color:var(--ds-text,#42526e)}
|
|
71
59
|
._f8pj15cr:focus{color:var(--ds-text-inverse,#fff)}
|
|
72
|
-
._f8pj1gjq:focus{color:var(--ds-text-subtle,#44546f)}
|
|
73
|
-
._f8pj1ldt:focus{color:var(--ds-text-selected,#0052cc)}
|
|
74
60
|
._f8pj1mjl:focus{color:color.text.subtle}
|
|
75
|
-
.
|
|
76
|
-
.
|
|
61
|
+
._f8pj1yd3:focus{color:var(--ds-text-warning-inverse,#292a2e)}
|
|
62
|
+
._f8pj6x5g:focus{color:var(--ds-text-selected,#1868db)}
|
|
63
|
+
._f8pjazsu:focus{color:var(--ds-text-subtle,#505258)}
|
|
77
64
|
._1bnxglyw:hover{text-decoration-line:none}
|
|
78
|
-
._30l310s3:hover{color:var(--ds-text,#42526e)}
|
|
79
65
|
._30l315cr:hover{color:var(--ds-text-inverse,#fff)}
|
|
80
|
-
.
|
|
81
|
-
.
|
|
82
|
-
.
|
|
83
|
-
.
|
|
84
|
-
._30l3al3n:hover{color:var(--ds-text-warning-inverse,#172b4d)}
|
|
66
|
+
._30l31gmx:hover{color:var(--ds-text-disabled,#080f214a)}
|
|
67
|
+
._30l31yd3:hover{color:var(--ds-text-warning-inverse,#292a2e)}
|
|
68
|
+
._30l36x5g:hover{color:var(--ds-text-selected,#1868db)}
|
|
69
|
+
._30l3azsu:hover{color:var(--ds-text-subtle,#505258)}
|
|
85
70
|
._9oik1r31:hover{text-decoration-color:currentColor}
|
|
86
|
-
.
|
|
87
|
-
.
|
|
88
|
-
.
|
|
89
|
-
.
|
|
90
|
-
.
|
|
91
|
-
.
|
|
92
|
-
.
|
|
93
|
-
._irr3beib:hover{background-color:var(--ds-background-selected,#bf2600)}
|
|
94
|
-
._irr3i1yw:hover{background-color:var(--ds-background-selected-hovered,#cce0ff)}
|
|
95
|
-
._irr3syzs:hover{background-color:var(--ds-background-disabled,#091e4208)}
|
|
96
|
-
._irr3vdtc:hover{background-color:var(--ds-background-selected,#ff991f)}
|
|
97
|
-
._irr3yw9d:hover{background-color:var(--ds-background-neutral-hovered,#091e4214)}
|
|
71
|
+
._irr315s3:hover{background-color:var(--ds-background-selected,#e9f2fe)}
|
|
72
|
+
._irr31dpa:hover{background-color:var(--ds-background-neutral-subtle-hovered,#0515240f)}
|
|
73
|
+
._irr31spp:hover{background-color:var(--ds-background-warning-bold-hovered,#fca700)}
|
|
74
|
+
._irr3by5v:hover{background-color:var(--ds-background-disabled,#17171708)}
|
|
75
|
+
._irr3fqeg:hover{background-color:var(--ds-background-discovery-bold-hovered,#803fa5)}
|
|
76
|
+
._irr3hf2y:hover{background-color:var(--ds-background-brand-bold-hovered,#1558bc)}
|
|
77
|
+
._irr3s9hg:hover{background-color:var(--ds-background-danger-bold-hovered,#ae2e24)}
|
|
98
78
|
._jf4cnqa1:hover{text-decoration-style:solid}
|
|
99
|
-
.
|
|
100
|
-
.
|
|
101
|
-
.
|
|
102
|
-
.
|
|
103
|
-
.
|
|
104
|
-
.
|
|
105
|
-
.
|
|
106
|
-
._1di6h4op:active{background-color:var(--ds-background-warning-bold-pressed,#ff991f)}
|
|
107
|
-
._1di6ip91:active{background-color:var(--ds-background-neutral-pressed,#091e424f)}
|
|
108
|
-
._1di6syzs:active{background-color:var(--ds-background-disabled,#091e4208)}
|
|
109
|
-
._1di6vdtc:active{background-color:var(--ds-background-selected,#ff991f)}
|
|
110
|
-
._1di6yycf:active{background-color:var(--ds-background-danger-bold-pressed,#bf2600)}
|
|
79
|
+
._1di613a9:active{background-color:var(--ds-background-danger-bold-pressed,#872821)}
|
|
80
|
+
._1di615s3:active{background-color:var(--ds-background-selected,#e9f2fe)}
|
|
81
|
+
._1di61f1m:active{background-color:var(--ds-background-discovery-bold-pressed,#673286)}
|
|
82
|
+
._1di64m4m:active{background-color:var(--ds-background-warning-bold-pressed,#f68909)}
|
|
83
|
+
._1di6by5v:active{background-color:var(--ds-background-disabled,#17171708)}
|
|
84
|
+
._1di6fcek:active{background-color:var(--ds-background-neutral-subtle-pressed,#0b120e24)}
|
|
85
|
+
._1di6g6ey:active{background-color:var(--ds-background-brand-bold-pressed,#144794)}
|
|
111
86
|
._1iohnqa1:active{text-decoration-style:solid}
|
|
112
87
|
._1nrm1r31:active{text-decoration-color:currentColor}
|
|
113
|
-
._9h8h10s3:active{color:var(--ds-text,#42526e)}
|
|
114
88
|
._9h8h15cr:active{color:var(--ds-text-inverse,#fff)}
|
|
115
|
-
.
|
|
116
|
-
.
|
|
117
|
-
.
|
|
118
|
-
.
|
|
119
|
-
._9h8hal3n:active{color:var(--ds-text-warning-inverse,#172b4d)}
|
|
89
|
+
._9h8h1gmx:active{color:var(--ds-text-disabled,#080f214a)}
|
|
90
|
+
._9h8h1yd3:active{color:var(--ds-text-warning-inverse,#292a2e)}
|
|
91
|
+
._9h8h6x5g:active{color:var(--ds-text-selected,#1868db)}
|
|
92
|
+
._9h8hazsu:active{color:var(--ds-text-subtle,#505258)}
|
|
120
93
|
._c2waglyw:active{text-decoration-line:none}
|
|
@@ -10,45 +10,41 @@ import { forwardRef, useRef } from 'react';
|
|
|
10
10
|
import { cx } from '@atlaskit/css';
|
|
11
11
|
import mergeRefs from '@atlaskit/ds-lib/merge-refs';
|
|
12
12
|
import useAutoFocus from '@atlaskit/ds-lib/use-auto-focus';
|
|
13
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
14
13
|
import { Anchor } from '@atlaskit/primitives/compiled';
|
|
15
14
|
import Content from '../shared/content';
|
|
16
15
|
import IconRenderer from '../shared/icon-renderer';
|
|
17
16
|
var styles = {
|
|
18
17
|
base: "_2rkofajl _11c82smr _v5649dqc _189eidpf _1rjc12x7 _1e0c116y _vchhusvi _1bsb1wug _p12f1osq _kqswh2mm _4cvr1q9y _1bah1h6o _gy1p1b66 _1o9zidpf _4t3iviql _k48p1wq8 _y4tiutpp _bozgutpp _y3gn1h6o _s7n4nkob _14mj1kw7 _9v7aze3t _1tv3nqa1 _39yqe4h9 _11fnglyw _18postnw",
|
|
19
18
|
linkDecorationUnset: "_4bfu1snc _1hmsagmp _ajmmvv82 _1a3b1r31 _4fprglyw _5goinqa1 _9oik1r31 _1bnxglyw _jf4cnqa1 _1nrm1r31 _c2waglyw _1iohnqa1",
|
|
20
|
-
disabled: "_80om13gf
|
|
19
|
+
disabled: "_80om13gf _bfhkby5v _syaz1gmx _aetrglyw _irr3by5v _30l31gmx _1di6by5v _9h8h1gmx",
|
|
21
20
|
spacingCompact: "_1rjcv77o _gy1p1b66 _4t3i1k8s _y4tiutpp _bozgutpp _s7n4nkob",
|
|
22
21
|
buttonIconBefore: "_bozgu2gc",
|
|
23
22
|
buttonIconAfter: "_y4tiu2gc",
|
|
24
23
|
fullWidth: "_1bsb1osq"
|
|
25
24
|
};
|
|
26
25
|
var defaultStyles = {
|
|
27
|
-
root: "
|
|
28
|
-
rootRefreshed: "_bfhksm61 _syaz1gjq _8l3mmuej _aetrb3bt _10531gjq _f8pj1gjq _irr3166n _30l31gjq _1di61dty _9h8h1gjq"
|
|
26
|
+
root: "_bfhksm61 _syazazsu _8l3m1l7x _aetrb3bt _1053azsu _f8pjazsu _irr31dpa _30l3azsu _1di6fcek _9h8hazsu"
|
|
29
27
|
};
|
|
30
28
|
var primaryStyles = {
|
|
31
|
-
root: "
|
|
29
|
+
root: "_bfhk1856 _syaz15cr _105315cr _f8pj15cr _30l315cr _irr3hf2y _9h8h15cr _1di6g6ey"
|
|
32
30
|
};
|
|
33
31
|
var warningStyles = {
|
|
34
|
-
root: "
|
|
32
|
+
root: "_bfhk1kmu _syaz1yd3 _10531yd3 _f8pj1yd3 _30l31yd3 _irr31spp _9h8h1yd3 _1di64m4m"
|
|
35
33
|
};
|
|
36
34
|
var dangerStyles = {
|
|
37
|
-
root: "
|
|
35
|
+
root: "_bfhkybec _syaz15cr _105315cr _f8pj15cr _30l315cr _irr3s9hg _9h8h15cr _1di613a9"
|
|
38
36
|
};
|
|
39
37
|
var discoveryStyles = {
|
|
40
|
-
root: "
|
|
38
|
+
root: "_bfhku5tj _syaz15cr _105315cr _f8pj15cr _30l315cr _irr3fqeg _9h8h15cr _1di61f1m"
|
|
41
39
|
};
|
|
42
40
|
var subtleStyles = {
|
|
43
|
-
root: "
|
|
44
|
-
rootRefreshed: "_bfhkqtfy _syaz1gjq _10531gjq _f8pj1mjl _irr34mfv _30l31gjq _1di619qy _9h8h1gjq"
|
|
41
|
+
root: "_bfhksm61 _syazazsu _1053azsu _f8pj1mjl _irr31dpa _30l3azsu _1di6fcek _9h8hazsu"
|
|
45
42
|
};
|
|
46
43
|
var selectedStyles = {
|
|
47
|
-
root: "
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
discovery: "_bfhk1g49 _syaz1pke _30l31pke _irr31g49 _9h8h1pke _1di61g49"
|
|
44
|
+
root: "_bfhk15s3 _syaz6x5g _8l3mq98m _aetrb3bt _10536x5g _f8pj6x5g _30l36x5g _9h8h6x5g",
|
|
45
|
+
warning: "_bfhk15s3 _syaz6x5g _30l36x5g _irr315s3 _9h8h6x5g _1di615s3",
|
|
46
|
+
danger: "_bfhk15s3 _syaz6x5g _30l36x5g _irr315s3 _9h8h6x5g _1di615s3",
|
|
47
|
+
discovery: "_bfhk15s3 _syaz6x5g _30l36x5g _irr315s3 _9h8h6x5g _1di615s3"
|
|
52
48
|
};
|
|
53
49
|
|
|
54
50
|
/**
|
|
@@ -129,13 +125,7 @@ var LinkButtonBase = function LinkButtonBase(_ref, ref) {
|
|
|
129
125
|
interactionName: interactionName
|
|
130
126
|
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
131
127
|
}, saferRest, {
|
|
132
|
-
xcss: cx(styles.base, appearance === 'default' &&
|
|
133
|
-
// TODO: remove me once we kill color fallbacks
|
|
134
|
-
isSelected && appearance === 'danger' && selectedStyles.danger,
|
|
135
|
-
// TODO: remove me once we kill color fallbacks
|
|
136
|
-
isSelected && appearance === 'warning' && selectedStyles.warning,
|
|
137
|
-
// TODO: remove me once we kill color fallbacks
|
|
138
|
-
isSelected && appearance === 'discovery' && selectedStyles.discovery, isDisabled && styles.disabled, spacing === 'compact' && styles.spacingCompact, hasIconBefore && styles.buttonIconBefore, hasIconAfter && styles.buttonIconAfter, shouldFitContainer && styles.fullWidth)
|
|
128
|
+
xcss: cx(styles.base, appearance === 'default' && defaultStyles.root, appearance === 'primary' && primaryStyles.root, appearance === 'warning' && warningStyles.root, appearance === 'danger' && dangerStyles.root, appearance === 'discovery' && discoveryStyles.root, appearance === 'subtle' && subtleStyles.root, styles.linkDecorationUnset, isSelected && selectedStyles.root, isSelected && appearance === 'danger' && selectedStyles.danger, isSelected && appearance === 'warning' && selectedStyles.warning, isSelected && appearance === 'discovery' && selectedStyles.discovery, isDisabled && styles.disabled, spacing === 'compact' && styles.spacingCompact, hasIconBefore && styles.buttonIconBefore, hasIconAfter && styles.buttonIconAfter, shouldFitContainer && styles.fullWidth)
|
|
139
129
|
}), iconBefore && /*#__PURE__*/React.createElement(Content, {
|
|
140
130
|
type: "icon",
|
|
141
131
|
position: "before",
|