@atlaskit/react-select 2.7.6 → 3.0.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 +33 -0
- package/dist/cjs/components/containers.compiled.css +26 -0
- package/dist/cjs/components/containers.js +80 -13
- package/dist/cjs/components/control.js +50 -9
- package/dist/cjs/components/group.js +60 -12
- package/dist/cjs/components/indicators.js +128 -15
- package/dist/cjs/components/input.js +50 -9
- package/dist/cjs/components/internal/a11y-text.js +14 -7
- package/dist/cjs/components/internal/dummy-input.js +21 -7
- package/dist/cjs/components/internal/required-input.js +24 -8
- package/dist/cjs/components/live-region.js +101 -7
- package/dist/cjs/components/menu.js +436 -27
- package/dist/cjs/components/multi-value.js +148 -22
- package/dist/cjs/components/option.js +41 -9
- package/dist/cjs/components/placeholder.js +29 -9
- package/dist/cjs/components/single-value.js +30 -9
- package/dist/cjs/select.js +1 -1
- package/dist/es2019/components/containers.compiled.css +26 -0
- package/dist/es2019/components/containers.js +93 -10
- package/dist/es2019/components/control.js +54 -8
- package/dist/es2019/components/group.js +67 -9
- package/dist/es2019/components/indicators.js +131 -11
- package/dist/es2019/components/input.js +53 -7
- package/dist/es2019/components/internal/a11y-text.js +12 -6
- package/dist/es2019/components/internal/dummy-input.js +19 -7
- package/dist/es2019/components/internal/required-input.js +22 -6
- package/dist/es2019/components/live-region.js +104 -6
- package/dist/es2019/components/menu.js +444 -19
- package/dist/es2019/components/multi-value.js +157 -15
- package/dist/es2019/components/option.js +45 -7
- package/dist/es2019/components/placeholder.js +33 -7
- package/dist/es2019/components/single-value.js +34 -7
- package/dist/es2019/select.js +1 -1
- package/dist/esm/components/containers.compiled.css +26 -0
- package/dist/esm/components/containers.js +78 -12
- package/dist/esm/components/control.js +51 -8
- package/dist/esm/components/group.js +60 -11
- package/dist/esm/components/indicators.js +127 -15
- package/dist/esm/components/input.js +50 -8
- package/dist/esm/components/internal/a11y-text.js +12 -6
- package/dist/esm/components/internal/dummy-input.js +20 -7
- package/dist/esm/components/internal/required-input.js +22 -7
- package/dist/esm/components/live-region.js +99 -6
- package/dist/esm/components/menu.js +437 -27
- package/dist/esm/components/multi-value.js +148 -21
- package/dist/esm/components/option.js +41 -8
- package/dist/esm/components/placeholder.js +29 -8
- package/dist/esm/components/single-value.js +30 -8
- package/dist/esm/select.js +1 -1
- package/dist/types/components/containers.d.ts +12 -8
- package/dist/types/components/control.d.ts +7 -3
- package/dist/types/components/group.d.ts +10 -6
- package/dist/types/components/index.d.ts +21 -21
- package/dist/types/components/indicators.d.ts +12 -8
- package/dist/types/components/input.d.ts +8 -4
- package/dist/types/components/internal/a11y-text.d.ts +2 -2
- package/dist/types/components/internal/dummy-input.d.ts +7 -3
- package/dist/types/components/internal/required-input.d.ts +4 -0
- package/dist/types/components/live-region.d.ts +0 -2
- package/dist/types/components/menu.d.ts +17 -13
- package/dist/types/components/multi-value.d.ts +13 -9
- package/dist/types/components/option.d.ts +8 -4
- package/dist/types/components/placeholder.d.ts +8 -4
- package/dist/types/components/single-value.d.ts +8 -4
- package/dist/types/select.d.ts +23 -25
- package/dist/types-ts4.5/components/containers.d.ts +12 -8
- package/dist/types-ts4.5/components/control.d.ts +7 -3
- package/dist/types-ts4.5/components/group.d.ts +10 -6
- package/dist/types-ts4.5/components/index.d.ts +21 -21
- package/dist/types-ts4.5/components/indicators.d.ts +12 -8
- package/dist/types-ts4.5/components/input.d.ts +8 -4
- package/dist/types-ts4.5/components/internal/a11y-text.d.ts +2 -2
- package/dist/types-ts4.5/components/internal/dummy-input.d.ts +7 -3
- package/dist/types-ts4.5/components/internal/required-input.d.ts +4 -0
- package/dist/types-ts4.5/components/live-region.d.ts +0 -2
- package/dist/types-ts4.5/components/menu.d.ts +17 -13
- package/dist/types-ts4.5/components/multi-value.d.ts +13 -9
- package/dist/types-ts4.5/components/option.d.ts +8 -4
- package/dist/types-ts4.5/components/placeholder.d.ts +8 -4
- package/dist/types-ts4.5/components/single-value.d.ts +8 -4
- package/dist/types-ts4.5/select.d.ts +23 -25
- package/package.json +3 -3
- package/dist/cjs/compiled/components/control.js +0 -65
- package/dist/cjs/compiled/components/group.js +0 -80
- package/dist/cjs/compiled/components/indicators.js +0 -158
- package/dist/cjs/compiled/components/input.js +0 -65
- package/dist/cjs/compiled/components/internal/a11y-text.js +0 -24
- package/dist/cjs/compiled/components/internal/dummy-input.js +0 -30
- package/dist/cjs/compiled/components/internal/required-input.js +0 -35
- package/dist/cjs/compiled/components/live-region.js +0 -117
- package/dist/cjs/compiled/components/menu.js +0 -489
- package/dist/cjs/compiled/components/multi-value.js +0 -173
- package/dist/cjs/compiled/components/option.js +0 -56
- package/dist/cjs/compiled/components/placeholder.js +0 -44
- package/dist/cjs/compiled/components/single-value.js +0 -45
- package/dist/cjs/emotion/components/containers.js +0 -117
- package/dist/cjs/emotion/components/control.js +0 -112
- package/dist/cjs/emotion/components/group.js +0 -72
- package/dist/cjs/emotion/components/indicators.js +0 -140
- package/dist/cjs/emotion/components/input.js +0 -94
- package/dist/cjs/emotion/components/internal/a11y-text.js +0 -37
- package/dist/cjs/emotion/components/internal/dummy-input.js +0 -45
- package/dist/cjs/emotion/components/internal/index.js +0 -34
- package/dist/cjs/emotion/components/internal/required-input.js +0 -45
- package/dist/cjs/emotion/components/internal/scroll-manager.js +0 -59
- package/dist/cjs/emotion/components/internal/use-scroll-capture.js +0 -132
- package/dist/cjs/emotion/components/internal/use-scroll-lock.js +0 -149
- package/dist/cjs/emotion/components/live-region.js +0 -120
- package/dist/cjs/emotion/components/menu.js +0 -456
- package/dist/cjs/emotion/components/multi-value.js +0 -199
- package/dist/cjs/emotion/components/option.js +0 -84
- package/dist/cjs/emotion/components/placeholder.js +0 -36
- package/dist/cjs/emotion/components/single-value.js +0 -42
- package/dist/es2019/compiled/components/control.js +0 -58
- package/dist/es2019/compiled/components/group.js +0 -72
- package/dist/es2019/compiled/components/indicators.js +0 -146
- package/dist/es2019/compiled/components/input.js +0 -56
- package/dist/es2019/compiled/components/internal/a11y-text.js +0 -13
- package/dist/es2019/compiled/components/internal/dummy-input.js +0 -20
- package/dist/es2019/compiled/components/internal/required-input.js +0 -25
- package/dist/es2019/compiled/components/live-region.js +0 -112
- package/dist/es2019/compiled/components/menu.js +0 -477
- package/dist/es2019/compiled/components/multi-value.js +0 -165
- package/dist/es2019/compiled/components/option.js +0 -48
- package/dist/es2019/compiled/components/placeholder.js +0 -36
- package/dist/es2019/compiled/components/single-value.js +0 -37
- package/dist/es2019/emotion/components/containers.js +0 -114
- package/dist/es2019/emotion/components/control.js +0 -108
- package/dist/es2019/emotion/components/group.js +0 -60
- package/dist/es2019/emotion/components/indicators.js +0 -131
- package/dist/es2019/emotion/components/input.js +0 -87
- package/dist/es2019/emotion/components/internal/a11y-text.js +0 -28
- package/dist/es2019/emotion/components/internal/dummy-input.js +0 -38
- package/dist/es2019/emotion/components/internal/index.js +0 -4
- package/dist/es2019/emotion/components/internal/required-input.js +0 -36
- package/dist/es2019/emotion/components/internal/scroll-manager.js +0 -51
- package/dist/es2019/emotion/components/internal/use-scroll-capture.js +0 -128
- package/dist/es2019/emotion/components/internal/use-scroll-lock.js +0 -143
- package/dist/es2019/emotion/components/live-region.js +0 -120
- package/dist/es2019/emotion/components/menu.js +0 -452
- package/dist/es2019/emotion/components/multi-value.js +0 -203
- package/dist/es2019/emotion/components/option.js +0 -79
- package/dist/es2019/emotion/components/placeholder.js +0 -29
- package/dist/es2019/emotion/components/single-value.js +0 -35
- package/dist/esm/compiled/components/control.js +0 -57
- package/dist/esm/compiled/components/group.js +0 -71
- package/dist/esm/compiled/components/indicators.js +0 -150
- package/dist/esm/compiled/components/input.js +0 -56
- package/dist/esm/compiled/components/internal/a11y-text.js +0 -15
- package/dist/esm/compiled/components/internal/dummy-input.js +0 -21
- package/dist/esm/compiled/components/internal/required-input.js +0 -26
- package/dist/esm/compiled/components/live-region.js +0 -109
- package/dist/esm/compiled/components/menu.js +0 -484
- package/dist/esm/compiled/components/multi-value.js +0 -162
- package/dist/esm/compiled/components/option.js +0 -47
- package/dist/esm/compiled/components/placeholder.js +0 -35
- package/dist/esm/compiled/components/single-value.js +0 -36
- package/dist/esm/emotion/components/containers.js +0 -110
- package/dist/esm/emotion/components/control.js +0 -104
- package/dist/esm/emotion/components/group.js +0 -66
- package/dist/esm/emotion/components/indicators.js +0 -135
- package/dist/esm/emotion/components/input.js +0 -90
- package/dist/esm/emotion/components/internal/a11y-text.js +0 -30
- package/dist/esm/emotion/components/internal/dummy-input.js +0 -39
- package/dist/esm/emotion/components/internal/index.js +0 -4
- package/dist/esm/emotion/components/internal/required-input.js +0 -37
- package/dist/esm/emotion/components/internal/scroll-manager.js +0 -51
- package/dist/esm/emotion/components/internal/use-scroll-capture.js +0 -126
- package/dist/esm/emotion/components/internal/use-scroll-lock.js +0 -143
- package/dist/esm/emotion/components/live-region.js +0 -117
- package/dist/esm/emotion/components/menu.js +0 -456
- package/dist/esm/emotion/components/multi-value.js +0 -193
- package/dist/esm/emotion/components/option.js +0 -76
- package/dist/esm/emotion/components/placeholder.js +0 -28
- package/dist/esm/emotion/components/single-value.js +0 -34
- package/dist/types/compiled/components/control.d.ts +0 -41
- package/dist/types/compiled/components/group.d.ts +0 -54
- package/dist/types/compiled/components/indicators.d.ts +0 -72
- package/dist/types/compiled/components/input.d.ts +0 -36
- package/dist/types/compiled/components/internal/a11y-text.d.ts +0 -3
- package/dist/types/compiled/components/internal/dummy-input.d.ts +0 -8
- package/dist/types/compiled/components/internal/required-input.d.ts +0 -10
- package/dist/types/compiled/components/live-region.d.ts +0 -17
- package/dist/types/compiled/components/menu.d.ts +0 -115
- package/dist/types/compiled/components/multi-value.d.ts +0 -57
- package/dist/types/compiled/components/option.d.ts +0 -48
- package/dist/types/compiled/components/placeholder.d.ts +0 -21
- package/dist/types/compiled/components/single-value.d.ts +0 -27
- package/dist/types/emotion/components/containers.d.ts +0 -54
- package/dist/types/emotion/components/control.d.ts +0 -42
- package/dist/types/emotion/components/group.d.ts +0 -52
- package/dist/types/emotion/components/indicators.d.ts +0 -73
- package/dist/types/emotion/components/input.d.ts +0 -37
- package/dist/types/emotion/components/internal/a11y-text.d.ts +0 -8
- package/dist/types/emotion/components/internal/dummy-input.d.ts +0 -9
- package/dist/types/emotion/components/internal/index.d.ts +0 -4
- package/dist/types/emotion/components/internal/required-input.d.ts +0 -10
- package/dist/types/emotion/components/internal/scroll-manager.d.ts +0 -17
- package/dist/types/emotion/components/internal/use-scroll-capture.d.ts +0 -12
- package/dist/types/emotion/components/internal/use-scroll-lock.d.ts +0 -9
- package/dist/types/emotion/components/live-region.d.ts +0 -23
- package/dist/types/emotion/components/menu.d.ts +0 -116
- package/dist/types/emotion/components/multi-value.d.ts +0 -47
- package/dist/types/emotion/components/option.d.ts +0 -49
- package/dist/types/emotion/components/placeholder.d.ts +0 -22
- package/dist/types/emotion/components/single-value.d.ts +0 -28
- package/dist/types-ts4.5/compiled/components/control.d.ts +0 -41
- package/dist/types-ts4.5/compiled/components/group.d.ts +0 -54
- package/dist/types-ts4.5/compiled/components/indicators.d.ts +0 -72
- package/dist/types-ts4.5/compiled/components/input.d.ts +0 -36
- package/dist/types-ts4.5/compiled/components/internal/a11y-text.d.ts +0 -3
- package/dist/types-ts4.5/compiled/components/internal/dummy-input.d.ts +0 -8
- package/dist/types-ts4.5/compiled/components/internal/required-input.d.ts +0 -10
- package/dist/types-ts4.5/compiled/components/live-region.d.ts +0 -17
- package/dist/types-ts4.5/compiled/components/menu.d.ts +0 -115
- package/dist/types-ts4.5/compiled/components/multi-value.d.ts +0 -57
- package/dist/types-ts4.5/compiled/components/option.d.ts +0 -48
- package/dist/types-ts4.5/compiled/components/placeholder.d.ts +0 -21
- package/dist/types-ts4.5/compiled/components/single-value.d.ts +0 -27
- package/dist/types-ts4.5/emotion/components/containers.d.ts +0 -54
- package/dist/types-ts4.5/emotion/components/control.d.ts +0 -42
- package/dist/types-ts4.5/emotion/components/group.d.ts +0 -52
- package/dist/types-ts4.5/emotion/components/indicators.d.ts +0 -73
- package/dist/types-ts4.5/emotion/components/input.d.ts +0 -37
- package/dist/types-ts4.5/emotion/components/internal/a11y-text.d.ts +0 -8
- package/dist/types-ts4.5/emotion/components/internal/dummy-input.d.ts +0 -9
- package/dist/types-ts4.5/emotion/components/internal/index.d.ts +0 -4
- package/dist/types-ts4.5/emotion/components/internal/required-input.d.ts +0 -10
- package/dist/types-ts4.5/emotion/components/internal/scroll-manager.d.ts +0 -17
- package/dist/types-ts4.5/emotion/components/internal/use-scroll-capture.d.ts +0 -12
- package/dist/types-ts4.5/emotion/components/internal/use-scroll-lock.d.ts +0 -9
- package/dist/types-ts4.5/emotion/components/live-region.d.ts +0 -23
- package/dist/types-ts4.5/emotion/components/menu.d.ts +0 -116
- package/dist/types-ts4.5/emotion/components/multi-value.d.ts +0 -47
- package/dist/types-ts4.5/emotion/components/option.d.ts +0 -49
- package/dist/types-ts4.5/emotion/components/placeholder.d.ts +0 -22
- package/dist/types-ts4.5/emotion/components/single-value.d.ts +0 -28
- /package/dist/cjs/{compiled/components → components}/control.compiled.css +0 -0
- /package/dist/cjs/{compiled/components → components}/group.compiled.css +0 -0
- /package/dist/cjs/{compiled/components → components}/indicators.compiled.css +0 -0
- /package/dist/cjs/{compiled/components → components}/input.compiled.css +0 -0
- /package/dist/cjs/{compiled/components → components}/internal/a11y-text.compiled.css +0 -0
- /package/dist/cjs/{compiled/components → components}/internal/dummy-input.compiled.css +0 -0
- /package/dist/cjs/{compiled/components → components}/internal/required-input.compiled.css +0 -0
- /package/dist/cjs/{compiled/components → components}/menu.compiled.css +0 -0
- /package/dist/cjs/{compiled/components → components}/multi-value.compiled.css +0 -0
- /package/dist/cjs/{compiled/components → components}/option.compiled.css +0 -0
- /package/dist/cjs/{compiled/components → components}/placeholder.compiled.css +0 -0
- /package/dist/cjs/{compiled/components → components}/single-value.compiled.css +0 -0
- /package/dist/es2019/{compiled/components → components}/control.compiled.css +0 -0
- /package/dist/es2019/{compiled/components → components}/group.compiled.css +0 -0
- /package/dist/es2019/{compiled/components → components}/indicators.compiled.css +0 -0
- /package/dist/es2019/{compiled/components → components}/input.compiled.css +0 -0
- /package/dist/es2019/{compiled/components → components}/internal/a11y-text.compiled.css +0 -0
- /package/dist/es2019/{compiled/components → components}/internal/dummy-input.compiled.css +0 -0
- /package/dist/es2019/{compiled/components → components}/internal/required-input.compiled.css +0 -0
- /package/dist/es2019/{compiled/components → components}/menu.compiled.css +0 -0
- /package/dist/es2019/{compiled/components → components}/multi-value.compiled.css +0 -0
- /package/dist/es2019/{compiled/components → components}/option.compiled.css +0 -0
- /package/dist/es2019/{compiled/components → components}/placeholder.compiled.css +0 -0
- /package/dist/es2019/{compiled/components → components}/single-value.compiled.css +0 -0
- /package/dist/esm/{compiled/components → components}/control.compiled.css +0 -0
- /package/dist/esm/{compiled/components → components}/group.compiled.css +0 -0
- /package/dist/esm/{compiled/components → components}/indicators.compiled.css +0 -0
- /package/dist/esm/{compiled/components → components}/input.compiled.css +0 -0
- /package/dist/esm/{compiled/components → components}/internal/a11y-text.compiled.css +0 -0
- /package/dist/esm/{compiled/components → components}/internal/dummy-input.compiled.css +0 -0
- /package/dist/esm/{compiled/components → components}/internal/required-input.compiled.css +0 -0
- /package/dist/esm/{compiled/components → components}/menu.compiled.css +0 -0
- /package/dist/esm/{compiled/components → components}/multi-value.compiled.css +0 -0
- /package/dist/esm/{compiled/components → components}/option.compiled.css +0 -0
- /package/dist/esm/{compiled/components → components}/placeholder.compiled.css +0 -0
- /package/dist/esm/{compiled/components → components}/single-value.compiled.css +0 -0
|
@@ -1,14 +1,72 @@
|
|
|
1
|
-
/*
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
/* group.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
+
import "./group.compiled.css";
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
6
|
+
import { cx } from '@compiled/react';
|
|
7
|
+
import { cleanCommonProps, getStyleProps } from '../utils';
|
|
8
|
+
const styles = {
|
|
9
|
+
root: "_n3tdu2gc _ca0qu2gc"
|
|
10
|
+
};
|
|
11
|
+
export const groupCSS = () => ({});
|
|
12
|
+
const Group = props => {
|
|
13
|
+
const {
|
|
14
|
+
children,
|
|
15
|
+
cx: builtinCX,
|
|
16
|
+
getStyles,
|
|
17
|
+
getClassNames,
|
|
18
|
+
Heading,
|
|
19
|
+
headingProps,
|
|
20
|
+
innerProps,
|
|
21
|
+
label,
|
|
22
|
+
selectProps,
|
|
23
|
+
xcss
|
|
24
|
+
} = props;
|
|
25
|
+
const {
|
|
26
|
+
css,
|
|
27
|
+
className
|
|
28
|
+
} = getStyleProps(props, 'group', {
|
|
29
|
+
group: true
|
|
30
|
+
});
|
|
31
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
32
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
33
|
+
style: css
|
|
34
|
+
}, innerProps, {
|
|
35
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop, @atlaskit/ui-styling-standard/local-cx-xcss, @compiled/local-cx-xcss
|
|
36
|
+
className: ax([styles.root, cx(className, xcss, innerProps === null || innerProps === void 0 ? void 0 : innerProps.className, '-Group')])
|
|
37
|
+
}), label && /*#__PURE__*/React.createElement(Heading, _extends({}, headingProps, {
|
|
38
|
+
selectProps: selectProps,
|
|
39
|
+
getStyles: getStyles,
|
|
40
|
+
getClassNames: getClassNames,
|
|
41
|
+
cx: builtinCX
|
|
42
|
+
}), label), /*#__PURE__*/React.createElement("div", null, children));
|
|
43
|
+
};
|
|
44
|
+
const headingStyles = null;
|
|
45
|
+
export const groupHeadingCSS = () => ({});
|
|
9
46
|
|
|
10
47
|
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
11
|
-
export const GroupHeading = props =>
|
|
48
|
+
export const GroupHeading = props => {
|
|
49
|
+
const {
|
|
50
|
+
xcss
|
|
51
|
+
} = props;
|
|
52
|
+
const {
|
|
53
|
+
data,
|
|
54
|
+
...innerProps
|
|
55
|
+
} = cleanCommonProps(props);
|
|
56
|
+
const {
|
|
57
|
+
css,
|
|
58
|
+
className
|
|
59
|
+
} = getStyleProps(props, 'groupHeading', {
|
|
60
|
+
'group-heading': true
|
|
61
|
+
});
|
|
62
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
63
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop, @atlaskit/ui-styling-standard/local-cx-xcss, @compiled/local-cx-xcss
|
|
64
|
+
className: ax(["_11c81o8v _1e0c1ule _syaz1gjq _80om73ad _k48pmoej _6rthpd1z _y4tiutpp _bozgutpp _1p1dglyw", cx(className, xcss, '-group')])
|
|
65
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
66
|
+
,
|
|
67
|
+
style: css
|
|
68
|
+
}, innerProps));
|
|
69
|
+
};
|
|
12
70
|
|
|
13
71
|
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
14
72
|
export default Group;
|
|
@@ -1,26 +1,146 @@
|
|
|
1
|
-
/*
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
1
|
+
/* indicators.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
+
import "./indicators.compiled.css";
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
6
|
+
import { cx } from '@compiled/react';
|
|
7
|
+
import DownIcon from '@atlaskit/icon/core/migration/chevron-down';
|
|
8
|
+
import CrossIcon from '@atlaskit/icon/core/migration/cross-circle--select-clear';
|
|
9
|
+
import { Inline, Pressable } from '@atlaskit/primitives/compiled';
|
|
10
|
+
import Spinner from '@atlaskit/spinner';
|
|
11
|
+
import { getStyleProps } from '../utils';
|
|
12
|
+
|
|
13
|
+
// ==============================
|
|
14
|
+
// Dropdown & Clear Icons
|
|
15
|
+
// ==============================
|
|
16
|
+
|
|
17
|
+
const iconContainerStyles = {
|
|
18
|
+
root: "_kkk2n7od _12ji1r31 _1qu219ly _12y31o36 _1e0c1txw _4cvr1h6o _1bah1h6o _ca0qv77o _u5f3v77o _n3tdv77o _19bvv77o"
|
|
19
|
+
};
|
|
20
|
+
const dropdownWrapperStyles = {
|
|
21
|
+
root: "_ca0q12x7 _u5f312x7 _n3td12x7 _19bv12x7"
|
|
22
|
+
};
|
|
6
23
|
|
|
7
24
|
// ==============================
|
|
8
25
|
// Dropdown & Clear Buttons
|
|
9
26
|
// ==============================
|
|
10
27
|
|
|
11
|
-
|
|
28
|
+
const dropdownStyles = {
|
|
29
|
+
default: "_v564vrg3 _1e0c1txw _syaz1gjq _ca0q12x7 _u5f3v77o _n3td12x7 _19bvv77o _30l31gjq",
|
|
30
|
+
compact: "_ca0qidpf _n3tdidpf",
|
|
31
|
+
disabled: "_syaz1lh4"
|
|
32
|
+
};
|
|
33
|
+
export const dropdownIndicatorCSS = () => ({});
|
|
12
34
|
|
|
13
35
|
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
14
|
-
export const DropdownIndicator = props =>
|
|
15
|
-
|
|
36
|
+
export const DropdownIndicator = props => {
|
|
37
|
+
const {
|
|
38
|
+
innerProps,
|
|
39
|
+
children,
|
|
40
|
+
isDisabled,
|
|
41
|
+
isCompact,
|
|
42
|
+
xcss
|
|
43
|
+
} = props;
|
|
44
|
+
const {
|
|
45
|
+
css,
|
|
46
|
+
className
|
|
47
|
+
} = getStyleProps(props, 'dropdownIndicator', {
|
|
48
|
+
indicator: true,
|
|
49
|
+
'dropdown-indicator': true
|
|
50
|
+
});
|
|
51
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
52
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
53
|
+
style: css
|
|
54
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop, @atlaskit/ui-styling-standard/local-cx-xcss, @compiled/local-cx-xcss
|
|
55
|
+
,
|
|
56
|
+
className: ax([dropdownStyles.default, isDisabled && dropdownStyles.disabled, isCompact && dropdownStyles.compact, cx(className, xcss, '-indicatorContainer')])
|
|
57
|
+
}, innerProps), children ? children : /*#__PURE__*/React.createElement(Inline, {
|
|
58
|
+
as: "span",
|
|
59
|
+
xcss: dropdownWrapperStyles.root
|
|
60
|
+
}, /*#__PURE__*/React.createElement(DownIcon, {
|
|
61
|
+
color: "currentColor",
|
|
62
|
+
label: "open",
|
|
63
|
+
LEGACY_margin: "var(--ds-space-negative-075, -0.375rem)",
|
|
64
|
+
size: "small"
|
|
65
|
+
})));
|
|
66
|
+
};
|
|
67
|
+
export const clearIndicatorCSS = () => ({});
|
|
68
|
+
const clearIndicatorStyles = {
|
|
69
|
+
default: "_v564vrg3 _1e0c1txw _syaz131l _ca0q12x7 _u5f3v77o _n3td12x7 _19bvv77o _30l31gjq",
|
|
70
|
+
compact: "_ca0qidpf _n3tdidpf"
|
|
71
|
+
};
|
|
16
72
|
|
|
17
73
|
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
18
|
-
export const ClearIndicator = props =>
|
|
74
|
+
export const ClearIndicator = props => {
|
|
75
|
+
const {
|
|
76
|
+
innerProps,
|
|
77
|
+
clearControlLabel = 'clear',
|
|
78
|
+
isCompact,
|
|
79
|
+
xcss
|
|
80
|
+
} = props;
|
|
81
|
+
const {
|
|
82
|
+
css,
|
|
83
|
+
className
|
|
84
|
+
} = getStyleProps(props, 'clearIndicator', {
|
|
85
|
+
indicator: true,
|
|
86
|
+
'clear-indicator': true
|
|
87
|
+
});
|
|
88
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
89
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
90
|
+
style: css
|
|
91
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop, @atlaskit/ui-styling-standard/local-cx-xcss, @compiled/local-cx-xcss
|
|
92
|
+
,
|
|
93
|
+
className: ax([clearIndicatorStyles.default, isCompact && clearIndicatorStyles.compact, cx(className, xcss, '-indicatorContainer')])
|
|
94
|
+
}, innerProps), /*#__PURE__*/React.createElement(Pressable, {
|
|
95
|
+
xcss: iconContainerStyles.root,
|
|
96
|
+
tabIndex: -1,
|
|
97
|
+
"aria-label": clearControlLabel
|
|
98
|
+
}, /*#__PURE__*/React.createElement(CrossIcon, {
|
|
99
|
+
label: "",
|
|
100
|
+
color: "currentColor",
|
|
101
|
+
LEGACY_size: "small",
|
|
102
|
+
LEGACY_margin: "var(--ds-space-negative-025, -0.125rem)",
|
|
103
|
+
size: "small"
|
|
104
|
+
})));
|
|
105
|
+
};
|
|
19
106
|
|
|
20
107
|
// ==============================
|
|
21
108
|
// Loading
|
|
22
109
|
// ==============================
|
|
23
110
|
|
|
24
|
-
export const loadingIndicatorCSS =
|
|
111
|
+
export const loadingIndicatorCSS = () => ({});
|
|
112
|
+
const loadingIndicatorStyles = {
|
|
113
|
+
default: "_ca0q12x7 _u5f3u2gc _n3td12x7 _19bvu2gc",
|
|
114
|
+
compact: "_ca0qidpf _n3tdidpf"
|
|
115
|
+
};
|
|
25
116
|
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
26
|
-
export const LoadingIndicator =
|
|
117
|
+
export const LoadingIndicator = ({
|
|
118
|
+
innerProps,
|
|
119
|
+
isRtl,
|
|
120
|
+
size = 4,
|
|
121
|
+
isCompact,
|
|
122
|
+
xcss,
|
|
123
|
+
...restProps
|
|
124
|
+
}) => {
|
|
125
|
+
const {
|
|
126
|
+
css,
|
|
127
|
+
className
|
|
128
|
+
} = getStyleProps({
|
|
129
|
+
...restProps,
|
|
130
|
+
innerProps,
|
|
131
|
+
isRtl,
|
|
132
|
+
size
|
|
133
|
+
}, 'loadingIndicator', {
|
|
134
|
+
indicator: true,
|
|
135
|
+
'loading-indicator': true
|
|
136
|
+
});
|
|
137
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
138
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
139
|
+
style: css
|
|
140
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop, @atlaskit/ui-styling-standard/local-cx-xcss, @compiled/local-cx-xcss
|
|
141
|
+
,
|
|
142
|
+
className: ax([loadingIndicatorStyles.default, isCompact && loadingIndicatorStyles.compact, cx(className, xcss, '-loadingIndicator')])
|
|
143
|
+
}, innerProps), /*#__PURE__*/React.createElement(Spinner, {
|
|
144
|
+
size: "small"
|
|
145
|
+
}));
|
|
146
|
+
};
|
|
@@ -1,10 +1,56 @@
|
|
|
1
|
-
/*
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
/* input.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
+
import "./input.compiled.css";
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
6
|
+
import { cx } from '@compiled/react';
|
|
7
|
+
import { cleanCommonProps, getStyleProps } from '../utils';
|
|
8
|
+
export const inputCSS = () => ({});
|
|
9
|
+
const inputStyles = {
|
|
10
|
+
root: "_16jlkb7n _1o9zkb7n _i0dl1wug _nd5l1sux _1mouv77o _195gv77o _1rjcv77o _1e0c1n7u _yv0e12qd _syaz1fxt _j8d6idpf _1av2idpf _1doyidpf _pfztidpf _uoe3idpf _1recidpf _70xridpf _1k96idpf _eq43idpf _1h9u1kw7 _ckog1yjy _1x651r31 _1nn4glyw _1rzeidpf _1yd8yh40 _aetr11ps _uy7x15vq _1qjlqvpr",
|
|
11
|
+
disabled: "_3um015vq"
|
|
12
|
+
};
|
|
13
|
+
const nativeInnputStyles = null;
|
|
14
|
+
const hidden = null;
|
|
15
|
+
const Input = props => {
|
|
16
|
+
const {
|
|
17
|
+
cx: builtinCX,
|
|
18
|
+
value,
|
|
19
|
+
xcss
|
|
20
|
+
} = props;
|
|
21
|
+
const {
|
|
22
|
+
innerRef,
|
|
23
|
+
isDisabled,
|
|
24
|
+
isHidden,
|
|
25
|
+
inputClassName,
|
|
26
|
+
testId,
|
|
27
|
+
...innerProps
|
|
28
|
+
} = cleanCommonProps(props);
|
|
29
|
+
const dataId = testId ? `${testId}-select--input` : null;
|
|
30
|
+
const {
|
|
31
|
+
css,
|
|
32
|
+
className
|
|
33
|
+
} = getStyleProps(props, 'input', {
|
|
34
|
+
'input-container': true
|
|
35
|
+
});
|
|
36
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
37
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
38
|
+
style: css
|
|
39
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop, @atlaskit/ui-styling-standard/local-cx-xcss, @compiled/local-cx-xcss
|
|
40
|
+
,
|
|
41
|
+
className: ax([inputStyles.root, isDisabled && inputStyles.disabled, cx(className, xcss, '-Input')]),
|
|
42
|
+
"data-value": value || '',
|
|
43
|
+
"data-testid": dataId && `${dataId}-container`
|
|
44
|
+
}, /*#__PURE__*/React.createElement("input", _extends({
|
|
45
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
46
|
+
className: ax(["_19pkidpf _2hwxidpf _otyridpf _18u0idpf _ca0qidpf _u5f3idpf _n3tdidpf _19bvidpf _11q7idpf _19itidpf _11c81kw7 _nd5l1yjy _12ji1r31 _1qu2glyw _12y3idpf _1bsb1osq _1ul9yh40 _syaz1kw7 _tzy4kb7n", isHidden && "_tzy4idpf", builtinCX({
|
|
47
|
+
input: true
|
|
48
|
+
}, inputClassName, '-input')]),
|
|
49
|
+
ref: innerRef,
|
|
50
|
+
disabled: isDisabled,
|
|
51
|
+
"data-testid": dataId
|
|
52
|
+
}, innerProps)));
|
|
53
|
+
};
|
|
8
54
|
|
|
9
55
|
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
10
56
|
export default Input;
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
/*
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
1
|
+
/* a11y-text.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
+
import "./a11y-text.compiled.css";
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
6
|
+
// Assistive text to describe visual elements. Hidden for sighted users.
|
|
7
|
+
const styles = null;
|
|
8
|
+
const A11yText = props => /*#__PURE__*/React.createElement("span", _extends({
|
|
9
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
10
|
+
className: ax(["_ca0qidpf _u5f3idpf _n3tdidpf _19bvidpf _19itidpf _1reo15vq _18m915vq _1bsbt94y _4t3it94y _kqswstnw _1pbydx66 _ogto7mnp _jqf6ydhy _uiztglyw _o5721q9c", "-a11yText"])
|
|
11
|
+
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
12
|
+
}, props));
|
|
7
13
|
export default A11yText;
|
|
@@ -1,8 +1,20 @@
|
|
|
1
|
-
/*
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
/* dummy-input.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
+
import "./dummy-input.compiled.css";
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
6
|
+
import { removeProps } from '../../utils';
|
|
7
|
+
const dummyInputStyles = null;
|
|
8
|
+
export default function DummyInput({
|
|
9
|
+
innerRef,
|
|
10
|
+
...props
|
|
11
|
+
}) {
|
|
12
|
+
// Remove animation props not meant for HTML elements
|
|
13
|
+
const filteredProps = removeProps(props, 'onExited', 'in', 'enter', 'exit', 'appear');
|
|
14
|
+
|
|
15
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
16
|
+
return /*#__PURE__*/React.createElement("input", _extends({
|
|
17
|
+
ref: innerRef,
|
|
18
|
+
className: ax(["_ca0qidpf _u5f3idpf _n3tdidpf _19bvidpf _11q7idpf _19itidpf _nd5l1sux _12ji1r31 _1qu2glyw _12y3idpf _1bsbt94y _kqswh2mm _1n5d1j28 _syaz1j28 _1e02p1rm _tzy4idpf _t9ec1kuz", "-dummyInput"])
|
|
19
|
+
}, filteredProps));
|
|
8
20
|
}
|
|
@@ -1,9 +1,25 @@
|
|
|
1
|
-
/*
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
const
|
|
1
|
+
/* required-input.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
|
+
import "./required-input.compiled.css";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
5
|
+
import __noop from '@atlaskit/ds-lib/noop';
|
|
6
|
+
const styles = null;
|
|
7
|
+
const RequiredInput = ({
|
|
8
|
+
name,
|
|
9
|
+
onFocus
|
|
10
|
+
}) => /*#__PURE__*/React.createElement("input", {
|
|
11
|
+
required: true,
|
|
12
|
+
name: name,
|
|
13
|
+
tabIndex: -1,
|
|
14
|
+
"aria-hidden": "true"
|
|
15
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
16
|
+
,
|
|
17
|
+
className: ax(["_1bsb1osq _kqswstnw _u7coidpf _rjxpidpf _1e02idpf _jqf61a21 _tzy4idpf _lcxvglyw", "-requiredInput"]),
|
|
18
|
+
onFocus: onFocus,
|
|
19
|
+
// Prevent `Switching from uncontrolled to controlled` error
|
|
20
|
+
value: "",
|
|
21
|
+
onChange: __noop
|
|
22
|
+
});
|
|
7
23
|
|
|
8
24
|
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
9
25
|
export default RequiredInput;
|
|
@@ -1,14 +1,112 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import Compiled from '../compiled/components/live-region';
|
|
5
|
-
import Emotion from '../emotion/components/live-region';
|
|
1
|
+
import React, { Fragment, useMemo } from 'react';
|
|
2
|
+
import { defaultAriaLiveMessages } from '../accessibility';
|
|
3
|
+
import A11yText from './internal/a11y-text';
|
|
6
4
|
|
|
7
5
|
// ==============================
|
|
8
6
|
// Root Container
|
|
9
7
|
// ==============================
|
|
10
8
|
|
|
11
|
-
const LiveRegion = props =>
|
|
9
|
+
const LiveRegion = props => {
|
|
10
|
+
const {
|
|
11
|
+
ariaSelection,
|
|
12
|
+
focusableOptions,
|
|
13
|
+
isFocused,
|
|
14
|
+
selectValue,
|
|
15
|
+
selectProps,
|
|
16
|
+
id
|
|
17
|
+
} = props;
|
|
18
|
+
const {
|
|
19
|
+
ariaLiveMessages,
|
|
20
|
+
getOptionLabel,
|
|
21
|
+
inputValue,
|
|
22
|
+
isOptionDisabled,
|
|
23
|
+
menuIsOpen,
|
|
24
|
+
options,
|
|
25
|
+
screenReaderStatus,
|
|
26
|
+
isLoading
|
|
27
|
+
} = selectProps;
|
|
28
|
+
const ariaLive = selectProps['aria-live'];
|
|
29
|
+
|
|
30
|
+
// Update aria live message configuration when prop changes
|
|
31
|
+
const messages = useMemo(() => ({
|
|
32
|
+
...defaultAriaLiveMessages,
|
|
33
|
+
...(ariaLiveMessages || {})
|
|
34
|
+
}), [ariaLiveMessages]);
|
|
35
|
+
|
|
36
|
+
// Update aria live selected option when prop changes
|
|
37
|
+
const ariaSelected = useMemo(() => {
|
|
38
|
+
let message = '';
|
|
39
|
+
if (menuIsOpen) {
|
|
40
|
+
// we don't need to have selected message when the menu is open
|
|
41
|
+
return '';
|
|
42
|
+
}
|
|
43
|
+
if (ariaSelection && messages.onChange) {
|
|
44
|
+
const {
|
|
45
|
+
option,
|
|
46
|
+
options: selectedOptions,
|
|
47
|
+
removedValue,
|
|
48
|
+
removedValues,
|
|
49
|
+
value
|
|
50
|
+
} = ariaSelection;
|
|
51
|
+
// select-option when !isMulti does not return option so we assume selected option is value
|
|
52
|
+
const asOption = val => !Array.isArray(val) ? val : null;
|
|
53
|
+
|
|
54
|
+
// If there is just one item from the action then get its label
|
|
55
|
+
const selected = removedValue || option || asOption(value);
|
|
56
|
+
const label = selected ? getOptionLabel(selected) : '';
|
|
57
|
+
|
|
58
|
+
// If there are multiple items from the action then return an array of labels
|
|
59
|
+
const multiSelected = selectedOptions || removedValues || undefined;
|
|
60
|
+
const labels = multiSelected ? multiSelected.map(getOptionLabel) : [];
|
|
61
|
+
if (!label && !labels.length) {
|
|
62
|
+
// return empty string if no labels provided
|
|
63
|
+
return '';
|
|
64
|
+
}
|
|
65
|
+
const onChangeProps = {
|
|
66
|
+
// multiSelected items are usually items that have already been selected
|
|
67
|
+
// or set by the user as a default value so we assume they are not disabled
|
|
68
|
+
isDisabled: selected && isOptionDisabled(selected, selectValue),
|
|
69
|
+
label,
|
|
70
|
+
labels,
|
|
71
|
+
...ariaSelection
|
|
72
|
+
};
|
|
73
|
+
message = messages.onChange(onChangeProps);
|
|
74
|
+
}
|
|
75
|
+
return message;
|
|
76
|
+
}, [ariaSelection, messages, isOptionDisabled, selectValue, getOptionLabel, menuIsOpen]);
|
|
77
|
+
const ariaResults = useMemo(() => {
|
|
78
|
+
let resultsMsg = '';
|
|
79
|
+
if (isLoading) {
|
|
80
|
+
resultsMsg = 'Loading. ';
|
|
81
|
+
}
|
|
82
|
+
if (menuIsOpen && options.length && !isLoading && messages.onFilter) {
|
|
83
|
+
const resultsMessage = screenReaderStatus({
|
|
84
|
+
count: focusableOptions.length
|
|
85
|
+
});
|
|
86
|
+
resultsMsg = messages.onFilter({
|
|
87
|
+
inputValue,
|
|
88
|
+
resultsMessage
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
if (options && options.length === 0) {
|
|
92
|
+
resultsMsg = 'No options. ';
|
|
93
|
+
}
|
|
94
|
+
return resultsMsg;
|
|
95
|
+
}, [focusableOptions, inputValue, menuIsOpen, messages, options, screenReaderStatus, isLoading]);
|
|
96
|
+
const isInitialFocus = (ariaSelection === null || ariaSelection === void 0 ? void 0 : ariaSelection.action) === 'initial-input-focus';
|
|
97
|
+
const ScreenReaderText = /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("span", {
|
|
98
|
+
id: "aria-selection"
|
|
99
|
+
}, ariaSelected), /*#__PURE__*/React.createElement("span", {
|
|
100
|
+
id: "aria-results"
|
|
101
|
+
}, ariaResults));
|
|
102
|
+
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(A11yText, {
|
|
103
|
+
id: id
|
|
104
|
+
}, isInitialFocus && ScreenReaderText), /*#__PURE__*/React.createElement(A11yText, {
|
|
105
|
+
"aria-live": ariaLive // Should be undefined by default unless a specific use case requires it
|
|
106
|
+
,
|
|
107
|
+
role: "status"
|
|
108
|
+
}, isFocused && !isInitialFocus && ScreenReaderText));
|
|
109
|
+
};
|
|
12
110
|
|
|
13
111
|
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
14
112
|
export default LiveRegion;
|