@box/blueprint-web 17.22.4 → 18.1.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/dist/lib-esm/components.css +120 -52
- package/dist/lib-esm/index.css +120 -52
- package/dist/lib-esm/index.d.ts +0 -1
- package/dist/lib-esm/index.js +0 -3
- package/dist/lib-esm/toolbar/index.d.ts +13 -0
- package/dist/lib-esm/toolbar/index.js +13 -0
- package/dist/lib-esm/toolbar/toolbar-dropdown-indicator.js +4 -2
- package/dist/lib-esm/toolbar/toolbar-icon.js +3 -2
- package/dist/lib-esm/toolbar/toolbar-root.d.ts +9 -0
- package/dist/lib-esm/toolbar/toolbar-root.js +15 -0
- package/dist/lib-esm/toolbar/toolbar-scrollable-container.d.ts +2 -0
- package/dist/lib-esm/toolbar/toolbar-scrollable-container.js +11 -5
- package/dist/lib-esm/toolbar/toolbar-toggle-item.js +3 -2
- package/dist/lib-esm/toolbar/toolbar.module.js +1 -1
- package/dist/lib-esm/toolbar/types.d.ts +13 -2
- package/package.json +3 -3
- package/dist/lib-esm/blueprint-modernization-context/blueprint-modernization-context.d.ts +0 -28
- package/dist/lib-esm/blueprint-modernization-context/blueprint-modernization-context.js +0 -28
- package/dist/lib-esm/blueprint-modernization-context/consts.d.ts +0 -1
- package/dist/lib-esm/blueprint-modernization-context/consts.js +0 -3
- package/dist/lib-esm/blueprint-modernization-context/index.d.ts +0 -7
- package/dist/lib-esm/blueprint-modernization-context/useBlueprintModernization.d.ts +0 -5
- package/dist/lib-esm/blueprint-modernization-context/useBlueprintModernization.js +0 -16
|
@@ -13,7 +13,8 @@ const ScrollButton = ({
|
|
|
13
13
|
ariaLabel,
|
|
14
14
|
onClick,
|
|
15
15
|
icon: Icon,
|
|
16
|
-
separatorPosition
|
|
16
|
+
separatorPosition,
|
|
17
|
+
variant
|
|
17
18
|
}) => jsxs("div", {
|
|
18
19
|
className: clsx(styles.scrollButtonWrapper, {
|
|
19
20
|
[styles.hidden]: hidden
|
|
@@ -21,14 +22,16 @@ const ScrollButton = ({
|
|
|
21
22
|
children: [separatorPosition === 'before' && jsx(ToolbarSeparator, {}), jsx(IconButton, {
|
|
22
23
|
"aria-label": ariaLabel,
|
|
23
24
|
icon: Icon,
|
|
24
|
-
onClick: onClick
|
|
25
|
+
onClick: onClick,
|
|
26
|
+
variant: variant
|
|
25
27
|
}), separatorPosition === 'after' && jsx(ToolbarSeparator, {})]
|
|
26
28
|
});
|
|
27
29
|
const ToolbarScrollableContainer = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
28
30
|
const {
|
|
29
31
|
children,
|
|
30
32
|
ariaLabelPrevButton,
|
|
31
|
-
ariaLabelNextButton
|
|
33
|
+
ariaLabelNextButton,
|
|
34
|
+
colorScheme = 'light'
|
|
32
35
|
} = props;
|
|
33
36
|
const {
|
|
34
37
|
scrollPosition,
|
|
@@ -36,6 +39,7 @@ const ToolbarScrollableContainer = /*#__PURE__*/forwardRef((props, forwardedRef)
|
|
|
36
39
|
scrollRight,
|
|
37
40
|
onAttach
|
|
38
41
|
} = useScrollContext();
|
|
42
|
+
const scrollButtonVariant = colorScheme === 'dark' ? 'on-dark' : 'default';
|
|
39
43
|
const onMountRef = useRefWithEffectMemoized(forwardedRef, node => {
|
|
40
44
|
onAttach(node);
|
|
41
45
|
});
|
|
@@ -45,7 +49,8 @@ const ToolbarScrollableContainer = /*#__PURE__*/forwardRef((props, forwardedRef)
|
|
|
45
49
|
hidden: scrollPosition === 'start' || scrollPosition === 'none',
|
|
46
50
|
icon: PointerChevronLeft,
|
|
47
51
|
onClick: scrollLeft,
|
|
48
|
-
separatorPosition: "after"
|
|
52
|
+
separatorPosition: "after",
|
|
53
|
+
variant: scrollButtonVariant
|
|
49
54
|
}), jsx("div", {
|
|
50
55
|
ref: onMountRef,
|
|
51
56
|
className: clsx(styles.scrollableChildrenWrapper),
|
|
@@ -56,7 +61,8 @@ const ToolbarScrollableContainer = /*#__PURE__*/forwardRef((props, forwardedRef)
|
|
|
56
61
|
hidden: scrollPosition === 'end' || scrollPosition === 'none',
|
|
57
62
|
icon: PointerChevronRight,
|
|
58
63
|
onClick: scrollRight,
|
|
59
|
-
separatorPosition: "before"
|
|
64
|
+
separatorPosition: "before",
|
|
65
|
+
variant: scrollButtonVariant
|
|
60
66
|
})]
|
|
61
67
|
});
|
|
62
68
|
});
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import {
|
|
2
|
+
import { Size5 } 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';
|
|
6
6
|
import styles from './toolbar.module.js';
|
|
7
7
|
|
|
8
8
|
const ToolbarToggleItem = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
9
|
+
// Inherit from Toolbar item text color so light/dark schemes both work without a hardcoded fill.
|
|
9
10
|
const {
|
|
10
11
|
children,
|
|
11
12
|
icon,
|
|
12
|
-
color =
|
|
13
|
+
color = 'currentColor',
|
|
13
14
|
...rest
|
|
14
15
|
} = props;
|
|
15
16
|
return jsxs(ToolbarPrimitive.ToggleItem, {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import '../index.css';
|
|
2
|
-
var styles = {"dropdownIndicator":"bp_toolbar_module_dropdownIndicator--
|
|
2
|
+
var styles = {"dropdownIndicator":"bp_toolbar_module_dropdownIndicator--36b15","invertCaret":"bp_toolbar_module_invertCaret--36b15","toolbarRoot":"bp_toolbar_module_toolbarRoot--36b15","ScrollableToolbarWithReducedPadding":"bp_toolbar_module_ScrollableToolbarWithReducedPadding--36b15","toolbarItem":"bp_toolbar_module_toolbarItem--36b15","toolbarButton":"bp_toolbar_module_toolbarButton--36b15","toolbarTextToggleItem":"bp_toolbar_module_toolbarTextToggleItem--36b15","toolbarLink":"bp_toolbar_module_toolbarLink--36b15","scrollButtonWrapper":"bp_toolbar_module_scrollButtonWrapper--36b15","hidden":"bp_toolbar_module_hidden--36b15","scrollableChildrenWrapper":"bp_toolbar_module_scrollableChildrenWrapper--36b15","separator":"bp_toolbar_module_separator--36b15","toggleGroup":"bp_toolbar_module_toggleGroup--36b15","toolbarToggle":"bp_toolbar_module_toolbarToggle--36b15","triggerButtonSelectedWithColor":"bp_toolbar_module_triggerButtonSelectedWithColor--36b15","toolbarIcon":"bp_toolbar_module_toolbarIcon--36b15","toolbarLinkText":"bp_toolbar_module_toolbarLinkText--36b15","toolbarInputContainer":"bp_toolbar_module_toolbarInputContainer--36b15","toolbarInput":"bp_toolbar_module_toolbarInput--36b15","toolbarInputErrorIcon":"bp_toolbar_module_toolbarInputErrorIcon--36b15","toolbarInputError":"bp_toolbar_module_toolbarInputError--36b15","toolbarInputErrorIconHidden":"bp_toolbar_module_toolbarInputErrorIconHidden--36b15"};
|
|
3
3
|
|
|
4
4
|
export { styles as default };
|
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
import { type ToolbarButtonProps as ToolbarPrimitiveButtonProps, type ToolbarLinkProps as ToolbarPrimitiveLinkProps, type ToolbarProps as ToolbarPrimitiveProps, type ToolbarSeparatorProps as ToolbarPrimitiveSeparatorProps, type ToolbarToggleItemProps as ToolbarPrimitiveToggleItemProps, type ToggleGroupProps as ToolbarToggleGroupPrimitiveProps } from '@radix-ui/react-toolbar';
|
|
2
2
|
import { type CSSProperties, type FunctionComponent, type HTMLAttributes, type PropsWithChildren, type SVGProps } from 'react';
|
|
3
|
+
/** Toolbar-only stopgap; not exported from the package root. */
|
|
4
|
+
export type ToolbarColorScheme = 'light' | 'dark';
|
|
5
|
+
interface ColorSchemeProps {
|
|
6
|
+
/**
|
|
7
|
+
* Color scheme of the toolbar. Independent of the page theme; the consumer chooses.
|
|
8
|
+
* Light remains the default so existing consumers are unchanged.
|
|
9
|
+
*
|
|
10
|
+
* @default 'light'
|
|
11
|
+
*/
|
|
12
|
+
colorScheme?: ToolbarColorScheme;
|
|
13
|
+
}
|
|
3
14
|
interface ToolbarWithoutScrollProps {
|
|
4
15
|
scrollable?: false;
|
|
5
16
|
}
|
|
@@ -20,9 +31,9 @@ interface ToolbarWithScrollProps extends ToolbarScrollOptions {
|
|
|
20
31
|
scrollable: true;
|
|
21
32
|
}
|
|
22
33
|
type ScrollProps = ToolbarWithoutScrollProps | ToolbarWithScrollProps;
|
|
23
|
-
export type ToolbarProps = ToolbarPrimitiveProps & ScrollProps;
|
|
34
|
+
export type ToolbarProps = ToolbarPrimitiveProps & ColorSchemeProps & ScrollProps;
|
|
24
35
|
/** 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);
|
|
36
|
+
export type ToolbarRootRuntimeProps = ToolbarPrimitiveProps & ColorSchemeProps & ((ToolbarWithoutScrollProps & Partial<ToolbarScrollOptions>) | ToolbarWithScrollProps);
|
|
26
37
|
export type ToolbarSeparatorProps = ToolbarPrimitiveSeparatorProps;
|
|
27
38
|
export type ToolbarToggleGroupProps = ToolbarToggleGroupPrimitiveProps;
|
|
28
39
|
interface ToolbarButtonCSS extends CSSProperties {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@box/blueprint-web",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "18.1.0",
|
|
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.
|
|
58
|
+
"@box/blueprint-web-assets": "^5.11.15",
|
|
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.
|
|
89
|
+
"@box/storybook-utils": "^1.4.10",
|
|
90
90
|
"@figma/code-connect": "1.4.4",
|
|
91
91
|
"@playwright/test": "1.46.1",
|
|
92
92
|
"@types/js-yaml": "^4.0.9",
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { type ReactNode } from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* @deprecated Modernized Blueprint UI is always on. Blueprint components no longer read this context.
|
|
4
|
-
* The API remains for consumer compatibility and will be removed in Q3FY27.
|
|
5
|
-
*/
|
|
6
|
-
export interface BlueprintModernizationContextValue {
|
|
7
|
-
/**
|
|
8
|
-
* @deprecated Ignored by Blueprint components — modern UI is always on. Will be removed in Q3FY27.
|
|
9
|
-
*/
|
|
10
|
-
enableModernizedComponents: boolean;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* @deprecated Modernized Blueprint UI is always on. Blueprint components no longer read this context.
|
|
14
|
-
* The API remains for consumer compatibility and will be removed in Q3FY27.
|
|
15
|
-
*/
|
|
16
|
-
export declare const BlueprintModernizationContext: import("react").Context<BlueprintModernizationContextValue>;
|
|
17
|
-
/**
|
|
18
|
-
* @deprecated Modernized Blueprint UI is always on. Blueprint components ignore `enableModernizedComponents`.
|
|
19
|
-
* Will be removed in Q3FY27.
|
|
20
|
-
*/
|
|
21
|
-
export declare const BlueprintModernizationProvider: ({ children, enableModernizedComponents, }: {
|
|
22
|
-
children: ReactNode;
|
|
23
|
-
/**
|
|
24
|
-
* @deprecated Ignored by Blueprint components — modern UI is always on. Optional for TypeScript
|
|
25
|
-
* compatibility; will be removed in Q3FY27.
|
|
26
|
-
*/
|
|
27
|
-
enableModernizedComponents?: boolean;
|
|
28
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { createContext, useMemo } from 'react';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* @deprecated Modernized Blueprint UI is always on. Blueprint components no longer read this context.
|
|
6
|
-
* The API remains for consumer compatibility and will be removed in Q3FY27.
|
|
7
|
-
*/
|
|
8
|
-
const BlueprintModernizationContext = /*#__PURE__*/createContext({
|
|
9
|
-
enableModernizedComponents: true
|
|
10
|
-
});
|
|
11
|
-
/**
|
|
12
|
-
* @deprecated Modernized Blueprint UI is always on. Blueprint components ignore `enableModernizedComponents`.
|
|
13
|
-
* Will be removed in Q3FY27.
|
|
14
|
-
*/
|
|
15
|
-
const BlueprintModernizationProvider = ({
|
|
16
|
-
children,
|
|
17
|
-
enableModernizedComponents = true
|
|
18
|
-
}) => {
|
|
19
|
-
const value = useMemo(() => ({
|
|
20
|
-
enableModernizedComponents
|
|
21
|
-
}), [enableModernizedComponents]);
|
|
22
|
-
return jsx(BlueprintModernizationContext.Provider, {
|
|
23
|
-
value: value,
|
|
24
|
-
children: children
|
|
25
|
-
});
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
export { BlueprintModernizationContext, BlueprintModernizationProvider };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const BLUEPRINT_UPLIFT_FEATURE_FLAG = "launchpad_blueprint_ui_uplift";
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @deprecated Modernized Blueprint UI is always on. This module remains for consumer compatibility
|
|
3
|
-
* and will be removed in Q3FY27. See LEGACY_REMOVAL_PLAN.md.
|
|
4
|
-
*/
|
|
5
|
-
export { BlueprintModernizationContext, BlueprintModernizationProvider, type BlueprintModernizationContextValue, } from './blueprint-modernization-context';
|
|
6
|
-
export { BLUEPRINT_UPLIFT_FEATURE_FLAG } from './consts';
|
|
7
|
-
export { useBlueprintModernization } from './useBlueprintModernization';
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @deprecated Modernized Blueprint UI is always on. Blueprint components no longer use this hook.
|
|
3
|
-
* The API remains for consumer compatibility and will be removed in Q3FY27.
|
|
4
|
-
*/
|
|
5
|
-
export declare const useBlueprintModernization: () => import("./blueprint-modernization-context").BlueprintModernizationContextValue;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { useContext } from 'react';
|
|
2
|
-
import { BlueprintModernizationContext } from './blueprint-modernization-context.js';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* @deprecated Modernized Blueprint UI is always on. Blueprint components no longer use this hook.
|
|
6
|
-
* The API remains for consumer compatibility and will be removed in Q3FY27.
|
|
7
|
-
*/
|
|
8
|
-
const useBlueprintModernization = () => {
|
|
9
|
-
const context = useContext(BlueprintModernizationContext);
|
|
10
|
-
if (context === undefined) {
|
|
11
|
-
throw new Error('useBlueprintModernization must be used within a BlueprintModernizationProvider');
|
|
12
|
-
}
|
|
13
|
-
return context;
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export { useBlueprintModernization };
|