@box/blueprint-web 6.12.0 → 6.14.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 +8 -6
- package/lib-esm/index.css +25 -14
- package/lib-esm/toolbar/index.d.ts +2 -2
- package/lib-esm/toolbar/index.js +1 -1
- package/lib-esm/toolbar/toolbar-dropdown-indicator.js +3 -3
- package/lib-esm/toolbar/toolbar-icon.d.ts +1 -1
- package/lib-esm/toolbar/toolbar-icon.js +11 -6
- package/lib-esm/toolbar/toolbar-root.js +1 -1
- package/lib-esm/toolbar/toolbar-toggle-item.js +3 -3
- package/lib-esm/toolbar/toolbar.module.js +1 -1
- package/lib-esm/toolbar/types.d.ts +2 -0
- package/package.json +2 -2
|
@@ -100,7 +100,14 @@ const RootInner = ({
|
|
|
100
100
|
}
|
|
101
101
|
return getSelectedOptionValues(valueProp);
|
|
102
102
|
}, [getSelectedOptionValues, valueProp]);
|
|
103
|
+
const focusInput = useCallback(() => {
|
|
104
|
+
inputRef.current?.focus();
|
|
105
|
+
}, []);
|
|
103
106
|
const setValue = newSelectedValue => {
|
|
107
|
+
// Move focus back to input for single selects
|
|
108
|
+
if (!Array.isArray(newSelectedValue)) {
|
|
109
|
+
focusInput();
|
|
110
|
+
}
|
|
104
111
|
if (!onValueChange) {
|
|
105
112
|
return;
|
|
106
113
|
}
|
|
@@ -141,9 +148,6 @@ const RootInner = ({
|
|
|
141
148
|
},
|
|
142
149
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
143
150
|
[displayAvatar]);
|
|
144
|
-
const focusInput = useCallback(() => {
|
|
145
|
-
inputRef.current?.focus();
|
|
146
|
-
}, []);
|
|
147
151
|
const renderSelectItemOption = useCallback(option => {
|
|
148
152
|
const value = getOptionValue(option);
|
|
149
153
|
return jsxs(OptionWithIndicator, {
|
|
@@ -162,10 +166,8 @@ const RootInner = ({
|
|
|
162
166
|
setInputValue('');
|
|
163
167
|
} else if (selectedValueMemoized) {
|
|
164
168
|
setInputValue(getDisplayValueFromOptionValue(selectedValueMemoized));
|
|
165
|
-
// Also focus input for single-select variant
|
|
166
|
-
focusInput();
|
|
167
169
|
}
|
|
168
|
-
}, [selectedValueMemoized, getDisplayValueFromOptionValue, setInputValue
|
|
170
|
+
}, [selectedValueMemoized, getDisplayValueFromOptionValue, setInputValue]);
|
|
169
171
|
const handleKeyDown = useCallback(event => {
|
|
170
172
|
// Close menu
|
|
171
173
|
if (event.key === 'Enter' || event.key === 'Tab') {
|
package/lib-esm/index.css
CHANGED
|
@@ -5610,28 +5610,30 @@ table.inline_table_module_inlineTable--b023b tr:not(:last-child) td{
|
|
|
5610
5610
|
--z-index-card-tooltip:2147483647;
|
|
5611
5611
|
}
|
|
5612
5612
|
|
|
5613
|
-
.
|
|
5613
|
+
.toolbar_module_toolbarRoot--66b77{
|
|
5614
|
+
align-items:center;
|
|
5614
5615
|
background:var(--surface-surface);
|
|
5615
5616
|
border:var(--border-1) solid var(--border-card-border);
|
|
5616
5617
|
border-radius:var(--radius-4);
|
|
5617
5618
|
box-shadow:var(--dropshadow-3);
|
|
5618
5619
|
display:flex;
|
|
5619
5620
|
gap:var(--space-1);
|
|
5620
|
-
padding:var(--space-1);
|
|
5621
|
+
padding:calc(var(--space-1) - var(--border-1));
|
|
5621
5622
|
}
|
|
5622
5623
|
|
|
5623
|
-
.toolbar_module_separator--
|
|
5624
|
+
.toolbar_module_separator--66b77{
|
|
5624
5625
|
background-color:var(--border-divider-border);
|
|
5625
5626
|
border-radius:var(--radius-2);
|
|
5627
|
+
height:var(--size-6);
|
|
5626
5628
|
width:1px;
|
|
5627
5629
|
}
|
|
5628
5630
|
|
|
5629
|
-
.toolbar_module_toggleGroup--
|
|
5631
|
+
.toolbar_module_toggleGroup--66b77,.toolbar_module_toolbarItem--66b77{
|
|
5630
5632
|
display:flex;
|
|
5631
5633
|
gap:var(--space-1);
|
|
5632
5634
|
}
|
|
5633
5635
|
|
|
5634
|
-
.toolbar_module_toolbarItem--
|
|
5636
|
+
.toolbar_module_toolbarItem--66b77{
|
|
5635
5637
|
align-items:center;
|
|
5636
5638
|
background:var(--toolbar-button-color, var(--surface-toggle-surface));
|
|
5637
5639
|
border:var(--border-1) solid #0000;
|
|
@@ -5641,38 +5643,47 @@ table.inline_table_module_inlineTable--b023b tr:not(:last-child) td{
|
|
|
5641
5643
|
min-height:var(--size-8);
|
|
5642
5644
|
min-width:var(--size-8);
|
|
5643
5645
|
outline:none;
|
|
5644
|
-
padding:calc(var(--space-1) - var(--border-1));
|
|
5646
|
+
padding-inline:calc(var(--space-1) - var(--border-1));
|
|
5647
|
+
text-indent:var(--space-1);
|
|
5645
5648
|
-webkit-user-select:none;
|
|
5646
5649
|
user-select:none;
|
|
5647
5650
|
}
|
|
5648
|
-
.toolbar_module_toolbarItem--
|
|
5651
|
+
.toolbar_module_toolbarItem--66b77[data-disabled]{
|
|
5649
5652
|
background:var(--surface-toggle-surface);
|
|
5650
5653
|
opacity:.3;
|
|
5651
5654
|
pointer-events:none;
|
|
5652
5655
|
}
|
|
5653
|
-
.toolbar_module_toolbarItem--
|
|
5656
|
+
.toolbar_module_toolbarItem--66b77:not([data-disabled]):focus-visible{
|
|
5654
5657
|
box-shadow:0 0 0 .0625rem #fff,0 0 0 .1875rem #2486fc;
|
|
5655
5658
|
}
|
|
5656
|
-
.toolbar_module_toolbarItem--
|
|
5659
|
+
.toolbar_module_toolbarItem--66b77:not([data-disabled]):hover{
|
|
5657
5660
|
background:var(--toolbar-button-color, var(--surface-toggle-surface-hover));
|
|
5658
5661
|
border:var(--border-1) solid var(--toolbar-button-color, var(--surface-toggle-surface-hover));
|
|
5659
5662
|
}
|
|
5660
5663
|
|
|
5661
|
-
.toolbar_module_toolbarToggle--
|
|
5664
|
+
.toolbar_module_toolbarToggle--66b77[data-state=on]{
|
|
5662
5665
|
background:var(--surface-toggle-surface-pressed);
|
|
5663
5666
|
}
|
|
5664
|
-
.toolbar_module_toolbarToggle--
|
|
5667
|
+
.toolbar_module_toolbarToggle--66b77[data-state=on] svg *{
|
|
5665
5668
|
fill:var(--icon-icon-on-dark);
|
|
5666
5669
|
}
|
|
5667
|
-
.toolbar_module_toolbarToggle--
|
|
5670
|
+
.toolbar_module_toolbarToggle--66b77[data-state=on]:not([data-disabled]):hover{
|
|
5668
5671
|
background:var(--surface-toggle-surface-on-hover);
|
|
5669
5672
|
border:var(--border-1) solid var(--surface-toggle-surface-on-hover);
|
|
5670
5673
|
}
|
|
5671
5674
|
|
|
5672
|
-
.toolbar_module_invertDropdownIndicator--
|
|
5675
|
+
.toolbar_module_invertDropdownIndicator--66b77{
|
|
5673
5676
|
transform:rotate(.5turn);
|
|
5674
5677
|
}
|
|
5675
5678
|
|
|
5676
|
-
.toolbar_module_triggerButtonSelectedWithColor--
|
|
5679
|
+
.toolbar_module_triggerButtonSelectedWithColor--66b77[data-state=on]:hover{
|
|
5677
5680
|
opacity:.7;
|
|
5681
|
+
}
|
|
5682
|
+
|
|
5683
|
+
.toolbar_module_toolbarIcon--66b77{
|
|
5684
|
+
align-items:center;
|
|
5685
|
+
display:flex;
|
|
5686
|
+
height:var(--size-5);
|
|
5687
|
+
justify-content:center;
|
|
5688
|
+
width:var(--size-5);
|
|
5678
5689
|
}
|
|
@@ -15,7 +15,7 @@ export { type ToolbarButtonProps, type ToolbarIconProps, type ToolbarProps, type
|
|
|
15
15
|
* </Toolbar.Button>
|
|
16
16
|
* <Toolbar.Separator />
|
|
17
17
|
*
|
|
18
|
-
* <Toolbar.Button
|
|
18
|
+
* <Toolbar.Button>
|
|
19
19
|
* Upload <Toolbar.DropdownIndicator direction="down" />
|
|
20
20
|
* </Toolbar.Button>
|
|
21
21
|
* </Toolbar.Root>
|
|
@@ -40,7 +40,7 @@ export declare const Toolbar: {
|
|
|
40
40
|
/**
|
|
41
41
|
* SVG element used to render icon in buttons.
|
|
42
42
|
*/
|
|
43
|
-
Icon: import("react").ForwardRefExoticComponent<import("./types").ToolbarIconProps & import("react").RefAttributes<
|
|
43
|
+
Icon: import("react").ForwardRefExoticComponent<import("./types").ToolbarIconProps & import("react").RefAttributes<HTMLSpanElement>>;
|
|
44
44
|
/**
|
|
45
45
|
* A button item.
|
|
46
46
|
*/
|
package/lib-esm/toolbar/index.js
CHANGED
|
@@ -22,7 +22,7 @@ import { ToolbarTriggerButton } from './toolbar-trigger-button.js';
|
|
|
22
22
|
* </Toolbar.Button>
|
|
23
23
|
* <Toolbar.Separator />
|
|
24
24
|
*
|
|
25
|
-
* <Toolbar.Button
|
|
25
|
+
* <Toolbar.Button>
|
|
26
26
|
* Upload <Toolbar.DropdownIndicator direction="down" />
|
|
27
27
|
* </Toolbar.Button>
|
|
28
28
|
* </Toolbar.Root>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { Caret } from '@box/blueprint-web-assets/icons/Fill';
|
|
3
|
-
import {
|
|
3
|
+
import { Size2 } from '@box/blueprint-web-assets/tokens/tokens';
|
|
4
4
|
import clsx from 'clsx';
|
|
5
5
|
import { forwardRef } from 'react';
|
|
6
6
|
import styles from './toolbar.module.js';
|
|
@@ -16,9 +16,9 @@ const ToolbarDropdownIndicator = /*#__PURE__*/forwardRef(({
|
|
|
16
16
|
[styles.invertDropdownIndicator]: direction === 'up'
|
|
17
17
|
}, className),
|
|
18
18
|
color: color,
|
|
19
|
-
height:
|
|
19
|
+
height: Size2,
|
|
20
20
|
role: "presentation",
|
|
21
|
-
width:
|
|
21
|
+
width: Size2
|
|
22
22
|
});
|
|
23
23
|
});
|
|
24
24
|
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type ToolbarIconProps } from './types';
|
|
3
|
-
export declare const ToolbarIcon: React.ForwardRefExoticComponent<ToolbarIconProps & React.RefAttributes<
|
|
3
|
+
export declare const ToolbarIcon: React.ForwardRefExoticComponent<ToolbarIconProps & React.RefAttributes<HTMLSpanElement>>;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
1
2
|
import { Size5, IconIconOnLight } from '@box/blueprint-web-assets/tokens/tokens';
|
|
3
|
+
import clsx from 'clsx';
|
|
2
4
|
import React__default, { forwardRef } from 'react';
|
|
5
|
+
import styles from './toolbar.module.js';
|
|
3
6
|
|
|
4
7
|
const ToolbarIcon = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
5
8
|
const {
|
|
@@ -7,13 +10,15 @@ const ToolbarIcon = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
|
7
10
|
className,
|
|
8
11
|
color = IconIconOnLight
|
|
9
12
|
} = props;
|
|
10
|
-
return
|
|
13
|
+
return jsx("span", {
|
|
11
14
|
ref: forwardedRef,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
className: clsx(styles.toolbarIcon, className),
|
|
16
|
+
children: /*#__PURE__*/React__default.createElement(icon, {
|
|
17
|
+
width: Size5,
|
|
18
|
+
height: Size5,
|
|
19
|
+
role: 'presentation',
|
|
20
|
+
color
|
|
21
|
+
})
|
|
17
22
|
});
|
|
18
23
|
});
|
|
19
24
|
|
|
@@ -13,7 +13,7 @@ const ToolbarRoot = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
|
13
13
|
return jsx(ToolbarPrimitive.Root, {
|
|
14
14
|
...rest,
|
|
15
15
|
ref: forwardedRef,
|
|
16
|
-
className: clsx(styles.
|
|
16
|
+
className: clsx(styles.toolbarRoot, className),
|
|
17
17
|
children: children
|
|
18
18
|
});
|
|
19
19
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import {
|
|
2
|
+
import { Size5, IconIconOnLight } from '@box/blueprint-web-assets/tokens/tokens';
|
|
3
3
|
import * as ToolbarPrimitive from '@radix-ui/react-toolbar';
|
|
4
4
|
import clsx from 'clsx';
|
|
5
5
|
import { forwardRef, createElement } from 'react';
|
|
@@ -17,8 +17,8 @@ const ToolbarToggleItem = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
|
17
17
|
ref: forwardedRef,
|
|
18
18
|
className: clsx(styles.toolbarItem, styles.toolbarToggle),
|
|
19
19
|
children: [children, /*#__PURE__*/createElement(icon, {
|
|
20
|
-
height:
|
|
21
|
-
width:
|
|
20
|
+
height: Size5,
|
|
21
|
+
width: Size5,
|
|
22
22
|
role: 'presentation',
|
|
23
23
|
color
|
|
24
24
|
})]
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import '../index.css';
|
|
2
|
-
var styles = {"
|
|
2
|
+
var styles = {"toolbarRoot":"toolbar_module_toolbarRoot--66b77","separator":"toolbar_module_separator--66b77","toggleGroup":"toolbar_module_toggleGroup--66b77","toolbarItem":"toolbar_module_toolbarItem--66b77","toolbarToggle":"toolbar_module_toolbarToggle--66b77","invertDropdownIndicator":"toolbar_module_invertDropdownIndicator--66b77","triggerButtonSelectedWithColor":"toolbar_module_triggerButtonSelectedWithColor--66b77","toolbarIcon":"toolbar_module_toolbarIcon--66b77"};
|
|
3
3
|
|
|
4
4
|
export { styles as default };
|
|
@@ -23,6 +23,7 @@ export interface ToolbarToggleItemProps extends ToolbarPrimitiveToggleItemProps
|
|
|
23
23
|
'aria-label': NonNullable<HTMLAttributes<HTMLButtonElement>['aria-label']>;
|
|
24
24
|
}
|
|
25
25
|
export type ToolbarIconProps = {
|
|
26
|
+
/** Color of rendered icon. */
|
|
26
27
|
color?: React.SVGProps<SVGSVGElement>['color'];
|
|
27
28
|
className?: string;
|
|
28
29
|
/** Icon rendered by the component. */
|
|
@@ -33,6 +34,7 @@ export type ToolbarDropdownIndicatorProps = {
|
|
|
33
34
|
* @default 'down'
|
|
34
35
|
*/
|
|
35
36
|
direction?: 'up' | 'down';
|
|
37
|
+
/** Color of rendered icon. */
|
|
36
38
|
color?: React.SVGProps<SVGSVGElement>['color'];
|
|
37
39
|
className?: string;
|
|
38
40
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@box/blueprint-web",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.14.0",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@box/storybook-utils": "^0.0.3"
|
|
59
59
|
},
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "070975e63431ea3fc2f4f2d0cad78571a0533a5f",
|
|
61
61
|
"module": "lib-esm/index.js",
|
|
62
62
|
"main": "lib-esm/index.js",
|
|
63
63
|
"exports": {
|