@ubie/vitals-ui-business 0.1.0 → 0.2.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/.storybook/main.ts +23 -0
- package/.storybook/preview.tsx +37 -0
- package/.storybook/vitest.setup.ts +6 -0
- package/CHANGELOG.md +12 -1
- package/dist/index.cjs +33 -0
- package/dist/index.d.cts +4 -2
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +4 -2
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +4 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +18 -5
- package/src/index.ts +3 -0
- package/src/stories/Button.stories.tsx +73 -0
- package/src/stories/ant-design-x/Actions.stories.tsx +73 -0
- package/src/stories/ant-design-x/Attachments.stories.tsx +101 -0
- package/src/stories/ant-design-x/Bubble.stories.tsx +78 -0
- package/src/stories/ant-design-x/CodeHighlighter.stories.tsx +86 -0
- package/src/stories/ant-design-x/Conversations.stories.tsx +87 -0
- package/src/stories/ant-design-x/FileCard.stories.tsx +70 -0
- package/src/stories/ant-design-x/Folder.stories.tsx +113 -0
- package/src/stories/ant-design-x/Mermaid.stories.tsx +81 -0
- package/src/stories/ant-design-x/Notification.stories.tsx +96 -0
- package/src/stories/ant-design-x/Prompts.stories.tsx +79 -0
- package/src/stories/ant-design-x/Sender.stories.tsx +50 -0
- package/src/stories/ant-design-x/SenderSwitch.stories.tsx +48 -0
- package/src/stories/ant-design-x/Sources.stories.tsx +62 -0
- package/src/stories/ant-design-x/Suggestion.stories.tsx +96 -0
- package/src/stories/ant-design-x/Think.stories.tsx +45 -0
- package/src/stories/ant-design-x/ThoughtChain.stories.tsx +98 -0
- package/src/stories/ant-design-x/Welcome.stories.tsx +78 -0
- package/src/stories/ant-design-x/XProvider.stories.tsx +76 -0
- package/src/stories/components/Affix.stories.tsx +33 -0
- package/src/stories/components/Alert.stories.tsx +35 -0
- package/src/stories/components/Anchor.stories.tsx +69 -0
- package/src/stories/components/App.stories.tsx +42 -0
- package/src/stories/components/AutoComplete.stories.tsx +48 -0
- package/src/stories/components/Avatar.stories.tsx +45 -0
- package/src/stories/components/BackTop.stories.tsx +42 -0
- package/src/stories/components/Badge.stories.tsx +49 -0
- package/src/stories/components/BorderBeam.stories.tsx +85 -0
- package/src/stories/components/Breadcrumb.stories.tsx +52 -0
- package/src/stories/components/Calendar.stories.tsx +50 -0
- package/src/stories/components/Card.stories.tsx +49 -0
- package/src/stories/components/Carousel.stories.tsx +65 -0
- package/src/stories/components/Cascader.stories.tsx +51 -0
- package/src/stories/components/Checkbox.stories.tsx +47 -0
- package/src/stories/components/Col.stories.tsx +56 -0
- package/src/stories/components/Collapse.stories.tsx +46 -0
- package/src/stories/components/ColorPicker.stories.tsx +43 -0
- package/src/stories/components/ConfigProvider.stories.tsx +53 -0
- package/src/stories/components/DatePicker.stories.tsx +45 -0
- package/src/stories/components/Descriptions.stories.tsx +45 -0
- package/src/stories/components/Divider.stories.tsx +49 -0
- package/src/stories/components/Drawer.stories.tsx +64 -0
- package/src/stories/components/Dropdown.stories.tsx +44 -0
- package/src/stories/components/Empty.stories.tsx +44 -0
- package/src/stories/components/Flex.stories.tsx +55 -0
- package/src/stories/components/FloatButton.stories.tsx +70 -0
- package/src/stories/components/Form.stories.tsx +69 -0
- package/src/stories/components/Grid.stories.tsx +71 -0
- package/src/stories/components/Image.stories.tsx +48 -0
- package/src/stories/components/Input.stories.tsx +50 -0
- package/src/stories/components/InputNumber.stories.tsx +46 -0
- package/src/stories/components/Layout.stories.tsx +70 -0
- package/src/stories/components/List.stories.tsx +57 -0
- package/src/stories/components/Masonry.stories.tsx +58 -0
- package/src/stories/components/Mentions.stories.tsx +63 -0
- package/src/stories/components/Menu.stories.tsx +56 -0
- package/src/stories/components/Message.stories.tsx +79 -0
- package/src/stories/components/Modal.stories.tsx +57 -0
- package/src/stories/components/Notification.stories.tsx +85 -0
- package/src/stories/components/Pagination.stories.tsx +39 -0
- package/src/stories/components/Popconfirm.stories.tsx +67 -0
- package/src/stories/components/Popover.stories.tsx +68 -0
- package/src/stories/components/Progress.stories.tsx +61 -0
- package/src/stories/components/QRCode.stories.tsx +47 -0
- package/src/stories/components/Radio.stories.tsx +50 -0
- package/src/stories/components/Rate.stories.tsx +39 -0
- package/src/stories/components/Result.stories.tsx +54 -0
- package/src/stories/components/Row.stories.tsx +62 -0
- package/src/stories/components/Segmented.stories.tsx +48 -0
- package/src/stories/components/Select.stories.tsx +55 -0
- package/src/stories/components/Skeleton.stories.tsx +43 -0
- package/src/stories/components/Slider.stories.tsx +49 -0
- package/src/stories/components/Space.stories.tsx +51 -0
- package/src/stories/components/Spin.stories.tsx +40 -0
- package/src/stories/components/Splitter.stories.tsx +61 -0
- package/src/stories/components/Statistic.stories.tsx +38 -0
- package/src/stories/components/Steps.stories.tsx +44 -0
- package/src/stories/components/Switch.stories.tsx +39 -0
- package/src/stories/components/Table.stories.tsx +72 -0
- package/src/stories/components/Tabs.stories.tsx +44 -0
- package/src/stories/components/Tag.stories.tsx +52 -0
- package/src/stories/components/TimePicker.stories.tsx +45 -0
- package/src/stories/components/Timeline.stories.tsx +48 -0
- package/src/stories/components/Tooltip.stories.tsx +44 -0
- package/src/stories/components/Tour.stories.tsx +59 -0
- package/src/stories/components/Transfer.stories.tsx +102 -0
- package/src/stories/components/Tree.stories.tsx +38 -0
- package/src/stories/components/TreeSelect.stories.tsx +52 -0
- package/src/stories/components/Typography.stories.tsx +53 -0
- package/src/stories/components/UbieConfigProvider.stories.tsx +62 -0
- package/src/stories/components/Upload.stories.tsx +64 -0
- package/src/stories/components/Watermark.stories.tsx +49 -0
- package/src/stories/storyHelpers.tsx +85 -0
- package/tsconfig.json +2 -1
- package/vite.config.ts +24 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { StorybookConfig } from "@storybook/react-vite";
|
|
2
|
+
|
|
3
|
+
const config: StorybookConfig = {
|
|
4
|
+
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
|
|
5
|
+
addons: [
|
|
6
|
+
"@storybook/addon-vitest",
|
|
7
|
+
"@storybook/addon-a11y",
|
|
8
|
+
"@storybook/addon-docs",
|
|
9
|
+
"@storybook/addon-onboarding",
|
|
10
|
+
],
|
|
11
|
+
framework: "@storybook/react-vite",
|
|
12
|
+
managerHead: (head) => `${head}
|
|
13
|
+
<script>
|
|
14
|
+
if (!window.location.search) {
|
|
15
|
+
window.location.replace(
|
|
16
|
+
window.location.pathname + "?path=/story/components-button--primary",
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
</script>
|
|
20
|
+
`,
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export default config;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React, { useRef } from "react";
|
|
2
|
+
import type { Preview } from "@storybook/react-vite";
|
|
3
|
+
|
|
4
|
+
import { UbieConfigProvider } from "../src";
|
|
5
|
+
|
|
6
|
+
function StoryDecorator({ Story }: { Story: React.ComponentType }) {
|
|
7
|
+
const popupContainerRef = useRef<HTMLDivElement>(null);
|
|
8
|
+
|
|
9
|
+
return (
|
|
10
|
+
<div ref={popupContainerRef} style={{ isolation: "isolate", minHeight: "100%" }}>
|
|
11
|
+
<UbieConfigProvider
|
|
12
|
+
getPopupContainer={(triggerNode) =>
|
|
13
|
+
triggerNode?.parentElement ?? popupContainerRef.current ?? document.body
|
|
14
|
+
}
|
|
15
|
+
>
|
|
16
|
+
<Story />
|
|
17
|
+
</UbieConfigProvider>
|
|
18
|
+
</div>
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const preview: Preview = {
|
|
23
|
+
parameters: {
|
|
24
|
+
controls: {
|
|
25
|
+
matchers: {
|
|
26
|
+
color: /(background|color)$/i,
|
|
27
|
+
date: /Date$/i,
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
a11y: {
|
|
31
|
+
test: "todo",
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
decorators: [(Story) => <StoryDecorator Story={Story} />],
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export default preview;
|
package/CHANGELOG.md
CHANGED
|
@@ -1,11 +1,22 @@
|
|
|
1
1
|
# @ubie/vitals-ui-business
|
|
2
2
|
|
|
3
|
+
## 0.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 4b911f2: Re-export the Ant Design X public API, with its conflicting `notification` and `version` exports available as `xNotification` and `xVersion`.
|
|
8
|
+
|
|
9
|
+
Update Ant Design to 6.5.1, add Ant Design X 2.8.0, and document the new Ant Design `BorderBeam` component and every visual Ant Design X root export in Storybook.
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- @ubie/vitals-antd-theme@0.0.8
|
|
14
|
+
|
|
3
15
|
## 0.1.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
|
6
18
|
|
|
7
19
|
- c28598e: `@ubie/vitals-ui-business` を初回公開します。
|
|
8
|
-
|
|
9
20
|
- Ant Design の root public exports を透過的に再公開
|
|
10
21
|
- Vitals theme を基底に利用側設定を拡張できる `UbieConfigProvider` と `UbieConfigProviderProps` を追加
|
|
11
22
|
- facade package を side-effect-free として宣言し、未使用 Provider/theme branch の tree-shaking を可能にする
|
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
let _ant_design_x = require("@ant-design/x");
|
|
2
3
|
let antd = require("antd");
|
|
3
4
|
let _ubie_vitals_antd_theme = require("@ubie/vitals-antd-theme");
|
|
4
5
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
@@ -14,6 +15,38 @@ function UbieConfigProvider({ children, ...configProviderProps }) {
|
|
|
14
15
|
}
|
|
15
16
|
//#endregion
|
|
16
17
|
exports.UbieConfigProvider = UbieConfigProvider;
|
|
18
|
+
Object.defineProperty(exports, "notification", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function() {
|
|
21
|
+
return antd.notification;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "version", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function() {
|
|
27
|
+
return antd.version;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(exports, "xNotification", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function() {
|
|
33
|
+
return _ant_design_x.notification;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
Object.defineProperty(exports, "xVersion", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function() {
|
|
39
|
+
return _ant_design_x.version;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
Object.keys(_ant_design_x).forEach(function(k) {
|
|
43
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
get: function() {
|
|
46
|
+
return _ant_design_x[k];
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
});
|
|
17
50
|
Object.keys(antd).forEach(function(k) {
|
|
18
51
|
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
19
52
|
enumerable: true,
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { notification as xNotification, version as xVersion } from "@ant-design/x";
|
|
2
|
+
import { ConfigProviderProps, notification, version } from "antd";
|
|
2
3
|
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
|
+
export * from "@ant-design/x";
|
|
3
5
|
export * from "antd";
|
|
4
6
|
|
|
5
7
|
//#region src/UbieConfigProvider.d.ts
|
|
@@ -9,5 +11,5 @@ declare function UbieConfigProvider({
|
|
|
9
11
|
...configProviderProps
|
|
10
12
|
}: UbieConfigProviderProps): _$react_jsx_runtime0.JSX.Element;
|
|
11
13
|
//#endregion
|
|
12
|
-
export { UbieConfigProvider, type UbieConfigProviderProps };
|
|
14
|
+
export { UbieConfigProvider, type UbieConfigProviderProps, notification, version, xNotification, xVersion };
|
|
13
15
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/UbieConfigProvider.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/UbieConfigProvider.tsx"],"mappings":";;;;;;;KAGY,uBAAA,GAA0B,mBAAA;AAAA,iBAEtB,kBAAA,CAAA;EAAqB,QAAA;EAAA,GAAa;AAAA,GAAuB,uBAAA,GAAuB,oBAAA,CAAA,GAAA,CAAA,OAAA"}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { notification as xNotification, version as xVersion } from "@ant-design/x";
|
|
2
|
+
import { ConfigProviderProps, notification, version } from "antd";
|
|
2
3
|
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
|
+
export * from "@ant-design/x";
|
|
3
5
|
export * from "antd";
|
|
4
6
|
|
|
5
7
|
//#region src/UbieConfigProvider.d.ts
|
|
@@ -9,5 +11,5 @@ declare function UbieConfigProvider({
|
|
|
9
11
|
...configProviderProps
|
|
10
12
|
}: UbieConfigProviderProps): _$react_jsx_runtime0.JSX.Element;
|
|
11
13
|
//#endregion
|
|
12
|
-
export { UbieConfigProvider, type UbieConfigProviderProps };
|
|
14
|
+
export { UbieConfigProvider, type UbieConfigProviderProps, notification, version, xNotification, xVersion };
|
|
13
15
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/UbieConfigProvider.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/UbieConfigProvider.tsx"],"mappings":";;;;;;;KAGY,uBAAA,GAA0B,mBAAA;AAAA,iBAEtB,kBAAA,CAAA;EAAqB,QAAA;EAAA,GAAa;AAAA,GAAuB,uBAAA,GAAuB,oBAAA,CAAA,GAAA,CAAA,OAAA"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { notification as xNotification, version as xVersion } from "@ant-design/x";
|
|
2
|
+
import { ConfigProvider, notification, version } from "antd";
|
|
2
3
|
import { antdTheme } from "@ubie/vitals-antd-theme";
|
|
3
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
export * from "@ant-design/x";
|
|
4
6
|
export * from "antd";
|
|
5
7
|
//#region src/UbieConfigProvider.tsx
|
|
6
8
|
function UbieConfigProvider({ children, ...configProviderProps }) {
|
|
@@ -13,6 +15,6 @@ function UbieConfigProvider({ children, ...configProviderProps }) {
|
|
|
13
15
|
});
|
|
14
16
|
}
|
|
15
17
|
//#endregion
|
|
16
|
-
export { UbieConfigProvider };
|
|
18
|
+
export { UbieConfigProvider, notification, version, xNotification, xVersion };
|
|
17
19
|
|
|
18
20
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../src/UbieConfigProvider.tsx"],"sourcesContent":["import { antdTheme } from \"@ubie/vitals-antd-theme\";\nimport { ConfigProvider, type ConfigProviderProps } from \"antd\";\n\nexport type UbieConfigProviderProps = ConfigProviderProps;\n\nexport function UbieConfigProvider({ children, ...configProviderProps }: UbieConfigProviderProps) {\n return (\n <ConfigProvider theme={antdTheme}>\n <ConfigProvider {...configProviderProps}>{children}</ConfigProvider>\n </ConfigProvider>\n );\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/UbieConfigProvider.tsx"],"sourcesContent":["import { antdTheme } from \"@ubie/vitals-antd-theme\";\nimport { ConfigProvider, type ConfigProviderProps } from \"antd\";\n\nexport type UbieConfigProviderProps = ConfigProviderProps;\n\nexport function UbieConfigProvider({ children, ...configProviderProps }: UbieConfigProviderProps) {\n return (\n <ConfigProvider theme={antdTheme}>\n <ConfigProvider {...configProviderProps}>{children}</ConfigProvider>\n </ConfigProvider>\n );\n}\n"],"mappings":";;;;;;;AAKA,SAAgB,mBAAmB,EAAE,UAAU,GAAG,uBAAgD;AAChG,QACE,oBAAC,gBAAD;EAAgB,OAAO;YACrB,oBAAC,gBAAD;GAAgB,GAAI;GAAsB;GAA0B,CAAA;EACrD,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ubie/vitals-ui-business",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Ant Design components with the Ubie Vitals theme for business products",
|
|
5
5
|
"author": "Ubie Inc.",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -15,21 +15,34 @@
|
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"
|
|
19
|
-
"
|
|
18
|
+
"@ant-design/x": "^2.8.0",
|
|
19
|
+
"antd": "^6.5.1",
|
|
20
|
+
"@ubie/vitals-antd-theme": "0.0.8"
|
|
20
21
|
},
|
|
21
22
|
"devDependencies": {
|
|
23
|
+
"@storybook/addon-a11y": "10.4.6",
|
|
24
|
+
"@storybook/addon-docs": "10.4.6",
|
|
25
|
+
"@storybook/addon-onboarding": "10.4.6",
|
|
26
|
+
"@storybook/addon-vitest": "10.4.6",
|
|
27
|
+
"@storybook/react-vite": "10.4.6",
|
|
22
28
|
"@types/react": "^19.2.7",
|
|
23
29
|
"@types/react-dom": "^19.2.3",
|
|
30
|
+
"@vitest/coverage-v8": "^4.1.2",
|
|
31
|
+
"dayjs": "^1.11.19",
|
|
32
|
+
"playwright": "^1.57.0",
|
|
24
33
|
"react": "19.2.5",
|
|
25
34
|
"react-dom": "19.2.5",
|
|
26
|
-
"
|
|
35
|
+
"storybook": "10.4.6",
|
|
36
|
+
"vite-plus": "0.1.20",
|
|
37
|
+
"vitest": "npm:@voidzero-dev/vite-plus-test@latest"
|
|
27
38
|
},
|
|
28
39
|
"peerDependencies": {
|
|
29
40
|
"react": ">=18.0.0",
|
|
30
41
|
"react-dom": ">=18.0.0"
|
|
31
42
|
},
|
|
32
43
|
"scripts": {
|
|
33
|
-
"build": "vp pack"
|
|
44
|
+
"build": "vp pack",
|
|
45
|
+
"dev": "storybook dev -p 6006",
|
|
46
|
+
"build-storybook": "storybook build"
|
|
34
47
|
}
|
|
35
48
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
export * from "@ant-design/x";
|
|
1
2
|
export * from "antd";
|
|
3
|
+
export { notification as xNotification, version as xVersion } from "@ant-design/x";
|
|
4
|
+
export { notification, version } from "antd";
|
|
2
5
|
export { UbieConfigProvider } from "./UbieConfigProvider";
|
|
3
6
|
export type { UbieConfigProviderProps } from "./UbieConfigProvider";
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
|
|
3
|
+
import { Button, Space } from "../index";
|
|
4
|
+
import { antDesignStoryParameters, StoryFrame } from "./storyHelpers";
|
|
5
|
+
|
|
6
|
+
const meta = {
|
|
7
|
+
title: "Components/Button",
|
|
8
|
+
component: Button,
|
|
9
|
+
tags: ["autodocs"],
|
|
10
|
+
parameters: {
|
|
11
|
+
...antDesignStoryParameters("button"),
|
|
12
|
+
controls: { disable: false },
|
|
13
|
+
},
|
|
14
|
+
args: {
|
|
15
|
+
children: "Button",
|
|
16
|
+
},
|
|
17
|
+
} satisfies Meta<typeof Button>;
|
|
18
|
+
|
|
19
|
+
export default meta;
|
|
20
|
+
|
|
21
|
+
type Story = StoryObj<typeof meta>;
|
|
22
|
+
|
|
23
|
+
export const Primary: Story = {
|
|
24
|
+
args: {
|
|
25
|
+
type: "primary",
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export const Default: Story = {};
|
|
30
|
+
|
|
31
|
+
export const Types: Story = {
|
|
32
|
+
parameters: { controls: { disable: true } },
|
|
33
|
+
render: () => (
|
|
34
|
+
<StoryFrame>
|
|
35
|
+
<Space wrap>
|
|
36
|
+
<Button type="primary">Primary</Button>
|
|
37
|
+
<Button>Default</Button>
|
|
38
|
+
<Button type="dashed">Dashed</Button>
|
|
39
|
+
<Button type="text">Text</Button>
|
|
40
|
+
<Button type="link">Link</Button>
|
|
41
|
+
</Space>
|
|
42
|
+
</StoryFrame>
|
|
43
|
+
),
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export const Sizes: Story = {
|
|
47
|
+
parameters: { controls: { disable: true } },
|
|
48
|
+
render: () => (
|
|
49
|
+
<StoryFrame>
|
|
50
|
+
<Space align="center">
|
|
51
|
+
<Button size="large">Large</Button>
|
|
52
|
+
<Button>Middle</Button>
|
|
53
|
+
<Button size="small">Small</Button>
|
|
54
|
+
</Space>
|
|
55
|
+
</StoryFrame>
|
|
56
|
+
),
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export const IconPlacement: Story = {
|
|
60
|
+
parameters: { controls: { disable: true } },
|
|
61
|
+
render: () => (
|
|
62
|
+
<StoryFrame>
|
|
63
|
+
<Space>
|
|
64
|
+
<Button icon={<span aria-hidden>+</span>} iconPlacement="start">
|
|
65
|
+
Create
|
|
66
|
+
</Button>
|
|
67
|
+
<Button icon={<span aria-hidden>→</span>} iconPlacement="end" type="primary">
|
|
68
|
+
Continue
|
|
69
|
+
</Button>
|
|
70
|
+
</Space>
|
|
71
|
+
</StoryFrame>
|
|
72
|
+
),
|
|
73
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
|
|
4
|
+
import { Actions, type ActionsProps, Flex } from "../../index";
|
|
5
|
+
import { antDesignXStoryParameters, StoryFrame } from "../storyHelpers";
|
|
6
|
+
|
|
7
|
+
const basicItems: ActionsProps["items"] = [
|
|
8
|
+
{ key: "retry", icon: <span aria-hidden>↻</span>, label: "Retry" },
|
|
9
|
+
{ key: "edit", icon: <span aria-hidden>✎</span>, label: "Edit" },
|
|
10
|
+
];
|
|
11
|
+
|
|
12
|
+
const nestedItems: ActionsProps["items"] = [
|
|
13
|
+
{
|
|
14
|
+
key: "share",
|
|
15
|
+
icon: <span aria-hidden>↗</span>,
|
|
16
|
+
label: "Share",
|
|
17
|
+
subItems: [
|
|
18
|
+
{ key: "workspace", label: "Share to workspace" },
|
|
19
|
+
{ key: "email", label: "Send by email" },
|
|
20
|
+
],
|
|
21
|
+
},
|
|
22
|
+
{ key: "archive", icon: <span aria-hidden>□</span>, label: "Archive" },
|
|
23
|
+
];
|
|
24
|
+
|
|
25
|
+
function InteractiveActions({ items }: { items: ActionsProps["items"] }) {
|
|
26
|
+
const [lastAction, setLastAction] = useState("No action selected");
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<Flex vertical gap={16}>
|
|
30
|
+
<Actions items={items} onClick={({ item, key }) => setLastAction(item.label ?? key)} />
|
|
31
|
+
<span aria-live="polite">Last action: {lastAction}</span>
|
|
32
|
+
</Flex>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const meta = {
|
|
37
|
+
title: "Ant Design X/Actions",
|
|
38
|
+
component: Actions,
|
|
39
|
+
args: { items: basicItems },
|
|
40
|
+
tags: ["autodocs"],
|
|
41
|
+
parameters: antDesignXStoryParameters("actions"),
|
|
42
|
+
} satisfies Meta<typeof Actions>;
|
|
43
|
+
|
|
44
|
+
export default meta;
|
|
45
|
+
type Story = StoryObj<typeof meta>;
|
|
46
|
+
|
|
47
|
+
export const Basic: Story = {
|
|
48
|
+
render: () => (
|
|
49
|
+
<StoryFrame>
|
|
50
|
+
<InteractiveActions items={basicItems} />
|
|
51
|
+
</StoryFrame>
|
|
52
|
+
),
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export const NestedMenu: Story = {
|
|
56
|
+
render: () => (
|
|
57
|
+
<StoryFrame>
|
|
58
|
+
<InteractiveActions items={nestedItems} />
|
|
59
|
+
</StoryFrame>
|
|
60
|
+
),
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export const Variants: Story = {
|
|
64
|
+
render: () => (
|
|
65
|
+
<StoryFrame>
|
|
66
|
+
<Flex vertical gap={16}>
|
|
67
|
+
<Actions items={basicItems} variant="borderless" />
|
|
68
|
+
<Actions items={basicItems} variant="filled" />
|
|
69
|
+
<Actions items={basicItems} variant="outlined" />
|
|
70
|
+
</Flex>
|
|
71
|
+
</StoryFrame>
|
|
72
|
+
),
|
|
73
|
+
};
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
|
|
4
|
+
import { Attachments, type AttachmentsProps } from "../../index";
|
|
5
|
+
import { antDesignXStoryParameters, placeholderImage, StoryFrame } from "../storyHelpers";
|
|
6
|
+
|
|
7
|
+
const preventUpload = () => false as const;
|
|
8
|
+
|
|
9
|
+
const fileStates = [
|
|
10
|
+
{
|
|
11
|
+
uid: "brief",
|
|
12
|
+
name: "project-brief.pdf",
|
|
13
|
+
status: "done",
|
|
14
|
+
size: 248_000,
|
|
15
|
+
description: "Approved project brief",
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
uid: "research",
|
|
19
|
+
name: "research-notes.docx",
|
|
20
|
+
status: "uploading",
|
|
21
|
+
percent: 64,
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
uid: "archive",
|
|
25
|
+
name: "legacy-assets.zip",
|
|
26
|
+
status: "error",
|
|
27
|
+
response: "The archive could not be processed.",
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
uid: "cover",
|
|
31
|
+
name: "report-cover.svg",
|
|
32
|
+
status: "done",
|
|
33
|
+
thumbUrl: placeholderImage("Report"),
|
|
34
|
+
},
|
|
35
|
+
] satisfies NonNullable<AttachmentsProps["items"]>;
|
|
36
|
+
|
|
37
|
+
function RemovableAttachments() {
|
|
38
|
+
const [items, setItems] = useState(fileStates.filter((item) => item.status === "done"));
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<Attachments
|
|
42
|
+
beforeUpload={preventUpload}
|
|
43
|
+
items={items}
|
|
44
|
+
onRemove={(file) => {
|
|
45
|
+
setItems((current) => current.filter((item) => item.uid !== file.uid));
|
|
46
|
+
return true;
|
|
47
|
+
}}
|
|
48
|
+
overflow="wrap"
|
|
49
|
+
/>
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const meta = {
|
|
54
|
+
title: "Ant Design X/Attachments",
|
|
55
|
+
component: Attachments,
|
|
56
|
+
tags: ["autodocs"],
|
|
57
|
+
parameters: antDesignXStoryParameters(
|
|
58
|
+
"attachments",
|
|
59
|
+
"All examples use local fixture data and prevent uploads.",
|
|
60
|
+
),
|
|
61
|
+
} satisfies Meta<typeof Attachments>;
|
|
62
|
+
|
|
63
|
+
export default meta;
|
|
64
|
+
type Story = StoryObj<typeof meta>;
|
|
65
|
+
|
|
66
|
+
export const FileStates: Story = {
|
|
67
|
+
render: () => (
|
|
68
|
+
<StoryFrame style={{ width: 720 }}>
|
|
69
|
+
<Attachments beforeUpload={preventUpload} items={fileStates} overflow="wrap" />
|
|
70
|
+
</StoryFrame>
|
|
71
|
+
),
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
export const RemovableList: Story = {
|
|
75
|
+
render: () => (
|
|
76
|
+
<StoryFrame style={{ width: 720 }}>
|
|
77
|
+
<RemovableAttachments />
|
|
78
|
+
</StoryFrame>
|
|
79
|
+
),
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
export const DisabledDropArea: Story = {
|
|
83
|
+
render: () => (
|
|
84
|
+
<StoryFrame>
|
|
85
|
+
<Attachments
|
|
86
|
+
beforeUpload={preventUpload}
|
|
87
|
+
disabled
|
|
88
|
+
items={[]}
|
|
89
|
+
placeholder={{
|
|
90
|
+
icon: (
|
|
91
|
+
<span style={{ fontSize: 28 }} aria-hidden>
|
|
92
|
+
↑
|
|
93
|
+
</span>
|
|
94
|
+
),
|
|
95
|
+
title: "Drop reference files here",
|
|
96
|
+
description: "File selection is disabled in this Storybook example.",
|
|
97
|
+
}}
|
|
98
|
+
/>
|
|
99
|
+
</StoryFrame>
|
|
100
|
+
),
|
|
101
|
+
};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
|
|
3
|
+
import { Avatar, Bubble, type BubbleListProps, Flex } from "../../index";
|
|
4
|
+
import { antDesignXStoryParameters, StoryFrame } from "../storyHelpers";
|
|
5
|
+
|
|
6
|
+
const conversationItems: BubbleListProps["items"] = [
|
|
7
|
+
{
|
|
8
|
+
key: "welcome",
|
|
9
|
+
role: "system",
|
|
10
|
+
content: "New conversation started",
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
key: "question",
|
|
14
|
+
role: "user",
|
|
15
|
+
content: "Summarize the latest project update.",
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
key: "answer",
|
|
19
|
+
role: "ai",
|
|
20
|
+
content: "The project is on schedule, with research complete and implementation underway.",
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
key: "milestone",
|
|
24
|
+
role: "divider",
|
|
25
|
+
content: "Today",
|
|
26
|
+
},
|
|
27
|
+
];
|
|
28
|
+
|
|
29
|
+
const meta = {
|
|
30
|
+
title: "Ant Design X/Bubble",
|
|
31
|
+
component: Bubble,
|
|
32
|
+
args: { content: "" },
|
|
33
|
+
tags: ["autodocs"],
|
|
34
|
+
parameters: antDesignXStoryParameters("bubble"),
|
|
35
|
+
} satisfies Meta<typeof Bubble>;
|
|
36
|
+
|
|
37
|
+
export default meta;
|
|
38
|
+
type Story = StoryObj<typeof meta>;
|
|
39
|
+
|
|
40
|
+
export const Basic: Story = {
|
|
41
|
+
render: () => (
|
|
42
|
+
<StoryFrame>
|
|
43
|
+
<Bubble
|
|
44
|
+
avatar={<Avatar>AI</Avatar>}
|
|
45
|
+
content="Hello! How can I help with your project today?"
|
|
46
|
+
footer="Generated locally for this preview"
|
|
47
|
+
header="Project assistant"
|
|
48
|
+
/>
|
|
49
|
+
</StoryFrame>
|
|
50
|
+
),
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export const ConversationList: Story = {
|
|
54
|
+
render: () => (
|
|
55
|
+
<StoryFrame style={{ height: 420, width: 720 }}>
|
|
56
|
+
<Bubble.List
|
|
57
|
+
items={conversationItems}
|
|
58
|
+
role={{
|
|
59
|
+
ai: { avatar: <Avatar>AI</Avatar>, placement: "start" },
|
|
60
|
+
user: { avatar: <Avatar>YO</Avatar>, placement: "end" },
|
|
61
|
+
}}
|
|
62
|
+
/>
|
|
63
|
+
</StoryFrame>
|
|
64
|
+
),
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export const VariantsAndShapes: Story = {
|
|
68
|
+
render: () => (
|
|
69
|
+
<StoryFrame>
|
|
70
|
+
<Flex vertical gap={16}>
|
|
71
|
+
<Bubble content="Filled default bubble" variant="filled" />
|
|
72
|
+
<Bubble content="Outlined round bubble" shape="round" variant="outlined" />
|
|
73
|
+
<Bubble content="Shadow corner bubble" placement="end" shape="corner" variant="shadow" />
|
|
74
|
+
<Bubble content="Borderless bubble" variant="borderless" />
|
|
75
|
+
</Flex>
|
|
76
|
+
</StoryFrame>
|
|
77
|
+
),
|
|
78
|
+
};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
|
|
3
|
+
import { CodeHighlighter, Flex, Tag } from "../../index";
|
|
4
|
+
import { antDesignXStoryParameters, StoryFrame } from "../storyHelpers";
|
|
5
|
+
|
|
6
|
+
const typescriptExample = `type Project = {
|
|
7
|
+
name: string;
|
|
8
|
+
status: "planned" | "active" | "complete";
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const project: Project = {
|
|
12
|
+
name: "Design system rollout",
|
|
13
|
+
status: "active",
|
|
14
|
+
};`;
|
|
15
|
+
|
|
16
|
+
const jsonExample = JSON.stringify(
|
|
17
|
+
{
|
|
18
|
+
project: "Vitals",
|
|
19
|
+
milestones: ["research", "implementation", "launch"],
|
|
20
|
+
onTrack: true,
|
|
21
|
+
},
|
|
22
|
+
null,
|
|
23
|
+
2,
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
const cssExample = `.project-card {
|
|
27
|
+
display: grid;
|
|
28
|
+
gap: 1rem;
|
|
29
|
+
padding: 1.5rem;
|
|
30
|
+
border: 1px solid currentColor;
|
|
31
|
+
}`;
|
|
32
|
+
|
|
33
|
+
const meta = {
|
|
34
|
+
title: "Ant Design X/CodeHighlighter",
|
|
35
|
+
component: CodeHighlighter,
|
|
36
|
+
args: { children: "" },
|
|
37
|
+
tags: ["autodocs"],
|
|
38
|
+
parameters: antDesignXStoryParameters("code-highlighter"),
|
|
39
|
+
} satisfies Meta<typeof CodeHighlighter>;
|
|
40
|
+
|
|
41
|
+
export default meta;
|
|
42
|
+
type Story = StoryObj<typeof meta>;
|
|
43
|
+
|
|
44
|
+
export const Basic: Story = {
|
|
45
|
+
render: () => (
|
|
46
|
+
<StoryFrame style={{ width: 720 }}>
|
|
47
|
+
<CodeHighlighter lang="typescript" prismLightMode={false}>
|
|
48
|
+
{typescriptExample}
|
|
49
|
+
</CodeHighlighter>
|
|
50
|
+
</StoryFrame>
|
|
51
|
+
),
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export const CustomHeader: Story = {
|
|
55
|
+
render: () => (
|
|
56
|
+
<StoryFrame style={{ width: 720 }}>
|
|
57
|
+
<CodeHighlighter
|
|
58
|
+
header={() => (
|
|
59
|
+
<Flex align="center" justify="space-between">
|
|
60
|
+
<strong>project.json</strong>
|
|
61
|
+
<Tag color="blue">JSON</Tag>
|
|
62
|
+
</Flex>
|
|
63
|
+
)}
|
|
64
|
+
lang="json"
|
|
65
|
+
prismLightMode={false}
|
|
66
|
+
>
|
|
67
|
+
{jsonExample}
|
|
68
|
+
</CodeHighlighter>
|
|
69
|
+
</StoryFrame>
|
|
70
|
+
),
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export const Headerless: Story = {
|
|
74
|
+
render: () => (
|
|
75
|
+
<StoryFrame style={{ width: 720 }}>
|
|
76
|
+
<CodeHighlighter
|
|
77
|
+
header={false}
|
|
78
|
+
highlightProps={{ wrapLongLines: true }}
|
|
79
|
+
lang="css"
|
|
80
|
+
prismLightMode={false}
|
|
81
|
+
>
|
|
82
|
+
{cssExample}
|
|
83
|
+
</CodeHighlighter>
|
|
84
|
+
</StoryFrame>
|
|
85
|
+
),
|
|
86
|
+
};
|