Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions flow-typed/npm/@box/blueprint-web-assets_vx.x.x.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
// @flow
// Flow stub for @box/blueprint-web-assets package

declare module '@box/blueprint-web-assets/icons/Medium' {
declare export var InformationCircle: React$ComponentType<any>;
declare export var CheckmarkCircle: React$ComponentType<any>;
declare export var AlertCircle: React$ComponentType<any>;
declare export var AlertTriangle: React$ComponentType<any>;
declare export var XMark: React$ComponentType<any>;
declare export var BoxAiAdvancedColor: React$ComponentType<any>;
declare export var BoxAiColor: React$ComponentType<any>;
}

declare module '@box/blueprint-web-assets/icons/Content' {
declare export var FolderExternal: React$ComponentType<any>;
declare export var FolderPersonal: React$ComponentType<any>;
declare export var FolderShared: React$ComponentType<any>;
declare export var Archive: React$ComponentType<any>;
declare export var FolderArchive: React$ComponentType<any>;
declare export var FileBookmark: React$ComponentType<any>;
}

declare module '@box/blueprint-web-assets/icons/Fill' {
declare export var XMark: React$ComponentType<any>;
declare export var ArrowCurveForward: React$ComponentType<any>;
declare export var Checkmark: React$ComponentType<any>;
declare export var Grid: React$ComponentType<any>;
declare export var Hamburger: React$ComponentType<any>;
declare export var PointerChevronRight: React$ComponentType<any>;
declare export var Pencil: React$ComponentType<any>;
declare export var Plus: React$ComponentType<any>;
declare export var Ellipsis: React$ComponentType<any>;
declare export var PointerChevronLeft: React$ComponentType<any>;
declare export var ArrowsExpand: React$ComponentType<any>;
}

declare module '@box/blueprint-web-assets/icons/Logo' {
declare export var BoxLogo: React$ComponentType<any>;
declare export var BoxAiLogo: React$ComponentType<any>;
}

declare module '@box/blueprint-web-assets/illustrations/Medium' {
declare export var DiscoDanceParty: React$ComponentType<any>;
declare export var HatWand: React$ComponentType<any>;
declare export var UploadCloud: React$ComponentType<any>;
declare export var Files: React$ComponentType<any>;
declare export var FolderFloat: React$ComponentType<any>;
declare export var OpenBook: React$ComponentType<any>;
}

