@rescui/select 0.22.0 → 0.22.1-floating-ui-migration-ee8cf10db.7.sha-ee8cf10db
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-actual-size-from-css.js +37 -17
- package/lib/index.css +192 -192
- package/lib/multiselect.js +32 -36
- package/lib/parts/popup-content.d.ts +2 -4
- package/lib/parts/popup-content.js +41 -68
- package/lib/select-basic.js +0 -2
- package/lib/select-searchable.js +0 -2
- package/lib/styles/common.p.module.css.js +1 -1
- package/lib/styles/form-trigger.p.module.css.js +1 -1
- package/lib/styles/list-box.p.module.css.js +1 -1
- package/llm/components/multiselect.md +5 -5
- package/llm/components/select.md +11 -11
- package/package.json +10 -10
package/lib/multiselect.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { c } from 'react-compiler-runtime';
|
|
3
|
-
import React, { useState
|
|
3
|
+
import React, { useState } from 'react';
|
|
4
4
|
import cn from 'classnames';
|
|
5
5
|
import { useSelect } from 'downshift';
|
|
6
6
|
import { useThemeWithUndefined } from '@rescui/ui-contexts';
|
|
@@ -58,7 +58,7 @@ const stateReducer = (state, actionAndChanges) => {
|
|
|
58
58
|
};
|
|
59
59
|
// eslint-disable-next-line complexity
|
|
60
60
|
function Multiselect(t0) {
|
|
61
|
-
const $ = c(
|
|
61
|
+
const $ = c(138);
|
|
62
62
|
let className;
|
|
63
63
|
let error;
|
|
64
64
|
let id;
|
|
@@ -202,7 +202,6 @@ function Multiselect(t0) {
|
|
|
202
202
|
const theme = useThemeWithUndefined(themeFromProps);
|
|
203
203
|
const [triggerEl, setTriggerEl] = useState(null);
|
|
204
204
|
const [menuEl, setMenuEl] = useState(null);
|
|
205
|
-
const dropdownRef = useRef(null);
|
|
206
205
|
let t16;
|
|
207
206
|
if ($[31] !== onChange || $[32] !== selectedItems) {
|
|
208
207
|
t16 = {
|
|
@@ -526,12 +525,11 @@ function Multiselect(t0) {
|
|
|
526
525
|
t34 = $[104];
|
|
527
526
|
}
|
|
528
527
|
let t35;
|
|
529
|
-
if ($[105] !== disableFlip || $[106] !== emptyListMessage || $[107] !== isOpen || $[108] !== listBoxItems || $[109] !== listBoxState || $[110] !== maxVisibleItems || $[111] !== mode || $[112] !== placement || $[113] !== renderInTrigger || $[114] !==
|
|
528
|
+
if ($[105] !== disableFlip || $[106] !== emptyListMessage || $[107] !== isOpen || $[108] !== listBoxItems || $[109] !== listBoxState || $[110] !== maxVisibleItems || $[111] !== mode || $[112] !== placement || $[113] !== renderInTrigger || $[114] !== size || $[115] !== t34 || $[116] !== theme || $[117] !== triggerEl) {
|
|
530
529
|
t35 = /*#__PURE__*/React.createElement(PopupContent, {
|
|
531
530
|
theme: theme,
|
|
532
531
|
size: size,
|
|
533
532
|
mode: mode,
|
|
534
|
-
dropdownRef: dropdownRef,
|
|
535
533
|
triggerEl: triggerEl,
|
|
536
534
|
placement: placement,
|
|
537
535
|
renderInTrigger: renderInTrigger,
|
|
@@ -541,7 +539,6 @@ function Multiselect(t0) {
|
|
|
541
539
|
maxVisibleItems: maxVisibleItems,
|
|
542
540
|
emptyListMessage: emptyListMessage,
|
|
543
541
|
listBoxItems: listBoxItems,
|
|
544
|
-
dropdownUpdateDep: selectedItems,
|
|
545
542
|
trigger: t34
|
|
546
543
|
});
|
|
547
544
|
$[105] = disableFlip;
|
|
@@ -553,17 +550,16 @@ function Multiselect(t0) {
|
|
|
553
550
|
$[111] = mode;
|
|
554
551
|
$[112] = placement;
|
|
555
552
|
$[113] = renderInTrigger;
|
|
556
|
-
$[114] =
|
|
557
|
-
$[115] =
|
|
558
|
-
$[116] =
|
|
559
|
-
$[117] =
|
|
560
|
-
$[118] =
|
|
561
|
-
$[119] = t35;
|
|
553
|
+
$[114] = size;
|
|
554
|
+
$[115] = t34;
|
|
555
|
+
$[116] = theme;
|
|
556
|
+
$[117] = triggerEl;
|
|
557
|
+
$[118] = t35;
|
|
562
558
|
} else {
|
|
563
|
-
t35 = $[
|
|
559
|
+
t35 = $[118];
|
|
564
560
|
}
|
|
565
561
|
let t36;
|
|
566
|
-
if ($[
|
|
562
|
+
if ($[119] !== boldLabel || $[120] !== descriptionProps || $[121] !== error || $[122] !== errorMessageProps || $[123] !== isDisabled || $[124] !== label || $[125] !== note || $[126] !== reserveErrorLine || $[127] !== size || $[128] !== t32 || $[129] !== t33 || $[130] !== t35 || $[131] !== theme) {
|
|
567
563
|
t36 = /*#__PURE__*/React.createElement(FormTriggerWrapper, {
|
|
568
564
|
theme: theme,
|
|
569
565
|
size: size,
|
|
@@ -577,38 +573,38 @@ function Multiselect(t0) {
|
|
|
577
573
|
note: note,
|
|
578
574
|
descriptionProps: descriptionProps
|
|
579
575
|
}, t33, t35);
|
|
580
|
-
$[
|
|
581
|
-
$[
|
|
582
|
-
$[
|
|
583
|
-
$[
|
|
584
|
-
$[
|
|
585
|
-
$[
|
|
586
|
-
$[
|
|
587
|
-
$[
|
|
588
|
-
$[
|
|
589
|
-
$[
|
|
590
|
-
$[
|
|
591
|
-
$[
|
|
592
|
-
$[
|
|
593
|
-
$[
|
|
576
|
+
$[119] = boldLabel;
|
|
577
|
+
$[120] = descriptionProps;
|
|
578
|
+
$[121] = error;
|
|
579
|
+
$[122] = errorMessageProps;
|
|
580
|
+
$[123] = isDisabled;
|
|
581
|
+
$[124] = label;
|
|
582
|
+
$[125] = note;
|
|
583
|
+
$[126] = reserveErrorLine;
|
|
584
|
+
$[127] = size;
|
|
585
|
+
$[128] = t32;
|
|
586
|
+
$[129] = t33;
|
|
587
|
+
$[130] = t35;
|
|
588
|
+
$[131] = theme;
|
|
589
|
+
$[132] = t36;
|
|
594
590
|
} else {
|
|
595
|
-
t36 = $[
|
|
591
|
+
t36 = $[132];
|
|
596
592
|
}
|
|
597
593
|
let t37;
|
|
598
|
-
if ($[
|
|
594
|
+
if ($[133] !== id || $[134] !== style || $[135] !== t31 || $[136] !== t36) {
|
|
599
595
|
t37 = /*#__PURE__*/React.createElement("div", {
|
|
600
596
|
className: t31,
|
|
601
597
|
id: id,
|
|
602
598
|
style: style,
|
|
603
599
|
"data-test": "multiselect"
|
|
604
600
|
}, t36);
|
|
605
|
-
$[
|
|
606
|
-
$[
|
|
607
|
-
$[
|
|
608
|
-
$[
|
|
609
|
-
$[
|
|
601
|
+
$[133] = id;
|
|
602
|
+
$[134] = style;
|
|
603
|
+
$[135] = t31;
|
|
604
|
+
$[136] = t36;
|
|
605
|
+
$[137] = t37;
|
|
610
606
|
} else {
|
|
611
|
-
t37 = $[
|
|
607
|
+
t37 = $[137];
|
|
612
608
|
}
|
|
613
609
|
return t37;
|
|
614
610
|
}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { Theme } from '@rescui/ui-contexts';
|
|
3
|
-
import type { DropdownProps
|
|
3
|
+
import type { DropdownProps } from '@rescui/dropdown';
|
|
4
4
|
import type { SelectMode, SelectSize, ListBoxState, ListBoxItem, Placement } from '../types';
|
|
5
5
|
export type PopupContentProps = {
|
|
6
6
|
theme: Theme;
|
|
7
7
|
listBoxState: ListBoxState;
|
|
8
8
|
triggerEl: HTMLElement | null;
|
|
9
|
-
dropdownRef?: React.RefObject<DropdownImperativeHandle>;
|
|
10
9
|
listBoxItems?: ListBoxItem[];
|
|
11
10
|
placement: Placement;
|
|
12
11
|
size?: SelectSize;
|
|
@@ -17,6 +16,5 @@ export type PopupContentProps = {
|
|
|
17
16
|
renderInTrigger?: boolean;
|
|
18
17
|
disableFlip?: boolean;
|
|
19
18
|
isOpen?: boolean;
|
|
20
|
-
dropdownUpdateDep?: unknown;
|
|
21
19
|
};
|
|
22
|
-
export declare const PopupContent: ({ theme, listBoxState, triggerEl,
|
|
20
|
+
export declare const PopupContent: ({ theme, listBoxState, triggerEl, listBoxItems, placement, size: sizeFromProps, mode, emptyListMessage, maxVisibleItems, trigger, renderInTrigger, disableFlip, isOpen }: PopupContentProps) => React.JSX.Element;
|
|
@@ -1,20 +1,18 @@
|
|
|
1
1
|
import { c } from 'react-compiler-runtime';
|
|
2
|
-
import React
|
|
2
|
+
import React from 'react';
|
|
3
3
|
import { Dropdown } from '@rescui/dropdown';
|
|
4
4
|
import { useActualSizeFromCss } from '../hooks/use-actual-size-from-css.js';
|
|
5
5
|
import { usePrimaryContrastCssVarTransfer } from '../hooks/use-primary-contrast-css-var-transfer.js';
|
|
6
6
|
import styles from '../styles/common.p.module.css.js';
|
|
7
7
|
import { ListBox } from './list-box.js';
|
|
8
8
|
|
|
9
|
-
const useIsomorphicLayoutEffect = typeof window === 'undefined' ? useEffect : useLayoutEffect;
|
|
10
9
|
// eslint-disable-next-line complexity
|
|
11
10
|
const PopupContent = t0 => {
|
|
12
|
-
const $ = c(
|
|
11
|
+
const $ = c(27);
|
|
13
12
|
const {
|
|
14
13
|
theme,
|
|
15
14
|
listBoxState,
|
|
16
15
|
triggerEl,
|
|
17
|
-
dropdownRef,
|
|
18
16
|
listBoxItems,
|
|
19
17
|
placement,
|
|
20
18
|
size: sizeFromProps,
|
|
@@ -24,8 +22,7 @@ const PopupContent = t0 => {
|
|
|
24
22
|
trigger,
|
|
25
23
|
renderInTrigger,
|
|
26
24
|
disableFlip,
|
|
27
|
-
isOpen
|
|
28
|
-
dropdownUpdateDep
|
|
25
|
+
isOpen
|
|
29
26
|
} = t0;
|
|
30
27
|
let t1;
|
|
31
28
|
if ($[0] !== sizeFromProps || $[1] !== triggerEl) {
|
|
@@ -59,41 +56,19 @@ const PopupContent = t0 => {
|
|
|
59
56
|
isPrimaryContrast
|
|
60
57
|
} = usePrimaryContrastCssVarTransfer(t2);
|
|
61
58
|
let t3;
|
|
62
|
-
if ($[6] !==
|
|
63
|
-
t3 = (
|
|
64
|
-
dropdownRef.current?.scheduleUpdate();
|
|
65
|
-
};
|
|
66
|
-
$[6] = dropdownRef;
|
|
67
|
-
$[7] = t3;
|
|
68
|
-
} else {
|
|
69
|
-
t3 = $[7];
|
|
70
|
-
}
|
|
71
|
-
let t4;
|
|
72
|
-
if ($[8] !== dropdownRef || $[9] !== dropdownUpdateDep || $[10] !== listBoxItems || $[11] !== size) {
|
|
73
|
-
t4 = [dropdownRef, dropdownUpdateDep, listBoxItems, size];
|
|
74
|
-
$[8] = dropdownRef;
|
|
75
|
-
$[9] = dropdownUpdateDep;
|
|
76
|
-
$[10] = listBoxItems;
|
|
77
|
-
$[11] = size;
|
|
78
|
-
$[12] = t4;
|
|
79
|
-
} else {
|
|
80
|
-
t4 = $[12];
|
|
81
|
-
}
|
|
82
|
-
useIsomorphicLayoutEffect(t3, t4);
|
|
83
|
-
let t5;
|
|
84
|
-
if ($[13] !== observableRef) {
|
|
85
|
-
t5 = /*#__PURE__*/React.createElement("div", {
|
|
59
|
+
if ($[6] !== observableRef) {
|
|
60
|
+
t3 = /*#__PURE__*/React.createElement("div", {
|
|
86
61
|
ref: observableRef,
|
|
87
62
|
className: styles.observable
|
|
88
63
|
});
|
|
89
|
-
$[
|
|
90
|
-
$[
|
|
64
|
+
$[6] = observableRef;
|
|
65
|
+
$[7] = t3;
|
|
91
66
|
} else {
|
|
92
|
-
|
|
67
|
+
t3 = $[7];
|
|
93
68
|
}
|
|
94
|
-
let
|
|
95
|
-
if ($[
|
|
96
|
-
|
|
69
|
+
let t4;
|
|
70
|
+
if ($[8] !== emptyListMessage || $[9] !== isPrimaryContrast || $[10] !== listBoxItems || $[11] !== listBoxState || $[12] !== maxVisibleItems || $[13] !== mode || $[14] !== size) {
|
|
71
|
+
t4 = /*#__PURE__*/React.createElement(ListBox, {
|
|
97
72
|
state: listBoxState,
|
|
98
73
|
size: size,
|
|
99
74
|
mode: mode,
|
|
@@ -102,22 +77,21 @@ const PopupContent = t0 => {
|
|
|
102
77
|
items: listBoxItems,
|
|
103
78
|
isPrimaryContrast: isPrimaryContrast
|
|
104
79
|
});
|
|
105
|
-
$[
|
|
106
|
-
$[
|
|
107
|
-
$[
|
|
108
|
-
$[
|
|
109
|
-
$[
|
|
110
|
-
$[
|
|
111
|
-
$[
|
|
112
|
-
$[
|
|
80
|
+
$[8] = emptyListMessage;
|
|
81
|
+
$[9] = isPrimaryContrast;
|
|
82
|
+
$[10] = listBoxItems;
|
|
83
|
+
$[11] = listBoxState;
|
|
84
|
+
$[12] = maxVisibleItems;
|
|
85
|
+
$[13] = mode;
|
|
86
|
+
$[14] = size;
|
|
87
|
+
$[15] = t4;
|
|
113
88
|
} else {
|
|
114
|
-
|
|
89
|
+
t4 = $[15];
|
|
115
90
|
}
|
|
116
|
-
let
|
|
117
|
-
if ($[
|
|
118
|
-
|
|
91
|
+
let t5;
|
|
92
|
+
if ($[16] !== disableFlip || $[17] !== isOpen || $[18] !== placement || $[19] !== renderInTrigger || $[20] !== t4 || $[21] !== theme || $[22] !== trigger) {
|
|
93
|
+
t5 = /*#__PURE__*/React.createElement(Dropdown, {
|
|
119
94
|
theme: theme,
|
|
120
|
-
ref: dropdownRef,
|
|
121
95
|
placement: placement,
|
|
122
96
|
maxWidth: "trigger",
|
|
123
97
|
minWidth: "trigger",
|
|
@@ -128,29 +102,28 @@ const PopupContent = t0 => {
|
|
|
128
102
|
renderInTrigger: renderInTrigger,
|
|
129
103
|
disableFlip: disableFlip,
|
|
130
104
|
trigger: trigger
|
|
131
|
-
},
|
|
132
|
-
$[
|
|
133
|
-
$[
|
|
134
|
-
$[
|
|
135
|
-
$[
|
|
136
|
-
$[
|
|
137
|
-
$[
|
|
138
|
-
$[
|
|
139
|
-
$[
|
|
140
|
-
$[31] = t7;
|
|
105
|
+
}, t4);
|
|
106
|
+
$[16] = disableFlip;
|
|
107
|
+
$[17] = isOpen;
|
|
108
|
+
$[18] = placement;
|
|
109
|
+
$[19] = renderInTrigger;
|
|
110
|
+
$[20] = t4;
|
|
111
|
+
$[21] = theme;
|
|
112
|
+
$[22] = trigger;
|
|
113
|
+
$[23] = t5;
|
|
141
114
|
} else {
|
|
142
|
-
|
|
115
|
+
t5 = $[23];
|
|
143
116
|
}
|
|
144
|
-
let
|
|
145
|
-
if ($[
|
|
146
|
-
|
|
147
|
-
$[
|
|
148
|
-
$[
|
|
149
|
-
$[
|
|
117
|
+
let t6;
|
|
118
|
+
if ($[24] !== t3 || $[25] !== t5) {
|
|
119
|
+
t6 = /*#__PURE__*/React.createElement(React.Fragment, null, t3, t5);
|
|
120
|
+
$[24] = t3;
|
|
121
|
+
$[25] = t5;
|
|
122
|
+
$[26] = t6;
|
|
150
123
|
} else {
|
|
151
|
-
|
|
124
|
+
t6 = $[26];
|
|
152
125
|
}
|
|
153
|
-
return
|
|
126
|
+
return t6;
|
|
154
127
|
};
|
|
155
128
|
|
|
156
129
|
export { PopupContent };
|
package/lib/select-basic.js
CHANGED
|
@@ -140,7 +140,6 @@ function SelectBasic(t0) {
|
|
|
140
140
|
theme = $[22];
|
|
141
141
|
}
|
|
142
142
|
const [triggerEl, setTriggerEl] = React.useState(null);
|
|
143
|
-
const dropdownRef = React.useRef(null);
|
|
144
143
|
const [menuEl, setMenuEl] = React.useState(null);
|
|
145
144
|
const {
|
|
146
145
|
flattenedOptions,
|
|
@@ -418,7 +417,6 @@ function SelectBasic(t0) {
|
|
|
418
417
|
theme: theme,
|
|
419
418
|
size: size,
|
|
420
419
|
mode: mode,
|
|
421
|
-
dropdownRef: dropdownRef,
|
|
422
420
|
triggerEl: triggerEl,
|
|
423
421
|
placement: placement,
|
|
424
422
|
isOpen: isOpen,
|
package/lib/select-searchable.js
CHANGED
|
@@ -141,7 +141,6 @@ function SelectSearchable(t0) {
|
|
|
141
141
|
theme = $[22];
|
|
142
142
|
}
|
|
143
143
|
const [inputEl, setInputEl] = useState(null);
|
|
144
|
-
const dropdownRef = useRef(null);
|
|
145
144
|
const [menuEl, setMenuEl] = useState(null);
|
|
146
145
|
const {
|
|
147
146
|
flattenedOptions,
|
|
@@ -572,7 +571,6 @@ function SelectSearchable(t0) {
|
|
|
572
571
|
theme: theme,
|
|
573
572
|
size: size,
|
|
574
573
|
mode: mode,
|
|
575
|
-
dropdownRef: dropdownRef,
|
|
576
574
|
triggerEl: inputEl,
|
|
577
575
|
placement: placement,
|
|
578
576
|
renderInTrigger: renderInTrigger,
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var styles = {"themeLight":"
|
|
1
|
+
var styles = {"themeLight":"_themeLight_vz9c6s_6","themeDark":"_themeDark_vz9c6s_9","sizeS":"_sizeS_vz9c6s_13","sizeM":"_sizeM_vz9c6s_16","sizeL":"_sizeL_vz9c6s_19","classic":"_classic_vz9c6s_23","rock":"_rock_vz9c6s_26","root":"_root_vz9c6s_30","triggerContainer":"_triggerContainer_vz9c6s_36","disabled":"_disabled_vz9c6s_41","trigger":"_trigger_vz9c6s_36","error":"_error_vz9c6s_78","enabled":"_enabled_vz9c6s_83","searchable":"_searchable_vz9c6s_103","canBeMultiline":"_canBeMultiline_vz9c6s_129","triggerText":"_triggerText_vz9c6s_133","searchInput":"_searchInput_vz9c6s_134","labelNotSelected":"_labelNotSelected_vz9c6s_164","multi":"_multi_vz9c6s_216","tagsContainer":"_tagsContainer_vz9c6s_231","tag":"_tag_vz9c6s_231","filledTag":"_filledTag_vz9c6s_253","iconsWrapper":"_iconsWrapper_vz9c6s_261","toggle":"_toggle_vz9c6s_279","icon":"_icon_vz9c6s_261","clearIcon":"_clearIcon_vz9c6s_364","visuallyHidden":"_visuallyHidden_vz9c6s_426","select":"_select_vz9c6s_443","observable":"_observable_vz9c6s_465"};
|
|
2
2
|
|
|
3
3
|
export { styles as default };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var styles = {"themeLight":"
|
|
1
|
+
var styles = {"themeLight":"_themeLight_12sz2ah_6","themeDark":"_themeDark_12sz2ah_9","sizeS":"_sizeS_12sz2ah_13","sizeM":"_sizeM_12sz2ah_16","sizeL":"_sizeL_12sz2ah_19","main":"_main_12sz2ah_23","label":"_label_12sz2ah_27","disabled":"_disabled_12sz2ah_33","footer":"_footer_12sz2ah_38","errorMessage":"_errorMessage_12sz2ah_45","error":"_error_12sz2ah_45","note":"_note_12sz2ah_54"};
|
|
2
2
|
|
|
3
3
|
export { styles as default };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var styles = {"sizeS":"
|
|
1
|
+
var styles = {"sizeS":"_sizeS_v70wyz_6","sizeM":"_sizeM_v70wyz_9","sizeL":"_sizeL_v70wyz_12","classic":"_classic_v70wyz_16","rock":"_rock_v70wyz_26","listBox":"_listBox_v70wyz_37","item":"_item_v70wyz_53","selected":"_selected_v70wyz_91","disabled":"_disabled_v70wyz_105","checkIcon":"_checkIcon_v70wyz_112","visible":"_visible_v70wyz_119","divider":"_divider_v70wyz_126","groupHeader":"_groupHeader_v70wyz_140"};
|
|
2
2
|
|
|
3
3
|
export { styles as default };
|
|
@@ -10,7 +10,7 @@ Multiselect is a control that allows users to select multiple options from a lis
|
|
|
10
10
|
|
|
11
11
|
You can control what has been selected through `value`/`onChange` props combination. The state represents the collection of options displayed in the select box. The empty state represents by `[]`.
|
|
12
12
|
|
|
13
|
-
```
|
|
13
|
+
```jsx
|
|
14
14
|
import { useState } from 'react';
|
|
15
15
|
import { Multiselect } from '@rescui/select';
|
|
16
16
|
|
|
@@ -54,7 +54,7 @@ render(<MySelect />);
|
|
|
54
54
|
|
|
55
55
|
You can use the `isSingleLine` prop to limit from grow and force it to be always single line. In this case extra tags is hidden and display the count of hidden tags instead.
|
|
56
56
|
|
|
57
|
-
```
|
|
57
|
+
```jsx
|
|
58
58
|
import { useState } from 'react';
|
|
59
59
|
import { Multiselect } from '@rescui/select';
|
|
60
60
|
|
|
@@ -93,7 +93,7 @@ render(<MySelect />);
|
|
|
93
93
|
|
|
94
94
|
If your primary color background requires dark text color, use `--rs-select-contrast-primary` CSS variable.
|
|
95
95
|
|
|
96
|
-
```
|
|
96
|
+
```jsx
|
|
97
97
|
import { useState } from 'react';
|
|
98
98
|
import { Multiselect } from '@rescui/select';
|
|
99
99
|
|
|
@@ -158,7 +158,7 @@ To work around this, we can use the `renderInTrigger` prop to render the popover
|
|
|
158
158
|
|
|
159
159
|
Also use `disableFlip` prop and `overflow: visible` css on the dialog if options will overflow it.
|
|
160
160
|
|
|
161
|
-
```
|
|
161
|
+
```jsx
|
|
162
162
|
import { useState } from 'react';
|
|
163
163
|
import { Multiselect } from '@rescui/select';
|
|
164
164
|
|
|
@@ -226,7 +226,7 @@ render(
|
|
|
226
226
|
|
|
227
227
|
Use the controls to see the effect at different viewport widths.
|
|
228
228
|
|
|
229
|
-
```
|
|
229
|
+
```jsx
|
|
230
230
|
import { useState } from 'react';
|
|
231
231
|
import { Multiselect } from '@rescui/select';
|
|
232
232
|
|
package/llm/components/select.md
CHANGED
|
@@ -10,7 +10,7 @@ Select is a control that allows users to select one option from a longer list.
|
|
|
10
10
|
|
|
11
11
|
Countries:
|
|
12
12
|
|
|
13
|
-
```
|
|
13
|
+
```jsx
|
|
14
14
|
import { useState } from 'react';
|
|
15
15
|
import { Select } from '@rescui/select';
|
|
16
16
|
import COUNTRIES from '@/parts/select/countries';
|
|
@@ -42,7 +42,7 @@ render(<MySelect />);
|
|
|
42
42
|
|
|
43
43
|
Default value:
|
|
44
44
|
|
|
45
|
-
```
|
|
45
|
+
```jsx
|
|
46
46
|
import { useState } from 'react';
|
|
47
47
|
import { Select } from '@rescui/select';
|
|
48
48
|
|
|
@@ -77,7 +77,7 @@ render(<MySelect />);
|
|
|
77
77
|
|
|
78
78
|
#### With fallback to NativeSelect on iOS and Android devices
|
|
79
79
|
|
|
80
|
-
```
|
|
80
|
+
```jsx
|
|
81
81
|
import { useEffect, useState } from 'react';
|
|
82
82
|
import Sniffr from 'sniffr';
|
|
83
83
|
import { Select, NativeSelect } from '@rescui/select';
|
|
@@ -123,7 +123,7 @@ render(<MySelect />);
|
|
|
123
123
|
|
|
124
124
|
#### GroupOptions example with headers
|
|
125
125
|
|
|
126
|
-
```
|
|
126
|
+
```jsx
|
|
127
127
|
import { useEffect, useState } from 'react';
|
|
128
128
|
import Sniffr from 'sniffr';
|
|
129
129
|
import { Select, NativeSelect } from '@rescui/select';
|
|
@@ -204,7 +204,7 @@ We've adopted a second option. Here are the main reasons:
|
|
|
204
204
|
|
|
205
205
|
Here's a concise example of a wrapper that modifies the API to a key-only approach, offering a cleaner interface.
|
|
206
206
|
|
|
207
|
-
```
|
|
207
|
+
```jsx
|
|
208
208
|
import { useState } from 'react';
|
|
209
209
|
import { Select as RSelect } from '@rescui/select';
|
|
210
210
|
|
|
@@ -260,7 +260,7 @@ render(<MySelect />);
|
|
|
260
260
|
|
|
261
261
|
If your primary color background requires dark text color, use `--rs-select-contrast-primary` CSS variable.
|
|
262
262
|
|
|
263
|
-
```
|
|
263
|
+
```jsx
|
|
264
264
|
import { useState } from 'react';
|
|
265
265
|
import { Select } from '@rescui/select';
|
|
266
266
|
|
|
@@ -314,7 +314,7 @@ To work around this, we can use the `renderInTrigger` prop to render the popover
|
|
|
314
314
|
|
|
315
315
|
Also use `disableFlip` prop and `overflow: visible` css on the dialog if options will overflow it.
|
|
316
316
|
|
|
317
|
-
```
|
|
317
|
+
```jsx
|
|
318
318
|
import { useState } from 'react';
|
|
319
319
|
import { Select } from '@rescui/select';
|
|
320
320
|
|
|
@@ -369,7 +369,7 @@ render(
|
|
|
369
369
|
|
|
370
370
|
#### Example:
|
|
371
371
|
|
|
372
|
-
```
|
|
372
|
+
```jsx
|
|
373
373
|
import { useState } from 'react';
|
|
374
374
|
import { NativeSelect } from '@rescui/select';
|
|
375
375
|
|
|
@@ -401,7 +401,7 @@ render(<MySelect />);
|
|
|
401
401
|
|
|
402
402
|
#### Custom trigger for NativeSelect
|
|
403
403
|
|
|
404
|
-
```
|
|
404
|
+
```jsx
|
|
405
405
|
import { useState } from 'react';
|
|
406
406
|
import { NativeSelect } from '@rescui/select';
|
|
407
407
|
|
|
@@ -457,7 +457,7 @@ render(<MySelect />);
|
|
|
457
457
|
|
|
458
458
|
Use the controls to see the effect at different viewport widths.
|
|
459
459
|
|
|
460
|
-
```
|
|
460
|
+
```jsx
|
|
461
461
|
import { useState } from 'react';
|
|
462
462
|
import { Select } from '@rescui/select';
|
|
463
463
|
|
|
@@ -524,7 +524,7 @@ Check out [this example](/components/select/#contrast-primary-color) for contras
|
|
|
524
524
|
|
|
525
525
|
Use the controls to see the effect at different viewport widths.
|
|
526
526
|
|
|
527
|
-
```
|
|
527
|
+
```jsx
|
|
528
528
|
import { useState } from 'react';
|
|
529
529
|
import { NativeSelect } from '@rescui/select';
|
|
530
530
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rescui/select",
|
|
3
|
-
"version": "0.22.
|
|
3
|
+
"version": "0.22.1-floating-ui-migration-ee8cf10db.7.sha-ee8cf10db",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "JetBrains",
|
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
"access": "public"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@rescui/dropdown": "
|
|
20
|
-
"@rescui/form-field": "
|
|
21
|
-
"@rescui/tag": "
|
|
22
|
-
"@rescui/use-resize-observer": "
|
|
19
|
+
"@rescui/dropdown": "0.13.4-floating-ui-migration-ee8cf10db.9.sha-ee8cf10db",
|
|
20
|
+
"@rescui/form-field": "0.3.4-floating-ui-migration-ee8cf10db.9.sha-ee8cf10db",
|
|
21
|
+
"@rescui/tag": "0.16.3-floating-ui-migration-ee8cf10db.9.sha-ee8cf10db",
|
|
22
|
+
"@rescui/use-resize-observer": "0.5.1-floating-ui-migration-ee8cf10db.25.sha-ee8cf10db",
|
|
23
23
|
"classnames": "^2.2.6",
|
|
24
24
|
"downshift": "^9.4.0",
|
|
25
25
|
"react-compiler-runtime": "^1.0.0",
|
|
@@ -31,10 +31,10 @@
|
|
|
31
31
|
"react": ">=17.0.0 <20"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@rescui/colors": "
|
|
35
|
-
"@rescui/scripts": "
|
|
36
|
-
"@rescui/typography": "
|
|
37
|
-
"@rescui/visual-regression": "
|
|
34
|
+
"@rescui/colors": "0.3.7-floating-ui-migration-ee8cf10db.12.sha-ee8cf10db",
|
|
35
|
+
"@rescui/scripts": "0.6.0",
|
|
36
|
+
"@rescui/typography": "0.30.3-floating-ui-migration-ee8cf10db.9.sha-ee8cf10db",
|
|
37
|
+
"@rescui/visual-regression": "0.1.5",
|
|
38
38
|
"sniffr": "^1.2.0"
|
|
39
39
|
},
|
|
40
40
|
"scripts": {
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
"build-pcss-api": "rescui-scripts build-pcss-api --file public-api.p.css"
|
|
43
43
|
},
|
|
44
44
|
"nx": {},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "ee8cf10dbbe12af812fa565b2325a88196088d92"
|
|
46
46
|
}
|