@box/blueprint-web 12.4.0 → 12.5.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/blueprint-modernization-context/blueprint-modernization-context.d.ts +9 -0
- package/dist/lib-esm/blueprint-modernization-context/blueprint-modernization-context.js +20 -0
- package/dist/lib-esm/blueprint-modernization-context/index.d.ts +2 -0
- package/dist/lib-esm/blueprint-modernization-context/useBlueprintModernization.d.ts +1 -0
- package/dist/lib-esm/blueprint-modernization-context/useBlueprintModernization.js +12 -0
- package/dist/lib-esm/index.d.ts +2 -1
- package/dist/lib-esm/index.js +3 -1
- package/package.json +3 -3
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
export interface BlueprintModernizationContextValue {
|
|
3
|
+
enableModernizedComponents: boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare const BlueprintModernizationContext: import("react").Context<BlueprintModernizationContextValue>;
|
|
6
|
+
export declare const BlueprintModernizationProvider: ({ children, enableModernizedComponents, }: {
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
enableModernizedComponents: boolean;
|
|
9
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useMemo, createContext } from 'react';
|
|
3
|
+
|
|
4
|
+
const BlueprintModernizationContext = /*#__PURE__*/createContext({
|
|
5
|
+
enableModernizedComponents: false
|
|
6
|
+
});
|
|
7
|
+
const BlueprintModernizationProvider = ({
|
|
8
|
+
children,
|
|
9
|
+
enableModernizedComponents
|
|
10
|
+
}) => {
|
|
11
|
+
const value = useMemo(() => ({
|
|
12
|
+
enableModernizedComponents
|
|
13
|
+
}), [enableModernizedComponents]);
|
|
14
|
+
return jsx(BlueprintModernizationContext.Provider, {
|
|
15
|
+
value: value,
|
|
16
|
+
children: children
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export { BlueprintModernizationContext, BlueprintModernizationProvider };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useBlueprintModernization: () => import("./blueprint-modernization-context").BlueprintModernizationContextValue;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { useContext } from 'react';
|
|
2
|
+
import { BlueprintModernizationContext } from './blueprint-modernization-context.js';
|
|
3
|
+
|
|
4
|
+
const useBlueprintModernization = () => {
|
|
5
|
+
const context = useContext(BlueprintModernizationContext);
|
|
6
|
+
if (context === undefined) {
|
|
7
|
+
throw new Error('useBlueprintModernization must be used within a BlueprintModernizationProvider');
|
|
8
|
+
}
|
|
9
|
+
return context;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export { useBlueprintModernization };
|
package/dist/lib-esm/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export * from './accordion';
|
|
|
2
2
|
export * from './actionable-inline-notice';
|
|
3
3
|
export * from './avatar';
|
|
4
4
|
export * from './badge';
|
|
5
|
+
export * from './blueprint-modernization-context';
|
|
5
6
|
export * from './branding-styles';
|
|
6
7
|
export * from './button';
|
|
7
8
|
export * from './button-wrapper';
|
|
@@ -36,6 +37,7 @@ export * from './navigation-menu';
|
|
|
36
37
|
export * from './page';
|
|
37
38
|
export * from './page-section';
|
|
38
39
|
export * from './password-input';
|
|
40
|
+
export * from './primitives/base-text-input';
|
|
39
41
|
export * from './primitives/calendar';
|
|
40
42
|
export * from './primitives/chips/filter-chip';
|
|
41
43
|
export * from './primitives/context-menu';
|
|
@@ -64,7 +66,6 @@ export * from './text';
|
|
|
64
66
|
export * from './text-area';
|
|
65
67
|
export * from './text-button';
|
|
66
68
|
export * from './text-input';
|
|
67
|
-
export * from './primitives/base-text-input';
|
|
68
69
|
export * from './text-toggle-button';
|
|
69
70
|
export * from './toolbar';
|
|
70
71
|
export * from './tooltip';
|
package/dist/lib-esm/index.js
CHANGED
|
@@ -4,6 +4,8 @@ export { Avatar } from './avatar/avatar.js';
|
|
|
4
4
|
export { IconBadge } from './badge/icon-badge.js';
|
|
5
5
|
export { NumericBadge } from './badge/numeric-badge.js';
|
|
6
6
|
export { StatusBadge } from './badge/status-badge.js';
|
|
7
|
+
export { BlueprintModernizationProvider } from './blueprint-modernization-context/blueprint-modernization-context.js';
|
|
8
|
+
export { useBlueprintModernization } from './blueprint-modernization-context/useBlueprintModernization.js';
|
|
7
9
|
export { BrandingStyles } from './branding-styles/branding-styles.js';
|
|
8
10
|
export { useCustomBranding } from './branding-styles/useCustomBranding.js';
|
|
9
11
|
export { Button } from './button/button.js';
|
|
@@ -41,6 +43,7 @@ export { NavigationMenu } from './navigation-menu/index.js';
|
|
|
41
43
|
export { Page } from './page/index.js';
|
|
42
44
|
export { PageSection } from './page-section/index.js';
|
|
43
45
|
export { PasswordInput } from './password-input/password-input.js';
|
|
46
|
+
export { BaseTextInput } from './primitives/base-text-input/base-text-input.js';
|
|
44
47
|
export { Calendar } from './primitives/calendar/calendar.js';
|
|
45
48
|
export { CalendarDate, CalendarDateTime, DateFormatter, Time, ZonedDateTime } from './primitives/calendar/classes.util.js';
|
|
46
49
|
export { fromAbsolute } from './primitives/calendar/from-absolute.util.js';
|
|
@@ -81,7 +84,6 @@ export { Text } from './text/text.js';
|
|
|
81
84
|
export { TextArea } from './text-area/text-area.js';
|
|
82
85
|
export { TextButton } from './text-button/text-button.js';
|
|
83
86
|
export { TextInput } from './text-input/text-input.js';
|
|
84
|
-
export { BaseTextInput } from './primitives/base-text-input/base-text-input.js';
|
|
85
87
|
export { TextToggleButton } from './text-toggle-button/text-toggle-button.js';
|
|
86
88
|
export { Toolbar } from './toolbar/index.js';
|
|
87
89
|
export { Tooltip, TooltipProvider } from './tooltip/tooltip.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@box/blueprint-web",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.5.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"publishConfig": {
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@ariakit/react": "0.4.15",
|
|
49
49
|
"@ariakit/react-core": "0.4.15",
|
|
50
|
-
"@box/blueprint-web-assets": "^4.47.
|
|
50
|
+
"@box/blueprint-web-assets": "^4.47.2",
|
|
51
51
|
"@internationalized/date": "^3.7.0",
|
|
52
52
|
"@radix-ui/react-accordion": "1.1.2",
|
|
53
53
|
"@radix-ui/react-checkbox": "1.0.4",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"type-fest": "^3.2.0"
|
|
78
78
|
},
|
|
79
79
|
"devDependencies": {
|
|
80
|
-
"@box/storybook-utils": "^0.
|
|
80
|
+
"@box/storybook-utils": "^0.13.0",
|
|
81
81
|
"@types/react": "^18.0.0",
|
|
82
82
|
"@types/react-dom": "^18.0.0",
|
|
83
83
|
"react": "^18.3.0",
|