@apify/ui-library 1.171.1 → 1.171.2-uilibraryversion2candida-85b55e.23
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/MIGRATION.md +5 -0
- package/README.md +1 -1
- package/dist/components/code/code_block/code_block.d.ts +1 -3
- package/dist/components/code/code_block/code_block.d.ts.map +1 -1
- package/dist/components/code/code_block/code_block.js +1 -7
- package/dist/components/code/code_block/code_block.styled.d.ts +0 -1
- package/dist/components/code/code_block/code_block.styled.d.ts.map +1 -1
- package/dist/components/code/code_block/code_block.styled.js +0 -10
- package/dist/components/code/inline_code/inline_code.d.ts.map +1 -1
- package/dist/components/index.d.ts +0 -3
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/simple_markdown/simple_markdown.d.ts.map +1 -1
- package/dist/components/simple_markdown/simple_markdown.js +1 -1
- package/dist/components/simple_markdown/simple_markdown_components.d.ts +5 -2
- package/dist/components/simple_markdown/simple_markdown_components.d.ts.map +1 -1
- package/dist/components/simple_markdown/simple_markdown_components.js +2 -3
- package/dist/components/tag/tag.d.ts +1 -1
- package/dist/components/tag/tag.d.ts.map +1 -1
- package/dist/components/text/index.d.ts +0 -1
- package/dist/components/text/index.d.ts.map +1 -1
- package/dist/components/text/text_content.d.ts +1 -1
- package/dist/components/text/text_content.js +1 -1
- package/dist/files_hash_at_build.txt +1 -1
- package/dist/index.js +1 -5
- package/dist/src/components/code/code_block/code_block.d.ts +1 -3
- package/dist/src/components/code/code_block/code_block.d.ts.map +1 -1
- package/dist/src/components/code/code_block/code_block.js +2 -3
- package/dist/src/components/code/code_block/code_block.js.map +1 -1
- package/dist/src/components/code/code_block/code_block.styled.d.ts +0 -1
- package/dist/src/components/code/code_block/code_block.styled.d.ts.map +1 -1
- package/dist/src/components/code/code_block/code_block.styled.js +0 -10
- package/dist/src/components/code/code_block/code_block.styled.js.map +1 -1
- package/dist/src/components/code/inline_code/inline_code.d.ts.map +1 -1
- package/dist/src/components/code/inline_code/inline_code.js +0 -1
- package/dist/src/components/code/inline_code/inline_code.js.map +1 -1
- package/dist/src/components/index.d.ts +0 -3
- package/dist/src/components/index.d.ts.map +1 -1
- package/dist/src/components/index.js +0 -3
- package/dist/src/components/index.js.map +1 -1
- package/dist/src/components/simple_markdown/simple_markdown.d.ts.map +1 -1
- package/dist/src/components/simple_markdown/simple_markdown.js +2 -1
- package/dist/src/components/simple_markdown/simple_markdown.js.map +1 -1
- package/dist/src/components/simple_markdown/simple_markdown_components.d.ts +5 -4
- package/dist/src/components/simple_markdown/simple_markdown_components.d.ts.map +1 -1
- package/dist/src/components/simple_markdown/simple_markdown_components.js +4 -4
- package/dist/src/components/simple_markdown/simple_markdown_components.js.map +1 -1
- package/dist/src/components/tag/tag.d.ts +1 -1
- package/dist/src/components/tag/tag.d.ts.map +1 -1
- package/dist/src/components/text/index.d.ts +0 -1
- package/dist/src/components/text/index.d.ts.map +1 -1
- package/dist/src/components/text/index.js +0 -1
- package/dist/src/components/text/index.js.map +1 -1
- package/dist/src/components/text/text_content.d.ts +1 -1
- package/dist/src/components/text/text_content.js +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/migration-guides/v1-to-v2.md +153 -0
- package/package.json +5 -3
- package/src/components/code/code_block/code_block.stories.jsx +6 -13
- package/src/components/code/code_block/code_block.styled.tsx +0 -11
- package/src/components/code/code_block/code_block.tsx +0 -8
- package/src/components/code/inline_code/inline_code.tsx +0 -1
- package/src/components/index.ts +0 -3
- package/src/components/simple_markdown/simple_markdown.tsx +2 -1
- package/src/components/simple_markdown/simple_markdown_components.tsx +8 -14
- package/src/components/tag/tag.tsx +1 -1
- package/src/components/text/index.ts +0 -1
- package/src/components/text/text_content.tsx +1 -1
- package/src/migration_guides/v1_to_v2.mdx +7 -0
- package/dist/components/banner/banner.d.ts +0 -11
- package/dist/components/banner/banner.d.ts.map +0 -1
- package/dist/components/banner/banner.js +0 -76
- package/dist/components/banner/index.d.ts +0 -2
- package/dist/components/banner/index.d.ts.map +0 -1
- package/dist/components/chip/chip.d.ts +0 -55
- package/dist/components/chip/chip.d.ts.map +0 -1
- package/dist/components/chip/chip.js +0 -144
- package/dist/components/chip/index.d.ts +0 -2
- package/dist/components/chip/index.d.ts.map +0 -1
- package/dist/components/color_wheel_gradient/color_wheel_gradient.d.ts +0 -9
- package/dist/components/color_wheel_gradient/color_wheel_gradient.d.ts.map +0 -1
- package/dist/components/color_wheel_gradient/color_wheel_gradient.js +0 -27
- package/dist/components/color_wheel_gradient/index.d.ts +0 -2
- package/dist/components/color_wheel_gradient/index.d.ts.map +0 -1
- package/dist/src/components/banner/banner.d.ts +0 -11
- package/dist/src/components/banner/banner.d.ts.map +0 -1
- package/dist/src/components/banner/banner.js +0 -70
- package/dist/src/components/banner/banner.js.map +0 -1
- package/dist/src/components/banner/index.d.ts +0 -2
- package/dist/src/components/banner/index.d.ts.map +0 -1
- package/dist/src/components/banner/index.js +0 -2
- package/dist/src/components/banner/index.js.map +0 -1
- package/dist/src/components/chip/chip.d.ts +0 -56
- package/dist/src/components/chip/chip.d.ts.map +0 -1
- package/dist/src/components/chip/chip.js +0 -123
- package/dist/src/components/chip/chip.js.map +0 -1
- package/dist/src/components/chip/index.d.ts +0 -2
- package/dist/src/components/chip/index.d.ts.map +0 -1
- package/dist/src/components/chip/index.js +0 -2
- package/dist/src/components/chip/index.js.map +0 -1
- package/dist/src/components/color_wheel_gradient/color_wheel_gradient.d.ts +0 -9
- package/dist/src/components/color_wheel_gradient/color_wheel_gradient.d.ts.map +0 -1
- package/dist/src/components/color_wheel_gradient/color_wheel_gradient.js +0 -25
- package/dist/src/components/color_wheel_gradient/color_wheel_gradient.js.map +0 -1
- package/dist/src/components/color_wheel_gradient/index.d.ts +0 -2
- package/dist/src/components/color_wheel_gradient/index.d.ts.map +0 -1
- package/dist/src/components/color_wheel_gradient/index.js +0 -2
- package/dist/src/components/color_wheel_gradient/index.js.map +0 -1
- package/src/components/banner/banner.stories.tsx +0 -238
- package/src/components/banner/banner.tsx +0 -91
- package/src/components/banner/index.ts +0 -1
- package/src/components/chip/chip.stories.tsx +0 -311
- package/src/components/chip/chip.tsx +0 -167
- package/src/components/chip/index.ts +0 -1
- package/src/components/color_wheel_gradient/color_wheel_gradient.stories.tsx +0 -152
- package/src/components/color_wheel_gradient/color_wheel_gradient.tsx +0 -33
- package/src/components/color_wheel_gradient/index.ts +0 -1
- package/src/components/text/text_content.stories.tsx +0 -194
|
@@ -1,238 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
-
import type React from 'react';
|
|
3
|
-
|
|
4
|
-
import { Banner } from './banner';
|
|
5
|
-
|
|
6
|
-
interface BannerProps {
|
|
7
|
-
background?: string;
|
|
8
|
-
useGradientBackground?: boolean;
|
|
9
|
-
width?: string;
|
|
10
|
-
className?: string;
|
|
11
|
-
children: React.ReactNode;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export default {
|
|
15
|
-
title: 'UI-Library/Banner',
|
|
16
|
-
component: Banner,
|
|
17
|
-
argTypes: {
|
|
18
|
-
background: {
|
|
19
|
-
control: 'text',
|
|
20
|
-
},
|
|
21
|
-
useGradientBackground: {
|
|
22
|
-
control: 'boolean',
|
|
23
|
-
},
|
|
24
|
-
width: {
|
|
25
|
-
control: 'text',
|
|
26
|
-
},
|
|
27
|
-
className: {
|
|
28
|
-
control: 'text',
|
|
29
|
-
},
|
|
30
|
-
children: {
|
|
31
|
-
control: false,
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
parameters: {
|
|
35
|
-
design: {
|
|
36
|
-
type: 'figma',
|
|
37
|
-
url: 'TODO: Add Figma URL',
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
} as Meta<BannerProps>;
|
|
41
|
-
|
|
42
|
-
type Story = StoryObj<BannerProps>;
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Default banner with gradient background enabled
|
|
46
|
-
*/
|
|
47
|
-
export const Default: Story = {
|
|
48
|
-
args: {
|
|
49
|
-
children: (
|
|
50
|
-
<div>
|
|
51
|
-
<h2 style={{ margin: 0, marginBottom: '8px', color: 'white' }}>Welcome to Apify</h2>
|
|
52
|
-
<p style={{ margin: 0, color: 'rgba(255, 255, 255, 0.8)' }}>Build reliable web scrapers. Fast.</p>
|
|
53
|
-
</div>
|
|
54
|
-
),
|
|
55
|
-
},
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Banner with gradient background enabled (explicitly set to true)
|
|
60
|
-
*/
|
|
61
|
-
export const WithGradientBackground: Story = {
|
|
62
|
-
args: {
|
|
63
|
-
useGradientBackground: true,
|
|
64
|
-
children: (
|
|
65
|
-
<div>
|
|
66
|
-
<h2 style={{ margin: 0, marginBottom: '8px', color: 'white' }}>Gradient Background Banner</h2>
|
|
67
|
-
<p style={{ margin: 0, color: 'rgba(255, 255, 255, 0.8)' }}>
|
|
68
|
-
This banner uses the beautiful gradient background with colorful shapes.
|
|
69
|
-
</p>
|
|
70
|
-
</div>
|
|
71
|
-
),
|
|
72
|
-
},
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* Banner without gradient background - shows solid background color
|
|
77
|
-
*/
|
|
78
|
-
export const WithoutGradientBackground: Story = {
|
|
79
|
-
args: {
|
|
80
|
-
useGradientBackground: false,
|
|
81
|
-
children: (
|
|
82
|
-
<div>
|
|
83
|
-
<h2 style={{ margin: 0, marginBottom: '8px' }}>Simple Banner</h2>
|
|
84
|
-
<p style={{ margin: 0, opacity: 0.7 }}>
|
|
85
|
-
This banner uses a simple solid background without gradient effects.
|
|
86
|
-
</p>
|
|
87
|
-
</div>
|
|
88
|
-
),
|
|
89
|
-
},
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Banner with custom background color
|
|
94
|
-
*/
|
|
95
|
-
export const WithCustomBackground: Story = {
|
|
96
|
-
args: {
|
|
97
|
-
background: '#4CAF50',
|
|
98
|
-
useGradientBackground: false,
|
|
99
|
-
children: (
|
|
100
|
-
<div>
|
|
101
|
-
<h2 style={{ margin: 0, marginBottom: '8px', color: 'white' }}>Custom Green Background</h2>
|
|
102
|
-
<p style={{ margin: 0, color: 'rgba(255, 255, 255, 0.9)' }}>
|
|
103
|
-
This banner has a custom green background color.
|
|
104
|
-
</p>
|
|
105
|
-
</div>
|
|
106
|
-
),
|
|
107
|
-
},
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* Banner with custom background color and gradient overlay
|
|
112
|
-
*/
|
|
113
|
-
export const WithCustomBackgroundAndGradient: Story = {
|
|
114
|
-
args: {
|
|
115
|
-
background: '#2196F3',
|
|
116
|
-
useGradientBackground: true,
|
|
117
|
-
children: (
|
|
118
|
-
<div>
|
|
119
|
-
<h2 style={{ margin: 0, marginBottom: '8px', color: 'white' }}>Blue Background with Gradient</h2>
|
|
120
|
-
<p style={{ margin: 0, color: 'rgba(255, 255, 255, 0.9)' }}>
|
|
121
|
-
Custom blue background with gradient overlay effects.
|
|
122
|
-
</p>
|
|
123
|
-
</div>
|
|
124
|
-
),
|
|
125
|
-
},
|
|
126
|
-
};
|
|
127
|
-
|
|
128
|
-
/**
|
|
129
|
-
* Banner with custom width
|
|
130
|
-
*/
|
|
131
|
-
export const WithCustomWidth: Story = {
|
|
132
|
-
args: {
|
|
133
|
-
width: '600px',
|
|
134
|
-
children: (
|
|
135
|
-
<div>
|
|
136
|
-
<h2 style={{ margin: 0, marginBottom: '8px', color: 'white' }}>Custom Width Banner</h2>
|
|
137
|
-
<p style={{ margin: 0, color: 'rgba(255, 255, 255, 0.8)' }}>
|
|
138
|
-
This banner has a fixed width of 600px instead of 100%.
|
|
139
|
-
</p>
|
|
140
|
-
</div>
|
|
141
|
-
),
|
|
142
|
-
},
|
|
143
|
-
};
|
|
144
|
-
|
|
145
|
-
/**
|
|
146
|
-
* Banner with minimal content
|
|
147
|
-
*/
|
|
148
|
-
export const WithMinimalContent: Story = {
|
|
149
|
-
args: {
|
|
150
|
-
children: <p style={{ margin: 0, color: 'white', textAlign: 'center' }}>Simple announcement message</p>,
|
|
151
|
-
},
|
|
152
|
-
};
|
|
153
|
-
|
|
154
|
-
/**
|
|
155
|
-
* Banner with rich content including buttons and links
|
|
156
|
-
*/
|
|
157
|
-
export const WithRichContent: Story = {
|
|
158
|
-
args: {
|
|
159
|
-
children: (
|
|
160
|
-
<div>
|
|
161
|
-
<h1 style={{ margin: 0, marginBottom: '12px', color: 'white', fontSize: '2rem' }}>
|
|
162
|
-
🚀 New Feature Launch
|
|
163
|
-
</h1>
|
|
164
|
-
<p style={{ margin: 0, marginBottom: '16px', color: 'rgba(255, 255, 255, 0.9)' }}>
|
|
165
|
-
We've just released our most powerful web scraping tools yet. Experience faster, more reliable
|
|
166
|
-
data extraction with our enhanced platform.
|
|
167
|
-
</p>
|
|
168
|
-
<div style={{ display: 'flex', gap: '12px', alignItems: 'center' }}>
|
|
169
|
-
<button
|
|
170
|
-
type="button"
|
|
171
|
-
style={{
|
|
172
|
-
padding: '8px 16px',
|
|
173
|
-
backgroundColor: 'white',
|
|
174
|
-
color: '#333',
|
|
175
|
-
border: 'none',
|
|
176
|
-
borderRadius: '4px',
|
|
177
|
-
fontWeight: 'bold',
|
|
178
|
-
cursor: 'pointer',
|
|
179
|
-
}}
|
|
180
|
-
>
|
|
181
|
-
Get Started
|
|
182
|
-
</button>
|
|
183
|
-
<a
|
|
184
|
-
href="#"
|
|
185
|
-
style={{
|
|
186
|
-
color: 'white',
|
|
187
|
-
textDecoration: 'underline',
|
|
188
|
-
}}
|
|
189
|
-
>
|
|
190
|
-
Learn more
|
|
191
|
-
</a>
|
|
192
|
-
</div>
|
|
193
|
-
</div>
|
|
194
|
-
),
|
|
195
|
-
},
|
|
196
|
-
};
|
|
197
|
-
|
|
198
|
-
/**
|
|
199
|
-
* Banner with warning/alert styling
|
|
200
|
-
*/
|
|
201
|
-
export const WarningBanner: Story = {
|
|
202
|
-
args: {
|
|
203
|
-
background: '#FF9800',
|
|
204
|
-
useGradientBackground: false,
|
|
205
|
-
children: (
|
|
206
|
-
<div style={{ display: 'flex', alignItems: 'center', gap: '12px' }}>
|
|
207
|
-
<span style={{ fontSize: '1.5rem' }}>⚠️</span>
|
|
208
|
-
<div>
|
|
209
|
-
<h3 style={{ margin: 0, marginBottom: '4px', color: 'white' }}>Maintenance Notice</h3>
|
|
210
|
-
<p style={{ margin: 0, color: 'rgba(255, 255, 255, 0.9)' }}>
|
|
211
|
-
Scheduled maintenance will occur on Sunday, 12:00-14:00 UTC.
|
|
212
|
-
</p>
|
|
213
|
-
</div>
|
|
214
|
-
</div>
|
|
215
|
-
),
|
|
216
|
-
},
|
|
217
|
-
};
|
|
218
|
-
|
|
219
|
-
/**
|
|
220
|
-
* Banner with success/positive messaging
|
|
221
|
-
*/
|
|
222
|
-
export const SuccessBanner: Story = {
|
|
223
|
-
args: {
|
|
224
|
-
background: '#4CAF50',
|
|
225
|
-
useGradientBackground: false,
|
|
226
|
-
children: (
|
|
227
|
-
<div style={{ display: 'flex', alignItems: 'center', gap: '12px' }}>
|
|
228
|
-
<span style={{ fontSize: '1.5rem' }}>✅</span>
|
|
229
|
-
<div>
|
|
230
|
-
<h3 style={{ margin: 0, marginBottom: '4px', color: 'white' }}>Migration Complete</h3>
|
|
231
|
-
<p style={{ margin: 0, color: 'rgba(255, 255, 255, 0.9)' }}>
|
|
232
|
-
Your account has been successfully migrated to our new platform.
|
|
233
|
-
</p>
|
|
234
|
-
</div>
|
|
235
|
-
</div>
|
|
236
|
-
),
|
|
237
|
-
},
|
|
238
|
-
};
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import type React from 'react';
|
|
2
|
-
import styled, { css } from 'styled-components';
|
|
3
|
-
|
|
4
|
-
import { theme } from '../../design_system/theme';
|
|
5
|
-
|
|
6
|
-
const BANNER_GRADIENT_BACKGROUND_SVG = `<svg width="1200" height="148" viewBox="0 0 1200 148" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
7
|
-
<g clip-path="url(#clip0_2285_34756)">
|
|
8
|
-
<g filter="url(#filter0_f_2285_34756)">
|
|
9
|
-
<path d="M-39.7702 191.085C-55.0622 193.205 -68.8864 201.311 -78.2029 213.621C-87.5194 225.932 -91.5654 241.438 -89.4512 256.731L-55.0077 502.652L89.8852 173L-39.7702 191.085Z" fill="url(#paint0_linear_2285_34756)"/>
|
|
10
|
-
</g>
|
|
11
|
-
<g filter="url(#filter1_f_2285_34756)">
|
|
12
|
-
<path d="M1267.53 398.062L1253.99 209.002C1252.85 193.626 1245.67 179.327 1234.01 169.234C1222.36 159.14 1207.18 154.073 1191.8 155.14C1190.5 155.19 1189.2 155.331 1187.92 155.564L1132 163.289L1254.84 438.685C1264.05 427.236 1268.59 412.721 1267.53 398.062Z" fill="url(#paint1_linear_2285_34756)"/>
|
|
13
|
-
</g>
|
|
14
|
-
<g filter="url(#filter2_f_2285_34756)">
|
|
15
|
-
<path d="M561 29.7691C570.917 30.4746 580.956 29.5571 590.142 27.1057L801.075 -28.7862L700.682 -170L561 29.7691Z" fill="url(#paint2_linear_2285_34756)"/>
|
|
16
|
-
</g>
|
|
17
|
-
</g>
|
|
18
|
-
<defs>
|
|
19
|
-
<filter id="filter0_f_2285_34756" x="-170" y="93" width="339.885" height="489.652" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
|
20
|
-
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
|
21
|
-
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
|
|
22
|
-
<feGaussianBlur stdDeviation="40" result="effect1_foregroundBlur_2285_34756"/>
|
|
23
|
-
</filter>
|
|
24
|
-
<filter id="filter1_f_2285_34756" x="1052" y="75" width="295.683" height="443.686" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
|
25
|
-
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
|
26
|
-
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
|
|
27
|
-
<feGaussianBlur stdDeviation="40" result="effect1_foregroundBlur_2285_34756"/>
|
|
28
|
-
</filter>
|
|
29
|
-
<filter id="filter2_f_2285_34756" x="481" y="-250" width="400.074" height="360" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
|
30
|
-
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
|
31
|
-
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
|
|
32
|
-
<feGaussianBlur stdDeviation="40" result="effect1_foregroundBlur_2285_34756"/>
|
|
33
|
-
</filter>
|
|
34
|
-
<linearGradient id="paint0_linear_2285_34756" x1="-0.0574112" y1="173" x2="-0.0574112" y2="502.652" gradientUnits="userSpaceOnUse">
|
|
35
|
-
<stop stop-color="#00FF85"/>
|
|
36
|
-
<stop offset="1" stop-color="#00FF47" stop-opacity="0"/>
|
|
37
|
-
</linearGradient>
|
|
38
|
-
<linearGradient id="paint1_linear_2285_34756" x1="1146.02" y1="174.549" x2="1333.1" y2="293.915" gradientUnits="userSpaceOnUse">
|
|
39
|
-
<stop stop-color="#00FFF0"/>
|
|
40
|
-
<stop offset="1" stop-color="#1672EB"/>
|
|
41
|
-
</linearGradient>
|
|
42
|
-
<linearGradient id="paint2_linear_2285_34756" x1="681.037" y1="-170" x2="681.037" y2="30" gradientUnits="userSpaceOnUse">
|
|
43
|
-
<stop stop-color="#F5B315"/>
|
|
44
|
-
<stop offset="1" stop-color="#FF2CC4"/>
|
|
45
|
-
</linearGradient>
|
|
46
|
-
<clipPath id="clip0_2285_34756">
|
|
47
|
-
<rect width="1200" height="1791.08" rx="16" fill="white"/>
|
|
48
|
-
</clipPath>
|
|
49
|
-
</defs>
|
|
50
|
-
</svg>
|
|
51
|
-
`;
|
|
52
|
-
|
|
53
|
-
interface BannerProps {
|
|
54
|
-
background?: string;
|
|
55
|
-
useGradientBackground?: boolean;
|
|
56
|
-
width?: string;
|
|
57
|
-
className?: string;
|
|
58
|
-
children: React.ReactNode;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
const getBannerBackground = (background?: string, useGradientBackground?: boolean) => {
|
|
62
|
-
return css`
|
|
63
|
-
background-color: ${background || theme.color.neutral.backgroundSubtle};
|
|
64
|
-
${useGradientBackground &&
|
|
65
|
-
`
|
|
66
|
-
background-image: url("data:image/svg+xml,${encodeURIComponent(BANNER_GRADIENT_BACKGROUND_SVG)}");
|
|
67
|
-
background-position: center;
|
|
68
|
-
background-repeat: no-repeat;
|
|
69
|
-
background-size: cover;
|
|
70
|
-
`}
|
|
71
|
-
`;
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
const StyledBanner = styled.div<{ $background?: string; $useGradientBackground?: boolean; width?: string }>`
|
|
75
|
-
width: ${(props) => props.width || '100%'};
|
|
76
|
-
padding: ${theme.space.space40} ${theme.space.space80};
|
|
77
|
-
border-radius: ${theme.radius.radius16};
|
|
78
|
-
|
|
79
|
-
${({ $background, $useGradientBackground }) => getBannerBackground($background, $useGradientBackground)};
|
|
80
|
-
`;
|
|
81
|
-
|
|
82
|
-
export const Banner: React.FC<BannerProps> = ({
|
|
83
|
-
useGradientBackground = true,
|
|
84
|
-
background,
|
|
85
|
-
children,
|
|
86
|
-
...otherProps
|
|
87
|
-
}) => (
|
|
88
|
-
<StyledBanner $background={background} $useGradientBackground={useGradientBackground} {...otherProps}>
|
|
89
|
-
{children}
|
|
90
|
-
</StyledBanner>
|
|
91
|
-
);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './banner';
|
|
@@ -1,311 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
-
|
|
3
|
-
import { Chip, CHIP_SIZES, CHIP_TYPES, type ChipProps } from './chip';
|
|
4
|
-
|
|
5
|
-
const mockIcons = {
|
|
6
|
-
star: <span style={{ fontSize: '14px' }}>⭐</span>,
|
|
7
|
-
check: <span style={{ fontSize: '14px' }}>✓</span>,
|
|
8
|
-
warning: <span style={{ fontSize: '14px' }}>⚠️</span>,
|
|
9
|
-
error: <span style={{ fontSize: '14px' }}>❌</span>,
|
|
10
|
-
info: <span style={{ fontSize: '14px' }}>ℹ️</span>,
|
|
11
|
-
heart: <span style={{ fontSize: '14px' }}>❤️</span>,
|
|
12
|
-
tag: <span style={{ fontSize: '14px' }}>#</span>,
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export default {
|
|
16
|
-
title: 'UI-Library/Chip',
|
|
17
|
-
tags: ['deprecated'],
|
|
18
|
-
component: Chip,
|
|
19
|
-
argTypes: {
|
|
20
|
-
type: {
|
|
21
|
-
control: 'select',
|
|
22
|
-
options: Object.values(CHIP_TYPES),
|
|
23
|
-
},
|
|
24
|
-
size: {
|
|
25
|
-
control: 'select',
|
|
26
|
-
options: Object.values(CHIP_SIZES),
|
|
27
|
-
},
|
|
28
|
-
clickable: {
|
|
29
|
-
control: 'boolean',
|
|
30
|
-
},
|
|
31
|
-
icon: {
|
|
32
|
-
control: false,
|
|
33
|
-
},
|
|
34
|
-
children: {
|
|
35
|
-
control: 'text',
|
|
36
|
-
},
|
|
37
|
-
className: {
|
|
38
|
-
control: 'text',
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
parameters: {
|
|
42
|
-
design: {
|
|
43
|
-
type: 'figma',
|
|
44
|
-
url: 'TODO: Add Figma URL',
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
} as Meta<ChipProps>;
|
|
48
|
-
|
|
49
|
-
type Story = StoryObj<ChipProps>;
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Default chip with medium size and default type
|
|
53
|
-
*/
|
|
54
|
-
export const Default: Story = {
|
|
55
|
-
args: {
|
|
56
|
-
children: 'Default Chip',
|
|
57
|
-
},
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Extra small chip - the smallest size available
|
|
62
|
-
*/
|
|
63
|
-
export const ExtraSmall: Story = {
|
|
64
|
-
args: {
|
|
65
|
-
size: CHIP_SIZES.EXTRA_SMALL,
|
|
66
|
-
children: 'XS Chip',
|
|
67
|
-
},
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* Small chip size
|
|
72
|
-
*/
|
|
73
|
-
export const Small: Story = {
|
|
74
|
-
args: {
|
|
75
|
-
size: CHIP_SIZES.SMALL,
|
|
76
|
-
children: 'Small Chip',
|
|
77
|
-
},
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* Medium chip size (default)
|
|
82
|
-
*/
|
|
83
|
-
export const Medium: Story = {
|
|
84
|
-
args: {
|
|
85
|
-
size: CHIP_SIZES.MEDIUM,
|
|
86
|
-
children: 'Medium Chip',
|
|
87
|
-
},
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* Large chip size
|
|
92
|
-
*/
|
|
93
|
-
export const Large: Story = {
|
|
94
|
-
args: {
|
|
95
|
-
size: CHIP_SIZES.LARGE,
|
|
96
|
-
children: 'Large Chip',
|
|
97
|
-
},
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* Primary chip type with brand colors
|
|
102
|
-
*/
|
|
103
|
-
export const Primary: Story = {
|
|
104
|
-
args: {
|
|
105
|
-
type: CHIP_TYPES.PRIMARY,
|
|
106
|
-
children: 'Primary Chip',
|
|
107
|
-
},
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* Success chip type for positive states
|
|
112
|
-
*/
|
|
113
|
-
export const Success: Story = {
|
|
114
|
-
args: {
|
|
115
|
-
type: CHIP_TYPES.SUCCESS,
|
|
116
|
-
children: 'Success Chip',
|
|
117
|
-
},
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
* Warning chip type for cautionary states
|
|
122
|
-
*/
|
|
123
|
-
export const Warning: Story = {
|
|
124
|
-
args: {
|
|
125
|
-
type: CHIP_TYPES.WARNING,
|
|
126
|
-
children: 'Warning Chip',
|
|
127
|
-
},
|
|
128
|
-
};
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* Danger chip type for error or critical states
|
|
132
|
-
*/
|
|
133
|
-
export const Danger: Story = {
|
|
134
|
-
args: {
|
|
135
|
-
type: CHIP_TYPES.DANGER,
|
|
136
|
-
children: 'Danger Chip',
|
|
137
|
-
},
|
|
138
|
-
};
|
|
139
|
-
|
|
140
|
-
/**
|
|
141
|
-
* Chip with an icon on the right side
|
|
142
|
-
*/
|
|
143
|
-
export const WithIcon: Story = {
|
|
144
|
-
args: {
|
|
145
|
-
children: 'Starred',
|
|
146
|
-
icon: mockIcons.star,
|
|
147
|
-
},
|
|
148
|
-
};
|
|
149
|
-
|
|
150
|
-
/**
|
|
151
|
-
* Primary chip with check icon
|
|
152
|
-
*/
|
|
153
|
-
export const PrimaryWithIcon: Story = {
|
|
154
|
-
args: {
|
|
155
|
-
type: CHIP_TYPES.PRIMARY,
|
|
156
|
-
children: 'Completed',
|
|
157
|
-
icon: mockIcons.check,
|
|
158
|
-
},
|
|
159
|
-
};
|
|
160
|
-
|
|
161
|
-
/**
|
|
162
|
-
* Success chip with check icon
|
|
163
|
-
*/
|
|
164
|
-
export const SuccessWithIcon: Story = {
|
|
165
|
-
args: {
|
|
166
|
-
type: CHIP_TYPES.SUCCESS,
|
|
167
|
-
children: 'Verified',
|
|
168
|
-
icon: mockIcons.check,
|
|
169
|
-
},
|
|
170
|
-
};
|
|
171
|
-
|
|
172
|
-
/**
|
|
173
|
-
* Warning chip with warning icon
|
|
174
|
-
*/
|
|
175
|
-
export const WarningWithIcon: Story = {
|
|
176
|
-
args: {
|
|
177
|
-
type: CHIP_TYPES.WARNING,
|
|
178
|
-
children: 'Caution',
|
|
179
|
-
icon: mockIcons.warning,
|
|
180
|
-
},
|
|
181
|
-
};
|
|
182
|
-
|
|
183
|
-
/**
|
|
184
|
-
* Danger chip with error icon
|
|
185
|
-
*/
|
|
186
|
-
export const DangerWithIcon: Story = {
|
|
187
|
-
args: {
|
|
188
|
-
type: CHIP_TYPES.DANGER,
|
|
189
|
-
children: 'Error',
|
|
190
|
-
icon: mockIcons.error,
|
|
191
|
-
},
|
|
192
|
-
};
|
|
193
|
-
|
|
194
|
-
/**
|
|
195
|
-
* Clickable chip with pointer cursor
|
|
196
|
-
*/
|
|
197
|
-
export const Clickable: Story = {
|
|
198
|
-
args: {
|
|
199
|
-
children: 'Click me',
|
|
200
|
-
clickable: true,
|
|
201
|
-
},
|
|
202
|
-
};
|
|
203
|
-
|
|
204
|
-
/**
|
|
205
|
-
* Non-clickable chip with default cursor
|
|
206
|
-
*/
|
|
207
|
-
export const NonClickable: Story = {
|
|
208
|
-
args: {
|
|
209
|
-
children: 'Static chip',
|
|
210
|
-
clickable: false,
|
|
211
|
-
},
|
|
212
|
-
};
|
|
213
|
-
|
|
214
|
-
/**
|
|
215
|
-
* Large primary clickable chip with icon
|
|
216
|
-
*/
|
|
217
|
-
export const LargePrimaryClickableWithIcon: Story = {
|
|
218
|
-
args: {
|
|
219
|
-
type: CHIP_TYPES.PRIMARY,
|
|
220
|
-
size: CHIP_SIZES.LARGE,
|
|
221
|
-
children: 'Premium Feature',
|
|
222
|
-
icon: mockIcons.star,
|
|
223
|
-
clickable: true,
|
|
224
|
-
},
|
|
225
|
-
};
|
|
226
|
-
|
|
227
|
-
/**
|
|
228
|
-
* Small success chip showing status
|
|
229
|
-
*/
|
|
230
|
-
export const SmallStatusChip: Story = {
|
|
231
|
-
args: {
|
|
232
|
-
type: CHIP_TYPES.SUCCESS,
|
|
233
|
-
size: CHIP_SIZES.SMALL,
|
|
234
|
-
children: 'Active',
|
|
235
|
-
},
|
|
236
|
-
};
|
|
237
|
-
|
|
238
|
-
/**
|
|
239
|
-
* Extra small chip for compact layouts
|
|
240
|
-
*/
|
|
241
|
-
export const ExtraSmallTag: Story = {
|
|
242
|
-
args: {
|
|
243
|
-
size: CHIP_SIZES.EXTRA_SMALL,
|
|
244
|
-
children: 'Tag',
|
|
245
|
-
icon: mockIcons.tag,
|
|
246
|
-
},
|
|
247
|
-
};
|
|
248
|
-
|
|
249
|
-
/**
|
|
250
|
-
* Chip with longer text content
|
|
251
|
-
*/
|
|
252
|
-
export const WithLongText: Story = {
|
|
253
|
-
args: {
|
|
254
|
-
children: 'This is a longer chip text',
|
|
255
|
-
type: CHIP_TYPES.PRIMARY,
|
|
256
|
-
},
|
|
257
|
-
};
|
|
258
|
-
|
|
259
|
-
/**
|
|
260
|
-
* Multiple chips showcasing different types in one view
|
|
261
|
-
*/
|
|
262
|
-
export const AllTypes: Story = {
|
|
263
|
-
render: () => (
|
|
264
|
-
<div style={{ display: 'flex', gap: '8px', flexWrap: 'wrap' }}>
|
|
265
|
-
<Chip type={CHIP_TYPES.DEFAULT}>Default</Chip>
|
|
266
|
-
<Chip type={CHIP_TYPES.PRIMARY}>Primary</Chip>
|
|
267
|
-
<Chip type={CHIP_TYPES.SUCCESS}>Success</Chip>
|
|
268
|
-
<Chip type={CHIP_TYPES.WARNING}>Warning</Chip>
|
|
269
|
-
<Chip type={CHIP_TYPES.DANGER}>Danger</Chip>
|
|
270
|
-
</div>
|
|
271
|
-
),
|
|
272
|
-
};
|
|
273
|
-
|
|
274
|
-
/**
|
|
275
|
-
* Multiple chips showcasing different sizes in one view
|
|
276
|
-
*/
|
|
277
|
-
export const AllSizes: Story = {
|
|
278
|
-
render: () => (
|
|
279
|
-
<div style={{ display: 'flex', gap: '8px', alignItems: 'center', flexWrap: 'wrap' }}>
|
|
280
|
-
<Chip size={CHIP_SIZES.EXTRA_SMALL}>XS</Chip>
|
|
281
|
-
<Chip size={CHIP_SIZES.SMALL}>Small</Chip>
|
|
282
|
-
<Chip size={CHIP_SIZES.MEDIUM}>Medium</Chip>
|
|
283
|
-
<Chip size={CHIP_SIZES.LARGE}>Large</Chip>
|
|
284
|
-
</div>
|
|
285
|
-
),
|
|
286
|
-
};
|
|
287
|
-
|
|
288
|
-
/**
|
|
289
|
-
* Chips with various icons demonstrating versatility
|
|
290
|
-
*/
|
|
291
|
-
export const WithVariousIcons: Story = {
|
|
292
|
-
render: () => (
|
|
293
|
-
<div style={{ display: 'flex', gap: '8px', flexWrap: 'wrap' }}>
|
|
294
|
-
<Chip type={CHIP_TYPES.SUCCESS} icon={mockIcons.check}>
|
|
295
|
-
Approved
|
|
296
|
-
</Chip>
|
|
297
|
-
<Chip type={CHIP_TYPES.WARNING} icon={mockIcons.warning}>
|
|
298
|
-
Pending
|
|
299
|
-
</Chip>
|
|
300
|
-
<Chip type={CHIP_TYPES.DANGER} icon={mockIcons.error}>
|
|
301
|
-
Failed
|
|
302
|
-
</Chip>
|
|
303
|
-
<Chip type={CHIP_TYPES.PRIMARY} icon={mockIcons.heart}>
|
|
304
|
-
Favorite
|
|
305
|
-
</Chip>
|
|
306
|
-
<Chip type={CHIP_TYPES.DEFAULT} icon={mockIcons.info}>
|
|
307
|
-
Info
|
|
308
|
-
</Chip>
|
|
309
|
-
</div>
|
|
310
|
-
),
|
|
311
|
-
};
|