@box/blueprint-web 8.1.1 → 8.2.0
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-esm/combobox/combobox.js +13 -6
- package/lib-esm/combobox/combobox.module.js +1 -1
- package/lib-esm/combobox/types.d.ts +8 -0
- package/lib-esm/combobox-group/combobox-group-combobox.d.ts +3 -0
- package/lib-esm/combobox-group/combobox-group-combobox.js +62 -0
- package/lib-esm/combobox-group/combobox-group-context.d.ts +24 -0
- package/lib-esm/combobox-group/combobox-group-context.js +50 -0
- package/lib-esm/combobox-group/combobox-group-select.d.ts +3 -0
- package/lib-esm/combobox-group/combobox-group-select.js +59 -0
- package/lib-esm/combobox-group/combobox-group.d.ts +7 -0
- package/lib-esm/combobox-group/combobox-group.js +61 -0
- package/lib-esm/combobox-group/combobox-group.module.js +4 -0
- package/lib-esm/combobox-group/index.d.ts +2 -0
- package/lib-esm/combobox-group/types.d.ts +22 -0
- package/lib-esm/index.css +283 -188
- package/lib-esm/index.d.ts +1 -0
- package/lib-esm/index.js +1 -0
- package/lib-esm/select/select.js +3 -2
- package/lib-esm/select/select.module.js +1 -1
- package/package.json +2 -2
|
@@ -9,11 +9,12 @@ import { LoadingIndicator } from '../loading-indicator/loading-indicator.js';
|
|
|
9
9
|
import { IconButton } from '../primitives/icon-button/icon-button.js';
|
|
10
10
|
import { InlineError } from '../primitives/inline-error/inline-error.js';
|
|
11
11
|
import { TextArea } from '../text-area/text-area.js';
|
|
12
|
+
import { useLabelable } from '../util-components/labelable/useLabelable.js';
|
|
13
|
+
import { composeEventHandlers } from '../utils/composeEventHandlers.js';
|
|
12
14
|
import { useForkRef } from '../utils/useForkRef.js';
|
|
13
15
|
import { useUniqueId } from '../utils/useUniqueId.js';
|
|
14
16
|
import { ChipsGroup } from './chips-group.js';
|
|
15
17
|
import styles from './combobox.module.js';
|
|
16
|
-
import { useLabelable } from '../util-components/labelable/useLabelable.js';
|
|
17
18
|
|
|
18
19
|
const getOptionValue = option => typeof option === 'string' ? option : option.value;
|
|
19
20
|
const getOptionFromValue = (value, options) => options.find(option => typeof option === 'string' ? option === value : option.value === value);
|
|
@@ -45,6 +46,7 @@ const RootInner = ({
|
|
|
45
46
|
open,
|
|
46
47
|
onOpenChange,
|
|
47
48
|
onFocus,
|
|
49
|
+
onBlur,
|
|
48
50
|
defaultInputValue = '',
|
|
49
51
|
inputValue: inputValueProp,
|
|
50
52
|
onInputValueChange,
|
|
@@ -70,11 +72,12 @@ const RootInner = ({
|
|
|
70
72
|
focusLoop,
|
|
71
73
|
clearButtonAriaLabel,
|
|
72
74
|
endComboboxIcon,
|
|
75
|
+
idForLabel,
|
|
73
76
|
...comboboxProps
|
|
74
77
|
} = rest;
|
|
75
78
|
const isInput = useMemo(() => as === 'input', [as]);
|
|
76
79
|
const inputRef = useRef(null);
|
|
77
|
-
const comboboxId = useUniqueId('combobox-');
|
|
80
|
+
const comboboxId = useUniqueId('combobox-', !idForLabel) || idForLabel || 'default-combobox-id';
|
|
78
81
|
const popoverRef = useRef(null);
|
|
79
82
|
const popoverRefCallback = useCallback(node => {
|
|
80
83
|
popoverRef.current = node;
|
|
@@ -277,13 +280,15 @@ const RootInner = ({
|
|
|
277
280
|
...comboboxProps,
|
|
278
281
|
ref: reference,
|
|
279
282
|
"aria-describedby": ariaDescribedBy,
|
|
280
|
-
|
|
283
|
+
...(hasError && {
|
|
284
|
+
'aria-invalid': 'true'
|
|
285
|
+
}),
|
|
281
286
|
"aria-required": required,
|
|
282
287
|
autoSelect: false,
|
|
283
288
|
className: styles.textInput,
|
|
284
289
|
disabled: disabled,
|
|
285
290
|
id: comboboxId,
|
|
286
|
-
onBlur: handleOnBlur,
|
|
291
|
+
onBlur: composeEventHandlers(onBlur, handleOnBlur),
|
|
287
292
|
onFocus: handleOnFocus,
|
|
288
293
|
onKeyDown: handleKeyDown,
|
|
289
294
|
required: required,
|
|
@@ -315,14 +320,16 @@ const RootInner = ({
|
|
|
315
320
|
id: comboboxId,
|
|
316
321
|
render: jsx(TextArea, {
|
|
317
322
|
ref: reference,
|
|
318
|
-
|
|
323
|
+
...(hasError && {
|
|
324
|
+
'aria-invalid': 'true'
|
|
325
|
+
}),
|
|
319
326
|
"aria-required": required,
|
|
320
327
|
className: styles.textInput,
|
|
321
328
|
disabled: disabled,
|
|
322
329
|
error: error,
|
|
323
330
|
hideLabel: hideLabel,
|
|
324
331
|
label: label,
|
|
325
|
-
onBlur: handleOnBlur,
|
|
332
|
+
onBlur: composeEventHandlers(onBlur, handleOnBlur),
|
|
326
333
|
onFocus: handleOnFocus,
|
|
327
334
|
onKeyDown: handleKeyDown,
|
|
328
335
|
required: required
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import '../index.css';
|
|
2
|
-
var styles = {"container":"bp_combobox_module_container--
|
|
2
|
+
var styles = {"container":"bp_combobox_module_container--4d653","disabled":"bp_combobox_module_disabled--4d653","label":"bp_combobox_module_label--4d653","hiddenLabel":"bp_combobox_module_hiddenLabel--4d653","comboboxContainer":"bp_combobox_module_comboboxContainer--4d653","withComboboxButtons":"bp_combobox_module_withComboboxButtons--4d653","error":"bp_combobox_module_error--4d653","textInputWrapper":"bp_combobox_module_textInputWrapper--4d653","textInput":"bp_combobox_module_textInput--4d653","errorIcon":"bp_combobox_module_errorIcon--4d653","comboboxButtons":"bp_combobox_module_comboboxButtons--4d653","withChips":"bp_combobox_module_withChips--4d653","inlineError":"bp_combobox_module_inlineError--4d653","popover":"bp_combobox_module_popover--4d653","option":"bp_combobox_module_option--4d653","indicator":"bp_combobox_module_indicator--4d653","indicatorIcon":"bp_combobox_module_indicatorIcon--4d653","optionWithIndicator":"bp_combobox_module_optionWithIndicator--4d653","loadingIndicator":"bp_combobox_module_loadingIndicator--4d653","noResultOption":"bp_combobox_module_noResultOption--4d653"};
|
|
3
3
|
|
|
4
4
|
export { styles as default };
|
|
@@ -185,6 +185,10 @@ export interface ComboboxBaseProps<Multiple extends boolean, FreeInput extends b
|
|
|
185
185
|
* Callback used when combobox input/textarea is focused
|
|
186
186
|
*/
|
|
187
187
|
onFocus?: (event: React.FocusEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
|
|
188
|
+
/**
|
|
189
|
+
* Callback used when combobox input/textarea loses focus
|
|
190
|
+
*/
|
|
191
|
+
onBlur?: (event: React.FocusEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
|
|
188
192
|
/**
|
|
189
193
|
* aria-label passed to the Combobox clear button. If not provided, the clear button is not shown.
|
|
190
194
|
*/
|
|
@@ -194,6 +198,10 @@ export interface ComboboxBaseProps<Multiple extends boolean, FreeInput extends b
|
|
|
194
198
|
* it disappears when the input is not empty
|
|
195
199
|
*/
|
|
196
200
|
endComboboxIcon?: React.ReactNode;
|
|
201
|
+
/**
|
|
202
|
+
* `idForLabel` is used in the Combobox Group to define the id of the subcomponent associated with the Combobox Group label.
|
|
203
|
+
*/
|
|
204
|
+
idForLabel?: string;
|
|
197
205
|
}
|
|
198
206
|
export type ComboboxTextArea = Pick<TextAreaProps, 'maxRows' | 'minRows' | 'maxLength' | 'aria-describedby'> & {
|
|
199
207
|
as: 'textarea';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { type ComboboxGroupComboboxProps } from './types';
|
|
3
|
+
export declare const ComboboxGroupCombobox: import("react").ForwardRefExoticComponent<ComboboxGroupComboboxProps<true, true, import("../combobox").OptionValue> & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import { forwardRef, useCallback, useEffect } from 'react';
|
|
4
|
+
import { Combobox } from '../combobox/combobox.js';
|
|
5
|
+
import { useComboboxGroupContext } from './combobox-group-context.js';
|
|
6
|
+
import styles from './combobox-group.module.js';
|
|
7
|
+
|
|
8
|
+
const ComboboxGroupCombobox = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
9
|
+
const {
|
|
10
|
+
position = 'leading',
|
|
11
|
+
error = false,
|
|
12
|
+
portalElement,
|
|
13
|
+
disabled,
|
|
14
|
+
...rest
|
|
15
|
+
} = props;
|
|
16
|
+
const {
|
|
17
|
+
errors,
|
|
18
|
+
setError,
|
|
19
|
+
inlineErrorId,
|
|
20
|
+
isDisabled,
|
|
21
|
+
isSelectFocused,
|
|
22
|
+
setComboboxFocus,
|
|
23
|
+
comboboxId,
|
|
24
|
+
setSubcomponentId
|
|
25
|
+
} = useComboboxGroupContext();
|
|
26
|
+
const borderStyles = position === 'trailing' ? styles.trailing : styles.leading;
|
|
27
|
+
const handleFocus = useCallback(() => setComboboxFocus(true), [setComboboxFocus]);
|
|
28
|
+
const handleBlur = useCallback(() => setComboboxFocus(false), [setComboboxFocus]);
|
|
29
|
+
const selectHasError = !!errors.select;
|
|
30
|
+
const comboboxHasError = !!errors.combobox;
|
|
31
|
+
const isLeading = position === 'leading';
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
if (isLeading) {
|
|
34
|
+
setSubcomponentId(comboboxId);
|
|
35
|
+
}
|
|
36
|
+
}, [isLeading, comboboxId, setSubcomponentId]);
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
setError('combobox', error);
|
|
39
|
+
}, [error, setError]);
|
|
40
|
+
return jsx(Combobox, {
|
|
41
|
+
as: "input",
|
|
42
|
+
...rest,
|
|
43
|
+
ref: forwardedRef,
|
|
44
|
+
"aria-describedby": comboboxHasError ? inlineErrorId : undefined,
|
|
45
|
+
"aria-invalid": comboboxHasError,
|
|
46
|
+
className: clsx(borderStyles, {
|
|
47
|
+
[styles.errorSelect]: selectHasError
|
|
48
|
+
}, {
|
|
49
|
+
[styles.errorCombobox]: comboboxHasError
|
|
50
|
+
}, {
|
|
51
|
+
[styles.selectHasFocus]: isSelectFocused
|
|
52
|
+
}),
|
|
53
|
+
disabled: isDisabled,
|
|
54
|
+
error: null,
|
|
55
|
+
idForLabel: comboboxId,
|
|
56
|
+
onBlur: handleBlur,
|
|
57
|
+
onFocus: handleFocus,
|
|
58
|
+
portalElement: portalElement
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
export { ComboboxGroupCombobox };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React, { type ReactNode } from 'react';
|
|
2
|
+
interface ComboboxGroupContextType {
|
|
3
|
+
errors: {
|
|
4
|
+
combobox?: boolean;
|
|
5
|
+
select?: boolean;
|
|
6
|
+
};
|
|
7
|
+
setError: (type: 'combobox' | 'select', error: boolean) => void;
|
|
8
|
+
inlineErrorId: string;
|
|
9
|
+
selectId: string;
|
|
10
|
+
comboboxId: string;
|
|
11
|
+
subcomponentId: string;
|
|
12
|
+
setSubcomponentId: (id: string) => void;
|
|
13
|
+
isDisabled: boolean;
|
|
14
|
+
isComboboxFocused: boolean;
|
|
15
|
+
setComboboxFocus: (focus: boolean) => void;
|
|
16
|
+
isSelectFocused: boolean;
|
|
17
|
+
setSelectFocus: (focus: boolean) => void;
|
|
18
|
+
}
|
|
19
|
+
export declare const ComboboxGroupProvider: React.FC<{
|
|
20
|
+
children: ReactNode;
|
|
21
|
+
isDisabled: boolean;
|
|
22
|
+
}>;
|
|
23
|
+
export declare const useComboboxGroupContext: () => ComboboxGroupContextType;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useState, useCallback, useMemo, createContext, useContext } from 'react';
|
|
3
|
+
import { useUniqueId } from '../utils/useUniqueId.js';
|
|
4
|
+
|
|
5
|
+
const ComboboxGroupContext = /*#__PURE__*/createContext(undefined);
|
|
6
|
+
const ComboboxGroupProvider = ({
|
|
7
|
+
children,
|
|
8
|
+
isDisabled
|
|
9
|
+
}) => {
|
|
10
|
+
const [errors, setErrors] = useState({});
|
|
11
|
+
const [isComboboxFocused, setComboboxFocus] = useState(false);
|
|
12
|
+
const [isSelectFocused, setSelectFocus] = useState(false);
|
|
13
|
+
const [subcomponentId, setSubcomponentId] = useState('');
|
|
14
|
+
const inlineErrorId = useUniqueId('inline-error-');
|
|
15
|
+
const selectId = useUniqueId('select-');
|
|
16
|
+
const comboboxId = useUniqueId('combobox-');
|
|
17
|
+
const setError = useCallback((type, hasError) => {
|
|
18
|
+
setErrors(prev => ({
|
|
19
|
+
...prev,
|
|
20
|
+
[type]: hasError
|
|
21
|
+
}));
|
|
22
|
+
}, []);
|
|
23
|
+
const contextValue = useMemo(() => ({
|
|
24
|
+
isDisabled,
|
|
25
|
+
errors,
|
|
26
|
+
setError,
|
|
27
|
+
inlineErrorId,
|
|
28
|
+
isComboboxFocused,
|
|
29
|
+
setComboboxFocus,
|
|
30
|
+
isSelectFocused,
|
|
31
|
+
setSelectFocus,
|
|
32
|
+
subcomponentId,
|
|
33
|
+
setSubcomponentId,
|
|
34
|
+
selectId,
|
|
35
|
+
comboboxId
|
|
36
|
+
}), [isDisabled, errors, setError, inlineErrorId, isComboboxFocused, setComboboxFocus, isSelectFocused, setSelectFocus, subcomponentId, setSubcomponentId, selectId, comboboxId]);
|
|
37
|
+
return jsx(ComboboxGroupContext.Provider, {
|
|
38
|
+
value: contextValue,
|
|
39
|
+
children: children
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
const useComboboxGroupContext = () => {
|
|
43
|
+
const context = useContext(ComboboxGroupContext);
|
|
44
|
+
if (!context) {
|
|
45
|
+
throw new Error('useComboboxGroupContext must be used within a component wrapped in ComboboxGroup.');
|
|
46
|
+
}
|
|
47
|
+
return context;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export { ComboboxGroupProvider, useComboboxGroupContext };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import { forwardRef, useCallback, useEffect } from 'react';
|
|
4
|
+
import { Select } from '../select/select.js';
|
|
5
|
+
import { useComboboxGroupContext } from './combobox-group-context.js';
|
|
6
|
+
import styles from './combobox-group.module.js';
|
|
7
|
+
|
|
8
|
+
const ComboboxGroupSelect = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
9
|
+
const {
|
|
10
|
+
position = 'trailing',
|
|
11
|
+
error = false,
|
|
12
|
+
disabled,
|
|
13
|
+
...rest
|
|
14
|
+
} = props;
|
|
15
|
+
const {
|
|
16
|
+
errors,
|
|
17
|
+
setError,
|
|
18
|
+
inlineErrorId,
|
|
19
|
+
isDisabled,
|
|
20
|
+
setSelectFocus,
|
|
21
|
+
isComboboxFocused,
|
|
22
|
+
setSubcomponentId,
|
|
23
|
+
selectId
|
|
24
|
+
} = useComboboxGroupContext();
|
|
25
|
+
const handleFocus = useCallback(() => setSelectFocus(true), [setSelectFocus]);
|
|
26
|
+
const handleBlur = useCallback(() => setSelectFocus(false), [setSelectFocus]);
|
|
27
|
+
const borderStyles = position === 'trailing' ? styles.trailing : styles.leading;
|
|
28
|
+
const selectHasError = !!errors.select;
|
|
29
|
+
const comboboxHasError = !!errors.combobox;
|
|
30
|
+
const isLeading = position === 'leading';
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
if (isLeading) {
|
|
33
|
+
setSubcomponentId(selectId);
|
|
34
|
+
}
|
|
35
|
+
}, [isLeading, selectId, setSubcomponentId]);
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
setError('select', error);
|
|
38
|
+
}, [error, setError]);
|
|
39
|
+
return jsx(Select, {
|
|
40
|
+
...rest,
|
|
41
|
+
ref: forwardedRef,
|
|
42
|
+
"aria-describedby": selectHasError ? inlineErrorId : undefined,
|
|
43
|
+
"aria-invalid": selectHasError,
|
|
44
|
+
className: clsx(borderStyles, {
|
|
45
|
+
[styles.errorSelect]: selectHasError
|
|
46
|
+
}, {
|
|
47
|
+
[styles.errorCombobox]: comboboxHasError
|
|
48
|
+
}, {
|
|
49
|
+
[styles.comboboxHasFocus]: isComboboxFocused
|
|
50
|
+
}),
|
|
51
|
+
disabled: isDisabled,
|
|
52
|
+
error: null,
|
|
53
|
+
id: selectId,
|
|
54
|
+
onBlur: handleBlur,
|
|
55
|
+
onFocus: handleFocus
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
export { ComboboxGroupSelect };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { type ComboboxGroupProps } from './types';
|
|
3
|
+
export declare const ComboboxGroup: {
|
|
4
|
+
({ children, disabled, ...props }: ComboboxGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
Combobox: import("react").ForwardRefExoticComponent<import("./types").ComboboxGroupComboboxProps<true, true, import("../combobox").OptionValue> & import("react").RefAttributes<HTMLInputElement>>;
|
|
6
|
+
Select: import("react").ForwardRefExoticComponent<import("./types").ComboboxGroupSelectProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
7
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import { forwardRef } from 'react';
|
|
4
|
+
import { InlineError } from '../primitives/inline-error/inline-error.js';
|
|
5
|
+
import { useLabelable } from '../util-components/labelable/useLabelable.js';
|
|
6
|
+
import { ComboboxGroupCombobox } from './combobox-group-combobox.js';
|
|
7
|
+
import { ComboboxGroupProvider, useComboboxGroupContext } from './combobox-group-context.js';
|
|
8
|
+
import { ComboboxGroupSelect } from './combobox-group-select.js';
|
|
9
|
+
import styles from './combobox-group.module.js';
|
|
10
|
+
|
|
11
|
+
const Root = /*#__PURE__*/forwardRef(({
|
|
12
|
+
children,
|
|
13
|
+
label,
|
|
14
|
+
errorMessage,
|
|
15
|
+
hideLabel,
|
|
16
|
+
...props
|
|
17
|
+
}, forwardedRef) => {
|
|
18
|
+
const {
|
|
19
|
+
errors,
|
|
20
|
+
inlineErrorId,
|
|
21
|
+
isDisabled,
|
|
22
|
+
subcomponentId
|
|
23
|
+
} = useComboboxGroupContext();
|
|
24
|
+
const selectHasError = !!errors.select;
|
|
25
|
+
const comboboxHasError = !!errors.combobox;
|
|
26
|
+
const Label = useLabelable(label, subcomponentId);
|
|
27
|
+
return jsxs("div", {
|
|
28
|
+
...props,
|
|
29
|
+
ref: forwardedRef,
|
|
30
|
+
className: clsx(styles.container, {
|
|
31
|
+
[styles.disabled]: isDisabled
|
|
32
|
+
}),
|
|
33
|
+
children: [jsx(Label, {
|
|
34
|
+
className: styles.label,
|
|
35
|
+
hideLabel: hideLabel
|
|
36
|
+
}), jsx("div", {
|
|
37
|
+
className: styles.comboboxGroupcontainer,
|
|
38
|
+
children: children
|
|
39
|
+
}), (comboboxHasError || selectHasError) && jsx(InlineError, {
|
|
40
|
+
id: inlineErrorId,
|
|
41
|
+
children: errorMessage
|
|
42
|
+
})]
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
const ComboboxGroup = ({
|
|
46
|
+
children,
|
|
47
|
+
disabled,
|
|
48
|
+
...props
|
|
49
|
+
}) => {
|
|
50
|
+
return jsx(ComboboxGroupProvider, {
|
|
51
|
+
isDisabled: !!disabled,
|
|
52
|
+
children: jsx(Root, {
|
|
53
|
+
...props,
|
|
54
|
+
children: children
|
|
55
|
+
})
|
|
56
|
+
});
|
|
57
|
+
};
|
|
58
|
+
ComboboxGroup.Combobox = ComboboxGroupCombobox;
|
|
59
|
+
ComboboxGroup.Select = ComboboxGroupSelect;
|
|
60
|
+
|
|
61
|
+
export { ComboboxGroup };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import '../index.css';
|
|
2
|
+
var styles = {"container":"bp_combobox_group_module_container--88b97","comboboxGroupcontainer":"bp_combobox_group_module_comboboxGroupcontainer--88b97","disabled":"bp_combobox_group_module_disabled--88b97","label":"bp_combobox_group_module_label--88b97","trailing":"bp_combobox_group_module_trailing--88b97","leading":"bp_combobox_group_module_leading--88b97","errorCombobox":"bp_combobox_group_module_errorCombobox--88b97","errorSelect":"bp_combobox_group_module_errorSelect--88b97","selectHasFocus":"bp_combobox_group_module_selectHasFocus--88b97","comboboxHasFocus":"bp_combobox_group_module_comboboxHasFocus--88b97"};
|
|
3
|
+
|
|
4
|
+
export { styles as default };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { type ComboboxBaseProps, type OptionValue } from '../combobox/types';
|
|
3
|
+
import { type SelectProps } from '../select/types';
|
|
4
|
+
export interface ComboboxGroupProps {
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
errorMessage?: string;
|
|
8
|
+
label: string;
|
|
9
|
+
hideLabel?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface ComboboxGroupSelectProps extends SelectProps {
|
|
12
|
+
disabled?: never;
|
|
13
|
+
error?: boolean;
|
|
14
|
+
label: never;
|
|
15
|
+
position?: 'leading' | 'trailing';
|
|
16
|
+
}
|
|
17
|
+
export interface ComboboxGroupComboboxProps<Multiple extends boolean = true, FreeInput extends boolean = true, T extends OptionValue = OptionValue> extends ComboboxBaseProps<Multiple, FreeInput, T> {
|
|
18
|
+
disabled?: never;
|
|
19
|
+
error?: boolean;
|
|
20
|
+
label: never;
|
|
21
|
+
position?: 'leading' | 'trailing';
|
|
22
|
+
}
|
package/lib-esm/index.css
CHANGED
|
@@ -1556,7 +1556,7 @@
|
|
|
1556
1556
|
max-width:100%;
|
|
1557
1557
|
}
|
|
1558
1558
|
|
|
1559
|
-
.bp_combobox_module_container--
|
|
1559
|
+
.bp_combobox_module_container--4d653{
|
|
1560
1560
|
display:flex;
|
|
1561
1561
|
flex-direction:column;
|
|
1562
1562
|
font-family:Lato, -apple-system, BlinkMacSystemFont, "San Francisco", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
|
|
@@ -1567,10 +1567,10 @@
|
|
|
1567
1567
|
text-decoration:none;
|
|
1568
1568
|
text-transform:none;
|
|
1569
1569
|
}
|
|
1570
|
-
.bp_combobox_module_container--
|
|
1570
|
+
.bp_combobox_module_container--4d653.bp_combobox_module_disabled--4d653{
|
|
1571
1571
|
opacity:60%;
|
|
1572
1572
|
}
|
|
1573
|
-
.bp_combobox_module_container--
|
|
1573
|
+
.bp_combobox_module_container--4d653 .bp_combobox_module_label--4d653{
|
|
1574
1574
|
color:var(--text-text-on-light);
|
|
1575
1575
|
flex:0 0 fit-content;
|
|
1576
1576
|
font-family:Lato, -apple-system, BlinkMacSystemFont, "San Francisco", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
|
|
@@ -1582,13 +1582,16 @@
|
|
|
1582
1582
|
text-decoration:none;
|
|
1583
1583
|
text-transform:none;
|
|
1584
1584
|
}
|
|
1585
|
-
.bp_combobox_module_container--
|
|
1585
|
+
.bp_combobox_module_container--4d653 .bp_combobox_module_label--4d653:not(.bp_combobox_module_hiddenLabel--4d653){
|
|
1586
1586
|
margin-block-end:var(--space-2);
|
|
1587
1587
|
}
|
|
1588
|
-
.bp_combobox_module_container--
|
|
1588
|
+
.bp_combobox_module_container--4d653 .bp_combobox_module_comboboxContainer--4d653{
|
|
1589
1589
|
background-color:var(--surface-dropdown-surface);
|
|
1590
|
-
border:var(--border-1) solid var(--border-input-border);
|
|
1590
|
+
border-bottom:var(--blueprint-combobox-border-bottom-width, var(--border-1)) solid var(--blueprint-combobox-border-color, var(--border-input-border));
|
|
1591
|
+
border-left:var(--blueprint-combobox-border-left-width, var(--border-1)) solid var(--blueprint-combobox-border-color, var(--border-input-border));
|
|
1591
1592
|
border-radius:var(--blueprint-combobox-input-radius, var(--radius-2));
|
|
1593
|
+
border-right:var(--blueprint-combobox-border-right-width, var(--border-1)) solid var(--blueprint-combobox-border-color, var(--border-input-border));
|
|
1594
|
+
border-top:var(--blueprint-combobox-border-top-width, var(--border-1)) solid var(--blueprint-combobox-border-color, var(--border-input-border));
|
|
1592
1595
|
box-shadow:var(--innershadow-1);
|
|
1593
1596
|
display:flex;
|
|
1594
1597
|
flex-wrap:wrap;
|
|
@@ -1598,25 +1601,29 @@
|
|
|
1598
1601
|
padding-inline:var(--space-3);
|
|
1599
1602
|
position:relative;
|
|
1600
1603
|
}
|
|
1601
|
-
.bp_combobox_module_container--
|
|
1604
|
+
.bp_combobox_module_container--4d653 .bp_combobox_module_comboboxContainer--4d653.bp_combobox_module_withComboboxButtons--4d653{
|
|
1602
1605
|
padding-inline-end:var(--space-10);
|
|
1603
1606
|
}
|
|
1604
|
-
.bp_combobox_module_container--
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
+
.bp_combobox_module_container--4d653 .bp_combobox_module_comboboxContainer--4d653:not(:disabled):has(input:focus),.bp_combobox_module_container--4d653 .bp_combobox_module_comboboxContainer--4d653:not(:disabled):has(input[data-focus-visible]:focus){
|
|
1608
|
+
background-color:var(--surface-dropdown-surface-focus);
|
|
1609
|
+
border:var(--border-2), solid, var(--outline-focus-on-light);
|
|
1610
|
+
padding-block:calc((2.5rem - var(--space-5))/2 - var(--border-2));
|
|
1607
1611
|
}
|
|
1608
|
-
.bp_combobox_module_container--
|
|
1612
|
+
.bp_combobox_module_container--4d653 .bp_combobox_module_comboboxContainer--4d653:not(:disabled).bp_combobox_module_error--4d653,.bp_combobox_module_container--4d653 .bp_combobox_module_comboboxContainer--4d653:not(:disabled):has([aria-invalid=true]){
|
|
1609
1613
|
background-color:var(--surface-dropdown-surface-error);
|
|
1610
|
-
border:var(--border-2) solid var(--border-input-border-error);
|
|
1614
|
+
border-bottom:var(--blueprint-combobox-border-error-bottom-width, var(--border-2)) solid var(--border-input-border-error);
|
|
1615
|
+
border-left:var(--blueprint-combobox-border-error-left-width, var(--border-2)) solid var(--border-input-border-error);
|
|
1616
|
+
border-right:var(--blueprint-combobox-border-error-right-width, var(--border-2)) solid var(--border-input-border-error);
|
|
1617
|
+
border-top:var(--blueprint-combobox-border-error-top-width, var(--border-2)) solid var(--border-input-border-error);
|
|
1611
1618
|
padding-block:calc((2.5rem - var(--space-5))/2 - var(--border-2));
|
|
1612
1619
|
}
|
|
1613
|
-
.bp_combobox_module_container--
|
|
1620
|
+
.bp_combobox_module_container--4d653 .bp_combobox_module_comboboxContainer--4d653 .bp_combobox_module_textInputWrapper--4d653{
|
|
1614
1621
|
align-items:center;
|
|
1615
1622
|
display:flex;
|
|
1616
1623
|
flex:content;
|
|
1617
1624
|
gap:var(--space-2);
|
|
1618
1625
|
}
|
|
1619
|
-
.bp_combobox_module_container--
|
|
1626
|
+
.bp_combobox_module_container--4d653 .bp_combobox_module_comboboxContainer--4d653 .bp_combobox_module_textInputWrapper--4d653 .bp_combobox_module_textInput--4d653{
|
|
1620
1627
|
background-color:initial;
|
|
1621
1628
|
border:none;
|
|
1622
1629
|
color:var(--text-text-on-light);
|
|
@@ -1632,28 +1639,28 @@
|
|
|
1632
1639
|
text-transform:none;
|
|
1633
1640
|
width:100%;
|
|
1634
1641
|
}
|
|
1635
|
-
.bp_combobox_module_container--
|
|
1642
|
+
.bp_combobox_module_container--4d653 .bp_combobox_module_comboboxContainer--4d653 .bp_combobox_module_textInputWrapper--4d653 .bp_combobox_module_errorIcon--4d653 path{
|
|
1636
1643
|
fill:var(--icon-icon-error-on-light);
|
|
1637
1644
|
}
|
|
1638
|
-
.bp_combobox_module_container--
|
|
1645
|
+
.bp_combobox_module_container--4d653 .bp_combobox_module_comboboxContainer--4d653 .bp_combobox_module_textInputWrapper--4d653 .bp_combobox_module_comboboxButtons--4d653{
|
|
1639
1646
|
align-items:center;
|
|
1640
1647
|
display:flex;
|
|
1641
1648
|
position:absolute;
|
|
1642
1649
|
right:var(--space-2);
|
|
1643
1650
|
top:var(--space-2);
|
|
1644
1651
|
}
|
|
1645
|
-
.bp_combobox_module_container--
|
|
1652
|
+
.bp_combobox_module_container--4d653 .bp_combobox_module_comboboxContainer--4d653.bp_combobox_module_withChips--4d653{
|
|
1646
1653
|
max-height:calc(var(--space-2)*2 + var(--space-6)*3);
|
|
1647
1654
|
padding-block:calc((2.5rem - var(--space-7))/2 - var(--border-1));
|
|
1648
1655
|
}
|
|
1649
|
-
.bp_combobox_module_container--
|
|
1656
|
+
.bp_combobox_module_container--4d653 .bp_combobox_module_comboboxContainer--4d653.bp_combobox_module_withChips--4d653:not(:disabled).bp_combobox_module_error--4d653{
|
|
1650
1657
|
padding-block:calc((2.5rem - var(--space-7))/2 - var(--border-2));
|
|
1651
1658
|
}
|
|
1652
|
-
.bp_combobox_module_container--
|
|
1659
|
+
.bp_combobox_module_container--4d653 .bp_combobox_module_inlineError--4d653{
|
|
1653
1660
|
margin-block-start:var(--space-2);
|
|
1654
1661
|
}
|
|
1655
1662
|
|
|
1656
|
-
.bp_combobox_module_popover--
|
|
1663
|
+
.bp_combobox_module_popover--4d653{
|
|
1657
1664
|
background-color:var(--surface-menu-surface);
|
|
1658
1665
|
border:var(--border-1) solid var(--border-card-border);
|
|
1659
1666
|
border-radius:var(--radius-3);
|
|
@@ -1671,7 +1678,7 @@
|
|
|
1671
1678
|
text-transform:none;
|
|
1672
1679
|
z-index:380;
|
|
1673
1680
|
}
|
|
1674
|
-
.bp_combobox_module_popover--
|
|
1681
|
+
.bp_combobox_module_popover--4d653 .bp_combobox_module_option--4d653{
|
|
1675
1682
|
border:var(--border-2) solid #0000;
|
|
1676
1683
|
border-radius:var(--radius-3);
|
|
1677
1684
|
box-sizing:border-box;
|
|
@@ -1685,17 +1692,17 @@
|
|
|
1685
1692
|
user-select:none;
|
|
1686
1693
|
width:100%;
|
|
1687
1694
|
}
|
|
1688
|
-
.bp_combobox_module_popover--
|
|
1695
|
+
.bp_combobox_module_popover--4d653 .bp_combobox_module_option--4d653[aria-disabled]{
|
|
1689
1696
|
opacity:60%;
|
|
1690
1697
|
}
|
|
1691
|
-
.bp_combobox_module_popover--
|
|
1698
|
+
.bp_combobox_module_popover--4d653 .bp_combobox_module_option--4d653[data-active-item]:not([aria-disabled]){
|
|
1692
1699
|
background-color:var(--surface-menu-surface-focus);
|
|
1693
1700
|
border:var(--border-2) solid var(--outline-focus-on-light);
|
|
1694
1701
|
}
|
|
1695
|
-
.bp_combobox_module_popover--
|
|
1702
|
+
.bp_combobox_module_popover--4d653 .bp_combobox_module_option--4d653:hover{
|
|
1696
1703
|
background-color:var(--surface-menu-surface-hover);
|
|
1697
1704
|
}
|
|
1698
|
-
.bp_combobox_module_popover--
|
|
1705
|
+
.bp_combobox_module_popover--4d653 .bp_combobox_module_option--4d653 .bp_combobox_module_indicator--4d653{
|
|
1699
1706
|
align-items:center;
|
|
1700
1707
|
display:flex;
|
|
1701
1708
|
height:var(--size-9);
|
|
@@ -1704,21 +1711,268 @@
|
|
|
1704
1711
|
position:absolute;
|
|
1705
1712
|
top:0;
|
|
1706
1713
|
}
|
|
1707
|
-
.bp_combobox_module_popover--
|
|
1714
|
+
.bp_combobox_module_popover--4d653 .bp_combobox_module_option--4d653 .bp_combobox_module_indicator--4d653 .bp_combobox_module_indicatorIcon--4d653 path{
|
|
1708
1715
|
fill:var(--icon-icon-on-light);
|
|
1709
1716
|
}
|
|
1710
|
-
.bp_combobox_module_popover--
|
|
1717
|
+
.bp_combobox_module_popover--4d653 .bp_combobox_module_optionWithIndicator--4d653{
|
|
1711
1718
|
padding-inline:var(--space-10) var(--space-2);
|
|
1712
1719
|
}
|
|
1713
|
-
.bp_combobox_module_popover--
|
|
1720
|
+
.bp_combobox_module_popover--4d653 .bp_combobox_module_loadingIndicator--4d653{
|
|
1714
1721
|
position:unset;
|
|
1715
1722
|
}
|
|
1716
|
-
.bp_combobox_module_popover--
|
|
1723
|
+
.bp_combobox_module_popover--4d653 .bp_combobox_module_noResultOption--4d653{
|
|
1717
1724
|
color:var(--text-text-on-light);
|
|
1718
1725
|
-webkit-user-select:none;
|
|
1719
1726
|
user-select:none;
|
|
1720
1727
|
}
|
|
1721
1728
|
|
|
1729
|
+
.bp_combobox_group_module_container--88b97{
|
|
1730
|
+
align-items:flex-start;
|
|
1731
|
+
display:flex;
|
|
1732
|
+
flex-direction:column;
|
|
1733
|
+
gap:var(--space-2);
|
|
1734
|
+
max-width:358px;
|
|
1735
|
+
}
|
|
1736
|
+
|
|
1737
|
+
.bp_combobox_group_module_comboboxGroupcontainer--88b97{
|
|
1738
|
+
display:flex;
|
|
1739
|
+
flex-direction:row;
|
|
1740
|
+
}
|
|
1741
|
+
|
|
1742
|
+
.bp_combobox_group_module_disabled--88b97{
|
|
1743
|
+
opacity:60%;
|
|
1744
|
+
pointer-events:none;
|
|
1745
|
+
}
|
|
1746
|
+
|
|
1747
|
+
.bp_combobox_group_module_label--88b97{
|
|
1748
|
+
color:var(--text-text-on-light);
|
|
1749
|
+
flex:0 0 fit-content;
|
|
1750
|
+
font-family:Lato, -apple-system, BlinkMacSystemFont, "San Francisco", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
|
|
1751
|
+
font-size:.875rem;
|
|
1752
|
+
font-weight:700;
|
|
1753
|
+
letter-spacing:.01875rem;
|
|
1754
|
+
line-height:1.25rem;
|
|
1755
|
+
overflow-wrap:break-word;
|
|
1756
|
+
text-decoration:none;
|
|
1757
|
+
text-transform:none;
|
|
1758
|
+
}
|
|
1759
|
+
|
|
1760
|
+
.bp_combobox_group_module_trailing--88b97{
|
|
1761
|
+
--blueprint-combobox-input-radius:0 var(--radius-2) var(--radius-2) 0;
|
|
1762
|
+
--blueprint-select-trigger-radius:0 var(--radius-2) var(--radius-2) 0;
|
|
1763
|
+
--blueprint-combobox-border-left-width:none;
|
|
1764
|
+
--blueprint-select-border-left-width:none;
|
|
1765
|
+
}
|
|
1766
|
+
|
|
1767
|
+
.bp_combobox_group_module_leading--88b97{
|
|
1768
|
+
--blueprint-combobox-input-radius:var(--radius-2) 0 0 var(--radius-2);
|
|
1769
|
+
--blueprint-select-trigger-radius:var(--radius-2) 0 0 var(--radius-2);
|
|
1770
|
+
}
|
|
1771
|
+
|
|
1772
|
+
.bp_combobox_group_module_errorCombobox--88b97.bp_combobox_group_module_leading--88b97{
|
|
1773
|
+
--blueprint-select-border-right-width:none;
|
|
1774
|
+
}
|
|
1775
|
+
|
|
1776
|
+
.bp_combobox_group_module_errorSelect--88b97.bp_combobox_group_module_leading--88b97{
|
|
1777
|
+
--blueprint-combobox-border-right-width:none;
|
|
1778
|
+
}
|
|
1779
|
+
|
|
1780
|
+
.bp_combobox_group_module_errorCombobox--88b97.bp_combobox_group_module_errorSelect--88b97.bp_combobox_group_module_trailing--88b97{
|
|
1781
|
+
--blueprint-select-border-error-left-width:none;
|
|
1782
|
+
}
|
|
1783
|
+
|
|
1784
|
+
.bp_combobox_group_module_errorCombobox--88b97.bp_combobox_group_module_errorSelect--88b97.bp_combobox_group_module_leading--88b97{
|
|
1785
|
+
--blueprint-select-border-error-right-width:none;
|
|
1786
|
+
}
|
|
1787
|
+
|
|
1788
|
+
.bp_combobox_group_module_selectHasFocus--88b97.bp_combobox_group_module_leading--88b97{
|
|
1789
|
+
--blueprint-combobox-border-right-width:none;
|
|
1790
|
+
}
|
|
1791
|
+
|
|
1792
|
+
.bp_combobox_group_module_selectHasFocus--88b97.bp_combobox_group_module_errorCombobox--88b97.bp_combobox_group_module_leading--88b97{
|
|
1793
|
+
--blueprint-combobox-border-error-right-width:none;
|
|
1794
|
+
}
|
|
1795
|
+
|
|
1796
|
+
.bp_combobox_group_module_selectHasFocus--88b97.bp_combobox_group_module_errorCombobox--88b97.bp_combobox_group_module_trailing--88b97{
|
|
1797
|
+
--blueprint-combobox-border-error-left-width:none;
|
|
1798
|
+
}
|
|
1799
|
+
|
|
1800
|
+
.bp_combobox_group_module_comboboxHasFocus--88b97.bp_combobox_group_module_leading--88b97{
|
|
1801
|
+
--blueprint-select-border-right-width:none;
|
|
1802
|
+
}
|
|
1803
|
+
|
|
1804
|
+
.bp_combobox_group_module_comboboxHasFocus--88b97.bp_combobox_group_module_errorSelect--88b97.bp_combobox_group_module_leading--88b97{
|
|
1805
|
+
--blueprint-select-border-error-right-width:none;
|
|
1806
|
+
}
|
|
1807
|
+
|
|
1808
|
+
.bp_combobox_group_module_comboboxHasFocus--88b97.bp_combobox_group_module_errorSelect--88b97.bp_combobox_group_module_trailing--88b97{
|
|
1809
|
+
--blueprint-select-border-error-left-width:none;
|
|
1810
|
+
}
|
|
1811
|
+
|
|
1812
|
+
.bp_select_module_container--ec76a{
|
|
1813
|
+
display:flex;
|
|
1814
|
+
flex-direction:column;
|
|
1815
|
+
font-family:Lato, -apple-system, BlinkMacSystemFont, "San Francisco", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
|
|
1816
|
+
font-size:.875rem;
|
|
1817
|
+
font-weight:400;
|
|
1818
|
+
gap:var(--space-2);
|
|
1819
|
+
letter-spacing:.01875rem;
|
|
1820
|
+
line-height:1.25rem;
|
|
1821
|
+
text-decoration:none;
|
|
1822
|
+
text-transform:none;
|
|
1823
|
+
}
|
|
1824
|
+
.bp_select_module_container--ec76a.bp_select_module_disabled--ec76a{
|
|
1825
|
+
opacity:60%;
|
|
1826
|
+
}
|
|
1827
|
+
.bp_select_module_container--ec76a .bp_select_module_label--ec76a{
|
|
1828
|
+
flex:0 0 fit-content;
|
|
1829
|
+
font-weight:700;
|
|
1830
|
+
overflow-wrap:break-word;
|
|
1831
|
+
}
|
|
1832
|
+
.bp_select_module_container--ec76a .bp_select_module_label--ec76a,.bp_select_module_container--ec76a .bp_select_module_triggerBtn--ec76a{
|
|
1833
|
+
color:var(--text-text-on-light);
|
|
1834
|
+
font-family:Lato, -apple-system, BlinkMacSystemFont, "San Francisco", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
|
|
1835
|
+
font-size:.875rem;
|
|
1836
|
+
letter-spacing:.01875rem;
|
|
1837
|
+
line-height:1.25rem;
|
|
1838
|
+
text-decoration:none;
|
|
1839
|
+
text-transform:none;
|
|
1840
|
+
}
|
|
1841
|
+
.bp_select_module_container--ec76a .bp_select_module_triggerBtn--ec76a{
|
|
1842
|
+
align-items:center;
|
|
1843
|
+
background-color:var(--surface-dropdown-surface);
|
|
1844
|
+
border-bottom:var(--blueprint-select-border-bottom-width, var(--border-1)) solid var(--border-dropdown-border);
|
|
1845
|
+
border-left:var(--blueprint-select-border-left-width, var(--border-1)) solid var(--border-dropdown-border);
|
|
1846
|
+
border-radius:var(--blueprint-select-trigger-radius, var(--radius-2));
|
|
1847
|
+
border-right:var(--blueprint-select-border-right-width, var(--border-1)) solid var(--border-dropdown-border);
|
|
1848
|
+
border-top:var(--blueprint-select-border-top-width, var(--border-1)) solid var(--border-dropdown-border);
|
|
1849
|
+
box-shadow:var(--dropshadow-2);
|
|
1850
|
+
cursor:pointer;
|
|
1851
|
+
display:flex;
|
|
1852
|
+
font-weight:400;
|
|
1853
|
+
gap:var(--space-2);
|
|
1854
|
+
height:var(--size-10);
|
|
1855
|
+
justify-content:space-between;
|
|
1856
|
+
outline:none;
|
|
1857
|
+
padding-block:0;
|
|
1858
|
+
padding-inline:var(--space-3);
|
|
1859
|
+
text-align:start;
|
|
1860
|
+
width:100%;
|
|
1861
|
+
}
|
|
1862
|
+
.bp_select_module_container--ec76a .bp_select_module_triggerBtn--ec76a span:first-child{
|
|
1863
|
+
overflow:hidden;
|
|
1864
|
+
text-overflow:ellipsis;
|
|
1865
|
+
white-space:nowrap;
|
|
1866
|
+
}
|
|
1867
|
+
.bp_select_module_container--ec76a .bp_select_module_triggerBtn--ec76a:disabled{
|
|
1868
|
+
cursor:default;
|
|
1869
|
+
}
|
|
1870
|
+
.bp_select_module_container--ec76a .bp_select_module_triggerBtn--ec76a:not(:disabled).bp_select_module_error--ec76a,.bp_select_module_container--ec76a .bp_select_module_triggerBtn--ec76a:not(:disabled)[aria-invalid=true]{
|
|
1871
|
+
background-color:var(--surface-dropdown-surface-error);
|
|
1872
|
+
border-bottom:var(--blueprint-select-border-error-bottom-width, var(--border-2)) solid var(--border-dropdown-border-error);
|
|
1873
|
+
border-left:var(--blueprint-select-border-error-left-width, var(--border-2)) solid var(--border-dropdown-border-error);
|
|
1874
|
+
border-right:var(--blueprint-select-border-error-right-width, var(--border-2)) solid var(--border-dropdown-border-error);
|
|
1875
|
+
border-top:var(--blueprint-select-border-error-top-width, var(--border-2)) solid var(--border-dropdown-border-error);
|
|
1876
|
+
}
|
|
1877
|
+
.bp_select_module_container--ec76a .bp_select_module_triggerBtn--ec76a:focus,.bp_select_module_container--ec76a .bp_select_module_triggerBtn--ec76a:not(:disabled).bp_select_module_error--ec76a:focus,.bp_select_module_container--ec76a .bp_select_module_triggerBtn--ec76a:not(:disabled)[aria-invalid=true]:focus{
|
|
1878
|
+
background-color:var(--surface-dropdown-surface-focus);
|
|
1879
|
+
border:var(--border-2), solid, var(--outline-focus-on-light);
|
|
1880
|
+
}
|
|
1881
|
+
.bp_select_module_container--ec76a .bp_select_module_triggerBtn--ec76a:not(:disabled):not(:focus):not(.bp_select_module_error--ec76a):not([aria-invalid]):hover{
|
|
1882
|
+
background-color:var(--surface-dropdown-surface-hover);
|
|
1883
|
+
border-color:var(--border-dropdown-border-hover);
|
|
1884
|
+
}
|
|
1885
|
+
.bp_select_module_container--ec76a .bp_select_module_triggerBtn--ec76a .bp_select_module_iconWrapper--ec76a{
|
|
1886
|
+
flex-shrink:0;
|
|
1887
|
+
-webkit-user-select:none;
|
|
1888
|
+
user-select:none;
|
|
1889
|
+
}
|
|
1890
|
+
.bp_select_module_container--ec76a .bp_select_module_triggerBtn--ec76a .bp_select_module_icon--ec76a{
|
|
1891
|
+
display:block;
|
|
1892
|
+
height:var(--size-2);
|
|
1893
|
+
width:var(--size-2);
|
|
1894
|
+
}
|
|
1895
|
+
.bp_select_module_container--ec76a .bp_select_module_triggerBtn--ec76a .bp_select_module_icon--ec76a path{
|
|
1896
|
+
fill:var(--icon-icon-on-light);
|
|
1897
|
+
}
|
|
1898
|
+
.bp_select_module_container--ec76a .bp_select_module_triggerBtn--ec76a[data-state=open] .bp_select_module_icon--ec76a{
|
|
1899
|
+
transform:rotate(180deg);
|
|
1900
|
+
}
|
|
1901
|
+
|
|
1902
|
+
.bp_select_module_content--ec76a{
|
|
1903
|
+
background-color:var(--surface-menu-surface);
|
|
1904
|
+
border:var(--border-1) solid var(--border-card-border);
|
|
1905
|
+
border-radius:var(--radius-3);
|
|
1906
|
+
box-shadow:var(--dropshadow-3);
|
|
1907
|
+
font-family:Lato, -apple-system, BlinkMacSystemFont, "San Francisco", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
|
|
1908
|
+
font-size:.875rem;
|
|
1909
|
+
font-weight:400;
|
|
1910
|
+
letter-spacing:.01875rem;
|
|
1911
|
+
line-height:1.25rem;
|
|
1912
|
+
max-height:var(--blueprint-select-content-max-height, var(--radix-select-content-available-height));
|
|
1913
|
+
max-width:min(var(--blueprint-select-content-max-width, 50vw), var(--radix-select-content-available-width));
|
|
1914
|
+
min-width:var(--blueprint-select-content-min-width, var(--radix-select-trigger-width));
|
|
1915
|
+
overflow:auto;
|
|
1916
|
+
text-decoration:none;
|
|
1917
|
+
text-transform:none;
|
|
1918
|
+
z-index:380;
|
|
1919
|
+
}
|
|
1920
|
+
.bp_select_module_content--ec76a .bp_select_module_viewport--ec76a{
|
|
1921
|
+
padding-block:var(--space-3);
|
|
1922
|
+
padding-inline:var(--space-3);
|
|
1923
|
+
}
|
|
1924
|
+
.bp_select_module_content--ec76a .bp_select_module_viewport--ec76a .bp_select_module_option--ec76a{
|
|
1925
|
+
border:var(--border-2) solid #0000;
|
|
1926
|
+
border-radius:var(--radius-3);
|
|
1927
|
+
cursor:pointer;
|
|
1928
|
+
display:flex;
|
|
1929
|
+
flex-wrap:wrap;
|
|
1930
|
+
gap:var(--space-2);
|
|
1931
|
+
justify-content:space-between;
|
|
1932
|
+
outline:none;
|
|
1933
|
+
padding-block:var(--space-2);
|
|
1934
|
+
padding-inline:var(--space-10) var(--space-2);
|
|
1935
|
+
position:relative;
|
|
1936
|
+
-webkit-user-select:none;
|
|
1937
|
+
user-select:none;
|
|
1938
|
+
}
|
|
1939
|
+
.bp_select_module_content--ec76a .bp_select_module_viewport--ec76a .bp_select_module_option--ec76a[data-disabled]{
|
|
1940
|
+
opacity:60%;
|
|
1941
|
+
pointer-events:none;
|
|
1942
|
+
}
|
|
1943
|
+
.bp_select_module_content--ec76a .bp_select_module_viewport--ec76a .bp_select_module_option--ec76a[data-highlighted]{
|
|
1944
|
+
background-color:var(--surface-menu-surface-focus);
|
|
1945
|
+
border:var(--border-2) solid var(--outline-focus-on-light);
|
|
1946
|
+
}
|
|
1947
|
+
.bp_select_module_content--ec76a .bp_select_module_viewport--ec76a .bp_select_module_option--ec76a:hover{
|
|
1948
|
+
background-color:var(--surface-menu-surface-hover);
|
|
1949
|
+
}
|
|
1950
|
+
.bp_select_module_content--ec76a .bp_select_module_viewport--ec76a .bp_select_module_option--ec76a span:first-child{
|
|
1951
|
+
overflow:hidden;
|
|
1952
|
+
overflow-wrap:break-word;
|
|
1953
|
+
}
|
|
1954
|
+
.bp_select_module_content--ec76a .bp_select_module_viewport--ec76a .bp_select_module_option--ec76a .bp_select_module_secondaryText--ec76a{
|
|
1955
|
+
color:var(--text-text-on-light-secondary);
|
|
1956
|
+
}
|
|
1957
|
+
.bp_select_module_content--ec76a .bp_select_module_viewport--ec76a .bp_select_module_option--ec76a .bp_select_module_indicator--ec76a{
|
|
1958
|
+
align-items:center;
|
|
1959
|
+
display:flex;
|
|
1960
|
+
height:var(--size-9);
|
|
1961
|
+
justify-content:center;
|
|
1962
|
+
left:var(--space-2);
|
|
1963
|
+
position:absolute;
|
|
1964
|
+
top:0;
|
|
1965
|
+
}
|
|
1966
|
+
.bp_select_module_content--ec76a .bp_select_module_viewport--ec76a .bp_select_module_option--ec76a .bp_select_module_indicator--ec76a path{
|
|
1967
|
+
fill:var(--icon-icon-on-light);
|
|
1968
|
+
}
|
|
1969
|
+
.bp_select_module_content--ec76a .bp_select_module_viewport--ec76a .bp_select_module_separator--ec76a{
|
|
1970
|
+
background-color:var(--border-divider-border);
|
|
1971
|
+
flex-shrink:0;
|
|
1972
|
+
height:var(--border-1);
|
|
1973
|
+
margin-block:var(--space-2);
|
|
1974
|
+
}
|
|
1975
|
+
|
|
1722
1976
|
.bp_content_card_module_card--e2f08{
|
|
1723
1977
|
background-color:var(--surface-surface);
|
|
1724
1978
|
border:var(--border-1) solid var(--border-card-border);
|
|
@@ -4997,165 +5251,6 @@ table.bp_inline_table_module_inlineTable--b023b tr:not(:last-child) td{
|
|
|
4997
5251
|
transform:translateY(-50%);
|
|
4998
5252
|
}
|
|
4999
5253
|
|
|
5000
|
-
.bp_select_module_container--56f5c{
|
|
5001
|
-
display:flex;
|
|
5002
|
-
flex-direction:column;
|
|
5003
|
-
font-family:Lato, -apple-system, BlinkMacSystemFont, "San Francisco", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
|
|
5004
|
-
font-size:.875rem;
|
|
5005
|
-
font-weight:400;
|
|
5006
|
-
gap:var(--space-2);
|
|
5007
|
-
letter-spacing:.01875rem;
|
|
5008
|
-
line-height:1.25rem;
|
|
5009
|
-
text-decoration:none;
|
|
5010
|
-
text-transform:none;
|
|
5011
|
-
}
|
|
5012
|
-
.bp_select_module_container--56f5c.bp_select_module_disabled--56f5c{
|
|
5013
|
-
opacity:60%;
|
|
5014
|
-
}
|
|
5015
|
-
.bp_select_module_container--56f5c .bp_select_module_label--56f5c{
|
|
5016
|
-
flex:0 0 fit-content;
|
|
5017
|
-
font-weight:700;
|
|
5018
|
-
overflow-wrap:break-word;
|
|
5019
|
-
}
|
|
5020
|
-
.bp_select_module_container--56f5c .bp_select_module_label--56f5c,.bp_select_module_container--56f5c .bp_select_module_triggerBtn--56f5c{
|
|
5021
|
-
color:var(--text-text-on-light);
|
|
5022
|
-
font-family:Lato, -apple-system, BlinkMacSystemFont, "San Francisco", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
|
|
5023
|
-
font-size:.875rem;
|
|
5024
|
-
letter-spacing:.01875rem;
|
|
5025
|
-
line-height:1.25rem;
|
|
5026
|
-
text-decoration:none;
|
|
5027
|
-
text-transform:none;
|
|
5028
|
-
}
|
|
5029
|
-
.bp_select_module_container--56f5c .bp_select_module_triggerBtn--56f5c{
|
|
5030
|
-
align-items:center;
|
|
5031
|
-
background-color:var(--surface-dropdown-surface);
|
|
5032
|
-
border:var(--border-1) solid var(--border-dropdown-border);
|
|
5033
|
-
border-radius:var(--blueprint-select-trigger-radius, var(--radius-2));
|
|
5034
|
-
box-shadow:var(--dropshadow-2);
|
|
5035
|
-
cursor:pointer;
|
|
5036
|
-
display:flex;
|
|
5037
|
-
font-weight:400;
|
|
5038
|
-
gap:var(--space-2);
|
|
5039
|
-
height:var(--size-10);
|
|
5040
|
-
justify-content:space-between;
|
|
5041
|
-
outline:none;
|
|
5042
|
-
padding-block:0;
|
|
5043
|
-
padding-inline:var(--space-3);
|
|
5044
|
-
text-align:start;
|
|
5045
|
-
width:100%;
|
|
5046
|
-
}
|
|
5047
|
-
.bp_select_module_container--56f5c .bp_select_module_triggerBtn--56f5c span:first-child{
|
|
5048
|
-
overflow:hidden;
|
|
5049
|
-
text-overflow:ellipsis;
|
|
5050
|
-
white-space:nowrap;
|
|
5051
|
-
}
|
|
5052
|
-
.bp_select_module_container--56f5c .bp_select_module_triggerBtn--56f5c:disabled{
|
|
5053
|
-
cursor:default;
|
|
5054
|
-
}
|
|
5055
|
-
.bp_select_module_container--56f5c .bp_select_module_triggerBtn--56f5c:not(.bp_select_module_error--56f5c):focus{
|
|
5056
|
-
background-color:var(--surface-dropdown-surface-focus);
|
|
5057
|
-
border-color:#0000;
|
|
5058
|
-
box-shadow:0 0 0 var(--border-2) var(--outline-focus-on-light);
|
|
5059
|
-
}
|
|
5060
|
-
.bp_select_module_container--56f5c .bp_select_module_triggerBtn--56f5c:not(:disabled):not(:focus):not(.bp_select_module_error--56f5c):hover{
|
|
5061
|
-
background-color:var(--surface-dropdown-surface-hover);
|
|
5062
|
-
border-color:var(--border-dropdown-border-hover);
|
|
5063
|
-
}
|
|
5064
|
-
.bp_select_module_container--56f5c .bp_select_module_triggerBtn--56f5c:not(:disabled).bp_select_module_error--56f5c{
|
|
5065
|
-
background-color:var(--surface-dropdown-surface-error);
|
|
5066
|
-
border:var(--border-2) solid var(--border-dropdown-border-error);
|
|
5067
|
-
}
|
|
5068
|
-
.bp_select_module_container--56f5c .bp_select_module_triggerBtn--56f5c .bp_select_module_iconWrapper--56f5c{
|
|
5069
|
-
flex-shrink:0;
|
|
5070
|
-
-webkit-user-select:none;
|
|
5071
|
-
user-select:none;
|
|
5072
|
-
}
|
|
5073
|
-
.bp_select_module_container--56f5c .bp_select_module_triggerBtn--56f5c .bp_select_module_icon--56f5c{
|
|
5074
|
-
display:block;
|
|
5075
|
-
height:var(--size-2);
|
|
5076
|
-
width:var(--size-2);
|
|
5077
|
-
}
|
|
5078
|
-
.bp_select_module_container--56f5c .bp_select_module_triggerBtn--56f5c .bp_select_module_icon--56f5c path{
|
|
5079
|
-
fill:var(--icon-icon-on-light);
|
|
5080
|
-
}
|
|
5081
|
-
.bp_select_module_container--56f5c .bp_select_module_triggerBtn--56f5c[data-state=open] .bp_select_module_icon--56f5c{
|
|
5082
|
-
transform:rotate(180deg);
|
|
5083
|
-
}
|
|
5084
|
-
|
|
5085
|
-
.bp_select_module_content--56f5c{
|
|
5086
|
-
background-color:var(--surface-menu-surface);
|
|
5087
|
-
border:var(--border-1) solid var(--border-card-border);
|
|
5088
|
-
border-radius:var(--radius-3);
|
|
5089
|
-
box-shadow:var(--dropshadow-3);
|
|
5090
|
-
font-family:Lato, -apple-system, BlinkMacSystemFont, "San Francisco", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
|
|
5091
|
-
font-size:.875rem;
|
|
5092
|
-
font-weight:400;
|
|
5093
|
-
letter-spacing:.01875rem;
|
|
5094
|
-
line-height:1.25rem;
|
|
5095
|
-
max-height:var(--blueprint-select-content-max-height, var(--radix-select-content-available-height));
|
|
5096
|
-
max-width:min(var(--blueprint-select-content-max-width, 50vw), var(--radix-select-content-available-width));
|
|
5097
|
-
min-width:var(--blueprint-select-content-min-width, var(--radix-select-trigger-width));
|
|
5098
|
-
overflow:auto;
|
|
5099
|
-
text-decoration:none;
|
|
5100
|
-
text-transform:none;
|
|
5101
|
-
z-index:380;
|
|
5102
|
-
}
|
|
5103
|
-
.bp_select_module_content--56f5c .bp_select_module_viewport--56f5c{
|
|
5104
|
-
padding-block:var(--space-3);
|
|
5105
|
-
padding-inline:var(--space-3);
|
|
5106
|
-
}
|
|
5107
|
-
.bp_select_module_content--56f5c .bp_select_module_viewport--56f5c .bp_select_module_option--56f5c{
|
|
5108
|
-
border:var(--border-2) solid #0000;
|
|
5109
|
-
border-radius:var(--radius-3);
|
|
5110
|
-
cursor:pointer;
|
|
5111
|
-
display:flex;
|
|
5112
|
-
flex-wrap:wrap;
|
|
5113
|
-
gap:var(--space-2);
|
|
5114
|
-
justify-content:space-between;
|
|
5115
|
-
outline:none;
|
|
5116
|
-
padding-block:var(--space-2);
|
|
5117
|
-
padding-inline:var(--space-10) var(--space-2);
|
|
5118
|
-
position:relative;
|
|
5119
|
-
-webkit-user-select:none;
|
|
5120
|
-
user-select:none;
|
|
5121
|
-
}
|
|
5122
|
-
.bp_select_module_content--56f5c .bp_select_module_viewport--56f5c .bp_select_module_option--56f5c[data-disabled]{
|
|
5123
|
-
opacity:60%;
|
|
5124
|
-
pointer-events:none;
|
|
5125
|
-
}
|
|
5126
|
-
.bp_select_module_content--56f5c .bp_select_module_viewport--56f5c .bp_select_module_option--56f5c[data-highlighted]{
|
|
5127
|
-
background-color:var(--surface-menu-surface-focus);
|
|
5128
|
-
border:var(--border-2) solid var(--outline-focus-on-light);
|
|
5129
|
-
}
|
|
5130
|
-
.bp_select_module_content--56f5c .bp_select_module_viewport--56f5c .bp_select_module_option--56f5c:hover{
|
|
5131
|
-
background-color:var(--surface-menu-surface-hover);
|
|
5132
|
-
}
|
|
5133
|
-
.bp_select_module_content--56f5c .bp_select_module_viewport--56f5c .bp_select_module_option--56f5c span:first-child{
|
|
5134
|
-
overflow:hidden;
|
|
5135
|
-
overflow-wrap:break-word;
|
|
5136
|
-
}
|
|
5137
|
-
.bp_select_module_content--56f5c .bp_select_module_viewport--56f5c .bp_select_module_option--56f5c .bp_select_module_secondaryText--56f5c{
|
|
5138
|
-
color:var(--text-text-on-light-secondary);
|
|
5139
|
-
}
|
|
5140
|
-
.bp_select_module_content--56f5c .bp_select_module_viewport--56f5c .bp_select_module_option--56f5c .bp_select_module_indicator--56f5c{
|
|
5141
|
-
align-items:center;
|
|
5142
|
-
display:flex;
|
|
5143
|
-
height:var(--size-9);
|
|
5144
|
-
justify-content:center;
|
|
5145
|
-
left:var(--space-2);
|
|
5146
|
-
position:absolute;
|
|
5147
|
-
top:0;
|
|
5148
|
-
}
|
|
5149
|
-
.bp_select_module_content--56f5c .bp_select_module_viewport--56f5c .bp_select_module_option--56f5c .bp_select_module_indicator--56f5c path{
|
|
5150
|
-
fill:var(--icon-icon-on-light);
|
|
5151
|
-
}
|
|
5152
|
-
.bp_select_module_content--56f5c .bp_select_module_viewport--56f5c .bp_select_module_separator--56f5c{
|
|
5153
|
-
background-color:var(--border-divider-border);
|
|
5154
|
-
flex-shrink:0;
|
|
5155
|
-
height:var(--border-1);
|
|
5156
|
-
margin-block:var(--space-2);
|
|
5157
|
-
}
|
|
5158
|
-
|
|
5159
5254
|
.bp_side_panel_module_content--4e61a{
|
|
5160
5255
|
background-color:var(--gray-white);
|
|
5161
5256
|
border-inline-start:var(--border-1) solid var(--border-divider-border);
|
package/lib-esm/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export * from './card-tooltip';
|
|
|
9
9
|
export * from './checkbox';
|
|
10
10
|
export * from './collapsible';
|
|
11
11
|
export * from './combobox';
|
|
12
|
+
export * from './combobox-group';
|
|
12
13
|
export * from './content-card';
|
|
13
14
|
export * from './content-field';
|
|
14
15
|
export * from './data-table/data-table';
|
package/lib-esm/index.js
CHANGED
|
@@ -12,6 +12,7 @@ export { CardTooltip } from './card-tooltip/card-tooltip.js';
|
|
|
12
12
|
export { Checkbox } from './checkbox/index.js';
|
|
13
13
|
export { CollapsibleSection } from './collapsible/collapsible-section.js';
|
|
14
14
|
export { Combobox, Root } from './combobox/combobox.js';
|
|
15
|
+
export { ComboboxGroup } from './combobox-group/combobox-group.js';
|
|
15
16
|
export { ContentCard } from './content-card/content-card.js';
|
|
16
17
|
export { ContentField } from './content-field/content-field.js';
|
|
17
18
|
export { DataTableWrapper, StickyCell } from './data-table/data-table.js';
|
package/lib-esm/select/select.js
CHANGED
|
@@ -5,9 +5,9 @@ import * as SelectPrimitive from '@radix-ui/react-select';
|
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import { forwardRef, useCallback } from 'react';
|
|
7
7
|
import { InlineError } from '../primitives/inline-error/inline-error.js';
|
|
8
|
+
import { useLabelable } from '../util-components/labelable/useLabelable.js';
|
|
8
9
|
import { useUniqueId } from '../utils/useUniqueId.js';
|
|
9
10
|
import styles from './select.module.js';
|
|
10
|
-
import { useLabelable } from '../util-components/labelable/useLabelable.js';
|
|
11
11
|
|
|
12
12
|
const Root = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
13
13
|
const {
|
|
@@ -28,10 +28,11 @@ const Root = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
|
28
28
|
name,
|
|
29
29
|
disabled,
|
|
30
30
|
required,
|
|
31
|
+
id,
|
|
31
32
|
// RadixSelectTrigger props
|
|
32
33
|
...triggerProps
|
|
33
34
|
} = props;
|
|
34
|
-
const selectId = useUniqueId('select-');
|
|
35
|
+
const selectId = useUniqueId('select-', !id) || id || 'default-select-id';
|
|
35
36
|
const hasError = !!error && !disabled;
|
|
36
37
|
// Restrict consumers from opening options menu when Root is disabled
|
|
37
38
|
const isSelectDefaultOpen = defaultOpen && !disabled;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import '../index.css';
|
|
2
|
-
var styles = {"container":"bp_select_module_container--
|
|
2
|
+
var styles = {"container":"bp_select_module_container--ec76a","disabled":"bp_select_module_disabled--ec76a","label":"bp_select_module_label--ec76a","triggerBtn":"bp_select_module_triggerBtn--ec76a","error":"bp_select_module_error--ec76a","iconWrapper":"bp_select_module_iconWrapper--ec76a","icon":"bp_select_module_icon--ec76a","content":"bp_select_module_content--ec76a","viewport":"bp_select_module_viewport--ec76a","option":"bp_select_module_option--ec76a","secondaryText":"bp_select_module_secondaryText--ec76a","indicator":"bp_select_module_indicator--ec76a","separator":"bp_select_module_separator--ec76a"};
|
|
3
3
|
|
|
4
4
|
export { styles as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@box/blueprint-web",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.2.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"publishConfig": {
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"react-stately": "^3.31.1",
|
|
64
64
|
"tsx": "^4.16.5"
|
|
65
65
|
},
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "e8ce4660827c02409096c1972517bcf898d1f251",
|
|
67
67
|
"module": "lib-esm/index.js",
|
|
68
68
|
"main": "lib-esm/index.js",
|
|
69
69
|
"exports": {
|