@box/blueprint-web 17.22.2 → 17.22.4

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.
@@ -10,21 +10,21 @@ const ToolbarRoot = /*#__PURE__*/forwardRef((props, forwardedRef) => {
10
10
  const {
11
11
  children,
12
12
  className,
13
+ style,
13
14
  scrollable,
15
+ ariaLabelNextButton,
16
+ ariaLabelPrevButton,
17
+ maxWidth,
18
+ scrollStep,
14
19
  ...rest
15
20
  } = props;
16
21
  if (scrollable) {
17
- const {
18
- ariaLabelNextButton,
19
- ariaLabelPrevButton,
20
- maxWidth,
21
- scrollStep = 50
22
- } = props;
23
22
  return jsx(ToolbarPrimitive.Root, {
24
23
  ...rest,
25
24
  ref: forwardedRef,
26
25
  className: clsx(styles.toolbarRoot, styles.ScrollableToolbarWithReducedPadding, className),
27
26
  style: {
27
+ ...style,
28
28
  maxWidth
29
29
  },
30
30
  children: jsx(HorizontalScrollProvider, {
@@ -41,6 +41,7 @@ const ToolbarRoot = /*#__PURE__*/forwardRef((props, forwardedRef) => {
41
41
  ...rest,
42
42
  ref: forwardedRef,
43
43
  className: clsx(styles.toolbarRoot, className),
44
+ style: style,
44
45
  children: children
45
46
  });
46
47
  });
@@ -3,10 +3,8 @@ import { type CSSProperties, type FunctionComponent, type HTMLAttributes, type P
3
3
  interface ToolbarWithoutScrollProps {
4
4
  scrollable?: false;
5
5
  }
6
- interface ToolbarWithScrollProps {
7
- /** Prop to enable horizontal scrolling with control buttons. */
8
- scrollable: true;
9
- /** The maximum width of the toolbar. When this width is reached, horizontal scrolling with control buttons will be enabled. */
6
+ interface ToolbarScrollOptions {
7
+ /** The maximum width of the toolbar. When this width is reached, horizontal scrolling with control buttons will be enabled. Takes precedence over `style.maxWidth`. */
10
8
  maxWidth: string;
11
9
  /** Aria label for the previous control button. */
12
10
  ariaLabelPrevButton: string;
@@ -17,8 +15,14 @@ interface ToolbarWithScrollProps {
17
15
  */
18
16
  scrollStep?: number;
19
17
  }
18
+ interface ToolbarWithScrollProps extends ToolbarScrollOptions {
19
+ /** Prop to enable horizontal scrolling with control buttons. */
20
+ scrollable: true;
21
+ }
20
22
  type ScrollProps = ToolbarWithoutScrollProps | ToolbarWithScrollProps;
21
23
  export type ToolbarProps = ToolbarPrimitiveProps & ScrollProps;
24
+ /** Scroll options can still be present at runtime when `scrollable` is falsy, e.g. `scrollable={isNarrow}`. */
25
+ export type ToolbarRootRuntimeProps = ToolbarPrimitiveProps & ((ToolbarWithoutScrollProps & Partial<ToolbarScrollOptions>) | ToolbarWithScrollProps);
22
26
  export type ToolbarSeparatorProps = ToolbarPrimitiveSeparatorProps;
23
27
  export type ToolbarToggleGroupProps = ToolbarToggleGroupPrimitiveProps;
24
28
  interface ToolbarButtonCSS extends CSSProperties {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@box/blueprint-web",
3
- "version": "17.22.2",
3
+ "version": "17.22.4",
4
4
  "type": "module",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "publishConfig": {
@@ -55,7 +55,7 @@
55
55
  "dependencies": {
56
56
  "@ariakit/react": "0.4.21",
57
57
  "@ariakit/react-core": "0.4.21",
58
- "@box/blueprint-web-assets": "^5.11.11",
58
+ "@box/blueprint-web-assets": "^5.11.13",
59
59
  "@internationalized/date": "^3.12.0",
60
60
  "@radix-ui/react-accordion": "1.1.2",
61
61
  "@radix-ui/react-checkbox": "1.0.4",
@@ -86,7 +86,7 @@
86
86
  "devDependencies": {
87
87
  "@box/box-test-client": "^3.2.7",
88
88
  "@box/playwright-utils": "^2.8.5",
89
- "@box/storybook-utils": "^1.4.6",
89
+ "@box/storybook-utils": "^1.4.8",
90
90
  "@figma/code-connect": "1.4.4",
91
91
  "@playwright/test": "1.46.1",
92
92
  "@types/js-yaml": "^4.0.9",