declare module '@box/blueprint-web-assets/tokens/tokens' {
declare export var Size8: any;
declare export var IconCtaIconHover: any;
declare export var Size5: any;
declare export var SurfaceStatusSurfaceSuccess: any;
declare export var Gray50: any;
declare export var Size3: any;
declare export var Size6: any;
}
14 changes: 8 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,17 +124,18 @@
"@babel/preset-typescript": "^7.24.7",
"@babel/template": "^7.24.7",
"@babel/types": "^7.24.7",
"@box/blueprint-web": "^12.7.1",
"@box/blueprint-web-assets": "^4.60.0",
"@box/blueprint-web": "12.43.0",
"@box/blueprint-web-assets": "4.61.5",
"@box/box-ai-agent-selector": "^0.48.5",
"@box/box-ai-content-answers": "^0.124.1",
"@box/cldr-data": "^34.2.0",
"@box/combobox-with-api": "^0.34.9",
"@box/frontend": "^11.0.1",
"@box/item-icon": "^0.9.83",
"@box/item-icon": "^0.17.0",
"@box/languages": "^1.0.0",
"@box/metadata-editor": "^0.122.0",
"@box/react-virtualized": "^9.22.3-rc-box.10",
"@box/types": "^0.2.1",
"@cfaester/enzyme-adapter-react-18": "^0.8.0",
"@chromatic-com/storybook": "^4.0.1",
"@commitlint/cli": "^19.8.0",
Expand Down Expand Up @@ -287,15 +288,16 @@
"webpack-dev-server": "^5.2.1"
},
"peerDependencies": {
"@box/blueprint-web": "^12.7.1",
"@box/blueprint-web-assets": "^4.60.0",
"@box/blueprint-web": "12.43.0",
"@box/blueprint-web-assets": "4.61.5",
"@box/box-ai-agent-selector": "^0.48.5",
"@box/box-ai-content-answers": "^0.124.1",
"@box/cldr-data": ">=34.2.0",
"@box/combobox-with-api": "^0.34.9",
"@box/item-icon": "^0.9.83",
"@box/item-icon": "^0.17.0",
"@box/metadata-editor": "^0.122.0",
"@box/react-virtualized": "^9.22.3-rc-box.10",
"@box/types": "^0.2.1",
"@hapi/address": "^2.1.4",
"axios": "^0.30.0",
"classnames": "^2.2.5",
Expand Down
2 changes: 1 addition & 1 deletion scripts/jest/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ module.exports = {
testMatch: ['**/__tests__/**/*.test.+(js|jsx|ts|tsx)'],
testPathIgnorePatterns: ['stories.test.js$', 'stories.test.tsx$', 'stories.test.d.ts'],
transformIgnorePatterns: [
'node_modules/(?!(@box/react-virtualized/dist/es|@box/cldr-data|@box/blueprint-web|@box/blueprint-web-assets|@box/metadata-editor|@box/box-ai-content-answers|@box/box-ai-agent-selector|@box/item-icon|@box/combobox-with-api|@box/tree)/)',
'node_modules/(?!(@box/react-virtualized/dist/es|@box/cldr-data|@box/blueprint-web|@box/blueprint-web-assets|@box/metadata-editor|@box/box-ai-content-answers|@box/box-ai-agent-selector|@box/item-icon|@box/combobox-with-api|@box/tree|@box/types)/)',
],
};
15 changes: 10 additions & 5 deletions src/components/notification/Notification.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@ import * as React from 'react';
import { defineMessages, injectIntl } from 'react-intl';
import classNames from 'classnames';

// $FlowFixMe
import { Information, Check, AlertTriangle, AlertBadge, XMark } from '@box/blueprint-web-assets/icons/Medium';
import {
AlertCircle,
InformationCircle,
CheckmarkCircle,
AlertTriangle,
XMark,
} from '@box/blueprint-web-assets/icons/Medium';

import InfoBadge16 from '../../icon/line/InfoBadge16';
import CircleCheck16 from '../../icon/line/CircleCheck16';
Expand Down Expand Up @@ -34,9 +39,9 @@ const DURATION_TIMES = {
};

const ICON_RENDERER: { [string]: Function } = {
[TYPE_DEFAULT]: useV2Icons => (useV2Icons ? <Information /> : <InfoBadge16 />),
[TYPE_ERROR]: useV2Icons => (useV2Icons ? <AlertBadge /> : <XBadge16 />),
[TYPE_INFO]: useV2Icons => (useV2Icons ? <Check /> : <CircleCheck16 />),
[TYPE_DEFAULT]: useV2Icons => (useV2Icons ? <InformationCircle /> : <InfoBadge16 />),
[TYPE_ERROR]: useV2Icons => (useV2Icons ? <AlertCircle /> : <XBadge16 />),
[TYPE_INFO]: useV2Icons => (useV2Icons ? <CheckmarkCircle /> : <CircleCheck16 />),
[TYPE_WARN]: useV2Icons => (useV2Icons ? <AlertTriangle /> : <TriangleAlert16 />),
};

Expand Down
33 changes: 33 additions & 0 deletions src/components/notification/stories/Notification.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,39 @@ export const error = () => (
</IntlProvider>
);

export const basicV2 = () => (
<IntlProvider locale="en">
<Notification useV2Icons>This is a default notification.</Notification>
</IntlProvider>
);

export const infoV2 = () => (
<IntlProvider locale="en">
<Notification type="info" useV2Icons>
<span>This is an info notification with a button.</span>
<Button>Click me</Button>
</Notification>
</IntlProvider>
);

export const warnV2 = () => (
<IntlProvider locale="en">
<Notification type="warn" useV2Icons>
<span>This is a warning notification with two buttons.</span>
<Button>Click me</Button>
<Button>Click me again</Button>
</Notification>
</IntlProvider>
);

export const errorV2 = () => (
<IntlProvider locale="en">
<Notification type="error" useV2Icons>
<span>This is an error notification.</span>
</Notification>
</IntlProvider>
);

export default {
title: 'Components/Notifications/Notification',
component: Notification,
Expand Down
Loading