@xyd-js/storybook 0.0.1-build.167
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.storybook/main.ts +40 -0
- package/.storybook/manager-head.html +6 -0
- package/.storybook/manager.ts +18 -0
- package/.storybook/preview.ts +40 -0
- package/.storybook/styles.css +5 -0
- package/.storybook/theme.ts +34 -0
- package/CHANGELOG.md +2357 -0
- package/LICENSE +21 -0
- package/README.md +50 -0
- package/eslint.config.js +28 -0
- package/package.json +61 -0
- package/public/logo.svg +10 -0
- package/src/__fixtures__/Icons.tsx +83 -0
- package/src/__fixtures__/atlas-index/package-index.mdx +194 -0
- package/src/__fixtures__/atlas-index/wip1.mdx +131 -0
- package/src/__fixtures__/atlas-index.mdx +53 -0
- package/src/__fixtures__/code-sample.mdx +15 -0
- package/src/__fixtures__/example-source-uniform.ts +41 -0
- package/src/__fixtures__/hello-world.mdx +116 -0
- package/src/components/DemoDocs.tsx +235 -0
- package/src/components/logo.tsx +37 -0
- package/src/decorators/DocsTemplate.tsx +101 -0
- package/src/docs/atlas/Atlas.stories.tsx +51 -0
- package/src/docs/atlas/todo-app.uniform.json +625 -0
- package/src/docs/atlas/uniform-to-references.ts +101 -0
- package/src/docs/components/coder/CodeSample.stories.tsx +29 -0
- package/src/docs/components/pages/PageBlogHome.stories.tsx +52 -0
- package/src/docs/components/pages/PageFirstSlide.stories.tsx +124 -0
- package/src/docs/components/pages/PageHome.stories.tsx +127 -0
- package/src/docs/components/system/Baseline.stories.tsx +126 -0
- package/src/docs/components/writer/Badge.stories.tsx +132 -0
- package/src/docs/components/writer/Banner.stories.tsx +394 -0
- package/src/docs/components/writer/Blockquote.stories.tsx +415 -0
- package/src/docs/components/writer/Breadcrumbs.stories.tsx +282 -0
- package/src/docs/components/writer/Button.stories.tsx +405 -0
- package/src/docs/components/writer/Callout.stories.tsx +183 -0
- package/src/docs/components/writer/Card.stories.tsx +457 -0
- package/src/docs/components/writer/ColorSchemeButton.stories.tsx +322 -0
- package/src/docs/components/writer/Details.stories.tsx +333 -0
- package/src/docs/components/writer/GuideCard.stories.tsx +384 -0
- package/src/docs/components/writer/Heading.stories.tsx +379 -0
- package/src/docs/components/writer/Hr.stories.tsx +325 -0
- package/src/docs/components/writer/IconSocial.stories.tsx +591 -0
- package/src/docs/components/writer/Image.stories.tsx +430 -0
- package/src/docs/components/writer/List.stories.tsx +479 -0
- package/src/docs/components/writer/NavLinks.stories.tsx +380 -0
- package/src/docs/components/writer/Pre.stories.tsx +23 -0
- package/src/docs/components/writer/Steps.stories.tsx +914 -0
- package/src/docs/components/writer/Table.stories.tsx +608 -0
- package/src/docs/components/writer/Tabs.stories.tsx +760 -0
- package/src/docs/components/writer/TocCard.stories.tsx +407 -0
- package/src/docs/components/writer/Update.stories.tsx +457 -0
- package/src/docs/components/writer/VideoGuide.stories.tsx +17 -0
- package/src/docs/templates/CodeSample.stories.tsx +15 -0
- package/src/docs/themes/TODO.md +1 -0
- package/src/docs/themes/logo.tsx +37 -0
- package/src/docs/themes/themes.stories.tsx +269 -0
- package/src/docs/ui/Nav.stories.tsx +58 -0
- package/src/docs/ui/Sidebar.stories.tsx +167 -0
- package/src/docs/ui/SubNav.stories.tsx +29 -0
- package/src/utils/mdx.ts +31 -0
- package/storybook-static/assets/Atlas.stories-B3Ix52TV.js +153 -0
- package/storybook-static/assets/Badge.stories-D3nfVAAW.js +84 -0
- package/storybook-static/assets/Banner.stories-BHLs2WlR.js +394 -0
- package/storybook-static/assets/Baseline.stories-Bwx2zF_U.js +103 -0
- package/storybook-static/assets/Blockquote.stories-Cxf9fDVo.js +468 -0
- package/storybook-static/assets/Breadcrumbs.stories-CFjDJvdh.js +219 -0
- package/storybook-static/assets/Button-Cj99tk5U-Cn0Wrqkw.js +3 -0
- package/storybook-static/assets/Button.stories-DUfQIyn7.js +472 -0
- package/storybook-static/assets/Callout.stories-CIQWommc.js +134 -0
- package/storybook-static/assets/Card.stories-0mJDPE-f.js +278 -0
- package/storybook-static/assets/CodeSample.stories-1k1_b2U_.js +8 -0
- package/storybook-static/assets/CodeSample.stories-BEAQ3H6A.js +22 -0
- package/storybook-static/assets/Color-YHDXOIA2-BAq_yxd2.js +1 -0
- package/storybook-static/assets/ColorSchemeButton.stories-C1yuuA8O.js +384 -0
- package/storybook-static/assets/Details.stories-BacIPYUH.js +290 -0
- package/storybook-static/assets/DocsRenderer-CFRXHY34-BwJiFRuq.js +575 -0
- package/storybook-static/assets/DocsTemplate-B8_ZAKIZ.js +16 -0
- package/storybook-static/assets/GuideCard.stories-IJbjW-xe.js +253 -0
- package/storybook-static/assets/Heading.stories-C9rBwnlZ.js +337 -0
- package/storybook-static/assets/Hr.stories-bgwD4mmY.js +351 -0
- package/storybook-static/assets/IconSocial.stories-Bv3u90GB.js +715 -0
- package/storybook-static/assets/Icons-CjNNbMNR.js +1 -0
- package/storybook-static/assets/Image.stories-BlrJ8Th7.js +349 -0
- package/storybook-static/assets/List.stories-mzy4ZAGg.js +513 -0
- package/storybook-static/assets/Nav.stories-CZhCHFlj.js +13 -0
- package/storybook-static/assets/NavLinks.stories-DuFRhZLh.js +359 -0
- package/storybook-static/assets/PageBlogHome.stories-BnmA2r3q.js +14 -0
- package/storybook-static/assets/PageFirstSlide-D2kcGYmB-BWfslHla.js +1 -0
- package/storybook-static/assets/PageFirstSlide-SzOOIHx0.css +1 -0
- package/storybook-static/assets/PageFirstSlide.stories-CoKlxYlH.js +55 -0
- package/storybook-static/assets/PageHome.stories-DcgUrGxe.js +121 -0
- package/storybook-static/assets/Pre.stories-CKu9R4kn.js +11 -0
- package/storybook-static/assets/Sidebar.stories-BivU6MOT.js +9 -0
- package/storybook-static/assets/Steps.stories-fSa3Sw8j.js +1146 -0
- package/storybook-static/assets/SubNav.stories-CL_Th3oO.js +19 -0
- package/storybook-static/assets/Table.stories-BdNM7k9y.js +581 -0
- package/storybook-static/assets/Tabs.stories-A3NcBab_.js +873 -0
- package/storybook-static/assets/Text-BAwif7rv-BYvLGGQV.js +31 -0
- package/storybook-static/assets/TocCard.stories-BRB1SH6U.js +299 -0
- package/storybook-static/assets/Update-DflVXGGQ-qVV03FlC.js +1 -0
- package/storybook-static/assets/Update.stories-DG383caW.js +387 -0
- package/storybook-static/assets/VideoGuide.stories-BnCDLXK7.js +3 -0
- package/storybook-static/assets/__vite-browser-external-FmFgRqLi.js +1 -0
- package/storybook-static/assets/_rollupPluginBabelHelpers-DuYa1R0C-CyXpXONY.js +4 -0
- package/storybook-static/assets/chunk-EF7DTUVF-DPkwZaUR.js +12 -0
- package/storybook-static/assets/chunk-XP5HYGXS-BpfKkqn7.js +1 -0
- package/storybook-static/assets/content-BRdfAQPf.js +27 -0
- package/storybook-static/assets/entry-preview-D5WwyKaL.js +2 -0
- package/storybook-static/assets/entry-preview-docs-DU3GzdsG.js +46 -0
- package/storybook-static/assets/entry-preview-rsc-56ExrKd2.js +1 -0
- package/storybook-static/assets/github-BKgXy13-.js +6 -0
- package/storybook-static/assets/iframe-YbiB23cy.js +211 -0
- package/storybook-static/assets/index-Cf9b6H0j.js +8 -0
- package/storybook-static/assets/index-CrSc8wm9.js +240 -0
- package/storybook-static/assets/index-CzKwSnp0.js +9 -0
- package/storybook-static/assets/index-D6tQpKjq.js +12 -0
- package/storybook-static/assets/index-DUCcPMOf.js +1 -0
- package/storybook-static/assets/index-D_kTjGoR.js +9 -0
- package/storybook-static/assets/index-DgnBCu_c.js +1 -0
- package/storybook-static/assets/index-DrFu-skq.js +6 -0
- package/storybook-static/assets/index-H0MBf5rE.js +1 -0
- package/storybook-static/assets/jsx-runtime-D_zvdyIk.js +9 -0
- package/storybook-static/assets/layouts-DBdGRyBm.js +1 -0
- package/storybook-static/assets/preview-B5edrxhc.js +1 -0
- package/storybook-static/assets/preview-BWzBA1C2.js +396 -0
- package/storybook-static/assets/preview-C5EOgwJ9.js +2 -0
- package/storybook-static/assets/preview-DGZ5Qq08.js +34 -0
- package/storybook-static/assets/preview-DTyQTpzx.js +1 -0
- package/storybook-static/assets/preview-TqM3Oi8H.js +1 -0
- package/storybook-static/assets/preview-WIE65ICp.js +1 -0
- package/storybook-static/assets/preview-_Oh-njOd.css +1 -0
- package/storybook-static/assets/preview-caVMbCIR.js +7 -0
- package/storybook-static/assets/react-18-Tf4JhPOR.js +25 -0
- package/storybook-static/assets/system-CcsYyfSK.js +1 -0
- package/storybook-static/assets/test-utils-BaXAOqRT.js +9 -0
- package/storybook-static/assets/themes.stories-D1474P9U.js +41 -0
- package/storybook-static/assets/writer-DkrWmB39.js +1 -0
- package/storybook-static/favicon.svg +1 -0
- package/storybook-static/iframe.html +666 -0
- package/storybook-static/index.html +183 -0
- package/storybook-static/index.json +1 -0
- package/storybook-static/logo.svg +10 -0
- package/storybook-static/nunito-sans-bold-italic.woff2 +0 -0
- package/storybook-static/nunito-sans-bold.woff2 +0 -0
- package/storybook-static/nunito-sans-italic.woff2 +0 -0
- package/storybook-static/nunito-sans-regular.woff2 +0 -0
- package/storybook-static/project.json +1 -0
- package/storybook-static/sb-addons/docs-9/manager-bundle.js +242 -0
- package/storybook-static/sb-addons/essentials-actions-2/manager-bundle.js +3 -0
- package/storybook-static/sb-addons/essentials-backgrounds-3/manager-bundle.js +12 -0
- package/storybook-static/sb-addons/essentials-controls-1/manager-bundle.js +402 -0
- package/storybook-static/sb-addons/essentials-measure-6/manager-bundle.js +3 -0
- package/storybook-static/sb-addons/essentials-outline-7/manager-bundle.js +3 -0
- package/storybook-static/sb-addons/essentials-toolbars-5/manager-bundle.js +3 -0
- package/storybook-static/sb-addons/essentials-viewport-4/manager-bundle.js +3 -0
- package/storybook-static/sb-addons/storybook-10/manager-bundle.js +3 -0
- package/storybook-static/sb-addons/storybook-core-core-server-presets-0/common-manager-bundle.js +3 -0
- package/storybook-static/sb-addons/storysource-8/manager-bundle.js +3 -0
- package/storybook-static/sb-common-assets/favicon.svg +1 -0
- package/storybook-static/sb-common-assets/nunito-sans-bold-italic.woff2 +0 -0
- package/storybook-static/sb-common-assets/nunito-sans-bold.woff2 +0 -0
- package/storybook-static/sb-common-assets/nunito-sans-italic.woff2 +0 -0
- package/storybook-static/sb-common-assets/nunito-sans-regular.woff2 +0 -0
- package/storybook-static/sb-manager/globals-module-info.js +1052 -0
- package/storybook-static/sb-manager/globals-runtime.js +42127 -0
- package/storybook-static/sb-manager/globals.js +48 -0
- package/storybook-static/sb-manager/runtime.js +12048 -0
- package/tsconfig.json +39 -0
- package/tsconfig.tsbuildinfo +1 -0
- package/vite.config.ts +8 -0
|
@@ -0,0 +1,394 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
|
+
|
|
4
|
+
import { Banner } from '@xyd-js/components/writer';
|
|
5
|
+
import {
|
|
6
|
+
IconSessionReplay,
|
|
7
|
+
IconMetrics,
|
|
8
|
+
IconFunnels
|
|
9
|
+
} from '../../../__fixtures__/Icons';
|
|
10
|
+
|
|
11
|
+
const meta: Meta<typeof Banner> = {
|
|
12
|
+
title: 'Components/Writer/Banner',
|
|
13
|
+
component: Banner,
|
|
14
|
+
parameters: {
|
|
15
|
+
docs: {
|
|
16
|
+
description: {
|
|
17
|
+
component: 'Banner component displays promotional or informational messages with optional storage functionality to control visibility based on user interactions.',
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
argTypes: {
|
|
22
|
+
children: {
|
|
23
|
+
description: 'The content to display inside the banner',
|
|
24
|
+
control: 'text',
|
|
25
|
+
},
|
|
26
|
+
kind: {
|
|
27
|
+
description: 'The visual style variant of the banner',
|
|
28
|
+
control: { type: 'select' },
|
|
29
|
+
options: ['secondary'],
|
|
30
|
+
},
|
|
31
|
+
label: {
|
|
32
|
+
description: 'Optional label to display in the banner',
|
|
33
|
+
control: 'text',
|
|
34
|
+
},
|
|
35
|
+
href: {
|
|
36
|
+
description: 'URL to navigate to when banner is clicked',
|
|
37
|
+
control: 'text',
|
|
38
|
+
},
|
|
39
|
+
icon: {
|
|
40
|
+
description: 'Icon to display in the banner',
|
|
41
|
+
control: false,
|
|
42
|
+
},
|
|
43
|
+
store: {
|
|
44
|
+
description: 'Seconds until banner can show again after being closed',
|
|
45
|
+
control: 'number',
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export default meta;
|
|
51
|
+
type Story = StoryObj<typeof Banner>;
|
|
52
|
+
|
|
53
|
+
// Basic usage
|
|
54
|
+
export const Default: Story = {
|
|
55
|
+
args: {
|
|
56
|
+
children: 'New feature available! Check out our latest updates.',
|
|
57
|
+
href: '#',
|
|
58
|
+
},
|
|
59
|
+
render: (args) => (
|
|
60
|
+
<div style={{ padding: '20px' }}>
|
|
61
|
+
<Banner {...args} />
|
|
62
|
+
</div>
|
|
63
|
+
),
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
// With icon
|
|
67
|
+
export const WithIcon: Story = {
|
|
68
|
+
args: {
|
|
69
|
+
children: 'Session replay is now available in beta',
|
|
70
|
+
icon: <IconSessionReplay />,
|
|
71
|
+
href: '/features/session-replay',
|
|
72
|
+
},
|
|
73
|
+
render: (args) => (
|
|
74
|
+
<div style={{ padding: '20px' }}>
|
|
75
|
+
<Banner {...args} />
|
|
76
|
+
</div>
|
|
77
|
+
),
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
// With label
|
|
81
|
+
export const WithLabel: Story = {
|
|
82
|
+
args: {
|
|
83
|
+
children: 'Analytics dashboard has been updated',
|
|
84
|
+
label: 'NEW',
|
|
85
|
+
href: '/analytics',
|
|
86
|
+
},
|
|
87
|
+
render: (args) => (
|
|
88
|
+
<div style={{ padding: '20px' }}>
|
|
89
|
+
<Banner {...args} />
|
|
90
|
+
</div>
|
|
91
|
+
),
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
// With icon and label
|
|
95
|
+
export const WithIconAndLabel: Story = {
|
|
96
|
+
args: {
|
|
97
|
+
children: 'Funnel analysis tool is now live',
|
|
98
|
+
icon: <IconFunnels />,
|
|
99
|
+
label: 'BETA',
|
|
100
|
+
href: '/tools/funnel-analysis',
|
|
101
|
+
},
|
|
102
|
+
render: (args) => (
|
|
103
|
+
<div style={{ padding: '20px' }}>
|
|
104
|
+
<Banner {...args} />
|
|
105
|
+
</div>
|
|
106
|
+
),
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
// Secondary variant
|
|
110
|
+
export const Secondary: Story = {
|
|
111
|
+
args: {
|
|
112
|
+
children: 'This is a secondary banner with different styling',
|
|
113
|
+
kind: 'secondary',
|
|
114
|
+
label: 'INFO',
|
|
115
|
+
},
|
|
116
|
+
render: (args) => (
|
|
117
|
+
<div style={{ padding: '20px' }}>
|
|
118
|
+
<Banner {...args} />
|
|
119
|
+
</div>
|
|
120
|
+
),
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
// With storage functionality
|
|
124
|
+
export const WithStorage: Story = {
|
|
125
|
+
args: {
|
|
126
|
+
children: 'This banner will be hidden for 30 seconds after closing',
|
|
127
|
+
label: 'REMINDER',
|
|
128
|
+
store: 30,
|
|
129
|
+
},
|
|
130
|
+
render: (args) => (
|
|
131
|
+
<div style={{ padding: '20px' }}>
|
|
132
|
+
<Banner {...args} />
|
|
133
|
+
<p style={{ marginTop: '10px', fontSize: '14px', color: '#666' }}>
|
|
134
|
+
Try closing this banner and refreshing the page to see the storage functionality.
|
|
135
|
+
</p>
|
|
136
|
+
</div>
|
|
137
|
+
),
|
|
138
|
+
parameters: {
|
|
139
|
+
docs: {
|
|
140
|
+
description: {
|
|
141
|
+
story: 'This banner demonstrates the storage functionality. When closed, it will be hidden for the specified number of seconds.',
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
},
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
// Long content
|
|
148
|
+
export const LongContent: Story = {
|
|
149
|
+
args: {
|
|
150
|
+
children: 'This is a banner with much longer content to demonstrate how the component handles extended text and multiple lines of information.',
|
|
151
|
+
icon: <IconMetrics />,
|
|
152
|
+
label: 'UPDATE',
|
|
153
|
+
href: '/changelog',
|
|
154
|
+
},
|
|
155
|
+
render: (args) => (
|
|
156
|
+
<div style={{ padding: '20px' }}>
|
|
157
|
+
<Banner {...args} />
|
|
158
|
+
</div>
|
|
159
|
+
),
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
// External link
|
|
163
|
+
export const ExternalLink: Story = {
|
|
164
|
+
args: {
|
|
165
|
+
children: 'Visit our documentation for more information',
|
|
166
|
+
icon: <IconSessionReplay />,
|
|
167
|
+
label: 'DOCS',
|
|
168
|
+
href: 'https://docs.example.com',
|
|
169
|
+
},
|
|
170
|
+
render: (args) => (
|
|
171
|
+
<div style={{ padding: '20px' }}>
|
|
172
|
+
<Banner {...args} />
|
|
173
|
+
</div>
|
|
174
|
+
),
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
// No link
|
|
178
|
+
export const NoLink: Story = {
|
|
179
|
+
args: {
|
|
180
|
+
children: 'This banner has no link and cannot be clicked',
|
|
181
|
+
icon: <IconFunnels />,
|
|
182
|
+
label: 'NOTICE',
|
|
183
|
+
},
|
|
184
|
+
render: (args) => (
|
|
185
|
+
<div style={{ padding: '20px' }}>
|
|
186
|
+
<Banner {...args} />
|
|
187
|
+
</div>
|
|
188
|
+
),
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
// All variants showcase
|
|
192
|
+
export const AllVariants: Story = {
|
|
193
|
+
render: () => (
|
|
194
|
+
<div style={{ padding: '20px' }}>
|
|
195
|
+
<div style={{ marginBottom: '30px' }}>
|
|
196
|
+
<h3 style={{ marginBottom: '10px', color: '#666' }}>Default Banners</h3>
|
|
197
|
+
<div style={{ marginBottom: '20px' }}>
|
|
198
|
+
<Banner href="#">
|
|
199
|
+
Basic banner with link
|
|
200
|
+
</Banner>
|
|
201
|
+
</div>
|
|
202
|
+
<div style={{ marginBottom: '20px' }}>
|
|
203
|
+
<Banner icon={<IconSessionReplay />} href="#">
|
|
204
|
+
Banner with icon
|
|
205
|
+
</Banner>
|
|
206
|
+
</div>
|
|
207
|
+
<div style={{ marginBottom: '20px' }}>
|
|
208
|
+
<Banner label="NEW" href="#">
|
|
209
|
+
Banner with label
|
|
210
|
+
</Banner>
|
|
211
|
+
</div>
|
|
212
|
+
<div style={{ marginBottom: '20px' }}>
|
|
213
|
+
<Banner icon={<IconMetrics />} label="BETA" href="#">
|
|
214
|
+
Banner with icon and label
|
|
215
|
+
</Banner>
|
|
216
|
+
</div>
|
|
217
|
+
</div>
|
|
218
|
+
|
|
219
|
+
<div style={{ marginBottom: '30px' }}>
|
|
220
|
+
<h3 style={{ marginBottom: '10px', color: '#666' }}>Secondary Banners</h3>
|
|
221
|
+
<div style={{ marginBottom: '20px' }}>
|
|
222
|
+
<Banner kind="secondary" label="INFO">
|
|
223
|
+
Secondary banner with label
|
|
224
|
+
</Banner>
|
|
225
|
+
</div>
|
|
226
|
+
<div style={{ marginBottom: '20px' }}>
|
|
227
|
+
<Banner kind="secondary" icon={<IconFunnels />} label="UPDATE">
|
|
228
|
+
Secondary banner with icon and label
|
|
229
|
+
</Banner>
|
|
230
|
+
</div>
|
|
231
|
+
</div>
|
|
232
|
+
|
|
233
|
+
<div style={{ marginBottom: '30px' }}>
|
|
234
|
+
<h3 style={{ marginBottom: '10px', color: '#666' }}>Banners with Storage</h3>
|
|
235
|
+
<div style={{ marginBottom: '20px' }}>
|
|
236
|
+
<Banner store={60} label="REMINDER">
|
|
237
|
+
This banner will be hidden for 1 minute after closing
|
|
238
|
+
</Banner>
|
|
239
|
+
</div>
|
|
240
|
+
<div style={{ marginBottom: '20px' }}>
|
|
241
|
+
<Banner store={300} icon={<IconSessionReplay />} label="TIP">
|
|
242
|
+
This banner will be hidden for 5 minutes after closing
|
|
243
|
+
</Banner>
|
|
244
|
+
</div>
|
|
245
|
+
</div>
|
|
246
|
+
|
|
247
|
+
<div style={{ marginBottom: '30px' }}>
|
|
248
|
+
<h3 style={{ marginBottom: '10px', color: '#666' }}>External Links</h3>
|
|
249
|
+
<div style={{ marginBottom: '20px' }}>
|
|
250
|
+
<Banner href="https://github.com" icon={<IconMetrics />} label="GITHUB">
|
|
251
|
+
Visit our GitHub repository
|
|
252
|
+
</Banner>
|
|
253
|
+
</div>
|
|
254
|
+
<div style={{ marginBottom: '20px' }}>
|
|
255
|
+
<Banner href="https://docs.example.com" label="DOCS">
|
|
256
|
+
Read our documentation
|
|
257
|
+
</Banner>
|
|
258
|
+
</div>
|
|
259
|
+
</div>
|
|
260
|
+
</div>
|
|
261
|
+
),
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
// Real-world examples
|
|
265
|
+
export const RealWorldExamples: Story = {
|
|
266
|
+
render: () => (
|
|
267
|
+
<div style={{ padding: '20px', maxWidth: '800px' }}>
|
|
268
|
+
<div style={{ marginBottom: '30px' }}>
|
|
269
|
+
<h2>Product Announcements</h2>
|
|
270
|
+
<p>Banners commonly used for product announcements and feature releases.</p>
|
|
271
|
+
<div style={{ marginTop: '16px' }}>
|
|
272
|
+
<Banner icon={<IconSessionReplay />} label="NEW" href="/features/session-replay">
|
|
273
|
+
Session replay is now available in beta! Record and analyze user interactions.
|
|
274
|
+
</Banner>
|
|
275
|
+
</div>
|
|
276
|
+
</div>
|
|
277
|
+
|
|
278
|
+
<div style={{ marginBottom: '30px' }}>
|
|
279
|
+
<h2>System Notifications</h2>
|
|
280
|
+
<p>Banners used for system-wide notifications and updates.</p>
|
|
281
|
+
<div style={{ marginTop: '16px' }}>
|
|
282
|
+
<Banner kind="secondary" label="MAINTENANCE" store={3600}>
|
|
283
|
+
Scheduled maintenance on Sunday, 2:00 AM - 4:00 AM EST
|
|
284
|
+
</Banner>
|
|
285
|
+
</div>
|
|
286
|
+
</div>
|
|
287
|
+
|
|
288
|
+
<div style={{ marginBottom: '30px' }}>
|
|
289
|
+
<h2>Promotional Content</h2>
|
|
290
|
+
<p>Banners for promotional content and marketing messages.</p>
|
|
291
|
+
<div style={{ marginTop: '16px' }}>
|
|
292
|
+
<Banner icon={<IconMetrics />} label="SALE" href="/pricing">
|
|
293
|
+
🎉 50% off annual plans! Limited time offer ends soon.
|
|
294
|
+
</Banner>
|
|
295
|
+
</div>
|
|
296
|
+
</div>
|
|
297
|
+
|
|
298
|
+
<div style={{ marginBottom: '30px' }}>
|
|
299
|
+
<h2>Documentation Updates</h2>
|
|
300
|
+
<p>Banners for documentation and help content.</p>
|
|
301
|
+
<div style={{ marginTop: '16px' }}>
|
|
302
|
+
<Banner icon={<IconFunnels />} label="GUIDE" href="/docs/getting-started">
|
|
303
|
+
New getting started guide available with step-by-step instructions
|
|
304
|
+
</Banner>
|
|
305
|
+
</div>
|
|
306
|
+
</div>
|
|
307
|
+
|
|
308
|
+
<div style={{ marginBottom: '30px' }}>
|
|
309
|
+
<h2>Beta Features</h2>
|
|
310
|
+
<p>Banners for beta features and experimental functionality.</p>
|
|
311
|
+
<div style={{ marginTop: '16px' }}>
|
|
312
|
+
<Banner kind="secondary" icon={<IconSessionReplay />} label="BETA" store={86400}>
|
|
313
|
+
Try our new analytics dashboard in beta! Feedback welcome.
|
|
314
|
+
</Banner>
|
|
315
|
+
</div>
|
|
316
|
+
</div>
|
|
317
|
+
</div>
|
|
318
|
+
),
|
|
319
|
+
parameters: {
|
|
320
|
+
docs: {
|
|
321
|
+
description: {
|
|
322
|
+
story: 'This example shows how banners are typically used in real-world applications, demonstrating common patterns and use cases.',
|
|
323
|
+
},
|
|
324
|
+
},
|
|
325
|
+
},
|
|
326
|
+
};
|
|
327
|
+
|
|
328
|
+
// Interactive example
|
|
329
|
+
export const Interactive: Story = {
|
|
330
|
+
args: {
|
|
331
|
+
children: 'This banner demonstrates interactive behavior. Try clicking it or closing it!',
|
|
332
|
+
icon: <IconSessionReplay />,
|
|
333
|
+
label: 'DEMO',
|
|
334
|
+
href: '#',
|
|
335
|
+
store: 10,
|
|
336
|
+
},
|
|
337
|
+
render: (args) => (
|
|
338
|
+
<div style={{ padding: '20px' }}>
|
|
339
|
+
<Banner {...args} />
|
|
340
|
+
<p style={{ marginTop: '10px', fontSize: '14px', color: '#666' }}>
|
|
341
|
+
This banner has a 10-second storage delay. Try closing it and refreshing the page to see the behavior.
|
|
342
|
+
</p>
|
|
343
|
+
</div>
|
|
344
|
+
),
|
|
345
|
+
parameters: {
|
|
346
|
+
docs: {
|
|
347
|
+
description: {
|
|
348
|
+
story: 'This banner demonstrates the interactive behavior including clicking and closing functionality.',
|
|
349
|
+
},
|
|
350
|
+
},
|
|
351
|
+
},
|
|
352
|
+
};
|
|
353
|
+
|
|
354
|
+
// Different storage durations
|
|
355
|
+
export const StorageDurations: Story = {
|
|
356
|
+
render: () => (
|
|
357
|
+
<div style={{ padding: '20px' }}>
|
|
358
|
+
<div style={{ marginBottom: '20px' }}>
|
|
359
|
+
<h3 style={{ marginBottom: '10px', color: '#666' }}>Short Duration (30 seconds)</h3>
|
|
360
|
+
<Banner store={30} label="QUICK">
|
|
361
|
+
This banner will reappear after 30 seconds
|
|
362
|
+
</Banner>
|
|
363
|
+
</div>
|
|
364
|
+
|
|
365
|
+
<div style={{ marginBottom: '20px' }}>
|
|
366
|
+
<h3 style={{ marginBottom: '10px', color: '#666' }}>Medium Duration (5 minutes)</h3>
|
|
367
|
+
<Banner store={300} icon={<IconMetrics />} label="INFO">
|
|
368
|
+
This banner will reappear after 5 minutes
|
|
369
|
+
</Banner>
|
|
370
|
+
</div>
|
|
371
|
+
|
|
372
|
+
<div style={{ marginBottom: '20px' }}>
|
|
373
|
+
<h3 style={{ marginBottom: '10px', color: '#666' }}>Long Duration (1 hour)</h3>
|
|
374
|
+
<Banner store={3600} icon={<IconFunnels />} label="REMINDER">
|
|
375
|
+
This banner will reappear after 1 hour
|
|
376
|
+
</Banner>
|
|
377
|
+
</div>
|
|
378
|
+
|
|
379
|
+
<div style={{ marginBottom: '20px' }}>
|
|
380
|
+
<h3 style={{ marginBottom: '10px', color: '#666' }}>Very Long Duration (1 day)</h3>
|
|
381
|
+
<Banner store={86400} kind="secondary" label="UPDATE">
|
|
382
|
+
This banner will reappear after 1 day
|
|
383
|
+
</Banner>
|
|
384
|
+
</div>
|
|
385
|
+
</div>
|
|
386
|
+
),
|
|
387
|
+
parameters: {
|
|
388
|
+
docs: {
|
|
389
|
+
description: {
|
|
390
|
+
story: 'This example shows different storage durations and how they affect banner visibility.',
|
|
391
|
+
},
|
|
392
|
+
},
|
|
393
|
+
},
|
|
394
|
+
};
|