@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,52 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react'
|
|
2
|
-
import InputNumber from '../components/input-number.js'
|
|
3
|
-
|
|
4
|
-
const meta = {
|
|
5
|
-
// 同时定义了页面左侧菜单
|
|
6
|
-
title: 'Components/InputNumber',
|
|
7
|
-
component: InputNumber,
|
|
8
|
-
subcomponents: { InputNumber } as any,
|
|
9
|
-
parameters: {
|
|
10
|
-
layout: 'centered',
|
|
11
|
-
},
|
|
12
|
-
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
|
|
13
|
-
tags: ['autodocs'],
|
|
14
|
-
// More on argTypes: https://storybook.js.org/docs/api/argtypes
|
|
15
|
-
args: {
|
|
16
|
-
onBlur: undefined,
|
|
17
|
-
onChange: undefined,
|
|
18
|
-
onEnter: undefined,
|
|
19
|
-
},
|
|
20
|
-
} satisfies Meta<typeof InputNumber>
|
|
21
|
-
|
|
22
|
-
export default meta
|
|
23
|
-
|
|
24
|
-
type Story = StoryObj<typeof meta>
|
|
25
|
-
|
|
26
|
-
export const Default: Story = {}
|
|
27
|
-
|
|
28
|
-
export const Tips: Story = {
|
|
29
|
-
args: {
|
|
30
|
-
asChild: true,
|
|
31
|
-
children: (
|
|
32
|
-
<div className="flex flex-col gap-4">
|
|
33
|
-
<InputNumber tips="Success" />
|
|
34
|
-
<InputNumber status="success" tips="Success" />
|
|
35
|
-
<InputNumber status="warning" tips="Success" />
|
|
36
|
-
<InputNumber status="error" tips="Success" />
|
|
37
|
-
</div>
|
|
38
|
-
),
|
|
39
|
-
},
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export const Disabled: Story = {
|
|
43
|
-
args: {
|
|
44
|
-
asChild: true,
|
|
45
|
-
children: (
|
|
46
|
-
<div className="flex flex-col gap-4">
|
|
47
|
-
<InputNumber disabled />
|
|
48
|
-
<InputNumber readonly />
|
|
49
|
-
</div>
|
|
50
|
-
),
|
|
51
|
-
},
|
|
52
|
-
}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react'
|
|
2
|
-
import type { ComponentType } from 'react'
|
|
3
|
-
import { Button, Input, InputSlot } from '../components/index.js'
|
|
4
|
-
import { SearchIcon } from '@storybook/icons'
|
|
5
|
-
import React from 'react'
|
|
6
|
-
|
|
7
|
-
const meta = {
|
|
8
|
-
title: 'Components/Input',
|
|
9
|
-
component: Input,
|
|
10
|
-
subcomponents: { InputSlot: InputSlot as ComponentType<unknown> }, // TODO: 检查type , 去掉as类型转换
|
|
11
|
-
parameters: {
|
|
12
|
-
layout: 'centered',
|
|
13
|
-
docs: {
|
|
14
|
-
description: {
|
|
15
|
-
component: 'Input 组件, 用于输入框, 可以通过插槽插入额外的内容, 比如icon, 按钮',
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
tags: ['autodocs'],
|
|
20
|
-
argTypes: {
|
|
21
|
-
size: {
|
|
22
|
-
control: {
|
|
23
|
-
type: 'select',
|
|
24
|
-
},
|
|
25
|
-
options: ['sm', 'base', 'lg'],
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
args: {
|
|
29
|
-
size: 'base',
|
|
30
|
-
},
|
|
31
|
-
} satisfies Meta<typeof Input>
|
|
32
|
-
|
|
33
|
-
export default meta
|
|
34
|
-
|
|
35
|
-
type Story = StoryObj<typeof meta>
|
|
36
|
-
|
|
37
|
-
export const Default: Story = {
|
|
38
|
-
args: {},
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export const WithButton: Story = {
|
|
42
|
-
render() {
|
|
43
|
-
return (
|
|
44
|
-
<Input className="rounded-3xl pr-0" placeholder="Enter your email" type="text">
|
|
45
|
-
<InputSlot side="right">
|
|
46
|
-
<Button className="h-full rounded-none" size="sm">
|
|
47
|
-
subscribe
|
|
48
|
-
</Button>
|
|
49
|
-
</InputSlot>
|
|
50
|
-
</Input>
|
|
51
|
-
)
|
|
52
|
-
},
|
|
53
|
-
}
|
|
54
|
-
export const WithIcon: Story = {
|
|
55
|
-
render() {
|
|
56
|
-
return (
|
|
57
|
-
<Input type="text" placeholder="search in site">
|
|
58
|
-
<InputSlot side="left">
|
|
59
|
-
<SearchIcon />
|
|
60
|
-
</InputSlot>
|
|
61
|
-
</Input>
|
|
62
|
-
)
|
|
63
|
-
},
|
|
64
|
-
}
|
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react'
|
|
2
|
-
import { ChevronRightIcon } from '@storybook/icons'
|
|
3
|
-
import Link from '../components/link.js'
|
|
4
|
-
|
|
5
|
-
const meta = {
|
|
6
|
-
// 同时定义了页面左侧菜单
|
|
7
|
-
title: 'Components/Link',
|
|
8
|
-
component: Link,
|
|
9
|
-
parameters: {
|
|
10
|
-
layout: 'centered',
|
|
11
|
-
},
|
|
12
|
-
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
|
|
13
|
-
tags: ['autodocs'],
|
|
14
|
-
// More on argTypes: https://storybook.js.org/docs/api/argtypes
|
|
15
|
-
argTypes: {
|
|
16
|
-
size: {
|
|
17
|
-
description: '尺寸',
|
|
18
|
-
control: {
|
|
19
|
-
type: 'select',
|
|
20
|
-
},
|
|
21
|
-
options: ['small', 'medium', 'large'],
|
|
22
|
-
table: {
|
|
23
|
-
defaultValue: { summary: 'small' },
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
underline: {
|
|
27
|
-
description: '链接下划线展示',
|
|
28
|
-
control: {
|
|
29
|
-
type: 'select',
|
|
30
|
-
},
|
|
31
|
-
options: ['none', 'hover', 'always'],
|
|
32
|
-
table: {
|
|
33
|
-
defaultValue: { summary: 'none' },
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
hoverColor: {
|
|
37
|
-
description: '链接悬浮文字样式',
|
|
38
|
-
control: {
|
|
39
|
-
type: 'select',
|
|
40
|
-
},
|
|
41
|
-
options: ['none', 'hover'],
|
|
42
|
-
table: {
|
|
43
|
-
defaultValue: { summary: 'none' },
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
onClick: {
|
|
47
|
-
control: false,
|
|
48
|
-
},
|
|
49
|
-
suffixIcon: {
|
|
50
|
-
control: false,
|
|
51
|
-
},
|
|
52
|
-
style: {
|
|
53
|
-
control: false,
|
|
54
|
-
},
|
|
55
|
-
className: {
|
|
56
|
-
control: false,
|
|
57
|
-
},
|
|
58
|
-
children: {
|
|
59
|
-
control: false,
|
|
60
|
-
},
|
|
61
|
-
},
|
|
62
|
-
args: {
|
|
63
|
-
onClick: undefined,
|
|
64
|
-
},
|
|
65
|
-
} satisfies Meta<typeof Link>
|
|
66
|
-
|
|
67
|
-
export default meta
|
|
68
|
-
|
|
69
|
-
type Story = StoryObj<typeof meta>
|
|
70
|
-
|
|
71
|
-
export const Default: Story = {
|
|
72
|
-
args: {
|
|
73
|
-
children: 'Link',
|
|
74
|
-
},
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
export const LinkSize = () => (
|
|
78
|
-
<div className="inline-flex flex-col gap-4">
|
|
79
|
-
<div className="inline-flex gap-4">
|
|
80
|
-
<Link size="small" hoverColor="hover">
|
|
81
|
-
Link
|
|
82
|
-
</Link>
|
|
83
|
-
<Link size="small" underline="always">
|
|
84
|
-
Link
|
|
85
|
-
</Link>
|
|
86
|
-
<Link size="small" underline="hover" hoverColor="hover" suffixIcon={<ChevronRightIcon />}>
|
|
87
|
-
Link
|
|
88
|
-
</Link>
|
|
89
|
-
</div>
|
|
90
|
-
<div className="inline-flex gap-4">
|
|
91
|
-
<Link size="medium" hoverColor="hover">
|
|
92
|
-
Link
|
|
93
|
-
</Link>
|
|
94
|
-
<Link size="medium" underline="always">
|
|
95
|
-
Link
|
|
96
|
-
</Link>
|
|
97
|
-
<Link size="medium" underline="hover" hoverColor="hover" suffixIcon={<ChevronRightIcon />}>
|
|
98
|
-
Link
|
|
99
|
-
</Link>
|
|
100
|
-
</div>
|
|
101
|
-
<div className="inline-flex gap-4">
|
|
102
|
-
<Link size="large" hoverColor="hover">
|
|
103
|
-
Link
|
|
104
|
-
</Link>
|
|
105
|
-
<Link size="large" underline="always">
|
|
106
|
-
Link
|
|
107
|
-
</Link>
|
|
108
|
-
<Link size="large" underline="hover" hoverColor="hover" suffixIcon={<ChevronRightIcon />}>
|
|
109
|
-
Link
|
|
110
|
-
</Link>
|
|
111
|
-
</div>
|
|
112
|
-
</div>
|
|
113
|
-
)
|
|
114
|
-
|
|
115
|
-
export const Disabled = () => (
|
|
116
|
-
<div className="inline-flex flex-col gap-4">
|
|
117
|
-
<div className="inline-flex gap-4">
|
|
118
|
-
<Link size="small" disabled>
|
|
119
|
-
Link
|
|
120
|
-
</Link>
|
|
121
|
-
<Link size="small" disabled suffixIcon={<ChevronRightIcon />}>
|
|
122
|
-
Link
|
|
123
|
-
</Link>
|
|
124
|
-
</div>
|
|
125
|
-
<div className="inline-flex gap-4">
|
|
126
|
-
<Link size="medium" disabled>
|
|
127
|
-
Link
|
|
128
|
-
</Link>
|
|
129
|
-
<Link size="medium" disabled suffixIcon={<ChevronRightIcon />}>
|
|
130
|
-
Link
|
|
131
|
-
</Link>
|
|
132
|
-
</div>
|
|
133
|
-
<div className="inline-flex gap-4">
|
|
134
|
-
<Link size="large" disabled>
|
|
135
|
-
Link
|
|
136
|
-
</Link>
|
|
137
|
-
<Link size="large" disabled suffixIcon={<ChevronRightIcon />}>
|
|
138
|
-
Link
|
|
139
|
-
</Link>
|
|
140
|
-
</div>
|
|
141
|
-
</div>
|
|
142
|
-
)
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import React, { type ComponentType } from 'react'
|
|
2
|
-
import type { Meta, StoryObj } from '@storybook/react'
|
|
3
|
-
import { Marquee, MarqueeList, MarqueeImageContent, MarqueeTextContent } from '../biz-components/Marquee'
|
|
4
|
-
|
|
5
|
-
const meta = {
|
|
6
|
-
title: 'Biz Components/Marquee',
|
|
7
|
-
component: Marquee,
|
|
8
|
-
subcomponents: {
|
|
9
|
-
MarqueeList: MarqueeList as ComponentType<unknown>,
|
|
10
|
-
MarqueeImageContent: MarqueeImageContent as ComponentType<unknown>,
|
|
11
|
-
MarqueeTextContent: MarqueeTextContent as ComponentType<unknown>,
|
|
12
|
-
},
|
|
13
|
-
parameters: {
|
|
14
|
-
layout: 'fullscreen',
|
|
15
|
-
docs: {
|
|
16
|
-
description: {
|
|
17
|
-
component: '跑马灯Marquee,基于react-fast-marquee<br>可使用react-fast-marquee所有props',
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
tags: ['autodocs'],
|
|
22
|
-
args: {
|
|
23
|
-
speed: 50,
|
|
24
|
-
},
|
|
25
|
-
argTypes: {
|
|
26
|
-
direction: {
|
|
27
|
-
control: {
|
|
28
|
-
type: 'inline-radio',
|
|
29
|
-
},
|
|
30
|
-
options: ['left', 'right', 'up', 'down'],
|
|
31
|
-
description: '跑马灯滑动的方向',
|
|
32
|
-
table: {
|
|
33
|
-
defaultValue: {
|
|
34
|
-
summary: 'left',
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
speed: {
|
|
39
|
-
control: {
|
|
40
|
-
type: 'number',
|
|
41
|
-
},
|
|
42
|
-
description: '速度,单位:像素/秒',
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
} satisfies Meta<typeof Marquee>
|
|
46
|
-
|
|
47
|
-
export default meta
|
|
48
|
-
|
|
49
|
-
type Story = StoryObj<typeof meta>
|
|
50
|
-
|
|
51
|
-
export const Default: Story = {
|
|
52
|
-
render: args => (
|
|
53
|
-
<Marquee {...args}>
|
|
54
|
-
<MarqueeList>
|
|
55
|
-
<MarqueeImageContent image="https://cdn.shopify.com/s/files/1/0521/9411/5753/files/Rectangle_6339.png?v=1745400317" />
|
|
56
|
-
<MarqueeTextContent text="跑马灯组件" />
|
|
57
|
-
<MarqueeImageContent image="https://cdn.shopify.com/s/files/1/0521/9411/5753/files/Rectangle_224.png?v=1745400317" />
|
|
58
|
-
<MarqueeTextContent className='text-nowrap' text="另一个跑马灯组件" />
|
|
59
|
-
<MarqueeImageContent image="https://cdn.shopify.com/s/files/1/0521/9411/5753/files/Rectangle_222.png?v=1745400317" />
|
|
60
|
-
</MarqueeList>
|
|
61
|
-
</Marquee>
|
|
62
|
-
),
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export const MarqueeImage: Story = {
|
|
66
|
-
render: args => (
|
|
67
|
-
<Marquee {...args}>
|
|
68
|
-
<MarqueeList>
|
|
69
|
-
<MarqueeImageContent image="https://cdn.shopify.com/s/files/1/0521/9411/5753/files/Rectangle_6339.png?v=1745400317" />
|
|
70
|
-
<MarqueeImageContent image="https://cdn.shopify.com/s/files/1/0521/9411/5753/files/Rectangle_224.png?v=1745400317" />
|
|
71
|
-
<MarqueeImageContent image="https://cdn.shopify.com/s/files/1/0521/9411/5753/files/Rectangle_222.png?v=1745400317" />
|
|
72
|
-
</MarqueeList>
|
|
73
|
-
</Marquee>
|
|
74
|
-
),
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
export const MarqueeText: Story = {
|
|
78
|
-
render: args => (
|
|
79
|
-
<Marquee {...args}>
|
|
80
|
-
<MarqueeList>
|
|
81
|
-
<MarqueeTextContent className='w-40' text="47%<br>R&D Employees" />
|
|
82
|
-
<MarqueeTextContent className='w-40' text="100 Million<br>Global Customers" />
|
|
83
|
-
<MarqueeTextContent className='w-60' text="Pioneering in Charging<br>Technology for 12 Years" />
|
|
84
|
-
</MarqueeList>
|
|
85
|
-
</Marquee>
|
|
86
|
-
),
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
export const MarqueeDirection: Story = {
|
|
90
|
-
render: args => (
|
|
91
|
-
<Marquee {...args}>
|
|
92
|
-
<MarqueeList>
|
|
93
|
-
<MarqueeImageContent image="https://cdn.shopify.com/s/files/1/0521/9411/5753/files/Rectangle_6339.png?v=1745400317" />
|
|
94
|
-
<MarqueeImageContent image="https://cdn.shopify.com/s/files/1/0521/9411/5753/files/Rectangle_224.png?v=1745400317" />
|
|
95
|
-
<MarqueeImageContent image="https://cdn.shopify.com/s/files/1/0521/9411/5753/files/Rectangle_222.png?v=1745400317" />
|
|
96
|
-
</MarqueeList>
|
|
97
|
-
</Marquee>
|
|
98
|
-
),
|
|
99
|
-
args: {
|
|
100
|
-
direction: 'right',
|
|
101
|
-
},
|
|
102
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react'
|
|
2
|
-
import { Picture } from '../components/index.js'
|
|
3
|
-
const imageUrl =
|
|
4
|
-
'https://cdn.shopify.com/s/files/1/0521/9411/5753/files/Mask_group_3_f2d0041d-7b54-4d6a-a504-1dbe6c2de6ee.png?v=1718245219'
|
|
5
|
-
|
|
6
|
-
const mobImageUrl =
|
|
7
|
-
'https://cdn.shopify.com/s/files/1/0521/9411/5753/files/1_c67da28a-50c5-4821-8712-330259ea6039.png?v=1718245627'
|
|
8
|
-
|
|
9
|
-
const imageUrl2 = 'https://http.cat/images/200.jpg'
|
|
10
|
-
const mobImageUrl2 = 'https://http.cat/images/102.jpg'
|
|
11
|
-
|
|
12
|
-
const meta = {
|
|
13
|
-
title: 'Components/Picture',
|
|
14
|
-
component: Picture,
|
|
15
|
-
parameters: {
|
|
16
|
-
layout: 'centerd',
|
|
17
|
-
docs: {
|
|
18
|
-
description: {
|
|
19
|
-
component: `响应式图片组件, 支持传入不同分辨率下的图片,比如,source="url1 1920, url2 1080, url3 767".
|
|
20
|
-
当图片匹配域名('cdn.shopify.com', 'cdn.shopifycdn.net', 'www.facebook.com')的时候,会自动在图片url后面添加图片尺寸后缀
|
|
21
|
-
`,
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
tags: ['autodocs'],
|
|
26
|
-
} satisfies Meta<typeof Picture>
|
|
27
|
-
|
|
28
|
-
export default meta
|
|
29
|
-
|
|
30
|
-
type Story = StoryObj<typeof meta>
|
|
31
|
-
|
|
32
|
-
export const Default: Story = {
|
|
33
|
-
args: {
|
|
34
|
-
source: `${imageUrl}, ${mobImageUrl} 768`,
|
|
35
|
-
imgClassName: 'rounded-[24px]',
|
|
36
|
-
},
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export const NotMatchDomain: Story = {
|
|
40
|
-
args: {
|
|
41
|
-
source: `${imageUrl2}, ${mobImageUrl2} 768`,
|
|
42
|
-
className: 'w-[300px]',
|
|
43
|
-
},
|
|
44
|
-
parameters: {
|
|
45
|
-
docs: {
|
|
46
|
-
description: {
|
|
47
|
-
story: '图片不匹配域名',
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { Popover, PopoverContent, PopoverTrigger } from '../components/index.js'
|
|
3
|
-
import type { Meta } from '@storybook/react/*'
|
|
4
|
-
|
|
5
|
-
const meta = {
|
|
6
|
-
title: 'Components/Popover',
|
|
7
|
-
component: Popover,
|
|
8
|
-
subcomponents: { Popover, PopoverTrigger, PopoverContent } as any,
|
|
9
|
-
parameters: {
|
|
10
|
-
layout: 'centered',
|
|
11
|
-
docs: {
|
|
12
|
-
description: {
|
|
13
|
-
component:
|
|
14
|
-
'popover组件,在一个portal展示复杂ui, 基于@radix-ui/react-popover, https://www.radix-ui.com/primitives/docs/components/popover',
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
tags: ['autodocs'],
|
|
19
|
-
} satisfies Meta<typeof Popover>
|
|
20
|
-
|
|
21
|
-
export default meta
|
|
22
|
-
|
|
23
|
-
export const Default = () => (
|
|
24
|
-
<Popover>
|
|
25
|
-
<PopoverTrigger asChild>
|
|
26
|
-
<button>Open popover</button>
|
|
27
|
-
</PopoverTrigger>
|
|
28
|
-
<PopoverContent className="w-80 bg-white" side="right">
|
|
29
|
-
<div className="grid gap-4">
|
|
30
|
-
<p>
|
|
31
|
-
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's
|
|
32
|
-
standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to
|
|
33
|
-
make a type specimen book. It has survived not only five centuries, but also the leap into electronic
|
|
34
|
-
typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset
|
|
35
|
-
sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus
|
|
36
|
-
PageMaker including versions of Lorem Ipsum.
|
|
37
|
-
</p>
|
|
38
|
-
</div>
|
|
39
|
-
</PopoverContent>
|
|
40
|
-
</Popover>
|
|
41
|
-
)
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react/*'
|
|
2
|
-
import { RadioGroup, RadioGroupItem } from '../components/index.js'
|
|
3
|
-
import React, { type ComponentType } from 'react'
|
|
4
|
-
|
|
5
|
-
const meta = {
|
|
6
|
-
title: 'Components/RadioGroup',
|
|
7
|
-
component: RadioGroup,
|
|
8
|
-
subcomponents: { RadioGroupItem: RadioGroupItem as ComponentType<unknown> },
|
|
9
|
-
parameters: {
|
|
10
|
-
layout: 'centered',
|
|
11
|
-
docs: {
|
|
12
|
-
description: {
|
|
13
|
-
component:
|
|
14
|
-
'单选框, 基于@radix-ui/react-radio-group https://www.radix-ui.com/primitives/docs/components/radio-group',
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
tags: ['autodocs'],
|
|
19
|
-
argTypes: {
|
|
20
|
-
size: {
|
|
21
|
-
control: {
|
|
22
|
-
type: 'select',
|
|
23
|
-
},
|
|
24
|
-
options: ['sm', 'base', 'lg'],
|
|
25
|
-
description: '尺寸',
|
|
26
|
-
table: {
|
|
27
|
-
defaultValue: { summary: 'base' },
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
args: {
|
|
32
|
-
size: 'base',
|
|
33
|
-
},
|
|
34
|
-
} satisfies Meta<typeof RadioGroup>
|
|
35
|
-
|
|
36
|
-
export default meta
|
|
37
|
-
|
|
38
|
-
type Story = StoryObj<typeof RadioGroup>
|
|
39
|
-
export const Default: Story = {
|
|
40
|
-
args: {
|
|
41
|
-
size: 'base',
|
|
42
|
-
children: (
|
|
43
|
-
<>
|
|
44
|
-
<div className="flex items-center space-x-2">
|
|
45
|
-
<RadioGroupItem value="option-one" id="option-one" />
|
|
46
|
-
<label htmlFor="option-one">Option One</label>
|
|
47
|
-
</div>
|
|
48
|
-
<div className="flex items-center space-x-2">
|
|
49
|
-
<RadioGroupItem value="option-two" id="option-two" />
|
|
50
|
-
<label htmlFor="option-two">Option Two</label>
|
|
51
|
-
</div>
|
|
52
|
-
</>
|
|
53
|
-
),
|
|
54
|
-
},
|
|
55
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react'
|
|
2
|
-
|
|
3
|
-
import { Shelf } from '../biz-components/index.js'
|
|
4
|
-
import React from 'react'
|
|
5
|
-
|
|
6
|
-
const meta = {
|
|
7
|
-
title: 'Biz-Components/Shelf',
|
|
8
|
-
component: Shelf,
|
|
9
|
-
parameters: {
|
|
10
|
-
layout: 'centered',
|
|
11
|
-
},
|
|
12
|
-
tags: ['autodocs'],
|
|
13
|
-
} satisfies Meta<typeof Shelf>
|
|
14
|
-
|
|
15
|
-
export default meta
|
|
16
|
-
|
|
17
|
-
type Story = StoryObj<typeof meta>
|
|
18
|
-
|
|
19
|
-
export const Default: Story = {
|
|
20
|
-
args: {
|
|
21
|
-
id: 'shelf',
|
|
22
|
-
title: 'this is title',
|
|
23
|
-
subtitle: 'this is subtitle',
|
|
24
|
-
products: [
|
|
25
|
-
{
|
|
26
|
-
sku: 'sku1',
|
|
27
|
-
name: 'product 1',
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
sku: 'sku2',
|
|
31
|
-
name: 'product 2',
|
|
32
|
-
},
|
|
33
|
-
],
|
|
34
|
-
},
|
|
35
|
-
}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react'
|
|
2
|
-
import ShelfDisplay from '../biz-components/ShelfDisplay'
|
|
3
|
-
|
|
4
|
-
const meta = {
|
|
5
|
-
title: 'Biz-Components/ShelfDisplay',
|
|
6
|
-
component: ShelfDisplay,
|
|
7
|
-
parameters: {
|
|
8
|
-
layout: 'fullscreen',
|
|
9
|
-
},
|
|
10
|
-
tags: ['autodocs'],
|
|
11
|
-
} satisfies Meta<typeof ShelfDisplay>
|
|
12
|
-
|
|
13
|
-
export default meta
|
|
14
|
-
type Story = StoryObj<typeof meta>
|
|
15
|
-
|
|
16
|
-
const mockItems = [
|
|
17
|
-
{
|
|
18
|
-
price: '$1,999.00',
|
|
19
|
-
basePrice: '$2,999.00',
|
|
20
|
-
subTitle: 'Fast Charging for 3 Devices',
|
|
21
|
-
title: 'Anker Prime 27,650mAh Power Bank (250W)',
|
|
22
|
-
tagItems: ['New', '20% OFF'],
|
|
23
|
-
img: 'https://cdn.shopify.com/s/files/1/0517/6767/3016/files/e7be0a68-29b9-431c-8c0f-21bf968b1545_Product_Image_2.png?v=1744274554',
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
price: '$1,999.00',
|
|
27
|
-
basePrice: '$2,999.00',
|
|
28
|
-
subTitle: 'Fast Charging for 3 Devices',
|
|
29
|
-
title: 'Anker Prime 27,650mAh Power Bank (250W)',
|
|
30
|
-
tagItems: ['New', '20% OFF'],
|
|
31
|
-
img: 'https://cdn.shopify.com/s/files/1/0517/6767/3016/files/e7be0a68-29b9-431c-8c0f-21bf968b1545_Product_Image_2.png?v=1744274554',
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
price: '$1,999.00',
|
|
35
|
-
basePrice: '$2,999.00',
|
|
36
|
-
subTitle: 'Fast Charging for 3 Devices',
|
|
37
|
-
title: 'Anker Prime 27,650mAh Power Bank (250W)',
|
|
38
|
-
tagItems: ['New', '20% OFF'],
|
|
39
|
-
img: 'https://cdn.shopify.com/s/files/1/0517/6767/3016/files/e7be0a68-29b9-431c-8c0f-21bf968b1545_Product_Image_2.png?v=1744274554',
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
price: '$1,999.00',
|
|
43
|
-
basePrice: '$2,999.00',
|
|
44
|
-
subTitle: 'Fast Charging for 3 Devices',
|
|
45
|
-
title: 'Anker Prime 27,650mAh Power Bank (250W)',
|
|
46
|
-
tagItems: ['New', '20% OFF'],
|
|
47
|
-
img: 'https://cdn.shopify.com/s/files/1/0517/6767/3016/files/e7be0a68-29b9-431c-8c0f-21bf968b1545_Product_Image_2.png?v=1744274554',
|
|
48
|
-
},
|
|
49
|
-
]
|
|
50
|
-
|
|
51
|
-
export const Default: Story = {
|
|
52
|
-
args: {
|
|
53
|
-
products: mockItems,
|
|
54
|
-
className: 'p-4',
|
|
55
|
-
primaryButton:"Learn More",
|
|
56
|
-
secondaryButton:"Shop Now",
|
|
57
|
-
},
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export const Round: Story = {
|
|
61
|
-
args: {
|
|
62
|
-
products: mockItems,
|
|
63
|
-
className: 'p-4',
|
|
64
|
-
shape: 'round',
|
|
65
|
-
itemShape: 'round',
|
|
66
|
-
primaryButton:"Learn More",
|
|
67
|
-
secondaryButton:"Shop Now",
|
|
68
|
-
},
|
|
69
|
-
}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react'
|
|
2
|
-
|
|
3
|
-
import { Skeleton } from '../components/index.js'
|
|
4
|
-
import React from 'react'
|
|
5
|
-
|
|
6
|
-
const meta = {
|
|
7
|
-
title: 'Components/Skeleton',
|
|
8
|
-
component: Skeleton,
|
|
9
|
-
parameters: {
|
|
10
|
-
layout: 'centered',
|
|
11
|
-
docs: {
|
|
12
|
-
description: {
|
|
13
|
-
component:
|
|
14
|
-
'骨架屏组件,用来在数据加载时展示一个占位图, 可以包在dom 外使用,通过loading 控制显示隐藏, 也可以单独使用,通过自定义class控制样式, 组合成想要的布局',
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
tags: ['autodocs'],
|
|
19
|
-
} satisfies Meta<typeof Skeleton>
|
|
20
|
-
|
|
21
|
-
export default meta
|
|
22
|
-
|
|
23
|
-
type Story = StoryObj<typeof meta>
|
|
24
|
-
|
|
25
|
-
export const Default: Story = {
|
|
26
|
-
args: {
|
|
27
|
-
loading: true,
|
|
28
|
-
children: (
|
|
29
|
-
<div className="h-14 rounded-3xl overflow-hidden px-4 py-4 w-full">
|
|
30
|
-
Fog creeps across moors, hills, and rivers. It adds an eerie charm to the landscape, but also complicates
|
|
31
|
-
driving.
|
|
32
|
-
</div>
|
|
33
|
-
),
|
|
34
|
-
},
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export const Multiple: Story = {
|
|
38
|
-
render() {
|
|
39
|
-
return (
|
|
40
|
-
<div className="flex flex-col items-center justify-center">
|
|
41
|
-
<div className="flex w-full justify-between">
|
|
42
|
-
<Skeleton className="size-12 rounded-full" />
|
|
43
|
-
<Skeleton className="h-12 w-[70%] " />
|
|
44
|
-
</div>
|
|
45
|
-
<Skeleton className="mt-2 h-40 w-[200px]" />
|
|
46
|
-
</div>
|
|
47
|
-
)
|
|
48
|
-
},
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export const WithText: Story = {
|
|
52
|
-
render() {
|
|
53
|
-
return (
|
|
54
|
-
<>
|
|
55
|
-
<Skeleton loading={true}>
|
|
56
|
-
Rainfall is a constant companion. Umbrellas are practically a national accessory. Expect drizzles, showers,
|
|
57
|
-
and downpours, often accompanied by gray skies.
|
|
58
|
-
</Skeleton>
|
|
59
|
-
<hr />
|
|
60
|
-
<Skeleton loading={false}>
|
|
61
|
-
Rainfall is a constant companion. Umbrellas are practically a national accessory. Expect drizzles, showers,
|
|
62
|
-
and downpours, often accompanied by gray skies.
|
|
63
|
-
</Skeleton>
|
|
64
|
-
</>
|
|
65
|
-
)
|
|
66
|
-
},
|
|
67
|
-
}
|