@atlaskit/react-select 2.2.0 → 2.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.
Files changed (102) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/cjs/emotion/components/containers.js +111 -0
  3. package/dist/cjs/emotion/components/control.js +110 -0
  4. package/dist/cjs/emotion/components/group.js +71 -0
  5. package/dist/cjs/emotion/components/index.js +52 -0
  6. package/dist/cjs/emotion/components/indicators.js +137 -0
  7. package/dist/cjs/emotion/components/input.js +94 -0
  8. package/dist/cjs/emotion/components/internal/a11y-text.js +36 -0
  9. package/dist/cjs/emotion/components/internal/dummy-input.js +44 -0
  10. package/dist/cjs/emotion/components/internal/index.js +34 -0
  11. package/dist/cjs/emotion/components/internal/notify-open-layer-observer.js +21 -0
  12. package/dist/cjs/emotion/components/internal/required-input.js +43 -0
  13. package/dist/cjs/emotion/components/internal/scroll-manager.js +57 -0
  14. package/dist/cjs/emotion/components/internal/use-scroll-capture.js +132 -0
  15. package/dist/cjs/emotion/components/internal/use-scroll-lock.js +149 -0
  16. package/dist/cjs/emotion/components/live-region.js +182 -0
  17. package/dist/cjs/emotion/components/menu.js +456 -0
  18. package/dist/cjs/emotion/components/multi-value.js +224 -0
  19. package/dist/cjs/emotion/components/option.js +82 -0
  20. package/dist/cjs/emotion/components/placeholder.js +34 -0
  21. package/dist/cjs/emotion/components/single-value.js +40 -0
  22. package/dist/es2019/emotion/components/containers.js +109 -0
  23. package/dist/es2019/emotion/components/control.js +107 -0
  24. package/dist/es2019/emotion/components/group.js +59 -0
  25. package/dist/es2019/emotion/components/index.js +41 -0
  26. package/dist/es2019/emotion/components/indicators.js +128 -0
  27. package/dist/es2019/emotion/components/input.js +86 -0
  28. package/dist/es2019/emotion/components/internal/a11y-text.js +27 -0
  29. package/dist/es2019/emotion/components/internal/dummy-input.js +37 -0
  30. package/dist/es2019/emotion/components/internal/index.js +4 -0
  31. package/dist/es2019/emotion/components/internal/notify-open-layer-observer.js +16 -0
  32. package/dist/es2019/emotion/components/internal/required-input.js +35 -0
  33. package/dist/es2019/emotion/components/internal/scroll-manager.js +49 -0
  34. package/dist/es2019/emotion/components/internal/use-scroll-capture.js +128 -0
  35. package/dist/es2019/emotion/components/internal/use-scroll-lock.js +143 -0
  36. package/dist/es2019/emotion/components/live-region.js +178 -0
  37. package/dist/es2019/emotion/components/menu.js +450 -0
  38. package/dist/es2019/emotion/components/multi-value.js +227 -0
  39. package/dist/es2019/emotion/components/option.js +78 -0
  40. package/dist/es2019/emotion/components/placeholder.js +28 -0
  41. package/dist/es2019/emotion/components/single-value.js +34 -0
  42. package/dist/esm/emotion/components/containers.js +105 -0
  43. package/dist/esm/emotion/components/control.js +103 -0
  44. package/dist/esm/emotion/components/group.js +65 -0
  45. package/dist/esm/emotion/components/index.js +43 -0
  46. package/dist/esm/emotion/components/indicators.js +132 -0
  47. package/dist/esm/emotion/components/input.js +89 -0
  48. package/dist/esm/emotion/components/internal/a11y-text.js +29 -0
  49. package/dist/esm/emotion/components/internal/dummy-input.js +38 -0
  50. package/dist/esm/emotion/components/internal/index.js +4 -0
  51. package/dist/esm/emotion/components/internal/notify-open-layer-observer.js +15 -0
  52. package/dist/esm/emotion/components/internal/required-input.js +36 -0
  53. package/dist/esm/emotion/components/internal/scroll-manager.js +49 -0
  54. package/dist/esm/emotion/components/internal/use-scroll-capture.js +126 -0
  55. package/dist/esm/emotion/components/internal/use-scroll-lock.js +143 -0
  56. package/dist/esm/emotion/components/live-region.js +175 -0
  57. package/dist/esm/emotion/components/menu.js +454 -0
  58. package/dist/esm/emotion/components/multi-value.js +217 -0
  59. package/dist/esm/emotion/components/option.js +75 -0
  60. package/dist/esm/emotion/components/placeholder.js +27 -0
  61. package/dist/esm/emotion/components/single-value.js +33 -0
  62. package/dist/types/emotion/components/containers.d.ts +54 -0
  63. package/dist/types/emotion/components/control.d.ts +42 -0
  64. package/dist/types/emotion/components/group.d.ts +52 -0
  65. package/dist/types/emotion/components/index.d.ts +67 -0
  66. package/dist/types/emotion/components/indicators.d.ts +73 -0
  67. package/dist/types/emotion/components/input.d.ts +37 -0
  68. package/dist/types/emotion/components/internal/a11y-text.d.ts +8 -0
  69. package/dist/types/emotion/components/internal/dummy-input.d.ts +9 -0
  70. package/dist/types/emotion/components/internal/index.d.ts +4 -0
  71. package/dist/types/emotion/components/internal/notify-open-layer-observer.d.ts +11 -0
  72. package/dist/types/emotion/components/internal/required-input.d.ts +10 -0
  73. package/dist/types/emotion/components/internal/scroll-manager.d.ts +17 -0
  74. package/dist/types/emotion/components/internal/use-scroll-capture.d.ts +12 -0
  75. package/dist/types/emotion/components/internal/use-scroll-lock.d.ts +9 -0
  76. package/dist/types/emotion/components/live-region.d.ts +25 -0
  77. package/dist/types/emotion/components/menu.d.ts +116 -0
  78. package/dist/types/emotion/components/multi-value.d.ts +47 -0
  79. package/dist/types/emotion/components/option.d.ts +49 -0
  80. package/dist/types/emotion/components/placeholder.d.ts +22 -0
  81. package/dist/types/emotion/components/single-value.d.ts +28 -0
  82. package/dist/types-ts4.5/emotion/components/containers.d.ts +54 -0
  83. package/dist/types-ts4.5/emotion/components/control.d.ts +42 -0
  84. package/dist/types-ts4.5/emotion/components/group.d.ts +52 -0
  85. package/dist/types-ts4.5/emotion/components/index.d.ts +67 -0
  86. package/dist/types-ts4.5/emotion/components/indicators.d.ts +73 -0
  87. package/dist/types-ts4.5/emotion/components/input.d.ts +37 -0
  88. package/dist/types-ts4.5/emotion/components/internal/a11y-text.d.ts +8 -0
  89. package/dist/types-ts4.5/emotion/components/internal/dummy-input.d.ts +9 -0
  90. package/dist/types-ts4.5/emotion/components/internal/index.d.ts +4 -0
  91. package/dist/types-ts4.5/emotion/components/internal/notify-open-layer-observer.d.ts +11 -0
  92. package/dist/types-ts4.5/emotion/components/internal/required-input.d.ts +10 -0
  93. package/dist/types-ts4.5/emotion/components/internal/scroll-manager.d.ts +17 -0
  94. package/dist/types-ts4.5/emotion/components/internal/use-scroll-capture.d.ts +12 -0
  95. package/dist/types-ts4.5/emotion/components/internal/use-scroll-lock.d.ts +9 -0
  96. package/dist/types-ts4.5/emotion/components/live-region.d.ts +25 -0
  97. package/dist/types-ts4.5/emotion/components/menu.d.ts +116 -0
  98. package/dist/types-ts4.5/emotion/components/multi-value.d.ts +47 -0
  99. package/dist/types-ts4.5/emotion/components/option.d.ts +49 -0
  100. package/dist/types-ts4.5/emotion/components/placeholder.d.ts +22 -0
  101. package/dist/types-ts4.5/emotion/components/single-value.d.ts +28 -0
  102. package/package.json +1 -1
