@atlaskit/react-select 1.4.0 → 1.4.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 +8 -0
- package/dist/cjs/components/containers.js +9 -7
- package/dist/cjs/components/control.js +58 -13
- package/dist/cjs/components/group.js +11 -11
- package/dist/cjs/components/indicators.js +39 -34
- package/dist/cjs/components/input.js +1 -1
- package/dist/cjs/components/menu.js +4 -5
- package/dist/cjs/components/multi-value.js +86 -30
- package/dist/cjs/components/option.js +31 -10
- package/dist/cjs/components/placeholder.js +3 -6
- package/dist/cjs/components/single-value.js +3 -6
- package/dist/cjs/select.js +57 -37
- package/dist/es2019/components/containers.js +8 -8
- package/dist/es2019/components/control.js +71 -24
- package/dist/es2019/components/group.js +10 -18
- package/dist/es2019/components/indicators.js +25 -28
- package/dist/es2019/components/input.js +1 -1
- package/dist/es2019/components/menu.js +6 -11
- package/dist/es2019/components/multi-value.js +89 -30
- package/dist/es2019/components/option.js +41 -19
- package/dist/es2019/components/placeholder.js +3 -7
- package/dist/es2019/components/single-value.js +3 -5
- package/dist/es2019/select.js +26 -9
- package/dist/esm/components/containers.js +9 -7
- package/dist/esm/components/control.js +58 -13
- package/dist/esm/components/group.js +11 -11
- package/dist/esm/components/indicators.js +39 -34
- package/dist/esm/components/input.js +1 -1
- package/dist/esm/components/menu.js +4 -5
- package/dist/esm/components/multi-value.js +86 -30
- package/dist/esm/components/option.js +31 -10
- package/dist/esm/components/placeholder.js +3 -6
- package/dist/esm/components/single-value.js +3 -6
- package/dist/esm/select.js +57 -37
- package/dist/types/components/containers.d.ts +5 -1
- package/dist/types/components/control.d.ts +10 -1
- package/dist/types/components/group.d.ts +2 -2
- package/dist/types/components/indicators.d.ts +16 -4
- package/dist/types/components/menu.d.ts +1 -1
- package/dist/types/components/multi-value.d.ts +3 -3
- package/dist/types/components/option.d.ts +1 -1
- package/dist/types/components/placeholder.d.ts +1 -1
- package/dist/types/components/single-value.d.ts +1 -1
- package/dist/types/select.d.ts +5 -0
- package/dist/types-ts4.5/components/containers.d.ts +5 -1
- package/dist/types-ts4.5/components/control.d.ts +10 -1
- package/dist/types-ts4.5/components/group.d.ts +2 -2
- package/dist/types-ts4.5/components/indicators.d.ts +16 -4
- package/dist/types-ts4.5/components/menu.d.ts +1 -1
- package/dist/types-ts4.5/components/multi-value.d.ts +3 -3
- package/dist/types-ts4.5/components/option.d.ts +1 -1
- package/dist/types-ts4.5/components/placeholder.d.ts +1 -1
- package/dist/types-ts4.5/components/single-value.d.ts +1 -1
- package/dist/types-ts4.5/select.d.ts +5 -0
- package/package.json +5 -1
|
@@ -9,27 +9,49 @@ import { getStyleProps } from '../utils';
|
|
|
9
9
|
export const optionCSS = ({
|
|
10
10
|
isDisabled,
|
|
11
11
|
isFocused,
|
|
12
|
-
isSelected
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
isSelected
|
|
13
|
+
}) => {
|
|
14
|
+
let color = "var(--ds-text, #172B4D)";
|
|
15
|
+
if (isDisabled) {
|
|
16
|
+
color = "var(--ds-text-disabled, #091E424F)";
|
|
17
|
+
} else if (isSelected) {
|
|
18
|
+
color = "var(--ds-text-selected, #0C66E4)";
|
|
16
19
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
padding: `${spacing.baseUnit * 2}px ${spacing.baseUnit * 3}px`,
|
|
28
|
-
// provide some affordance on touch devices
|
|
29
|
-
':active': {
|
|
30
|
-
backgroundColor: !isDisabled ? isSelected ? colors.primary : colors.primary50 : undefined
|
|
20
|
+
let boxShadow;
|
|
21
|
+
let backgroundColor;
|
|
22
|
+
if (isDisabled) {
|
|
23
|
+
backgroundColor = undefined;
|
|
24
|
+
} else if (isSelected && isFocused) {
|
|
25
|
+
backgroundColor = "var(--ds-background-selected-hovered, #CCE0FF)";
|
|
26
|
+
} else if (isSelected) {
|
|
27
|
+
backgroundColor = "var(--ds-background-selected, #E9F2FF)";
|
|
28
|
+
} else if (isFocused) {
|
|
29
|
+
backgroundColor = "var(--ds-background-neutral-subtle-hovered, #091E420F)";
|
|
31
30
|
}
|
|
32
|
-
|
|
31
|
+
if (!isDisabled && (isFocused || isSelected)) {
|
|
32
|
+
boxShadow = `inset 2px 0px 0px ${"var(--ds-border-selected, #0C66E4)"}`;
|
|
33
|
+
}
|
|
34
|
+
const cursor = isDisabled ? 'not-allowed' : 'default';
|
|
35
|
+
return {
|
|
36
|
+
label: 'option',
|
|
37
|
+
display: 'block',
|
|
38
|
+
fontSize: 'inherit',
|
|
39
|
+
width: '100%',
|
|
40
|
+
userSelect: 'none',
|
|
41
|
+
WebkitTapHighlightColor: 'rgba(0, 0, 0, 0)',
|
|
42
|
+
padding: `${"var(--ds-space-075, 6px)"} ${"var(--ds-space-150, 12px)"}`,
|
|
43
|
+
backgroundColor,
|
|
44
|
+
color,
|
|
45
|
+
cursor,
|
|
46
|
+
boxShadow,
|
|
47
|
+
':active': {
|
|
48
|
+
backgroundColor: !isDisabled ? isSelected ? "var(--ds-background-selected-pressed, #85B8FF)" : "var(--ds-background-neutral-subtle-pressed, #091E4224)" : undefined
|
|
49
|
+
},
|
|
50
|
+
'@media screen and (-ms-high-contrast: active)': {
|
|
51
|
+
borderLeft: !isDisabled && (isFocused || isSelected) ? '2px solid transparent' : ''
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
};
|
|
33
55
|
const Option = props => {
|
|
34
56
|
const {
|
|
35
57
|
children,
|
|
@@ -7,16 +7,12 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
7
7
|
import { jsx } from '@emotion/react';
|
|
8
8
|
import { getStyleProps } from '../utils';
|
|
9
9
|
export const placeholderCSS = ({
|
|
10
|
-
|
|
11
|
-
spacing,
|
|
12
|
-
colors
|
|
13
|
-
}
|
|
10
|
+
isDisabled
|
|
14
11
|
}) => ({
|
|
15
12
|
label: 'placeholder',
|
|
16
13
|
gridArea: '1 / 1 / 2 / 3',
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
marginRight: spacing.baseUnit / 2
|
|
14
|
+
margin: `0 ${"var(--ds-space-025, 2px)"}`,
|
|
15
|
+
color: isDisabled ? "var(--ds-text-disabled, #091E424F)" : "var(--ds-text-subtlest, #626F86)"
|
|
20
16
|
});
|
|
21
17
|
const Placeholder = props => {
|
|
22
18
|
const {
|
|
@@ -9,8 +9,7 @@ import { getStyleProps } from '../utils';
|
|
|
9
9
|
export const css = ({
|
|
10
10
|
isDisabled,
|
|
11
11
|
theme: {
|
|
12
|
-
spacing
|
|
13
|
-
colors
|
|
12
|
+
spacing
|
|
14
13
|
}
|
|
15
14
|
}) => ({
|
|
16
15
|
label: 'singleValue',
|
|
@@ -19,9 +18,8 @@ export const css = ({
|
|
|
19
18
|
overflow: 'hidden',
|
|
20
19
|
textOverflow: 'ellipsis',
|
|
21
20
|
whiteSpace: 'nowrap',
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
marginRight: spacing.baseUnit / 2
|
|
21
|
+
margin: `0 ${"var(--ds-space-025, 2px)"}`,
|
|
22
|
+
color: isDisabled ? "var(--ds-text-disabled, #091E424F)" : "var(--ds-text, #172B4D)"
|
|
25
23
|
});
|
|
26
24
|
const SingleValue = props => {
|
|
27
25
|
const {
|
package/dist/es2019/select.js
CHANGED
|
@@ -1389,7 +1389,8 @@ export default class Select extends Component {
|
|
|
1389
1389
|
const {
|
|
1390
1390
|
clearControlLabel,
|
|
1391
1391
|
isDisabled,
|
|
1392
|
-
isLoading
|
|
1392
|
+
isLoading,
|
|
1393
|
+
spacing
|
|
1393
1394
|
} = this.props;
|
|
1394
1395
|
const {
|
|
1395
1396
|
isFocused
|
|
@@ -1402,11 +1403,13 @@ export default class Select extends Component {
|
|
|
1402
1403
|
onTouchEnd: this.onClearIndicatorTouchEnd,
|
|
1403
1404
|
'aria-hidden': 'true'
|
|
1404
1405
|
};
|
|
1406
|
+
const isCompact = spacing === 'compact';
|
|
1405
1407
|
return /*#__PURE__*/React.createElement(ClearIndicator, _extends({
|
|
1406
1408
|
clearControlLabel: clearControlLabel
|
|
1407
1409
|
}, commonProps, {
|
|
1408
1410
|
innerProps: innerProps,
|
|
1409
|
-
isFocused: isFocused
|
|
1411
|
+
isFocused: isFocused,
|
|
1412
|
+
isCompact: isCompact
|
|
1410
1413
|
}));
|
|
1411
1414
|
}
|
|
1412
1415
|
renderLoadingIndicator() {
|
|
@@ -1418,7 +1421,8 @@ export default class Select extends Component {
|
|
|
1418
1421
|
} = this;
|
|
1419
1422
|
const {
|
|
1420
1423
|
isDisabled,
|
|
1421
|
-
isLoading
|
|
1424
|
+
isLoading,
|
|
1425
|
+
spacing
|
|
1422
1426
|
} = this.props;
|
|
1423
1427
|
const {
|
|
1424
1428
|
isFocused
|
|
@@ -1426,13 +1430,15 @@ export default class Select extends Component {
|
|
|
1426
1430
|
if (!LoadingIndicator || !isLoading) {
|
|
1427
1431
|
return null;
|
|
1428
1432
|
}
|
|
1433
|
+
const isCompact = spacing === 'compact';
|
|
1429
1434
|
const innerProps = {
|
|
1430
1435
|
'aria-hidden': 'true'
|
|
1431
1436
|
};
|
|
1432
1437
|
return /*#__PURE__*/React.createElement(LoadingIndicator, _extends({}, commonProps, {
|
|
1433
1438
|
innerProps: innerProps,
|
|
1434
1439
|
isDisabled: isDisabled,
|
|
1435
|
-
isFocused: isFocused
|
|
1440
|
+
isFocused: isFocused,
|
|
1441
|
+
isCompact: isCompact
|
|
1436
1442
|
}));
|
|
1437
1443
|
}
|
|
1438
1444
|
renderIndicatorSeparator() {
|
|
@@ -1470,11 +1476,13 @@ export default class Select extends Component {
|
|
|
1470
1476
|
commonProps
|
|
1471
1477
|
} = this;
|
|
1472
1478
|
const {
|
|
1473
|
-
isDisabled
|
|
1479
|
+
isDisabled,
|
|
1480
|
+
spacing
|
|
1474
1481
|
} = this.props;
|
|
1475
1482
|
const {
|
|
1476
1483
|
isFocused
|
|
1477
1484
|
} = this.state;
|
|
1485
|
+
const isCompact = spacing === 'compact';
|
|
1478
1486
|
const innerProps = {
|
|
1479
1487
|
onMouseDown: this.onDropdownIndicatorMouseDown,
|
|
1480
1488
|
onTouchEnd: this.onDropdownIndicatorTouchEnd,
|
|
@@ -1483,7 +1491,8 @@ export default class Select extends Component {
|
|
|
1483
1491
|
return /*#__PURE__*/React.createElement(DropdownIndicator, _extends({}, commonProps, {
|
|
1484
1492
|
innerProps: innerProps,
|
|
1485
1493
|
isDisabled: isDisabled,
|
|
1486
|
-
isFocused: isFocused
|
|
1494
|
+
isFocused: isFocused,
|
|
1495
|
+
isCompact: isCompact
|
|
1487
1496
|
}));
|
|
1488
1497
|
}
|
|
1489
1498
|
renderMenu() {
|
|
@@ -1748,12 +1757,16 @@ export default class Select extends Component {
|
|
|
1748
1757
|
className,
|
|
1749
1758
|
id,
|
|
1750
1759
|
isDisabled,
|
|
1751
|
-
menuIsOpen
|
|
1760
|
+
menuIsOpen,
|
|
1761
|
+
isInvalid,
|
|
1762
|
+
appearance = 'default',
|
|
1763
|
+
spacing = 'default'
|
|
1752
1764
|
} = this.props;
|
|
1753
1765
|
const {
|
|
1754
1766
|
isFocused
|
|
1755
1767
|
} = this.state;
|
|
1756
1768
|
const commonProps = this.commonProps = this.getCommonProps();
|
|
1769
|
+
const isCompact = spacing === 'compact';
|
|
1757
1770
|
return /*#__PURE__*/React.createElement(SelectContainer, _extends({}, commonProps, {
|
|
1758
1771
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
1759
1772
|
className: className,
|
|
@@ -1769,11 +1782,15 @@ export default class Select extends Component {
|
|
|
1769
1782
|
onMouseDown: this.onControlMouseDown,
|
|
1770
1783
|
onTouchEnd: this.onControlTouchEnd
|
|
1771
1784
|
},
|
|
1785
|
+
appearance: appearance,
|
|
1786
|
+
isInvalid: isInvalid,
|
|
1772
1787
|
isDisabled: isDisabled,
|
|
1773
1788
|
isFocused: isFocused,
|
|
1774
|
-
menuIsOpen: menuIsOpen
|
|
1789
|
+
menuIsOpen: menuIsOpen,
|
|
1790
|
+
isCompact: isCompact
|
|
1775
1791
|
}), /*#__PURE__*/React.createElement(ValueContainer, _extends({}, commonProps, {
|
|
1776
|
-
isDisabled: isDisabled
|
|
1792
|
+
isDisabled: isDisabled,
|
|
1793
|
+
isCompact: isCompact
|
|
1777
1794
|
}), this.renderPlaceholderOrValue(), this.renderInput()), /*#__PURE__*/React.createElement(IndicatorsContainer, _extends({}, commonProps, {
|
|
1778
1795
|
isDisabled: isDisabled
|
|
1779
1796
|
}), this.renderClearIndicator(), this.renderLoadingIndicator(), this.renderIndicatorSeparator(), this.renderDropdownIndicator())), this.renderMenu(), this.renderFormField());
|
|
@@ -17,9 +17,10 @@ export var containerCSS = function containerCSS(_ref) {
|
|
|
17
17
|
return {
|
|
18
18
|
label: 'container',
|
|
19
19
|
direction: isRtl ? 'rtl' : undefined,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
position: 'relative',
|
|
21
|
+
font: "var(--ds-font-body, normal 400 14px/20px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
|
|
22
|
+
pointerEvents: 'all',
|
|
23
|
+
cursor: isDisabled ? 'not-allowed' : undefined
|
|
23
24
|
};
|
|
24
25
|
};
|
|
25
26
|
|
|
@@ -40,9 +41,9 @@ export var SelectContainer = function SelectContainer(props) {
|
|
|
40
41
|
// ==============================
|
|
41
42
|
|
|
42
43
|
export var valueContainerCSS = function valueContainerCSS(_ref2) {
|
|
43
|
-
var
|
|
44
|
-
isMulti = _ref2.isMulti,
|
|
44
|
+
var isMulti = _ref2.isMulti,
|
|
45
45
|
hasValue = _ref2.hasValue,
|
|
46
|
+
isCompact = _ref2.isCompact,
|
|
46
47
|
controlShouldRenderValue = _ref2.selectProps.controlShouldRenderValue;
|
|
47
48
|
return {
|
|
48
49
|
alignItems: 'center',
|
|
@@ -52,7 +53,7 @@ export var valueContainerCSS = function valueContainerCSS(_ref2) {
|
|
|
52
53
|
WebkitOverflowScrolling: 'touch',
|
|
53
54
|
position: 'relative',
|
|
54
55
|
overflow: 'hidden',
|
|
55
|
-
padding: "".concat(
|
|
56
|
+
padding: "".concat(isCompact ? 0 : "var(--ds-space-025, 2px)", " ", "var(--ds-space-075, 6px)")
|
|
56
57
|
};
|
|
57
58
|
};
|
|
58
59
|
|
|
@@ -84,7 +85,8 @@ export var indicatorsContainerCSS = function indicatorsContainerCSS() {
|
|
|
84
85
|
alignItems: 'center',
|
|
85
86
|
alignSelf: 'stretch',
|
|
86
87
|
display: 'flex',
|
|
87
|
-
flexShrink: 0
|
|
88
|
+
flexShrink: 0,
|
|
89
|
+
paddingRight: "var(--ds-space-050, 4px)"
|
|
88
90
|
};
|
|
89
91
|
};
|
|
90
92
|
|
|
@@ -9,10 +9,33 @@ import { getStyleProps } from '../utils';
|
|
|
9
9
|
export var css = function css(_ref) {
|
|
10
10
|
var isDisabled = _ref.isDisabled,
|
|
11
11
|
isFocused = _ref.isFocused,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
isInvalid = _ref.isInvalid,
|
|
13
|
+
isCompact = _ref.isCompact,
|
|
14
|
+
appearance = _ref.appearance;
|
|
15
|
+
var borderColor = isFocused ? "var(--ds-border-focused, #388BFF)" : "var(--ds-border-input, #8590A2)";
|
|
16
|
+
var backgroundColor = isFocused ? "var(--ds-background-input-pressed, #FFFFFF)" : "var(--ds-background-input, #FFFFFF)";
|
|
17
|
+
var backgroundColorHover = isFocused ? "var(--ds-background-input-pressed, #FFFFFF)" : "var(--ds-background-input-hovered, #F7F8F9)";
|
|
18
|
+
var borderColorHover = isFocused ? "var(--ds-border-focused, #388BFF)" : "var(--ds-border-input, #8590A2)";
|
|
19
|
+
if (isDisabled) {
|
|
20
|
+
backgroundColor = "var(--ds-background-disabled, #091E4208)";
|
|
21
|
+
borderColor = "var(--ds-background-disabled, #091E4208)";
|
|
22
|
+
}
|
|
23
|
+
if (isInvalid) {
|
|
24
|
+
borderColor = "var(--ds-border-danger, #E2483D)";
|
|
25
|
+
borderColorHover = "var(--ds-border-danger, #E2483D)";
|
|
26
|
+
}
|
|
27
|
+
var transitionDuration = '200ms';
|
|
28
|
+
if (appearance === 'subtle') {
|
|
29
|
+
borderColor = isFocused ? "var(--ds-border-focused, #388BFF)" : 'transparent';
|
|
30
|
+
backgroundColor = isFocused ? "var(--ds-surface, #FFFFFF)" : 'transparent';
|
|
31
|
+
backgroundColorHover = isFocused ? "var(--ds-background-input-pressed, #FFFFFF)" : "var(--ds-background-input-hovered, #F7F8F9)";
|
|
32
|
+
}
|
|
33
|
+
if (appearance === 'none') {
|
|
34
|
+
borderColor = 'transparent';
|
|
35
|
+
backgroundColor = 'transparent';
|
|
36
|
+
backgroundColorHover = 'transparent';
|
|
37
|
+
borderColorHover = 'transparent';
|
|
38
|
+
}
|
|
16
39
|
return {
|
|
17
40
|
label: 'control',
|
|
18
41
|
alignItems: 'center',
|
|
@@ -20,18 +43,40 @@ export var css = function css(_ref) {
|
|
|
20
43
|
display: 'flex',
|
|
21
44
|
flexWrap: 'wrap',
|
|
22
45
|
justifyContent: 'space-between',
|
|
23
|
-
minHeight: spacing.controlHeight,
|
|
24
46
|
outline: '0 !important',
|
|
25
47
|
position: 'relative',
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
48
|
+
// Turn pointer events off when disabled - this makes it so hover etc don't work.
|
|
49
|
+
pointerEvents: isDisabled ? 'none' : undefined,
|
|
50
|
+
backgroundColor: backgroundColor,
|
|
51
|
+
borderColor: borderColor,
|
|
30
52
|
borderStyle: 'solid',
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
'
|
|
34
|
-
|
|
53
|
+
borderRadius: "var(--ds-border-radius-100, 3px)",
|
|
54
|
+
borderWidth: "var(--ds-border-width, 1px)",
|
|
55
|
+
boxShadow: isInvalid ? "inset 0 0 0 ".concat("var(--ds-border-width, 1px)", " ", borderColor) : 'none',
|
|
56
|
+
'&:focus-within': {
|
|
57
|
+
boxShadow: "inset 0 0 0 ".concat("var(--ds-border-width, 1px)", " ", borderColor)
|
|
58
|
+
},
|
|
59
|
+
minHeight: isCompact ? 32 : 40,
|
|
60
|
+
padding: 0,
|
|
61
|
+
transition: "background-color ".concat(transitionDuration, " ease-in-out,\nborder-color ").concat(transitionDuration, " ease-in-out"),
|
|
62
|
+
'::-webkit-scrollbar': {
|
|
63
|
+
height: 8,
|
|
64
|
+
width: 8
|
|
65
|
+
},
|
|
66
|
+
'::-webkit-scrollbar-corner': {
|
|
67
|
+
display: 'none'
|
|
68
|
+
},
|
|
69
|
+
':hover': {
|
|
70
|
+
'::-webkit-scrollbar-thumb': {
|
|
71
|
+
// scrollbars occur only if the user passes in a custom component with overflow: scroll
|
|
72
|
+
backgroundColor: 'rgba(0,0,0,0.2)'
|
|
73
|
+
},
|
|
74
|
+
cursor: 'pointer',
|
|
75
|
+
backgroundColor: backgroundColorHover,
|
|
76
|
+
borderColor: borderColorHover
|
|
77
|
+
},
|
|
78
|
+
'::-webkit-scrollbar-thumb:hover': {
|
|
79
|
+
backgroundColor: 'rgba(0,0,0,0.4)'
|
|
35
80
|
}
|
|
36
81
|
};
|
|
37
82
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
+
import _objectDestructuringEmpty from "@babel/runtime/helpers/objectDestructuringEmpty";
|
|
3
4
|
var _excluded = ["data"];
|
|
4
5
|
/**
|
|
5
6
|
* @jsxRuntime classic
|
|
@@ -9,10 +10,10 @@ var _excluded = ["data"];
|
|
|
9
10
|
import { jsx } from '@emotion/react';
|
|
10
11
|
import { cleanCommonProps, getStyleProps } from '../utils';
|
|
11
12
|
export var groupCSS = function groupCSS(_ref) {
|
|
12
|
-
|
|
13
|
+
_objectDestructuringEmpty(_ref);
|
|
13
14
|
return {
|
|
14
|
-
paddingBottom:
|
|
15
|
-
paddingTop:
|
|
15
|
+
paddingBottom: "var(--ds-space-100, 8px)",
|
|
16
|
+
paddingTop: "var(--ds-space-100, 8px)"
|
|
16
17
|
};
|
|
17
18
|
};
|
|
18
19
|
var Group = function Group(props) {
|
|
@@ -39,20 +40,19 @@ var Group = function Group(props) {
|
|
|
39
40
|
}), label), jsx("div", null, children));
|
|
40
41
|
};
|
|
41
42
|
export var groupHeadingCSS = function groupHeadingCSS(_ref2) {
|
|
42
|
-
|
|
43
|
-
colors = _ref2$theme.colors,
|
|
44
|
-
spacing = _ref2$theme.spacing;
|
|
43
|
+
_objectDestructuringEmpty(_ref2);
|
|
45
44
|
return {
|
|
46
45
|
label: 'group',
|
|
47
46
|
cursor: 'default',
|
|
48
47
|
display: 'block',
|
|
49
|
-
color: colors.neutral40,
|
|
50
48
|
fontSize: '75%',
|
|
51
|
-
fontWeight: 500,
|
|
52
49
|
marginBottom: '0.25em',
|
|
53
|
-
paddingLeft:
|
|
54
|
-
paddingRight:
|
|
55
|
-
|
|
50
|
+
paddingLeft: "var(--ds-space-150, 12px)",
|
|
51
|
+
paddingRight: "var(--ds-space-150, 12px)",
|
|
52
|
+
font: "var(--ds-font-body-small, normal 400 11px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
|
|
53
|
+
color: "var(--ds-text-subtle, #44546F)",
|
|
54
|
+
fontWeight: "var(--ds-font-weight-bold, 700)".concat(" !important"),
|
|
55
|
+
textTransform: 'none'
|
|
56
56
|
};
|
|
57
57
|
};
|
|
58
58
|
|
|
@@ -64,23 +64,20 @@ export var DownChevron = function DownChevron(props) {
|
|
|
64
64
|
// Dropdown & Clear Buttons
|
|
65
65
|
// ==============================
|
|
66
66
|
|
|
67
|
-
var
|
|
68
|
-
var
|
|
69
|
-
|
|
70
|
-
baseUnit = _ref2$theme.spacing.baseUnit,
|
|
71
|
-
colors = _ref2$theme.colors;
|
|
67
|
+
export var dropdownIndicatorCSS = function dropdownIndicatorCSS(_ref2) {
|
|
68
|
+
var isCompact = _ref2.isCompact,
|
|
69
|
+
isDisabled = _ref2.isDisabled;
|
|
72
70
|
return {
|
|
73
71
|
label: 'indicatorContainer',
|
|
74
72
|
display: 'flex',
|
|
75
73
|
transition: 'color 150ms',
|
|
76
|
-
color:
|
|
77
|
-
padding:
|
|
74
|
+
color: isDisabled ? "var(--ds-text-disabled, #091E424F)" : "var(--ds-text-subtle, #44546F)",
|
|
75
|
+
padding: "".concat(isCompact ? 0 : "var(--ds-space-075, 6px)", " ", "var(--ds-space-025, 2px)"),
|
|
78
76
|
':hover': {
|
|
79
|
-
color:
|
|
77
|
+
color: "var(--ds-text-subtle, #44546F)"
|
|
80
78
|
}
|
|
81
79
|
};
|
|
82
80
|
};
|
|
83
|
-
export var dropdownIndicatorCSS = baseCSS;
|
|
84
81
|
|
|
85
82
|
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
86
83
|
export var DropdownIndicator = function DropdownIndicator(props) {
|
|
@@ -91,7 +88,19 @@ export var DropdownIndicator = function DropdownIndicator(props) {
|
|
|
91
88
|
'dropdown-indicator': true
|
|
92
89
|
}), innerProps), children || jsx(DownChevron, null));
|
|
93
90
|
};
|
|
94
|
-
export var clearIndicatorCSS =
|
|
91
|
+
export var clearIndicatorCSS = function clearIndicatorCSS(_ref3) {
|
|
92
|
+
var isCompact = _ref3.isCompact;
|
|
93
|
+
return {
|
|
94
|
+
label: 'indicatorContainer',
|
|
95
|
+
display: 'flex',
|
|
96
|
+
transition: 'color 150ms',
|
|
97
|
+
color: "var(--ds-text-subtlest, #626F86)",
|
|
98
|
+
padding: "".concat(isCompact ? 0 : "var(--ds-space-075, 6px)", " ", "var(--ds-space-025, 2px)"),
|
|
99
|
+
':hover': {
|
|
100
|
+
color: "var(--ds-text-subtle, #44546F)"
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
};
|
|
95
104
|
|
|
96
105
|
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
97
106
|
export var ClearIndicator = function ClearIndicator(props) {
|
|
@@ -107,18 +116,15 @@ export var ClearIndicator = function ClearIndicator(props) {
|
|
|
107
116
|
// Separator
|
|
108
117
|
// ==============================
|
|
109
118
|
|
|
110
|
-
export var indicatorSeparatorCSS = function indicatorSeparatorCSS(
|
|
111
|
-
var isDisabled =
|
|
112
|
-
_ref3$theme = _ref3.theme,
|
|
113
|
-
baseUnit = _ref3$theme.spacing.baseUnit,
|
|
114
|
-
colors = _ref3$theme.colors;
|
|
119
|
+
export var indicatorSeparatorCSS = function indicatorSeparatorCSS(_ref4) {
|
|
120
|
+
var isDisabled = _ref4.isDisabled;
|
|
115
121
|
return {
|
|
116
122
|
label: 'indicatorSeparator',
|
|
117
123
|
alignSelf: 'stretch',
|
|
118
124
|
width: 1,
|
|
119
|
-
backgroundColor: isDisabled ?
|
|
120
|
-
marginBottom:
|
|
121
|
-
marginTop:
|
|
125
|
+
backgroundColor: isDisabled ? "var(--ds-border-disabled, #091E420F)" : "var(--ds-border, #091E4224)",
|
|
126
|
+
marginBottom: "var(--ds-space-100, 8px)",
|
|
127
|
+
marginTop: "var(--ds-space-100, 8px)"
|
|
122
128
|
};
|
|
123
129
|
};
|
|
124
130
|
|
|
@@ -142,12 +148,11 @@ var loadingDotAnimations = keyframes({
|
|
|
142
148
|
opacity: 1
|
|
143
149
|
}
|
|
144
150
|
});
|
|
145
|
-
export var loadingIndicatorCSS = function loadingIndicatorCSS(
|
|
146
|
-
var isFocused =
|
|
147
|
-
size =
|
|
148
|
-
|
|
149
|
-
colors =
|
|
150
|
-
baseUnit = _ref4$theme.spacing.baseUnit;
|
|
151
|
+
export var loadingIndicatorCSS = function loadingIndicatorCSS(_ref5) {
|
|
152
|
+
var isFocused = _ref5.isFocused,
|
|
153
|
+
size = _ref5.size,
|
|
154
|
+
isCompact = _ref5.isCompact,
|
|
155
|
+
colors = _ref5.theme.colors;
|
|
151
156
|
return {
|
|
152
157
|
label: 'loadingIndicator',
|
|
153
158
|
display: 'flex',
|
|
@@ -159,12 +164,12 @@ export var loadingIndicatorCSS = function loadingIndicatorCSS(_ref4) {
|
|
|
159
164
|
textAlign: 'center',
|
|
160
165
|
verticalAlign: 'middle',
|
|
161
166
|
color: isFocused ? colors.neutral60 : colors.neutral20,
|
|
162
|
-
padding:
|
|
167
|
+
padding: "".concat(isCompact ? 0 : "var(--ds-space-075, 6px)", " ", "var(--ds-space-100, 8px)")
|
|
163
168
|
};
|
|
164
169
|
};
|
|
165
|
-
var LoadingDot = function LoadingDot(
|
|
166
|
-
var delay =
|
|
167
|
-
offset =
|
|
170
|
+
var LoadingDot = function LoadingDot(_ref6) {
|
|
171
|
+
var delay = _ref6.delay,
|
|
172
|
+
offset = _ref6.offset;
|
|
168
173
|
return jsx("span", {
|
|
169
174
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
170
175
|
css: {
|
|
@@ -180,12 +185,12 @@ var LoadingDot = function LoadingDot(_ref5) {
|
|
|
180
185
|
});
|
|
181
186
|
};
|
|
182
187
|
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
183
|
-
export var LoadingIndicator = function LoadingIndicator(
|
|
184
|
-
var innerProps =
|
|
185
|
-
isRtl =
|
|
186
|
-
|
|
187
|
-
size =
|
|
188
|
-
restProps = _objectWithoutProperties(
|
|
188
|
+
export var LoadingIndicator = function LoadingIndicator(_ref7) {
|
|
189
|
+
var innerProps = _ref7.innerProps,
|
|
190
|
+
isRtl = _ref7.isRtl,
|
|
191
|
+
_ref7$size = _ref7.size,
|
|
192
|
+
size = _ref7$size === void 0 ? 4 : _ref7$size,
|
|
193
|
+
restProps = _objectWithoutProperties(_ref7, _excluded2);
|
|
189
194
|
return jsx("div", _extends({}, getStyleProps(_objectSpread(_objectSpread({}, restProps), {}, {
|
|
190
195
|
innerProps: innerProps,
|
|
191
196
|
isRtl: isRtl,
|
|
@@ -26,7 +26,7 @@ export var inputCSS = function inputCSS(_ref) {
|
|
|
26
26
|
margin: spacing.baseUnit / 2,
|
|
27
27
|
paddingBottom: spacing.baseUnit / 2,
|
|
28
28
|
paddingTop: spacing.baseUnit / 2,
|
|
29
|
-
color:
|
|
29
|
+
color: "var(--ds-text, hsl(0, 0%, 20%))"
|
|
30
30
|
});
|
|
31
31
|
};
|
|
32
32
|
var spacingStyle = {
|
|
@@ -201,7 +201,7 @@ export var menuCSS = function menuCSS(_ref2) {
|
|
|
201
201
|
colors = _ref2$theme.colors;
|
|
202
202
|
return _ref3 = {
|
|
203
203
|
label: 'menu'
|
|
204
|
-
}, _defineProperty(_ref3, alignToControl(placement), '100%'), _defineProperty(_ref3, "position", 'absolute'), _defineProperty(_ref3, "width", '100%'), _defineProperty(_ref3, "zIndex", 1), _defineProperty(_ref3, "
|
|
204
|
+
}, _defineProperty(_ref3, alignToControl(placement), '100%'), _defineProperty(_ref3, "position", 'absolute'), _defineProperty(_ref3, "width", '100%'), _defineProperty(_ref3, "zIndex", 1), _defineProperty(_ref3, "borderRadius", borderRadius), _defineProperty(_ref3, "marginBottom", spacing.menuGutter), _defineProperty(_ref3, "marginTop", spacing.menuGutter), _defineProperty(_ref3, "backgroundColor", "var(--ds-surface-overlay, white)"), _defineProperty(_ref3, "boxShadow", "var(--ds-shadow-overlay, 0 0 0 1px hsl(0deg 0% 0% / 10%), 0 4px 11px hsl(0deg 0% 0% / 10%))"), _ref3;
|
|
205
205
|
};
|
|
206
206
|
var PortalPlacementContext = /*#__PURE__*/createContext(null);
|
|
207
207
|
|
|
@@ -276,16 +276,15 @@ export default Menu;
|
|
|
276
276
|
// ==============================
|
|
277
277
|
|
|
278
278
|
export var menuListCSS = function menuListCSS(_ref5) {
|
|
279
|
-
var maxHeight = _ref5.maxHeight
|
|
280
|
-
baseUnit = _ref5.theme.spacing.baseUnit;
|
|
279
|
+
var maxHeight = _ref5.maxHeight;
|
|
281
280
|
return {
|
|
282
281
|
maxHeight: maxHeight,
|
|
283
282
|
overflowY: 'auto',
|
|
284
283
|
position: 'relative',
|
|
285
284
|
// required for offset[Height, Top] > keyboard scroll
|
|
286
285
|
WebkitOverflowScrolling: 'touch',
|
|
287
|
-
|
|
288
|
-
|
|
286
|
+
paddingTop: "var(--ds-space-100, 8px)",
|
|
287
|
+
paddingBottom: "var(--ds-space-100, 8px)"
|
|
289
288
|
};
|
|
290
289
|
};
|
|
291
290
|
|