@rescui/select 0.18.1-RUI-297-Add-react-compiler-to-the-packages-build-8aaaed4be.39 → 0.18.1-RUI-297-Add-react-compiler-to-the-packages-build-ccd086200.40
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/lib/_virtual/index.css.js +12 -12
- package/lib/hooks/use-a11y.d.ts +2 -2
- package/lib/hooks/use-a11y.js +6 -6
- package/lib/hooks/use-actual-size-from-css.d.ts +3 -4
- package/lib/hooks/use-actual-size-from-css.js +5 -5
- package/lib/hooks/use-primary-contrast-css-var-transfer.d.ts +2 -3
- package/lib/hooks/use-primary-contrast-css-var-transfer.js +6 -6
- package/lib/index.css +193 -193
- package/lib/multiselect.js +200 -218
- package/lib/native-select.js +114 -112
- package/lib/parts/list-box.js +86 -48
- package/lib/parts/multi-trigger.d.ts +2 -2
- package/lib/parts/multi-trigger.js +51 -37
- package/lib/parts/popup-content.d.ts +2 -2
- package/lib/parts/popup-content.js +7 -7
- package/lib/select-basic.js +158 -174
- package/lib/select-searchable.js +138 -145
- package/lib/styles/common.p.module.css.js +29 -29
- package/lib/styles/form-trigger.p.module.css.js +12 -12
- package/lib/styles/list-box.p.module.css.js +13 -13
- package/package.json +9 -9
- package/lib/hooks/use-no-memo-getter.d.ts +0 -5
- package/lib/hooks/use-no-memo-getter.js +0 -15
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
var styles = {
|
|
2
|
-
"icon": "
|
|
3
|
-
"sizeXS": "
|
|
4
|
-
"sizeS": "
|
|
5
|
-
"sizeM": "
|
|
6
|
-
"sizeL": "
|
|
7
|
-
"light": "
|
|
8
|
-
"dark": "
|
|
9
|
-
"allVariants": "
|
|
10
|
-
"variant16": "
|
|
11
|
-
"variant20": "
|
|
12
|
-
"variant24": "
|
|
13
|
-
"variant28": "
|
|
2
|
+
"icon": "_icon_j4spmh_4",
|
|
3
|
+
"sizeXS": "_sizeXS_j4spmh_14",
|
|
4
|
+
"sizeS": "_sizeS_j4spmh_18",
|
|
5
|
+
"sizeM": "_sizeM_j4spmh_22",
|
|
6
|
+
"sizeL": "_sizeL_j4spmh_26",
|
|
7
|
+
"light": "_light_j4spmh_30",
|
|
8
|
+
"dark": "_dark_j4spmh_34",
|
|
9
|
+
"allVariants": "_allVariants_j4spmh_48",
|
|
10
|
+
"variant16": "_variant16_j4spmh_53",
|
|
11
|
+
"variant20": "_variant20_j4spmh_54",
|
|
12
|
+
"variant24": "_variant24_j4spmh_55",
|
|
13
|
+
"variant28": "_variant28_j4spmh_58"
|
|
14
14
|
};
|
|
15
15
|
export { styles as default };
|
package/lib/hooks/use-a11y.d.ts
CHANGED
|
@@ -5,10 +5,10 @@ export type UseA11yArgs = {
|
|
|
5
5
|
description?: React.ReactNode;
|
|
6
6
|
error?: React.ReactNode;
|
|
7
7
|
label?: React.ReactNode;
|
|
8
|
-
|
|
8
|
+
fieldEl?: HTMLElement | null;
|
|
9
9
|
isDisabled?: boolean;
|
|
10
10
|
};
|
|
11
|
-
export declare const useA11y: ({ baseId: baseIdFromProps, prefix, description, error, label,
|
|
11
|
+
export declare const useA11y: ({ baseId: baseIdFromProps, prefix, description, error, label, fieldEl, isDisabled }: UseA11yArgs) => {
|
|
12
12
|
baseId: string;
|
|
13
13
|
fieldProps: {
|
|
14
14
|
'aria-invalid': boolean;
|
package/lib/hooks/use-a11y.js
CHANGED
|
@@ -9,7 +9,7 @@ const useA11y = t0 => {
|
|
|
9
9
|
description,
|
|
10
10
|
error,
|
|
11
11
|
label,
|
|
12
|
-
|
|
12
|
+
fieldEl,
|
|
13
13
|
isDisabled: t2
|
|
14
14
|
} = t0;
|
|
15
15
|
const prefix = t1 === undefined ? "" : t1;
|
|
@@ -80,21 +80,21 @@ const useA11y = t0 => {
|
|
|
80
80
|
const descriptionProps = t7;
|
|
81
81
|
let t8;
|
|
82
82
|
|
|
83
|
-
if ($[12] !==
|
|
83
|
+
if ($[12] !== fieldEl || $[13] !== fieldId || $[14] !== isDisabled) {
|
|
84
84
|
t8 = () => {
|
|
85
85
|
if (isDisabled) {
|
|
86
86
|
return;
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
-
if (
|
|
90
|
-
|
|
89
|
+
if (fieldEl) {
|
|
90
|
+
fieldEl.focus();
|
|
91
91
|
} else {
|
|
92
92
|
document.getElementById(fieldId)?.focus();
|
|
93
93
|
}
|
|
94
94
|
};
|
|
95
95
|
|
|
96
|
-
$[12] =
|
|
97
|
-
$[13] =
|
|
96
|
+
$[12] = fieldEl;
|
|
97
|
+
$[13] = fieldId;
|
|
98
98
|
$[14] = isDisabled;
|
|
99
99
|
$[15] = t8;
|
|
100
100
|
} else {
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import type { SelectSize } from '../types';
|
|
3
2
|
export type UseActualSizeFromCssParams = {
|
|
4
3
|
sizeFromProps: SelectSize;
|
|
5
|
-
|
|
4
|
+
triggerEl: HTMLElement | null;
|
|
6
5
|
};
|
|
7
|
-
export declare const useActualSizeFromCss: ({ sizeFromProps,
|
|
8
|
-
observableRef:
|
|
6
|
+
export declare const useActualSizeFromCss: ({ sizeFromProps, triggerEl }: UseActualSizeFromCssParams) => {
|
|
7
|
+
observableRef: import("react").RefObject<HTMLDivElement>;
|
|
9
8
|
size: "l" | "m" | "s";
|
|
10
9
|
};
|
|
@@ -7,30 +7,30 @@ const useActualSizeFromCss = t0 => {
|
|
|
7
7
|
const $ = c(5);
|
|
8
8
|
const {
|
|
9
9
|
sizeFromProps,
|
|
10
|
-
|
|
10
|
+
triggerEl
|
|
11
11
|
} = t0;
|
|
12
12
|
const observableRef = useRef(null);
|
|
13
13
|
const [size, setSize] = useState(sizeFromProps);
|
|
14
14
|
let t1;
|
|
15
15
|
|
|
16
|
-
if ($[0] !== sizeFromProps || $[1] !==
|
|
16
|
+
if ($[0] !== sizeFromProps || $[1] !== triggerEl) {
|
|
17
17
|
t1 = () => {
|
|
18
18
|
var _context;
|
|
19
19
|
|
|
20
|
-
const ownerWindow =
|
|
20
|
+
const ownerWindow = triggerEl?.ownerDocument.defaultView;
|
|
21
21
|
|
|
22
22
|
if (!ownerWindow) {
|
|
23
23
|
return;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
const triggerFormWrapperStyles = ownerWindow.getComputedStyle(
|
|
26
|
+
const triggerFormWrapperStyles = ownerWindow.getComputedStyle(triggerEl);
|
|
27
27
|
const rawSizeFromCss = triggerFormWrapperStyles.getPropertyValue("--_rs-select-size");
|
|
28
28
|
const sizeFromCss = _includesInstanceProperty(_context = ["s", "m", "l"]).call(_context, rawSizeFromCss) ? rawSizeFromCss : null;
|
|
29
29
|
setSize(sizeFromCss || sizeFromProps);
|
|
30
30
|
};
|
|
31
31
|
|
|
32
32
|
$[0] = sizeFromProps;
|
|
33
|
-
$[1] =
|
|
33
|
+
$[1] = triggerEl;
|
|
34
34
|
$[2] = t1;
|
|
35
35
|
} else {
|
|
36
36
|
t1 = $[2];
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
export type UsePrimaryContrastCssVarTransferParams = {
|
|
3
|
-
|
|
2
|
+
triggerEl: HTMLElement | null;
|
|
4
3
|
isOpen: boolean;
|
|
5
4
|
};
|
|
6
5
|
/**
|
|
7
6
|
* Transfer primary contrast css var to the dropdown, but only when the dropdown opens
|
|
8
7
|
*/
|
|
9
|
-
export declare const usePrimaryContrastCssVarTransfer: ({
|
|
8
|
+
export declare const usePrimaryContrastCssVarTransfer: ({ triggerEl, isOpen }: UsePrimaryContrastCssVarTransferParams) => {
|
|
10
9
|
isPrimaryContrast: boolean;
|
|
11
10
|
};
|
|
@@ -8,28 +8,28 @@ const useIsomorphicLayoutEffect = typeof window === 'undefined' ? useEffect : us
|
|
|
8
8
|
const usePrimaryContrastCssVarTransfer = t0 => {
|
|
9
9
|
const $ = c(6);
|
|
10
10
|
const {
|
|
11
|
-
|
|
11
|
+
triggerEl,
|
|
12
12
|
isOpen
|
|
13
13
|
} = t0;
|
|
14
14
|
const [isPrimaryContrast, setIsPrimaryContrast] = useState(false);
|
|
15
15
|
let t1;
|
|
16
16
|
let t2;
|
|
17
17
|
|
|
18
|
-
if ($[0] !== isOpen || $[1] !==
|
|
18
|
+
if ($[0] !== isOpen || $[1] !== triggerEl) {
|
|
19
19
|
t1 = () => {
|
|
20
|
-
const ownerWindow =
|
|
20
|
+
const ownerWindow = triggerEl?.ownerDocument.defaultView;
|
|
21
21
|
|
|
22
22
|
if (!isOpen || !ownerWindow) {
|
|
23
23
|
return;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
const isPrimaryContrastFromCss = ownerWindow.getComputedStyle(
|
|
26
|
+
const isPrimaryContrastFromCss = ownerWindow.getComputedStyle(triggerEl).getPropertyValue("--rs-select-contrast-primary");
|
|
27
27
|
setIsPrimaryContrast(isPrimaryContrastFromCss === "1");
|
|
28
28
|
};
|
|
29
29
|
|
|
30
|
-
t2 = [isOpen,
|
|
30
|
+
t2 = [isOpen, triggerEl];
|
|
31
31
|
$[0] = isOpen;
|
|
32
|
-
$[1] =
|
|
32
|
+
$[1] = triggerEl;
|
|
33
33
|
$[2] = t1;
|
|
34
34
|
$[3] = t2;
|
|
35
35
|
} else {
|