@anker-in/headless-ui 0.0.27-alpha.0 → 0.0.27-alpha.2
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/cjs/biz-components/BrandEquity/BrandEquity.js +1 -1
- package/dist/cjs/biz-components/BrandEquity/BrandEquity.js.map +2 -2
- package/dist/cjs/biz-components/Category/index.js +1 -1
- package/dist/cjs/biz-components/Category/index.js.map +2 -2
- package/dist/cjs/biz-components/Evaluate/index.d.ts +1 -0
- package/dist/cjs/biz-components/Evaluate/index.js +1 -1
- package/dist/cjs/biz-components/Evaluate/index.js.map +3 -3
- package/dist/cjs/biz-components/Marquee/index.js +1 -1
- package/dist/cjs/biz-components/Marquee/index.js.map +2 -2
- package/dist/cjs/biz-components/MemberEquity/index.js +30 -30
- package/dist/cjs/biz-components/MemberEquity/index.js.map +2 -2
- package/dist/cjs/biz-components/ShelfDisplay/index.js +9 -9
- package/dist/cjs/biz-components/ShelfDisplay/index.js.map +2 -2
- package/dist/cjs/biz-components/Slogan/index.js +1 -1
- package/dist/cjs/biz-components/Slogan/index.js.map +2 -2
- package/dist/cjs/components/button.js +1 -1
- package/dist/cjs/components/button.js.map +2 -2
- package/dist/cjs/components/card.js +1 -1
- package/dist/cjs/components/card.js.map +2 -2
- package/dist/cjs/components/carousel.js +1 -1
- package/dist/cjs/components/carousel.js.map +2 -2
- package/dist/cjs/components/container.js +1 -1
- package/dist/cjs/components/container.js.map +2 -2
- package/dist/cjs/components/dialog.js +1 -1
- package/dist/cjs/components/dialog.js.map +2 -2
- package/dist/cjs/components/gird.js +1 -1
- package/dist/cjs/components/gird.js.map +2 -2
- package/dist/cjs/components/heading.d.ts +1 -1
- package/dist/cjs/components/heading.js +1 -1
- package/dist/cjs/components/heading.js.map +2 -2
- package/dist/cjs/components/text.js +1 -1
- package/dist/cjs/components/text.js.map +1 -1
- package/dist/cjs/stories/container.stories.js +6 -6
- package/dist/cjs/stories/container.stories.js.map +2 -2
- package/dist/cjs/stories/dialog.stories.js +1 -1
- package/dist/cjs/stories/dialog.stories.js.map +2 -2
- package/dist/cjs/stories/evaluate.stories.js +1 -1
- package/dist/cjs/stories/evaluate.stories.js.map +2 -2
- package/dist/cjs/stories/heading.stories.d.ts +3 -2
- package/dist/cjs/stories/heading.stories.js +1 -1
- package/dist/cjs/stories/heading.stories.js.map +2 -2
- package/dist/cjs/stories/text.stories.js +1 -1
- package/dist/cjs/stories/text.stories.js.map +2 -2
- package/dist/esm/biz-components/BrandEquity/BrandEquity.js +1 -1
- package/dist/esm/biz-components/BrandEquity/BrandEquity.js.map +2 -2
- package/dist/esm/biz-components/Category/index.js +1 -1
- package/dist/esm/biz-components/Category/index.js.map +2 -2
- package/dist/esm/biz-components/Evaluate/index.d.ts +1 -0
- package/dist/esm/biz-components/Evaluate/index.js +1 -1
- package/dist/esm/biz-components/Evaluate/index.js.map +3 -3
- package/dist/esm/biz-components/Marquee/index.js +1 -1
- package/dist/esm/biz-components/Marquee/index.js.map +2 -2
- package/dist/esm/biz-components/MemberEquity/index.js +29 -29
- package/dist/esm/biz-components/MemberEquity/index.js.map +2 -2
- package/dist/esm/biz-components/ShelfDisplay/index.js +9 -9
- package/dist/esm/biz-components/ShelfDisplay/index.js.map +2 -2
- package/dist/esm/biz-components/Slogan/index.js +1 -1
- package/dist/esm/biz-components/Slogan/index.js.map +2 -2
- package/dist/esm/components/button.js +1 -1
- package/dist/esm/components/button.js.map +2 -2
- package/dist/esm/components/card.js +1 -1
- package/dist/esm/components/card.js.map +2 -2
- package/dist/esm/components/carousel.js +1 -1
- package/dist/esm/components/carousel.js.map +2 -2
- package/dist/esm/components/container.js +1 -1
- package/dist/esm/components/container.js.map +2 -2
- package/dist/esm/components/dialog.js +1 -1
- package/dist/esm/components/dialog.js.map +2 -2
- package/dist/esm/components/gird.js +1 -1
- package/dist/esm/components/gird.js.map +2 -2
- package/dist/esm/components/heading.d.ts +1 -1
- package/dist/esm/components/heading.js +1 -1
- package/dist/esm/components/heading.js.map +2 -2
- package/dist/esm/components/text.js +1 -1
- package/dist/esm/components/text.js.map +1 -1
- package/dist/esm/stories/container.stories.js +6 -6
- package/dist/esm/stories/container.stories.js.map +2 -2
- package/dist/esm/stories/dialog.stories.js +1 -1
- package/dist/esm/stories/dialog.stories.js.map +2 -2
- package/dist/esm/stories/evaluate.stories.js +1 -1
- package/dist/esm/stories/evaluate.stories.js.map +2 -2
- package/dist/esm/stories/heading.stories.d.ts +3 -2
- package/dist/esm/stories/heading.stories.js +1 -1
- package/dist/esm/stories/heading.stories.js.map +2 -2
- package/dist/esm/stories/text.stories.js +2 -2
- package/dist/esm/stories/text.stories.js.map +2 -2
- package/package.json +2 -3
- package/style.css +69 -34
- package/src/biz-components/BrandEquity/BrandEquity.tsx +0 -77
- package/src/biz-components/BrandEquity/index.ts +0 -1
- package/src/biz-components/Category/index.tsx +0 -57
- package/src/biz-components/Evaluate/index.tsx +0 -85
- package/src/biz-components/HeroBanner/HeroBanner.tsx +0 -103
- package/src/biz-components/HeroBanner/index.tsx +0 -1
- package/src/biz-components/HeroBanner/types.ts +0 -28
- package/src/biz-components/Marquee/index.tsx +0 -79
- package/src/biz-components/MemberEquity/index.tsx +0 -114
- package/src/biz-components/MemberEquity/types.ts +0 -26
- package/src/biz-components/Shelf/Shelf.tsx +0 -22
- package/src/biz-components/Shelf/index.ts +0 -1
- package/src/biz-components/Shelf/types.ts +0 -6
- package/src/biz-components/ShelfDisplay/index.tsx +0 -142
- package/src/biz-components/Slogan/index.tsx +0 -53
- package/src/biz-components/Slogan/types.ts +0 -25
- package/src/biz-components/index.ts +0 -11
- package/src/components/alert.tsx +0 -124
- package/src/components/avatar.tsx +0 -126
- package/src/components/badge.tsx +0 -27
- package/src/components/button.tsx +0 -183
- package/src/components/card.tsx +0 -51
- package/src/components/carousel.tsx +0 -352
- package/src/components/checkbox.tsx +0 -42
- package/src/components/color.tsx +0 -77
- package/src/components/container.tsx +0 -28
- package/src/components/dialog.tsx +0 -98
- package/src/components/drawer.tsx +0 -115
- package/src/components/drop-down.tsx +0 -182
- package/src/components/gird.tsx +0 -90
- package/src/components/heading.tsx +0 -80
- package/src/components/index.ts +0 -26
- package/src/components/input-number.tsx +0 -216
- package/src/components/input.tsx +0 -79
- package/src/components/link.tsx +0 -99
- package/src/components/picture.tsx +0 -100
- package/src/components/popover.tsx +0 -31
- package/src/components/radio.tsx +0 -85
- package/src/components/skeleton.tsx +0 -41
- package/src/components/tabs.tsx +0 -78
- package/src/components/text.tsx +0 -99
- package/src/components/theme.tsx +0 -20
- package/src/helpers/component-props.ts +0 -17
- package/src/helpers/constants.ts +0 -0
- package/src/helpers/index.ts +0 -2
- package/src/helpers/utils.ts +0 -16
- package/src/icons/spinner.tsx +0 -26
- package/src/index.ts +0 -1
- package/src/shared/Styles.tsx +0 -94
- package/src/stories/HeroBanner.stories.tsx +0 -86
- package/src/stories/MemberEquity.stories.tsx +0 -107
- package/src/stories/alert.stories.tsx +0 -41
- package/src/stories/avatar.stories.tsx +0 -83
- package/src/stories/badge.stories.tsx +0 -40
- package/src/stories/brandEquity.stories.tsx +0 -73
- package/src/stories/button.stories.tsx +0 -145
- package/src/stories/card.stories.tsx +0 -97
- package/src/stories/carousel.stories.tsx +0 -161
- package/src/stories/category.stories.tsx +0 -52
- package/src/stories/checkbox.stories.tsx +0 -93
- package/src/stories/container.stories.tsx +0 -97
- package/src/stories/dialog.stories.tsx +0 -74
- package/src/stories/drawer.stories.tsx +0 -88
- package/src/stories/drop-down.stories.tsx +0 -83
- package/src/stories/evaluate.stories.tsx +0 -53
- package/src/stories/grid.stories.tsx +0 -190
- package/src/stories/heading.stories.tsx +0 -96
- package/src/stories/input-number.stories.tsx +0 -52
- package/src/stories/input.stories.tsx +0 -64
- package/src/stories/link.stories.tsx +0 -142
- package/src/stories/marquee.stories.tsx +0 -102
- package/src/stories/picture.stories.tsx +0 -51
- package/src/stories/popover.stories.tsx +0 -41
- package/src/stories/radio.stories.tsx +0 -55
- package/src/stories/shelf.stories.tsx +0 -35
- package/src/stories/shelfDisplay.stories.tsx +0 -69
- package/src/stories/skeleton.stories.tsx +0 -67
- package/src/stories/slogan.stories.tsx +0 -99
- package/src/stories/tabs.stories.tsx +0 -179
- package/src/stories/text.stories.tsx +0 -130
- package/src/styles/global.css +0 -4
- package/src/styles/index.css +0 -0
- package/src/types/index.ts +0 -0
- package/src/types/props.ts +0 -5
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { Container } from '../components/index.js'
|
|
3
|
-
import type { Meta, StoryObj } from '@storybook/react'
|
|
4
|
-
import { cn } from '../helpers/utils.js'
|
|
5
|
-
|
|
6
|
-
const meta = {
|
|
7
|
-
title: 'Layout/Container',
|
|
8
|
-
component: Container,
|
|
9
|
-
parameters: {
|
|
10
|
-
layout: 'fullscreen',
|
|
11
|
-
docs: {
|
|
12
|
-
description: {
|
|
13
|
-
component: `
|
|
14
|
-
Container 容器组件,用于限制和约束内容的最大宽度,实现响应式的页面布局。
|
|
15
|
-
|
|
16
|
-
### 实现细节
|
|
17
|
-
- 基于 Tailwind CSS 实现
|
|
18
|
-
- 默认最大宽度为 1664px
|
|
19
|
-
- 响应式边距设计:
|
|
20
|
-
- 默认: 左右边距 16px (mx-4)
|
|
21
|
-
- sm: 左右边距 32px (mx-8)
|
|
22
|
-
- md: 左右边距 64px (mx-16)
|
|
23
|
-
- lg: 左右边距 64px (mx-16)
|
|
24
|
-
- xl: 左右边距 128px (mx-32)
|
|
25
|
-
|
|
26
|
-
`,
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
tags: ['autodocs'],
|
|
31
|
-
} satisfies Meta<typeof Container>
|
|
32
|
-
|
|
33
|
-
export default meta
|
|
34
|
-
|
|
35
|
-
type Story = StoryObj<typeof Container>
|
|
36
|
-
|
|
37
|
-
// 基础示例
|
|
38
|
-
export const Basic = () => (
|
|
39
|
-
<Container className="p-4">
|
|
40
|
-
<div className="bg-blue-100 p-4 rounded-lg text-center">
|
|
41
|
-
基础容器 - 自动居中,响应式宽度
|
|
42
|
-
</div>
|
|
43
|
-
</Container>
|
|
44
|
-
)
|
|
45
|
-
|
|
46
|
-
// 带内边距和背景色
|
|
47
|
-
export const WithPaddingAndBackground = () => (
|
|
48
|
-
<Container className="p-4 bg-gray-50">
|
|
49
|
-
<div className="space-y-4">
|
|
50
|
-
<div className="bg-white p-4 rounded-lg shadow-sm">
|
|
51
|
-
<h3 className="text-lg font-medium">内容区块 1</h3>
|
|
52
|
-
<p className="text-gray-600">带有内边距和背景色的容器示例</p>
|
|
53
|
-
</div>
|
|
54
|
-
<div className="bg-white p-4 rounded-lg shadow-sm">
|
|
55
|
-
<h3 className="text-lg font-medium">内容区块 2</h3>
|
|
56
|
-
<p className="text-gray-600">展示内容的组织方式</p>
|
|
57
|
-
</div>
|
|
58
|
-
</div>
|
|
59
|
-
</Container>
|
|
60
|
-
)
|
|
61
|
-
|
|
62
|
-
// 响应式内边距
|
|
63
|
-
export const ResponsivePadding = () => (
|
|
64
|
-
<Container className="px-4 sm:px-6 md:px-8 py-4 bg-gradient-to-r from-blue-50 to-purple-50">
|
|
65
|
-
<div className="bg-white p-4 rounded-lg shadow-sm">
|
|
66
|
-
<h3 className="text-lg font-medium">响应式内边距</h3>
|
|
67
|
-
<p className="text-gray-600">
|
|
68
|
-
在不同屏幕尺寸下有不同的水平内边距:
|
|
69
|
-
<br />
|
|
70
|
-
默认: px-4 (16px)
|
|
71
|
-
<br />
|
|
72
|
-
sm: px-6 (24px)
|
|
73
|
-
<br />
|
|
74
|
-
md: px-8 (32px)
|
|
75
|
-
</p>
|
|
76
|
-
</div>
|
|
77
|
-
</Container>
|
|
78
|
-
)
|
|
79
|
-
|
|
80
|
-
// 嵌套内容示例
|
|
81
|
-
export const NestedContent = () => (
|
|
82
|
-
<Container className="p-4">
|
|
83
|
-
<header className="bg-gray-800 text-white p-4 rounded-t-lg">
|
|
84
|
-
<h2 className="text-xl">页面标题</h2>
|
|
85
|
-
</header>
|
|
86
|
-
<main className="bg-white p-4 border-x border-gray-200">
|
|
87
|
-
<p className="text-gray-600 mb-4">主要内容区域</p>
|
|
88
|
-
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
|
89
|
-
<div className="bg-blue-50 p-4 rounded">内容块 1</div>
|
|
90
|
-
<div className="bg-purple-50 p-4 rounded">内容块 2</div>
|
|
91
|
-
</div>
|
|
92
|
-
</main>
|
|
93
|
-
<footer className="bg-gray-100 p-4 rounded-b-lg border-x border-b border-gray-200">
|
|
94
|
-
<p className="text-gray-500 text-sm">页脚内容</p>
|
|
95
|
-
</footer>
|
|
96
|
-
</Container>
|
|
97
|
-
)
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import {
|
|
3
|
-
Button,
|
|
4
|
-
Dialog,
|
|
5
|
-
DialogContent,
|
|
6
|
-
DialogDescription,
|
|
7
|
-
DialogFooter,
|
|
8
|
-
DialogHeader,
|
|
9
|
-
DialogTitle,
|
|
10
|
-
DialogTrigger,
|
|
11
|
-
Input,
|
|
12
|
-
} from '../components/index.js'
|
|
13
|
-
import type { Meta, StoryObj } from '@storybook/react/*'
|
|
14
|
-
|
|
15
|
-
const meta = {
|
|
16
|
-
title: 'Components/Dialog',
|
|
17
|
-
component: Dialog,
|
|
18
|
-
subcomponents: {
|
|
19
|
-
DialogTrigger,
|
|
20
|
-
DialogContent,
|
|
21
|
-
DialogHeader,
|
|
22
|
-
DialogTitle,
|
|
23
|
-
DialogDescription,
|
|
24
|
-
DialogFooter,
|
|
25
|
-
} as any,
|
|
26
|
-
parameters: {
|
|
27
|
-
layout: 'centered',
|
|
28
|
-
docs: {
|
|
29
|
-
description: {
|
|
30
|
-
component: '弹窗组件,基于@radix-ui/react-dialog,https://www.radix-ui.com/primitives/docs/components/dialog ',
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
tags: ['autodocs'],
|
|
35
|
-
} satisfies Meta<typeof Dialog>
|
|
36
|
-
|
|
37
|
-
export default meta
|
|
38
|
-
|
|
39
|
-
type Story = StoryObj<typeof Dialog>
|
|
40
|
-
|
|
41
|
-
export const Default: Story = {
|
|
42
|
-
args: {
|
|
43
|
-
children: (
|
|
44
|
-
<>
|
|
45
|
-
<DialogTrigger asChild>
|
|
46
|
-
<button>Edit Profile</button>
|
|
47
|
-
</DialogTrigger>
|
|
48
|
-
<DialogContent className="sm:max-w-[425px]">
|
|
49
|
-
<DialogHeader>
|
|
50
|
-
<DialogTitle>Edit profile</DialogTitle>
|
|
51
|
-
<DialogDescription>Make changes to your profile here. Click save when you're done.</DialogDescription>
|
|
52
|
-
</DialogHeader>
|
|
53
|
-
<div className="grid gap-4 py-4">
|
|
54
|
-
<div className="grid grid-cols-4 items-center gap-4">
|
|
55
|
-
<label htmlFor="name" className="text-right">
|
|
56
|
-
Name
|
|
57
|
-
</label>
|
|
58
|
-
<Input id="name" defaultValue="Pedro Duarte" className="col-span-3" />
|
|
59
|
-
</div>
|
|
60
|
-
<div className="grid grid-cols-4 items-center gap-4">
|
|
61
|
-
<label htmlFor="username" className="text-right">
|
|
62
|
-
Username
|
|
63
|
-
</label>
|
|
64
|
-
<Input id="username" defaultValue="@peduarte" className="col-span-3" />
|
|
65
|
-
</div>
|
|
66
|
-
</div>
|
|
67
|
-
<DialogFooter>
|
|
68
|
-
<Button type="submit">Save changes</Button>
|
|
69
|
-
</DialogFooter>
|
|
70
|
-
</DialogContent>
|
|
71
|
-
</>
|
|
72
|
-
),
|
|
73
|
-
},
|
|
74
|
-
}
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import {
|
|
3
|
-
Drawer,
|
|
4
|
-
DrawerClose,
|
|
5
|
-
DrawerContent,
|
|
6
|
-
DrawerFooter,
|
|
7
|
-
DrawerHeader,
|
|
8
|
-
DrawerTrigger,
|
|
9
|
-
Button,
|
|
10
|
-
} from '../components/index.js'
|
|
11
|
-
import type { Meta, StoryObj } from '@storybook/react'
|
|
12
|
-
|
|
13
|
-
const meta = {
|
|
14
|
-
title: 'Components/Drawer',
|
|
15
|
-
component: Drawer,
|
|
16
|
-
subcomponents: {
|
|
17
|
-
DrawerClose,
|
|
18
|
-
DrawerContent,
|
|
19
|
-
DrawerFooter,
|
|
20
|
-
DrawerHeader,
|
|
21
|
-
DrawerTrigger,
|
|
22
|
-
} as any,
|
|
23
|
-
parameters: {
|
|
24
|
-
layout: 'centered',
|
|
25
|
-
docs: {
|
|
26
|
-
description: {
|
|
27
|
-
component: '抽屉组件;基于 https://vaul.emilkowal.ski/api 开发',
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
tags: ['autodocs'],
|
|
32
|
-
} satisfies Meta<typeof Drawer>
|
|
33
|
-
|
|
34
|
-
export default meta
|
|
35
|
-
|
|
36
|
-
type Story = StoryObj<typeof Drawer>
|
|
37
|
-
|
|
38
|
-
export const Default: Story = {
|
|
39
|
-
args: {
|
|
40
|
-
direction: 'right',
|
|
41
|
-
children: (
|
|
42
|
-
<>
|
|
43
|
-
<DrawerTrigger asChild>
|
|
44
|
-
<Button>Open Drawer</Button>
|
|
45
|
-
</DrawerTrigger>
|
|
46
|
-
<DrawerContent>
|
|
47
|
-
<div className="mx-auto w-full max-w-sm">
|
|
48
|
-
<DrawerHeader>
|
|
49
|
-
<span>My Cart(0)</span>
|
|
50
|
-
</DrawerHeader>
|
|
51
|
-
<div className="p-4 pb-0">The contents of the drawer...</div>
|
|
52
|
-
<DrawerFooter>
|
|
53
|
-
<DrawerClose asChild>
|
|
54
|
-
<Button>Cancel</Button>
|
|
55
|
-
</DrawerClose>
|
|
56
|
-
</DrawerFooter>
|
|
57
|
-
</div>
|
|
58
|
-
</DrawerContent>
|
|
59
|
-
</>
|
|
60
|
-
),
|
|
61
|
-
},
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export const Bottom: Story = {
|
|
65
|
-
args: {
|
|
66
|
-
direction: 'bottom',
|
|
67
|
-
children: (
|
|
68
|
-
<>
|
|
69
|
-
<DrawerTrigger asChild>
|
|
70
|
-
<Button>Open Drawer</Button>
|
|
71
|
-
</DrawerTrigger>
|
|
72
|
-
<DrawerContent>
|
|
73
|
-
<div className="mx-auto w-full max-w-sm">
|
|
74
|
-
<DrawerHeader>
|
|
75
|
-
<span>Policy</span>
|
|
76
|
-
</DrawerHeader>
|
|
77
|
-
<div className="p-4 pb-0">The contents of the drawer...</div>
|
|
78
|
-
<DrawerFooter>
|
|
79
|
-
<DrawerClose asChild>
|
|
80
|
-
<Button className="ai-w-40">Agree</Button>
|
|
81
|
-
</DrawerClose>
|
|
82
|
-
</DrawerFooter>
|
|
83
|
-
</div>
|
|
84
|
-
</DrawerContent>
|
|
85
|
-
</>
|
|
86
|
-
),
|
|
87
|
-
},
|
|
88
|
-
}
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import type { Meta } from '@storybook/react'
|
|
2
|
-
import {
|
|
3
|
-
DropdownMenu,
|
|
4
|
-
DropdownMenuTrigger,
|
|
5
|
-
DropdownMenuContent,
|
|
6
|
-
DropdownMenuItem,
|
|
7
|
-
DropdownMenuCheckboxItem,
|
|
8
|
-
DropdownMenuRadioItem,
|
|
9
|
-
DropdownMenuLabel,
|
|
10
|
-
DropdownMenuSeparator,
|
|
11
|
-
DropdownMenuShortcut,
|
|
12
|
-
DropdownMenuGroup,
|
|
13
|
-
DropdownMenuPortal,
|
|
14
|
-
DropdownMenuSub,
|
|
15
|
-
DropdownMenuSubContent,
|
|
16
|
-
DropdownMenuSubTrigger,
|
|
17
|
-
DropdownMenuRadioGroup,
|
|
18
|
-
} from '../components/drop-down'
|
|
19
|
-
|
|
20
|
-
const meta = {
|
|
21
|
-
// 同时定义了页面左侧菜单
|
|
22
|
-
title: 'Components/DropDown',
|
|
23
|
-
component: DropdownMenu,
|
|
24
|
-
subcomponents: {
|
|
25
|
-
DropdownMenuTrigger,
|
|
26
|
-
DropdownMenuContent,
|
|
27
|
-
DropdownMenuItem,
|
|
28
|
-
DropdownMenuCheckboxItem,
|
|
29
|
-
DropdownMenuRadioItem,
|
|
30
|
-
DropdownMenuLabel,
|
|
31
|
-
DropdownMenuSeparator,
|
|
32
|
-
DropdownMenuShortcut,
|
|
33
|
-
DropdownMenuGroup,
|
|
34
|
-
DropdownMenuPortal,
|
|
35
|
-
DropdownMenuSub,
|
|
36
|
-
DropdownMenuSubContent,
|
|
37
|
-
DropdownMenuSubTrigger,
|
|
38
|
-
DropdownMenuRadioGroup,
|
|
39
|
-
} as any,
|
|
40
|
-
parameters: {
|
|
41
|
-
layout: 'centered',
|
|
42
|
-
docs: {
|
|
43
|
-
description: {
|
|
44
|
-
component:
|
|
45
|
-
'dropdown组件,基于@radix-ui/react-dropdown-menu,https://www.radix-ui.com/primitives/docs/components/dropdown-menu',
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
|
|
50
|
-
tags: ['autodocs'],
|
|
51
|
-
} satisfies Meta<typeof DropdownMenu>
|
|
52
|
-
|
|
53
|
-
export default meta
|
|
54
|
-
|
|
55
|
-
export const Default = () => (
|
|
56
|
-
<DropdownMenu>
|
|
57
|
-
<DropdownMenuTrigger asChild>
|
|
58
|
-
<span>Open</span>
|
|
59
|
-
</DropdownMenuTrigger>
|
|
60
|
-
<DropdownMenuContent>
|
|
61
|
-
<DropdownMenuLabel>My Account</DropdownMenuLabel>
|
|
62
|
-
<DropdownMenuGroup>
|
|
63
|
-
<DropdownMenuItem>
|
|
64
|
-
Profile
|
|
65
|
-
<DropdownMenuShortcut>⌘</DropdownMenuShortcut>
|
|
66
|
-
</DropdownMenuItem>
|
|
67
|
-
<DropdownMenuItem>Billing</DropdownMenuItem>
|
|
68
|
-
</DropdownMenuGroup>
|
|
69
|
-
<DropdownMenuGroup>
|
|
70
|
-
<DropdownMenuItem>Team</DropdownMenuItem>
|
|
71
|
-
<DropdownMenuSub>
|
|
72
|
-
<DropdownMenuSubTrigger>Invite users</DropdownMenuSubTrigger>
|
|
73
|
-
<DropdownMenuPortal>
|
|
74
|
-
<DropdownMenuSubContent>
|
|
75
|
-
<DropdownMenuItem>Email</DropdownMenuItem>
|
|
76
|
-
<DropdownMenuItem>Message</DropdownMenuItem>
|
|
77
|
-
</DropdownMenuSubContent>
|
|
78
|
-
</DropdownMenuPortal>
|
|
79
|
-
</DropdownMenuSub>
|
|
80
|
-
</DropdownMenuGroup>
|
|
81
|
-
</DropdownMenuContent>
|
|
82
|
-
</DropdownMenu>
|
|
83
|
-
)
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react'
|
|
2
|
-
import Evaluate from '../biz-components/Evaluate'
|
|
3
|
-
|
|
4
|
-
const meta = {
|
|
5
|
-
title: 'Biz-Components/Evaluate',
|
|
6
|
-
component: Evaluate,
|
|
7
|
-
parameters: {
|
|
8
|
-
layout: 'fullscreen',
|
|
9
|
-
},
|
|
10
|
-
tags: ['autodocs'],
|
|
11
|
-
} satisfies Meta<typeof Evaluate>
|
|
12
|
-
|
|
13
|
-
export default meta
|
|
14
|
-
type Story = StoryObj<typeof meta>
|
|
15
|
-
|
|
16
|
-
const mockItems = [
|
|
17
|
-
{
|
|
18
|
-
title: 'Theoldpiggery',
|
|
19
|
-
subTitle: 'Fast Charging for 3 Devices',
|
|
20
|
-
description: 'Anker Prime 27,650mAh Power Bank (250W)',
|
|
21
|
-
avatar: 'https://cdn.shopify.com/s/files/1/0521/9411/5753/files/85087c9c0ec8c86b481eaea247812c3e.png?v=1744612102',
|
|
22
|
-
img: 'https://cdn.shopify.com/s/files/1/0517/6767/3016/files/e7be0a68-29b9-431c-8c0f-21bf968b1545_Product_Image_2.png?v=1744274554',
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
title: 'Theoldpiggery',
|
|
26
|
-
subTitle: 'Fast Charging for 3 Devices',
|
|
27
|
-
description: 'Anker Prime 27,650mAh Power Bank (250W)',
|
|
28
|
-
avatar: 'https://cdn.shopify.com/s/files/1/0521/9411/5753/files/85087c9c0ec8c86b481eaea247812c3e.png?v=1744612102',
|
|
29
|
-
img: 'https://cdn.shopify.com/s/files/1/0517/6767/3016/files/e7be0a68-29b9-431c-8c0f-21bf968b1545_Product_Image_2.png?v=1744274554',
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
title: 'Theoldpiggery',
|
|
33
|
-
subTitle: 'Fast Charging for 3 Devices',
|
|
34
|
-
description: 'Anker Prime 27,650mAh Power Bank (250W)Anker Prime 27,650mAh Power Bank (250W)Anker Prime 27,650mAh Power Bank (250W)650mAh Power Bank (250W)650mAh Power Bank (250W)',
|
|
35
|
-
avatar: 'https://cdn.shopify.com/s/files/1/0521/9411/5753/files/85087c9c0ec8c86b481eaea247812c3e.png?v=1744612102',
|
|
36
|
-
img: 'https://cdn.shopify.com/s/files/1/0517/6767/3016/files/e7be0a68-29b9-431c-8c0f-21bf968b1545_Product_Image_2.png?v=1744274554',
|
|
37
|
-
},
|
|
38
|
-
]
|
|
39
|
-
|
|
40
|
-
export const Default: Story = {
|
|
41
|
-
args: {
|
|
42
|
-
products: mockItems,
|
|
43
|
-
className: 'p-4',
|
|
44
|
-
},
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export const Round: Story = {
|
|
48
|
-
args: {
|
|
49
|
-
products: mockItems,
|
|
50
|
-
className: 'p-4',
|
|
51
|
-
shape: 'round',
|
|
52
|
-
},
|
|
53
|
-
}
|
|
@@ -1,190 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import type { Meta, StoryObj } from '@storybook/react'
|
|
3
|
-
import { Grid, GridItem } from '../components/gird.js'
|
|
4
|
-
|
|
5
|
-
const meta = {
|
|
6
|
-
title: 'Layout/Grid',
|
|
7
|
-
component: Grid,
|
|
8
|
-
subcomponents: {
|
|
9
|
-
GridItem,
|
|
10
|
-
},
|
|
11
|
-
parameters: {
|
|
12
|
-
layout: 'fullscreen',
|
|
13
|
-
docs: {
|
|
14
|
-
description: {
|
|
15
|
-
component: `
|
|
16
|
-
Grid 布局组件,基于 CSS Grid 实现的 12 列网格系统。
|
|
17
|
-
|
|
18
|
-
### 实现细节
|
|
19
|
-
- Grid 组件使用 CSS Grid 布局,默认为 12 列网格
|
|
20
|
-
- 默认间距为 gap-3 (12px),在 md 断点后变为 gap-4 (16px)
|
|
21
|
-
- 使用 Tailwind CSS 的网格类实现,无需额外的 CSS
|
|
22
|
-
|
|
23
|
-
### 宽度 和 自定义定位开始和结束位置
|
|
24
|
-
- 使用 start 和 end 属性来指定网格项的开始和结束位置(1-13)
|
|
25
|
-
- 使用 span 属性来指定网格项的跨度(1-12)
|
|
26
|
-
`,
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
tags: ['autodocs'],
|
|
31
|
-
} satisfies Meta<typeof Grid>
|
|
32
|
-
|
|
33
|
-
export default meta
|
|
34
|
-
|
|
35
|
-
type Story = StoryObj<typeof Grid>
|
|
36
|
-
|
|
37
|
-
// 基础布局
|
|
38
|
-
export const Basic = () => (
|
|
39
|
-
<div className="p-4">
|
|
40
|
-
<Grid>
|
|
41
|
-
<GridItem span={12} className="bg-blue-100 p-4 text-center">span-12</GridItem>
|
|
42
|
-
<GridItem span={6} className="bg-blue-200 p-4 text-center">span-6</GridItem>
|
|
43
|
-
<GridItem span={6} className="bg-blue-300 p-4 text-center">span-6</GridItem>
|
|
44
|
-
<GridItem span={4} className="bg-blue-400 p-4 text-center">span-4</GridItem>
|
|
45
|
-
<GridItem span={4} className="bg-blue-500 p-4 text-center">span-4</GridItem>
|
|
46
|
-
<GridItem span={4} className="bg-blue-600 p-4 text-center">span-4</GridItem>
|
|
47
|
-
<GridItem span={3} className="bg-blue-700 p-4 text-center text-white">span-3</GridItem>
|
|
48
|
-
<GridItem span={3} className="bg-blue-800 p-4 text-center text-white">span-3</GridItem>
|
|
49
|
-
<GridItem span={3} className="bg-blue-900 p-4 text-center text-white">span-3</GridItem>
|
|
50
|
-
<GridItem span={3} className="bg-blue-950 p-4 text-center text-white">span-3</GridItem>
|
|
51
|
-
</Grid>
|
|
52
|
-
</div>
|
|
53
|
-
)
|
|
54
|
-
|
|
55
|
-
type GridStart = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12
|
|
56
|
-
type GridEnd = 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
export const CustomPosition = ({
|
|
61
|
-
baseStart = 2,
|
|
62
|
-
baseEnd = 6,
|
|
63
|
-
showBoundaryExamples = true,
|
|
64
|
-
gridGap = '',
|
|
65
|
-
colorScheme = 'blue'
|
|
66
|
-
}: any) => (
|
|
67
|
-
<div className="p-4">
|
|
68
|
-
<Grid className={gridGap}>
|
|
69
|
-
{/* 基本定位示例 */}
|
|
70
|
-
<GridItem
|
|
71
|
-
start={baseStart as GridStart}
|
|
72
|
-
end={baseEnd as GridEnd}
|
|
73
|
-
className={`bg-${colorScheme}-200 p-4 text-center`}
|
|
74
|
-
>
|
|
75
|
-
start-{baseStart} end-{baseEnd}
|
|
76
|
-
</GridItem>
|
|
77
|
-
<GridItem
|
|
78
|
-
start={(baseEnd + 1) as GridStart}
|
|
79
|
-
end={12}
|
|
80
|
-
className={`bg-${colorScheme}-300 p-4 text-center`}
|
|
81
|
-
>
|
|
82
|
-
start-{baseEnd + 1} end-12
|
|
83
|
-
</GridItem>
|
|
84
|
-
|
|
85
|
-
{/* 跨越整行示例 */}
|
|
86
|
-
<GridItem
|
|
87
|
-
start={1}
|
|
88
|
-
end={13}
|
|
89
|
-
className={`bg-${colorScheme}-400 p-4 text-center`}
|
|
90
|
-
>
|
|
91
|
-
start-1 end-13 (整行)
|
|
92
|
-
</GridItem>
|
|
93
|
-
|
|
94
|
-
{/* 单格示例 */}
|
|
95
|
-
<GridItem
|
|
96
|
-
start={1}
|
|
97
|
-
end={2}
|
|
98
|
-
className={`bg-${colorScheme}-500 p-4 text-center text-white`}
|
|
99
|
-
>
|
|
100
|
-
1格 (start-1)
|
|
101
|
-
</GridItem>
|
|
102
|
-
<GridItem
|
|
103
|
-
start={3}
|
|
104
|
-
end={4}
|
|
105
|
-
className={`bg-${colorScheme}-500 p-4 text-center text-white`}
|
|
106
|
-
>
|
|
107
|
-
1格 (start-3)
|
|
108
|
-
</GridItem>
|
|
109
|
-
|
|
110
|
-
{/* 不规则跨度示例 */}
|
|
111
|
-
<GridItem
|
|
112
|
-
start={5}
|
|
113
|
-
end={10}
|
|
114
|
-
className={`bg-${colorScheme}-600 p-4 text-center text-white`}
|
|
115
|
-
>
|
|
116
|
-
start-5 end-10
|
|
117
|
-
</GridItem>
|
|
118
|
-
<GridItem
|
|
119
|
-
start={10}
|
|
120
|
-
end={13}
|
|
121
|
-
className={`bg-${colorScheme}-700 p-4 text-center text-white`}
|
|
122
|
-
>
|
|
123
|
-
end-13
|
|
124
|
-
</GridItem>
|
|
125
|
-
|
|
126
|
-
{/* 使用 span 的示例 */}
|
|
127
|
-
<GridItem
|
|
128
|
-
start={1}
|
|
129
|
-
span={3}
|
|
130
|
-
className={`bg-${colorScheme}-800 p-4 text-center text-white`}
|
|
131
|
-
>
|
|
132
|
-
start-1 span-3
|
|
133
|
-
</GridItem>
|
|
134
|
-
<GridItem
|
|
135
|
-
start={4}
|
|
136
|
-
span={9}
|
|
137
|
-
className={`bg-${colorScheme}-900 p-4 text-center text-white`}
|
|
138
|
-
>
|
|
139
|
-
start-4 span-9
|
|
140
|
-
</GridItem>
|
|
141
|
-
|
|
142
|
-
{/* 边界情况示例 */}
|
|
143
|
-
{showBoundaryExamples && (
|
|
144
|
-
<>
|
|
145
|
-
<GridItem
|
|
146
|
-
start={12}
|
|
147
|
-
span={1}
|
|
148
|
-
className="bg-yellow-500 p-4 text-center text-white"
|
|
149
|
-
>
|
|
150
|
-
最后1格
|
|
151
|
-
</GridItem>
|
|
152
|
-
<GridItem
|
|
153
|
-
start={1}
|
|
154
|
-
span={1}
|
|
155
|
-
className="bg-yellow-600 p-4 text-center text-white"
|
|
156
|
-
>
|
|
157
|
-
第1格
|
|
158
|
-
</GridItem>
|
|
159
|
-
</>
|
|
160
|
-
)}
|
|
161
|
-
</Grid>
|
|
162
|
-
</div>
|
|
163
|
-
)
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
// 自定义间距
|
|
167
|
-
export const CustomGap = () => (
|
|
168
|
-
<div className="p-4">
|
|
169
|
-
<Grid className="gap-8">
|
|
170
|
-
<GridItem span={6} className="bg-purple-200 p-4 text-center">间距 32px (gap-8)</GridItem>
|
|
171
|
-
<GridItem span={6} className="bg-purple-300 p-4 text-center">间距 32px (gap-8)</GridItem>
|
|
172
|
-
<GridItem span={4} className="bg-purple-400 p-4 text-center">间距 32px (gap-8)</GridItem>
|
|
173
|
-
<GridItem span={4} className="bg-purple-500 p-4 text-center text-white">间距 32px (gap-8)</GridItem>
|
|
174
|
-
<GridItem span={4} className="bg-purple-600 p-4 text-center text-white">间距 32px (gap-8)</GridItem>
|
|
175
|
-
</Grid>
|
|
176
|
-
</div>
|
|
177
|
-
)
|
|
178
|
-
|
|
179
|
-
// 不同的横向和纵向间距
|
|
180
|
-
export const DifferentGaps = () => (
|
|
181
|
-
<div className="p-4">
|
|
182
|
-
<Grid className="gap-x-8 gap-y-2">
|
|
183
|
-
<GridItem span={6} className="bg-orange-200 p-4 text-center">横向 32px 纵向 8px</GridItem>
|
|
184
|
-
<GridItem span={6} className="bg-orange-300 p-4 text-center">横向 32px 纵向 8px</GridItem>
|
|
185
|
-
<GridItem span={4} className="bg-orange-400 p-4 text-center">横向 32px 纵向 8px</GridItem>
|
|
186
|
-
<GridItem span={4} className="bg-orange-500 p-4 text-center text-white">横向 32px 纵向 8px</GridItem>
|
|
187
|
-
<GridItem span={4} className="bg-orange-600 p-4 text-center text-white">横向 32px 纵向 8px</GridItem>
|
|
188
|
-
</Grid>
|
|
189
|
-
</div>
|
|
190
|
-
)
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react'
|
|
2
|
-
|
|
3
|
-
import { Heading } from '../components/index.js'
|
|
4
|
-
import React from 'react'
|
|
5
|
-
|
|
6
|
-
const meta = {
|
|
7
|
-
title: 'Typography/Heading',
|
|
8
|
-
component: Heading,
|
|
9
|
-
parameters: {
|
|
10
|
-
layout: 'padded',
|
|
11
|
-
docs: {
|
|
12
|
-
description: {
|
|
13
|
-
component: 'Heading 组件, 基本和text 组件一样,只是默认的标签类型不一样',
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
tags: ['autodocs'],
|
|
18
|
-
argTypes: {
|
|
19
|
-
size: {
|
|
20
|
-
control: {
|
|
21
|
-
type: 'select',
|
|
22
|
-
},
|
|
23
|
-
options: [1, 2, 3, 4, 5],
|
|
24
|
-
description: '文本尺寸,从5到1,越来越小',
|
|
25
|
-
table: {
|
|
26
|
-
defaultValue: { summary: '5' },
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
weight: {
|
|
30
|
-
control: {
|
|
31
|
-
type: 'select',
|
|
32
|
-
},
|
|
33
|
-
options: ['light', 'normal', 'medium', 'bold'],
|
|
34
|
-
table: {
|
|
35
|
-
defaultValue: { summary: 'normal' },
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
align: {
|
|
39
|
-
control: {
|
|
40
|
-
type: 'select',
|
|
41
|
-
},
|
|
42
|
-
options: ['left', 'center', 'right'],
|
|
43
|
-
table: {
|
|
44
|
-
defaultValue: { summary: undefined },
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
color: {
|
|
48
|
-
control: {
|
|
49
|
-
type: 'color',
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
as: {
|
|
53
|
-
control: {
|
|
54
|
-
type: 'select',
|
|
55
|
-
},
|
|
56
|
-
options: ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'],
|
|
57
|
-
description: 'html 标签类型',
|
|
58
|
-
table: {
|
|
59
|
-
defaultValue: { summary: 'h1' },
|
|
60
|
-
},
|
|
61
|
-
},
|
|
62
|
-
html: {
|
|
63
|
-
type: 'string',
|
|
64
|
-
description: '相当于 dangerouslySetInnerHTML',
|
|
65
|
-
},
|
|
66
|
-
},
|
|
67
|
-
args: {
|
|
68
|
-
as: 'h1',
|
|
69
|
-
size: 5,
|
|
70
|
-
weight: 'normal',
|
|
71
|
-
align: 'left',
|
|
72
|
-
},
|
|
73
|
-
} satisfies Meta<typeof Heading>
|
|
74
|
-
|
|
75
|
-
export default meta
|
|
76
|
-
|
|
77
|
-
type Story = StoryObj<typeof meta>
|
|
78
|
-
|
|
79
|
-
export const Default: Story = {
|
|
80
|
-
args: {
|
|
81
|
-
as: 'h1',
|
|
82
|
-
children: ' The quick brown fox jumps over the lazy dog.',
|
|
83
|
-
},
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
export const All: Story = {
|
|
87
|
-
render: () => (
|
|
88
|
-
<>
|
|
89
|
-
<Heading size={1}>The quick brown fox jumps over the lazy dog.</Heading>
|
|
90
|
-
<Heading size={2}>The quick brown fox jumps over the lazy dog.</Heading>
|
|
91
|
-
<Heading size={3}>The quick brown fox jumps over the lazy dog.</Heading>
|
|
92
|
-
<Heading size={4}>The quick brown fox jumps over the lazy dog.</Heading>
|
|
93
|
-
<Heading size={5}>The quick brown fox jumps over the lazy dog.</Heading>
|
|
94
|
-
</>
|
|
95
|
-
),
|
|
96
|
-
}
|