@@ -0,0 +1,78 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ /**
3
+ * @jsxRuntime classic
4
+ * @jsx jsx
5
+ */
6
+
7
+ import { jsx } from '@emotion/react';
8
+ import { getStyleProps } from '../../utils';
9
+ export const optionCSS = ({
10
+ isDisabled,
11
+ isFocused,
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)";
19
+ }
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)";
30
+ }
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
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
39
+ fontSize: 'inherit',
40
+ width: '100%',
41
+ userSelect: 'none',
42
+ WebkitTapHighlightColor: 'rgba(0, 0, 0, 0)',
43
+ padding: `${"var(--ds-space-075, 6px)"} ${"var(--ds-space-150, 12px)"}`,
44
+ backgroundColor,
45
+ color,
46
+ cursor,
47
+ boxShadow,
48
+ ':active': {
49
+ backgroundColor: !isDisabled ? isSelected ? "var(--ds-background-selected-pressed, #85B8FF)" : "var(--ds-background-neutral-subtle-pressed, #091E4224)" : undefined
50
+ },
51
+ '@media screen and (-ms-high-contrast: active)': {
52
+ borderLeft: !isDisabled && (isFocused || isSelected) ? '2px solid transparent' : ''
53
+ }
54
+ };
55
+ };
56
+ const Option = props => {
57
+ const {
58
+ children,
59
+ isDisabled,
60
+ isFocused,
61
+ isSelected,
62
+ innerRef,
63
+ innerProps
64
+ } = props;
65
+ return jsx("div", _extends({}, getStyleProps(props, 'option', {
66
+ option: true,
67
+ 'option--is-disabled': isDisabled,
68
+ 'option--is-focused': isFocused,
69
+ 'option--is-selected': isSelected
70
+ }), {
71
+ ref: innerRef
72
+ }, innerProps, {
73
+ tabIndex: -1
74
+ }), children);
75
+ };
76
+
77
+ // eslint-disable-next-line @repo/internal/react/require-jsdoc
78
+ export default Option;
@@ -0,0 +1,28 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ /**
3
+ * @jsxRuntime classic
4
+ * @jsx jsx
5
+ */
6
+
7
+ import { jsx } from '@emotion/react';
8
+ import { getStyleProps } from '../../utils';
9
+ export const placeholderCSS = ({
10
+ isDisabled
11
+ }) => ({
12
+ label: 'placeholder',
13
+ gridArea: '1 / 1 / 2 / 3',
14
+ margin: `0 ${"var(--ds-space-025, 2px)"}`,
15
+ color: isDisabled ? "var(--ds-text-disabled, #091E424F)" : "var(--ds-text-subtlest, #626F86)"
16
+ });
17
+ const Placeholder = props => {
18
+ const {
19
+ children,
20
+ innerProps
21
+ } = props;
22
+ return jsx("div", _extends({}, getStyleProps(props, 'placeholder', {
23
+ placeholder: true
24
+ }), innerProps), children);
25
+ };
26
+
27
+ // eslint-disable-next-line @repo/internal/react/require-jsdoc
28
+ export default Placeholder;
@@ -0,0 +1,34 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ /**
3
+ * @jsxRuntime classic
4
+ * @jsx jsx
5
+ */
6
+
7
+ import { jsx } from '@emotion/react';
8
+ import { getStyleProps } from '../../utils';
9
+ export const css = ({
10
+ isDisabled
11
+ }) => ({
12
+ label: 'singleValue',
13
+ gridArea: '1 / 1 / 2 / 3',
14
+ maxWidth: '100%',
15
+ overflow: 'hidden',
16
+ textOverflow: 'ellipsis',
17
+ whiteSpace: 'nowrap',
18
+ margin: `0 ${"var(--ds-space-025, 2px)"}`,
19
+ color: isDisabled ? "var(--ds-text-disabled, #091E424F)" : "var(--ds-text, #172B4D)"
20
+ });
21
+ const SingleValue = props => {
22
+ const {
23
+ children,
24
+ isDisabled,
25
+ innerProps
26
+ } = props;
27
+ return jsx("div", _extends({}, getStyleProps(props, 'singleValue', {
28
+ 'single-value': true,
29
+ 'single-value--is-disabled': isDisabled
30
+ }), innerProps), children);
31
+ };
32
+
33
+ // eslint-disable-next-line @repo/internal/react/require-jsdoc
34
+ export default SingleValue;
@@ -0,0 +1,105 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
+ /**
4
+ * @jsxRuntime classic
5
+ * @jsx jsx
6
+ */
7
+
8
+ import { jsx } from '@emotion/react';
9
+ import { fg } from '@atlaskit/platform-feature-flags';
10
+ import { media } from '@atlaskit/primitives';
11
+ import { getStyleProps } from '../../utils';
12
+
13
+ // ==============================
14
+ // Root Container
15
+ // ==============================
16
+
17
+ export var containerCSS = function containerCSS(_ref) {
18
+ var isDisabled = _ref.isDisabled,
19
+ isRtl = _ref.isRtl;
20
+ return _defineProperty({
21
+ label: 'container',
22
+ direction: isRtl ? 'rtl' : undefined,
23
+ position: 'relative',
24
+ font: fg('platform_design_system_team_safari_input_fix') ? "var(--ds-font-body-large, normal 400 16px/24px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)" : "var(--ds-font-body, normal 400 14px/20px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)",
25
+ pointerEvents: 'all',
26
+ cursor: isDisabled ? 'not-allowed' : undefined
27
+ }, "".concat(media.above.xs), {
28
+ font: fg('platform_design_system_team_safari_input_fix') ? "var(--ds-font-body, normal 400 14px/20px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)" : undefined
29
+ });
30
+ };
31
+
32
+ // eslint-disable-next-line @repo/internal/react/require-jsdoc
33
+ export var SelectContainer = function SelectContainer(props) {
34
+ var children = props.children,
35
+ innerProps = props.innerProps,
36
+ isDisabled = props.isDisabled,
37
+ isRtl = props.isRtl;
38
+ return jsx("div", _extends({}, getStyleProps(props, 'container', {
39
+ '--is-disabled': isDisabled,
40
+ '--is-rtl': isRtl
41
+ }), innerProps), children);
42
+ };
43
+
44
+ // ==============================
45
+ // Value Container
46
+ // ==============================
47
+
48
+ export var valueContainerCSS = function valueContainerCSS(_ref3) {
49
+ var isMulti = _ref3.isMulti,
50
+ hasValue = _ref3.hasValue,
51
+ isCompact = _ref3.isCompact,
52
+ controlShouldRenderValue = _ref3.selectProps.controlShouldRenderValue;
53
+ return {
54
+ alignItems: 'center',
55
+ display: isMulti && hasValue && controlShouldRenderValue ? 'flex' : 'grid',
56
+ flex: 1,
57
+ flexWrap: 'wrap',
58
+ WebkitOverflowScrolling: 'touch',
59
+ position: 'relative',
60
+ overflow: 'hidden',
61
+ padding: "".concat(isCompact ? 0 : "var(--ds-space-025, 2px)", " ", "var(--ds-space-075, 6px)")
62
+ };
63
+ };
64
+
65
+ // eslint-disable-next-line @repo/internal/react/require-jsdoc
66
+ export var ValueContainer = function ValueContainer(props) {
67
+ var children = props.children,
68
+ innerProps = props.innerProps,
69
+ isMulti = props.isMulti,
70
+ hasValue = props.hasValue;
71
+ var styles = getStyleProps(props, 'valueContainer', {
72
+ 'value-container': true,
73
+ 'value-container--is-multi': isMulti,
74
+ 'value-container--has-value': hasValue
75
+ });
76
+ return jsx("div", _extends({
77
+ css: styles.css
78
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
79
+ ,
80
+ className: styles.className || 'value-container'
81
+ }, innerProps), children);
82
+ };
83
+
84
+ // ==============================
85
+ // Indicator Container
86
+ // ==============================
87
+
88
+ export var indicatorsContainerCSS = function indicatorsContainerCSS() {
89
+ return {
90
+ alignItems: 'center',
91
+ alignSelf: 'stretch',
92
+ display: 'flex',
93
+ flexShrink: 0,
94
+ paddingRight: "var(--ds-space-050, 4px)"
95
+ };
96
+ };
97
+
98
+ // eslint-disable-next-line @repo/internal/react/require-jsdoc
99
+ export var IndicatorsContainer = function IndicatorsContainer(props) {
100
+ var children = props.children,
101
+ innerProps = props.innerProps;
102
+ return jsx("div", _extends({}, getStyleProps(props, 'indicatorsContainer', {
103
+ indicators: true
104
+ }), innerProps), children);
105
+ };
@@ -0,0 +1,103 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ /**
3
+ * @jsxRuntime classic
4
+ * @jsx jsx
5
+ */
6
+
7
+ import { jsx } from '@emotion/react';
8
+ import { getStyleProps } from '../../utils';
9
+ export var css = function css(_ref) {
10
+ var isDisabled = _ref.isDisabled,
11
+ isFocused = _ref.isFocused,
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
+ }
39
+ return {
40
+ label: 'control',
41
+ alignItems: 'center',
42
+ cursor: 'default',
43
+ display: 'flex',
44
+ flexWrap: 'wrap',
45
+ justifyContent: 'space-between',
46
+ outline: '0 !important',
47
+ position: 'relative',
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,
52
+ borderStyle: 'solid',
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)'
80
+ }
81
+ };
82
+ };
83
+ var Control = function Control(props) {
84
+ var children = props.children,
85
+ isDisabled = props.isDisabled,
86
+ isFocused = props.isFocused,
87
+ innerRef = props.innerRef,
88
+ innerProps = props.innerProps,
89
+ menuIsOpen = props.menuIsOpen;
90
+ return jsx("div", _extends({
91
+ ref: innerRef
92
+ }, getStyleProps(props, 'control', {
93
+ control: true,
94
+ 'control--is-disabled': isDisabled,
95
+ 'control--is-focused': isFocused,
96
+ 'control--menu-is-open': menuIsOpen
97
+ }), innerProps, {
98
+ "aria-disabled": isDisabled || undefined
99
+ }), children);
100
+ };
101
+
102
+ // eslint-disable-next-line @repo/internal/react/require-jsdoc
103
+ export default Control;
@@ -0,0 +1,65 @@
1
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
2
+ import _extends from "@babel/runtime/helpers/extends";
3
+ import _objectDestructuringEmpty from "@babel/runtime/helpers/objectDestructuringEmpty";
4
+ var _excluded = ["data"];
5
+ /**
6
+ * @jsxRuntime classic
7
+ * @jsx jsx
8
+ */
9
+
10
+ import { jsx } from '@emotion/react';
11
+ import { cleanCommonProps, getStyleProps } from '../../utils';
12
+ export var groupCSS = function groupCSS(_ref) {
13
+ _objectDestructuringEmpty(_ref);
14
+ return {
15
+ paddingBottom: "var(--ds-space-100, 8px)",
16
+ paddingTop: "var(--ds-space-100, 8px)"
17
+ };
18
+ };
19
+ var Group = function Group(props) {
20
+ var children = props.children,
21
+ cx = props.cx,
22
+ getStyles = props.getStyles,
23
+ getClassNames = props.getClassNames,
24
+ Heading = props.Heading,
25
+ headingProps = props.headingProps,
26
+ innerProps = props.innerProps,
27
+ label = props.label,
28
+ selectProps = props.selectProps;
29
+ return jsx("div", _extends({}, getStyleProps(props, 'group', {
30
+ group: true
31
+ }), innerProps), jsx(Heading, _extends({}, headingProps, {
32
+ selectProps: selectProps,
33
+ getStyles: getStyles,
34
+ getClassNames: getClassNames,
35
+ cx: cx
36
+ }), label), jsx("div", null, children));
37
+ };
38
+ export var groupHeadingCSS = function groupHeadingCSS(_ref2) {
39
+ _objectDestructuringEmpty(_ref2);
40
+ return {
41
+ label: 'group',
42
+ cursor: 'default',
43
+ display: 'block',
44
+ marginBottom: '0.25em',
45
+ paddingLeft: "var(--ds-space-150, 12px)",
46
+ paddingRight: "var(--ds-space-150, 12px)",
47
+ font: "var(--ds-font-body-small, normal 400 11px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)",
48
+ color: "var(--ds-text-subtle, #44546F)",
49
+ fontWeight: "var(--ds-font-weight-bold, 700)",
50
+ textTransform: 'none'
51
+ };
52
+ };
53
+
54
+ // eslint-disable-next-line @repo/internal/react/require-jsdoc
55
+ export var GroupHeading = function GroupHeading(props) {
56
+ var _cleanCommonProps = cleanCommonProps(props),
57
+ data = _cleanCommonProps.data,
58
+ innerProps = _objectWithoutProperties(_cleanCommonProps, _excluded);
59
+ return jsx("div", _extends({}, getStyleProps(props, 'groupHeading', {
60
+ 'group-heading': true
61
+ }), innerProps));
62
+ };
63
+
64
+ // eslint-disable-next-line @repo/internal/react/require-jsdoc
65
+ export default Group;
@@ -0,0 +1,43 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
+ import { IndicatorsContainer, SelectContainer, ValueContainer } from './containers';
5
+ import Control from './control';
6
+ import Group, { GroupHeading } from './group';
7
+ import { ClearIndicator, DropdownIndicator, LoadingIndicator } from './indicators';
8
+ import Input from './input';
9
+ import Menu, { LoadingMessage, MenuList, MenuPortal, NoOptionsMessage } from './menu';
10
+ import MultiValue, { MultiValueContainer, MultiValueLabel, MultiValueRemove } from './multi-value';
11
+ import Option from './option';
12
+ import Placeholder from './placeholder';
13
+ import SingleValue from './single-value';
14
+
15
+ // Required export for external packages
16
+
17
+ export var components = {
18
+ ClearIndicator: ClearIndicator,
19
+ Control: Control,
20
+ DropdownIndicator: DropdownIndicator,
21
+ Group: Group,
22
+ GroupHeading: GroupHeading,
23
+ IndicatorsContainer: IndicatorsContainer,
24
+ Input: Input,
25
+ LoadingIndicator: LoadingIndicator,
26
+ Menu: Menu,
27
+ MenuList: MenuList,
28
+ MenuPortal: MenuPortal,
29
+ LoadingMessage: LoadingMessage,
30
+ NoOptionsMessage: NoOptionsMessage,
31
+ MultiValue: MultiValue,
32
+ MultiValueContainer: MultiValueContainer,
33
+ MultiValueLabel: MultiValueLabel,
34
+ MultiValueRemove: MultiValueRemove,
35
+ Option: Option,
36
+ Placeholder: Placeholder,
37
+ SelectContainer: SelectContainer,
38
+ SingleValue: SingleValue,
39
+ ValueContainer: ValueContainer
40
+ };
41
+ export var defaultComponents = function defaultComponents(props) {
42
+ return _objectSpread(_objectSpread({}, components), props.components);
43
+ };
@@ -0,0 +1,132 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
+ import _extends from "@babel/runtime/helpers/extends";
4
+ var _excluded = ["innerProps", "isRtl", "size"];
5
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
6
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
7
+ /**
8
+ * @jsxRuntime classic
9
+ * @jsx jsx
10
+ */
11
+
12
+ import { jsx } from '@emotion/react';
13
+ import DownIcon from '@atlaskit/icon/utility/migration/chevron-down';
14
+ import CrossIcon from '@atlaskit/icon/utility/migration/cross-circle--select-clear';
15
+ import { Inline, Pressable, xcss } from '@atlaskit/primitives';
16
+ import Spinner from '@atlaskit/spinner';
17
+ import { getStyleProps } from '../../utils';
18
+
19
+ // ==============================
20
+ // Dropdown & Clear Icons
21
+ // ==============================
22
+
23
+ var iconContainerStyles = xcss({
24
+ all: 'unset',
25
+ outline: 'revert',
26
+ display: 'flex',
27
+ alignItems: 'center',
28
+ justifyContent: 'center',
29
+ padding: 'space.025'
30
+ });
31
+ var dropdownWrapperStyles = xcss({
32
+ padding: 'space.075'
33
+ });
34
+
35
+ // ==============================
36
+ // Dropdown & Clear Buttons
37
+ // ==============================
38
+
39
+ export var dropdownIndicatorCSS = function dropdownIndicatorCSS(_ref) {
40
+ var isCompact = _ref.isCompact,
41
+ isDisabled = _ref.isDisabled;
42
+ return {
43
+ label: 'indicatorContainer',
44
+ display: 'flex',
45
+ transition: 'color 150ms',
46
+ color: isDisabled ? "var(--ds-text-disabled, #091E424F)" : "var(--ds-text-subtle, #44546F)",
47
+ padding: "".concat(isCompact ? 0 : "var(--ds-space-075, 6px)", " ", "var(--ds-space-025, 2px)"),
48
+ ':hover': {
49
+ color: "var(--ds-text-subtle, #44546F)"
50
+ }
51
+ };
52
+ };
53
+
54
+ // eslint-disable-next-line @repo/internal/react/require-jsdoc
55
+ export var DropdownIndicator = function DropdownIndicator(props) {
56
+ var innerProps = props.innerProps,
57
+ children = props.children;
58
+ return jsx("div", _extends({}, getStyleProps(props, 'dropdownIndicator', {
59
+ indicator: true,
60
+ 'dropdown-indicator': true
61
+ }), innerProps), children ? children : jsx(Inline, {
62
+ as: "span",
63
+ xcss: dropdownWrapperStyles
64
+ }, jsx(DownIcon, {
65
+ color: "currentColor",
66
+ label: "open",
67
+ LEGACY_margin: "var(--ds-space-negative-075, -0.375rem)"
68
+ })));
69
+ };
70
+ export var clearIndicatorCSS = function clearIndicatorCSS(_ref2) {
71
+ var isCompact = _ref2.isCompact;
72
+ return {
73
+ label: 'indicatorContainer',
74
+ display: 'flex',
75
+ transition: 'color 150ms',
76
+ color: "var(--ds-text-subtlest, #626F86)",
77
+ padding: "".concat(isCompact ? 0 : "var(--ds-space-075, 6px)", " ", "var(--ds-space-025, 2px)"),
78
+ ':hover': {
79
+ color: "var(--ds-text-subtle, #44546F)"
80
+ }
81
+ };
82
+ };
83
+
84
+ // eslint-disable-next-line @repo/internal/react/require-jsdoc
85
+ export var ClearIndicator = function ClearIndicator(props) {
86
+ var innerProps = props.innerProps,
87
+ _props$clearControlLa = props.clearControlLabel,
88
+ clearControlLabel = _props$clearControlLa === void 0 ? 'clear' : _props$clearControlLa;
89
+ return jsx("div", _extends({}, getStyleProps(props, 'clearIndicator', {
90
+ indicator: true,
91
+ 'clear-indicator': true
92
+ }), innerProps), jsx(Pressable, {
93
+ xcss: iconContainerStyles,
94
+ tabIndex: -1,
95
+ "aria-label": clearControlLabel
96
+ }, jsx(CrossIcon, {
97
+ label: "",
98
+ color: "currentColor",
99
+ LEGACY_size: "small",
100
+ LEGACY_margin: "var(--ds-space-negative-025, -0.125rem)"
101
+ })));
102
+ };
103
+
104
+ // ==============================
105
+ // Loading
106
+ // ==============================
107
+
108
+ export var loadingIndicatorCSS = function loadingIndicatorCSS(_ref3) {
109
+ var isCompact = _ref3.isCompact;
110
+ return {
111
+ label: 'loadingIndicator',
112
+ padding: "".concat(isCompact ? 0 : "var(--ds-space-075, 6px)", " ", "var(--ds-space-100, 8px)")
113
+ };
114
+ };
115
+ // eslint-disable-next-line @repo/internal/react/require-jsdoc
116
+ export var LoadingIndicator = function LoadingIndicator(_ref4) {
117
+ var innerProps = _ref4.innerProps,
118
+ isRtl = _ref4.isRtl,
119
+ _ref4$size = _ref4.size,
120
+ size = _ref4$size === void 0 ? 4 : _ref4$size,
121
+ restProps = _objectWithoutProperties(_ref4, _excluded);
122
+ return jsx("div", _extends({}, getStyleProps(_objectSpread(_objectSpread({}, restProps), {}, {
123
+ innerProps: innerProps,
124
+ isRtl: isRtl,
125
+ size: size
126
+ }), 'loadingIndicator', {
127
+ indicator: true,
128
+ 'loading-indicator': true
129
+ }), innerProps), jsx(Spinner, {
130
+ size: "small"
131
+ }));
132
+ };
@@ -0,0 +1,89 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
+ var _excluded = ["innerRef", "isDisabled", "isHidden", "inputClassName", "testId"];
5
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
6
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
7
+ /**
8
+ * @jsxRuntime classic
9
+ * @jsx jsx
10
+ */
11
+
12
+ import { jsx } from '@emotion/react';
13
+ import { cleanCommonProps, getStyleProps } from '../../utils';
14
+ export var inputCSS = function inputCSS(_ref) {
15
+ var isDisabled = _ref.isDisabled,
16
+ value = _ref.value;
17
+ return _objectSpread(_objectSpread({
18
+ visibility: isDisabled ? 'hidden' : 'visible',
19
+ // force css to recompute when value change due to @emotion bug.
20
+ // We can remove it whenever the bug is fixed.
21
+ transform: value ? 'translateZ(0)' : ''
22
+ }, containerStyle), {}, {
23
+ margin: "var(--ds-space-025, 2px)",
24
+ paddingBottom: "var(--ds-space-025, 2px)",
25
+ paddingTop: "var(--ds-space-025, 2px)",
26
+ color: "var(--ds-text, #172B4D)"
27
+ });
28
+ };
29
+ var spacingStyle = {
30
+ gridArea: '1 / 2',
31
+ font: 'inherit',
32
+ minWidth: '2px',
33
+ border: 0,
34
+ margin: 0,
35
+ outline: 0,
36
+ padding: 0
37
+ };
38
+ var containerStyle = {
39
+ flex: '1 1 auto',
40
+ display: 'inline-grid',
41
+ gridArea: '1 / 1 / 2 / 3',
42
+ gridTemplateColumns: '0 min-content',
43
+ '&:after': _objectSpread({
44
+ content: 'attr(data-value) " "',
45
+ visibility: 'hidden',
46
+ whiteSpace: 'pre'
47
+ }, spacingStyle)
48
+ };
49
+ var inputStyle = function inputStyle(isHidden) {
50
+ return _objectSpread({
51
+ label: 'input',
52
+ color: 'inherit',
53
+ background: 0,
54
+ opacity: isHidden ? 0 : 1,
55
+ width: '100%'
56
+ }, spacingStyle);
57
+ };
58
+ var Input = function Input(props) {
59
+ var cx = props.cx,
60
+ value = props.value;
61
+ var _cleanCommonProps = cleanCommonProps(props),
62
+ innerRef = _cleanCommonProps.innerRef,
63
+ isDisabled = _cleanCommonProps.isDisabled,
64
+ isHidden = _cleanCommonProps.isHidden,
65
+ inputClassName = _cleanCommonProps.inputClassName,
66
+ testId = _cleanCommonProps.testId,
67
+ innerProps = _objectWithoutProperties(_cleanCommonProps, _excluded);
68
+ var dataId = testId ? "".concat(testId, "-select--input") : null;
69
+ return jsx("div", _extends({}, getStyleProps(props, 'input', {
70
+ 'input-container': true
71
+ }), {
72
+ "data-value": value || '',
73
+ "data-testid": dataId && "".concat(dataId, "-container")
74
+ }), jsx("input", _extends({
75
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
76
+ className: cx({
77
+ input: true
78
+ }, inputClassName),
79
+ ref: innerRef
80
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
81
+ ,
82
+ style: inputStyle(isHidden),
83
+ disabled: isDisabled,
84
+ "data-testid": dataId
85
+ }, innerProps)));
86
+ };
87
+
88
+ // eslint-disable-next-line @repo/internal/react/require-jsdoc
89
+ export default Input;