@box/blueprint-web 7.33.0 → 7.33.3
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/index.css +34 -34
- package/lib-esm/primitives/chips/chip.module.js +1 -1
- package/lib-esm/select/types.d.ts +5 -0
- package/lib-esm/split-button/split-button.d.ts +25 -2
- package/lib-esm/split-button/split-button.js +35 -18
- package/lib-esm/split-button/types.d.ts +10 -6
- package/package.json +2 -2
package/lib-esm/index.css
CHANGED
|
@@ -4086,7 +4086,7 @@ table.bp_inline_table_module_inlineTable--b023b tr:not(:last-child) td{
|
|
|
4086
4086
|
.bp_base_text_input_module_inlineError--3320c{
|
|
4087
4087
|
margin-block-start:var(--space-2);
|
|
4088
4088
|
}
|
|
4089
|
-
.bp_chip_module_chip--
|
|
4089
|
+
.bp_chip_module_chip--45a2c{
|
|
4090
4090
|
align-items:center;
|
|
4091
4091
|
border:none;
|
|
4092
4092
|
border-radius:var(--radius-half);
|
|
@@ -4103,19 +4103,19 @@ table.bp_inline_table_module_inlineTable--b023b tr:not(:last-child) td{
|
|
|
4103
4103
|
text-decoration:none;
|
|
4104
4104
|
text-transform:none;
|
|
4105
4105
|
}
|
|
4106
|
-
.bp_chip_module_chip--
|
|
4106
|
+
.bp_chip_module_chip--45a2c .bp_chip_module_labelText--45a2c:first-child{
|
|
4107
4107
|
margin-inline-start:var(--space-4);
|
|
4108
4108
|
}
|
|
4109
|
-
.bp_chip_module_chip--
|
|
4109
|
+
.bp_chip_module_chip--45a2c .bp_chip_module_labelText--45a2c:last-child{
|
|
4110
4110
|
margin-inline-end:var(--space-4);
|
|
4111
4111
|
}
|
|
4112
|
-
.bp_chip_module_chip--
|
|
4112
|
+
.bp_chip_module_chip--45a2c .bp_chip_module_chipStatus--45a2c:first-child,.bp_chip_module_chip--45a2c svg:first-child{
|
|
4113
4113
|
margin-inline-start:var(--space-2);
|
|
4114
4114
|
}
|
|
4115
|
-
.bp_chip_module_chip--
|
|
4115
|
+
.bp_chip_module_chip--45a2c .bp_chip_module_chipStatus--45a2c:last-child,.bp_chip_module_chip--45a2c svg:last-child{
|
|
4116
4116
|
margin-inline-end:var(--space-2);
|
|
4117
4117
|
}
|
|
4118
|
-
.bp_chip_module_chip--
|
|
4118
|
+
.bp_chip_module_chip--45a2c .bp_chip_module_chipStatus--45a2c{
|
|
4119
4119
|
align-items:center;
|
|
4120
4120
|
background-color:var(--gray-10);
|
|
4121
4121
|
border-radius:var(--radius-half);
|
|
@@ -4134,10 +4134,10 @@ table.bp_inline_table_module_inlineTable--b023b tr:not(:last-child) td{
|
|
|
4134
4134
|
text-decoration:none;
|
|
4135
4135
|
text-transform:none;
|
|
4136
4136
|
}
|
|
4137
|
-
.bp_chip_module_chip--
|
|
4137
|
+
.bp_chip_module_chip--45a2c .bp_chip_module_labelText--45a2c{
|
|
4138
4138
|
white-space:nowrap;
|
|
4139
4139
|
}
|
|
4140
|
-
.bp_chip_module_chip--
|
|
4140
|
+
.bp_chip_module_chip--45a2c.bp_chip_module_chipButton--45a2c{
|
|
4141
4141
|
background-color:var(--surface-chip-button-surface);
|
|
4142
4142
|
font-family:Lato, -apple-system, BlinkMacSystemFont, "San Francisco", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
|
|
4143
4143
|
font-size:.875rem;
|
|
@@ -4147,50 +4147,50 @@ table.bp_inline_table_module_inlineTable--b023b tr:not(:last-child) td{
|
|
|
4147
4147
|
text-decoration:none;
|
|
4148
4148
|
text-transform:none;
|
|
4149
4149
|
}
|
|
4150
|
-
.bp_chip_module_chip--
|
|
4150
|
+
.bp_chip_module_chip--45a2c.bp_chip_module_chipButton--45a2c:focus-visible{
|
|
4151
4151
|
box-shadow:0 0 0 var(--border-2) var(--outline-focus-on-light);
|
|
4152
4152
|
outline:none;
|
|
4153
4153
|
overflow:visible;
|
|
4154
4154
|
}
|
|
4155
|
-
.bp_chip_module_chip--
|
|
4155
|
+
.bp_chip_module_chip--45a2c.bp_chip_module_chipButton--45a2c .bp_chip_module_chipStatus--45a2c{
|
|
4156
4156
|
background-color:var(--box-blue-100);
|
|
4157
4157
|
color:var(--text-text-on-dark);
|
|
4158
4158
|
}
|
|
4159
|
-
.bp_chip_module_chip--
|
|
4159
|
+
.bp_chip_module_chip--45a2c.bp_chip_module_chipButton--45a2c:focus-visible,.bp_chip_module_chip--45a2c.bp_chip_module_chipButton--45a2c[data-active-item]{
|
|
4160
4160
|
box-shadow:0 0 0 var(--border-2) var(--outline-focus-on-light);
|
|
4161
4161
|
outline:none;
|
|
4162
4162
|
}
|
|
4163
|
-
.bp_chip_module_chip--
|
|
4163
|
+
.bp_chip_module_chip--45a2c.bp_chip_module_chipButton--45a2c:disabled{
|
|
4164
4164
|
pointer-events:none;
|
|
4165
4165
|
}
|
|
4166
|
-
.bp_chip_module_chip--
|
|
4166
|
+
.bp_chip_module_chip--45a2c.bp_chip_module_chipButton--45a2c:disabled .bp_chip_module_chipStatus--45a2c{
|
|
4167
4167
|
opacity:.4;
|
|
4168
4168
|
}
|
|
4169
|
-
.bp_chip_module_chip--
|
|
4169
|
+
.bp_chip_module_chip--45a2c.bp_chip_module_chipButton--45a2c:hover:enabled{
|
|
4170
4170
|
background-color:var(--surface-chip-button-surface-hover);
|
|
4171
4171
|
}
|
|
4172
|
-
.bp_chip_module_chip--
|
|
4172
|
+
.bp_chip_module_chip--45a2c.bp_chip_module_singleSelectChip--45a2c{
|
|
4173
4173
|
background-color:var(--surface-filterchip-surface-single);
|
|
4174
4174
|
}
|
|
4175
|
-
.bp_chip_module_chip--
|
|
4175
|
+
.bp_chip_module_chip--45a2c.bp_chip_module_singleSelectChip--45a2c[data-state=on]{
|
|
4176
4176
|
background-color:var(--surface-filterchip-surface-single-on);
|
|
4177
4177
|
color:var(--text-text-on-dark);
|
|
4178
4178
|
}
|
|
4179
|
-
.bp_chip_module_chip--
|
|
4179
|
+
.bp_chip_module_chip--45a2c.bp_chip_module_singleSelectChip--45a2c[data-state=on]:hover{
|
|
4180
4180
|
background-color:var(--surface-filterchip-surface-single-on-hover);
|
|
4181
4181
|
}
|
|
4182
|
-
.bp_chip_module_chip--
|
|
4182
|
+
.bp_chip_module_chip--45a2c.bp_chip_module_singleSelectChip--45a2c[data-state=on] .bp_chip_module_chipStatus--45a2c{
|
|
4183
4183
|
color:var(--text-text-on-light);
|
|
4184
4184
|
}
|
|
4185
|
-
.bp_chip_module_chip--
|
|
4185
|
+
.bp_chip_module_chip--45a2c.bp_chip_module_singleSelectChip--45a2c:focus-visible,.bp_chip_module_chip--45a2c.bp_chip_module_singleSelectChip--45a2c[data-active-item]{
|
|
4186
4186
|
box-shadow:0 0 0 var(--border-2) var(--outline-focus-on-light);
|
|
4187
4187
|
outline:var(--border-1) solid var(--gray-white);
|
|
4188
4188
|
outline-offset:calc(var(--border-1)*-1);
|
|
4189
4189
|
}
|
|
4190
|
-
.bp_chip_module_chip--
|
|
4190
|
+
.bp_chip_module_chip--45a2c.bp_chip_module_singleSelectChip--45a2c:hover:not([data-state=on]){
|
|
4191
4191
|
background-color:var(--surface-filterchip-surface-single-hover);
|
|
4192
4192
|
}
|
|
4193
|
-
.bp_chip_module_chip--
|
|
4193
|
+
.bp_chip_module_chip--45a2c.bp_chip_module_multiSelectChip--45a2c{
|
|
4194
4194
|
background-color:var(--surface-filterchip-surface-multi);
|
|
4195
4195
|
border:var(--border-1) solid var(--surface-filterchip-surface-multi);
|
|
4196
4196
|
font-family:Lato, -apple-system, BlinkMacSystemFont, "San Francisco", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
|
|
@@ -4201,10 +4201,10 @@ table.bp_inline_table_module_inlineTable--b023b tr:not(:last-child) td{
|
|
|
4201
4201
|
text-decoration:none;
|
|
4202
4202
|
text-transform:none;
|
|
4203
4203
|
}
|
|
4204
|
-
.bp_chip_module_chip--
|
|
4204
|
+
.bp_chip_module_chip--45a2c.bp_chip_module_multiSelectChip--45a2c path{
|
|
4205
4205
|
fill:var(--icon-icon-on-light);
|
|
4206
4206
|
}
|
|
4207
|
-
.bp_chip_module_chip--
|
|
4207
|
+
.bp_chip_module_chip--45a2c.bp_chip_module_multiSelectChip--45a2c[data-state=on]{
|
|
4208
4208
|
background-color:var(--surface-filterchip-surface-multi-on);
|
|
4209
4209
|
border:var(--border-1) solid var(--border-filterchip-border-multi-on);
|
|
4210
4210
|
color:var(--text-cta-link);
|
|
@@ -4216,32 +4216,32 @@ table.bp_inline_table_module_inlineTable--b023b tr:not(:last-child) td{
|
|
|
4216
4216
|
text-decoration:none;
|
|
4217
4217
|
text-transform:none;
|
|
4218
4218
|
}
|
|
4219
|
-
.bp_chip_module_chip--
|
|
4219
|
+
.bp_chip_module_chip--45a2c.bp_chip_module_multiSelectChip--45a2c[data-state=on] path{
|
|
4220
4220
|
fill:var(--text-cta-link);
|
|
4221
4221
|
}
|
|
4222
|
-
.bp_chip_module_chip--
|
|
4222
|
+
.bp_chip_module_chip--45a2c.bp_chip_module_multiSelectChip--45a2c[data-state=on]:hover{
|
|
4223
4223
|
background-color:var(--surface-filterchip-surface-multi-on-hover);
|
|
4224
4224
|
}
|
|
4225
|
-
.bp_chip_module_chip--
|
|
4225
|
+
.bp_chip_module_chip--45a2c.bp_chip_module_multiSelectChip--45a2c[data-state=on]:focus-visible,.bp_chip_module_chip--45a2c.bp_chip_module_multiSelectChip--45a2c[data-state=on][data-active-item]{
|
|
4226
4226
|
border:var(--border-1) solid var(--gray-white);
|
|
4227
4227
|
box-shadow:0 0 0 var(--border-2) var(--outline-focus-on-light);
|
|
4228
4228
|
outline:var(--border-1) solid var(--border-filterchip-border-multi-on);
|
|
4229
4229
|
outline-offset:calc(var(--border-2)*-1);
|
|
4230
4230
|
}
|
|
4231
|
-
.bp_chip_module_chip--
|
|
4231
|
+
.bp_chip_module_chip--45a2c.bp_chip_module_multiSelectChip--45a2c[data-state=on] .bp_chip_module_chipStatus--45a2c{
|
|
4232
4232
|
background-color:var(--box-blue-100);
|
|
4233
4233
|
color:var(--text-text-on-dark);
|
|
4234
4234
|
}
|
|
4235
|
-
.bp_chip_module_chip--
|
|
4235
|
+
.bp_chip_module_chip--45a2c.bp_chip_module_multiSelectChip--45a2c:focus-visible:not([data-state=on]),.bp_chip_module_chip--45a2c.bp_chip_module_multiSelectChip--45a2c[data-active-item]:not([data-state=on]){
|
|
4236
4236
|
box-shadow:0 0 0 var(--border-2) var(--outline-focus-on-light);
|
|
4237
4237
|
outline:var(--border-1) solid var(--gray-white);
|
|
4238
4238
|
outline-offset:calc(var(--border-1)*-1);
|
|
4239
4239
|
}
|
|
4240
|
-
.bp_chip_module_chip--
|
|
4240
|
+
.bp_chip_module_chip--45a2c.bp_chip_module_multiSelectChip--45a2c:hover:not([data-state=on]){
|
|
4241
4241
|
background-color:var(--surface-filterchip-surface-multi-hover);
|
|
4242
4242
|
border:var(--border-1) solid var(--surface-filterchip-surface-multi-hover);
|
|
4243
4243
|
}
|
|
4244
|
-
.bp_chip_module_chip--
|
|
4244
|
+
.bp_chip_module_chip--45a2c.bp_chip_module_multiSelectChip--45a2c span::before{
|
|
4245
4245
|
content:attr(data-text);
|
|
4246
4246
|
display:block;
|
|
4247
4247
|
font-family:Lato, -apple-system, BlinkMacSystemFont, "San Francisco", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
|
|
@@ -4256,20 +4256,20 @@ table.bp_inline_table_module_inlineTable--b023b tr:not(:last-child) td{
|
|
|
4256
4256
|
visibility:hidden;
|
|
4257
4257
|
}
|
|
4258
4258
|
|
|
4259
|
-
.bp_chip_module_chipsGroup--
|
|
4259
|
+
.bp_chip_module_chipsGroup--45a2c{
|
|
4260
4260
|
display:flex;
|
|
4261
4261
|
flex-wrap:wrap;
|
|
4262
4262
|
gap:var(--space-2);
|
|
4263
4263
|
}
|
|
4264
|
-
@media (max-width:
|
|
4265
|
-
.bp_chip_module_chipsGroup--
|
|
4264
|
+
@media (max-width: 767px){
|
|
4265
|
+
.bp_chip_module_chipsGroup--45a2c{
|
|
4266
4266
|
-ms-overflow-style:none;
|
|
4267
4267
|
flex-wrap:nowrap;
|
|
4268
4268
|
overflow-x:scroll;
|
|
4269
4269
|
padding:var(--space-05);
|
|
4270
4270
|
scrollbar-width:none;
|
|
4271
4271
|
}
|
|
4272
|
-
.bp_chip_module_chipsGroup--
|
|
4272
|
+
.bp_chip_module_chipsGroup--45a2c::-webkit-scrollbar{
|
|
4273
4273
|
display:none;
|
|
4274
4274
|
}
|
|
4275
4275
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import '../../index.css';
|
|
2
|
-
var styles = {"chip":"bp_chip_module_chip--
|
|
2
|
+
var styles = {"chip":"bp_chip_module_chip--45a2c","labelText":"bp_chip_module_labelText--45a2c","chipStatus":"bp_chip_module_chipStatus--45a2c","chipButton":"bp_chip_module_chipButton--45a2c","singleSelectChip":"bp_chip_module_singleSelectChip--45a2c","multiSelectChip":"bp_chip_module_multiSelectChip--45a2c","chipsGroup":"bp_chip_module_chipsGroup--45a2c"};
|
|
3
3
|
|
|
4
4
|
export { styles as default };
|
|
@@ -78,6 +78,11 @@ export interface SelectContentProps extends React.ComponentPropsWithRef<'div'> {
|
|
|
78
78
|
* The DOM element where the COntent should be portal-ed into. If not provided, the Content will be appended to the document body.
|
|
79
79
|
*/
|
|
80
80
|
container?: HTMLElement;
|
|
81
|
+
/**
|
|
82
|
+
* Event handler called when the escape key is down.
|
|
83
|
+
* Can be prevented.
|
|
84
|
+
*/
|
|
85
|
+
onEscapeKeyDown?: RadixSelectContentProps['onEscapeKeyDown'];
|
|
81
86
|
}
|
|
82
87
|
export interface SelectOptionProps extends React.ComponentPropsWithRef<'div'> {
|
|
83
88
|
/**
|
|
@@ -1,3 +1,26 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
export declare const SplitButton: import("react").ForwardRefExoticComponent<(Omit<Omit<import("../button").ButtonProps, "children"> & {
|
|
3
|
+
children: import("react").ReactNode;
|
|
4
|
+
label: string;
|
|
5
|
+
dropdownTriggerAriaLabel: string;
|
|
6
|
+
align?: "center" | "start" | "end" | undefined;
|
|
7
|
+
size?: "small" | "large" | undefined;
|
|
8
|
+
variant?: "primary" | "secondary" | undefined;
|
|
9
|
+
defaultOpen?: boolean | undefined;
|
|
10
|
+
open?: boolean | undefined;
|
|
11
|
+
onOpenChange?(pressed: boolean): void;
|
|
12
|
+
disabled?: boolean | undefined;
|
|
13
|
+
container?: HTMLElement | null | undefined;
|
|
14
|
+
} & Required<Pick<import("./types").Loading, keyof import("./types").Loading>> & Omit<import("./types").Loading, keyof import("./types").Loading>, "ref"> | Omit<Omit<import("../button").ButtonProps, "children"> & {
|
|
15
|
+
children: import("react").ReactNode;
|
|
16
|
+
label: string;
|
|
17
|
+
dropdownTriggerAriaLabel: string;
|
|
18
|
+
align?: "center" | "start" | "end" | undefined;
|
|
19
|
+
size?: "small" | "large" | undefined;
|
|
20
|
+
variant?: "primary" | "secondary" | undefined;
|
|
21
|
+
defaultOpen?: boolean | undefined;
|
|
22
|
+
open?: boolean | undefined;
|
|
23
|
+
onOpenChange?(pressed: boolean): void;
|
|
24
|
+
disabled?: boolean | undefined;
|
|
25
|
+
container?: HTMLElement | null | undefined;
|
|
26
|
+
} & Partial<Record<keyof import("./types").Loading, never>> & Omit<import("./types").Loading, keyof import("./types").Loading>, "ref">) & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -7,9 +7,13 @@ import { useControllableState } from '../utils/useControllableState.js';
|
|
|
7
7
|
import { SplitTriggerButton } from './SplitTriggerButton.js';
|
|
8
8
|
import styles from './styles.module.js';
|
|
9
9
|
|
|
10
|
-
const
|
|
10
|
+
const getLeftButtonWidth = (loading, leftButtonSize, rightButtonSize) => {
|
|
11
|
+
return loading && leftButtonSize && rightButtonSize ? leftButtonSize + rightButtonSize : undefined;
|
|
12
|
+
};
|
|
13
|
+
const SplitButton = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
11
14
|
const {
|
|
12
15
|
align = 'end',
|
|
16
|
+
container,
|
|
13
17
|
children,
|
|
14
18
|
disabled,
|
|
15
19
|
dropdownTriggerAriaLabel,
|
|
@@ -20,7 +24,8 @@ const SplitButton = /*#__PURE__*/forwardRef(props => {
|
|
|
20
24
|
onOpenChange,
|
|
21
25
|
defaultOpen = false,
|
|
22
26
|
size = 'large',
|
|
23
|
-
variant = 'primary'
|
|
27
|
+
variant = 'primary',
|
|
28
|
+
...rest
|
|
24
29
|
} = props;
|
|
25
30
|
const [leftButtonSize, setLeftButtonSize] = useState(undefined);
|
|
26
31
|
const [rightButtonSize, setRightButtonSize] = useState(undefined);
|
|
@@ -30,45 +35,56 @@ const SplitButton = /*#__PURE__*/forwardRef(props => {
|
|
|
30
35
|
defaultProp: defaultOpen
|
|
31
36
|
});
|
|
32
37
|
const onLeftButtonMountCallback = useCallback(button => {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
setLeftButtonSize(buttonWidth);
|
|
38
|
+
if (button?.offsetWidth) {
|
|
39
|
+
setLeftButtonSize(button?.offsetWidth);
|
|
36
40
|
}
|
|
37
|
-
|
|
41
|
+
if (!forwardedRef) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
if (typeof forwardedRef === 'function') {
|
|
45
|
+
forwardedRef(button);
|
|
46
|
+
} else {
|
|
47
|
+
forwardedRef.current = button;
|
|
48
|
+
}
|
|
49
|
+
}, [forwardedRef]);
|
|
38
50
|
const onRightButtonMountCallback = useCallback(button => {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
setRightButtonSize(buttonWidth);
|
|
51
|
+
if (button?.offsetWidth) {
|
|
52
|
+
setRightButtonSize(button.offsetWidth);
|
|
42
53
|
}
|
|
43
54
|
}, []);
|
|
44
55
|
const onOpenChangeLocal = useCallback(() => {
|
|
45
|
-
if (
|
|
46
|
-
|
|
56
|
+
if (disabled) {
|
|
57
|
+
return;
|
|
47
58
|
}
|
|
59
|
+
setOpen(!open);
|
|
48
60
|
}, [disabled, open, setOpen]);
|
|
61
|
+
const shouldAlignToLeft = align === 'start' && leftButtonSize;
|
|
49
62
|
const alignOpts = {
|
|
50
63
|
align,
|
|
51
|
-
...(
|
|
64
|
+
...(shouldAlignToLeft ? {
|
|
52
65
|
alignOffset: -leftButtonSize
|
|
53
|
-
})
|
|
66
|
+
} : {})
|
|
54
67
|
};
|
|
68
|
+
const className = loading ? styles.loadingButton : clsx(styles.splitButtonLeft, {
|
|
69
|
+
[styles.gap]: variant === 'primary',
|
|
70
|
+
[styles.skipRightBorder]: variant !== 'primary'
|
|
71
|
+
});
|
|
72
|
+
const leftButtonWidth = getLeftButtonWidth(loading, leftButtonSize, rightButtonSize);
|
|
55
73
|
return jsxs(DropdownMenu.Root, {
|
|
56
74
|
onOpenChange: onOpenChangeLocal,
|
|
57
75
|
open: open,
|
|
58
76
|
children: [jsxs("span", {
|
|
59
77
|
className: styles.splitButton,
|
|
60
78
|
children: [jsx(Button, {
|
|
79
|
+
...rest,
|
|
61
80
|
ref: onLeftButtonMountCallback,
|
|
62
|
-
className:
|
|
63
|
-
[styles.gap]: variant === 'primary',
|
|
64
|
-
[styles.skipRightBorder]: variant !== 'primary'
|
|
65
|
-
}),
|
|
81
|
+
className: className,
|
|
66
82
|
disabled: disabled,
|
|
67
83
|
loading: loading,
|
|
68
84
|
loadingAriaLabel: loadingAriaLabel,
|
|
69
85
|
size: size,
|
|
70
86
|
style: {
|
|
71
|
-
width:
|
|
87
|
+
width: leftButtonWidth
|
|
72
88
|
},
|
|
73
89
|
variant: variant,
|
|
74
90
|
children: label
|
|
@@ -85,6 +101,7 @@ const SplitButton = /*#__PURE__*/forwardRef(props => {
|
|
|
85
101
|
})]
|
|
86
102
|
}), jsx(DropdownMenu.Content, {
|
|
87
103
|
className: styles.dropdown,
|
|
104
|
+
container: container,
|
|
88
105
|
...alignOpts,
|
|
89
106
|
children: children
|
|
90
107
|
})]
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import { type RequireAllOrNone } from 'type-fest';
|
|
3
|
-
|
|
3
|
+
import { type ButtonProps } from '../button/index';
|
|
4
|
+
import { type DropdownMenuContentProps } from '../primitives/dropdown-menu/index';
|
|
5
|
+
export interface Loading {
|
|
4
6
|
/** Whether the button is loading. */
|
|
5
7
|
loading?: boolean;
|
|
6
8
|
/** The aria-label for the loading indicator. */
|
|
7
9
|
loadingAriaLabel?: string;
|
|
8
10
|
}
|
|
9
|
-
export
|
|
11
|
+
export type BasicSplitButtonProps = Omit<ButtonProps, 'children'> & {
|
|
10
12
|
/** Contents of the dropdown */
|
|
11
|
-
children: ReactNode;
|
|
13
|
+
children: React.ReactNode;
|
|
12
14
|
/** The text of the left button */
|
|
13
15
|
label: string;
|
|
14
16
|
/** Aria-label of the right button, a.k.a DropdownMenu Trigger */
|
|
@@ -35,6 +37,8 @@ export interface BasicSplitButtonProps {
|
|
|
35
37
|
onOpenChange?(pressed: boolean): void;
|
|
36
38
|
/** Should both buttons be disabled */
|
|
37
39
|
disabled?: boolean;
|
|
38
|
-
|
|
40
|
+
/** Specify a container element to portal the content into. */
|
|
41
|
+
/** @default document.body */
|
|
42
|
+
container?: DropdownMenuContentProps['container'];
|
|
43
|
+
};
|
|
39
44
|
export type SplitButtonProps = BasicSplitButtonProps & RequireAllOrNone<Loading, keyof Loading>;
|
|
40
|
-
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@box/blueprint-web",
|
|
3
|
-
"version": "7.33.
|
|
3
|
+
"version": "7.33.3",
|
|
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": "a8f9386f6254e765ed5bd9014080891c913384c6",
|
|
67
67
|
"module": "lib-esm/index.js",
|
|
68
68
|
"main": "lib-esm/index.js",
|
|
69
69
|
"exports": {
|