@reliability-design/web 1.0.2 → 1.0.6
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/components/rel-accordion/README.md +132 -0
- package/dist/components/rel-accordion/rel-accordion.ts +61 -29
- package/dist/components/rel-alert/README.md +141 -0
- package/dist/components/rel-alert/rel-alert.ts +110 -67
- package/dist/components/rel-avatar/README.md +119 -0
- package/dist/components/rel-avatar/rel-avatar.ts +8 -15
- package/dist/components/rel-badge/README.md +86 -0
- package/dist/components/rel-badge/rel-badge.ts +28 -21
- package/dist/components/rel-breadcrumb/README.md +102 -0
- package/dist/components/rel-breadcrumb/rel-breadcrumb.ts +24 -18
- package/dist/components/rel-button/README.md +130 -0
- package/dist/components/rel-button/rel-button.ts +39 -59
- package/dist/components/rel-calendar/README.md +109 -0
- package/dist/components/rel-calendar/index.ts +1 -0
- package/dist/components/rel-calendar/rel-calendar.ts +467 -0
- package/dist/components/rel-card/README.md +94 -0
- package/dist/components/rel-card/rel-card.ts +21 -11
- package/dist/components/rel-cardmedia/README.md +127 -0
- package/dist/components/rel-cardmedia/rel-cardmedia.ts +22 -18
- package/dist/components/rel-carousel/README.md +166 -0
- package/dist/components/rel-carousel/index.ts +1 -0
- package/dist/components/rel-carousel/rel-carousel.ts +469 -0
- package/dist/components/rel-chart/README.md +286 -0
- package/dist/components/rel-chart/index.ts +1 -0
- package/dist/components/rel-chart/rel-chart.ts +736 -0
- package/dist/components/rel-checkbox/README.md +77 -0
- package/dist/components/rel-checkbox/rel-checkbox.ts +36 -45
- package/dist/components/rel-chip/README.md +114 -0
- package/dist/components/rel-chip/rel-chip.ts +47 -122
- package/dist/components/rel-container/README.md +99 -0
- package/dist/components/rel-container/rel-container.ts +1 -6
- package/dist/components/rel-date-picker/README.md +253 -0
- package/dist/components/rel-date-picker/index.ts +1 -0
- package/dist/components/rel-date-picker/rel-date-picker.ts +916 -0
- package/dist/components/rel-divider/README.md +100 -0
- package/dist/components/rel-divider/rel-divider.ts +37 -37
- package/dist/components/rel-drawer/README.md +200 -0
- package/dist/components/rel-drawer/index.ts +1 -0
- package/dist/components/rel-drawer/rel-drawer.ts +621 -0
- package/dist/components/rel-kbd/README.md +151 -0
- package/dist/components/rel-kbd/rel-kbd.ts +118 -0
- package/dist/components/rel-layout/README.md +88 -0
- package/dist/components/rel-layout/rel-layout.ts +12 -14
- package/dist/components/rel-menu/README.md +151 -0
- package/dist/components/rel-menu/rel-menu.ts +18 -10
- package/dist/components/rel-menubar/README.md +329 -0
- package/dist/components/rel-menubar/index.ts +2 -0
- package/dist/components/rel-menubar/rel-menubar-menu.ts +16 -0
- package/dist/components/rel-menubar/rel-menubar.ts +576 -0
- package/dist/components/rel-nav-menu/README.md +289 -0
- package/dist/components/rel-nav-menu/index.ts +3 -0
- package/dist/components/rel-nav-menu/rel-nav-menu-item.ts +143 -0
- package/dist/components/rel-nav-menu/rel-nav-menu-panel.ts +53 -0
- package/dist/components/rel-nav-menu/rel-nav-menu.ts +331 -0
- package/dist/components/rel-navbar/README.md +126 -0
- package/dist/components/rel-navbar/rel-navbar.ts +91 -0
- package/dist/components/rel-otp/README.md +440 -0
- package/dist/components/rel-otp/index.ts +1 -0
- package/dist/components/rel-otp/rel-otp.ts +504 -0
- package/dist/components/rel-pagination/README.md +410 -0
- package/dist/components/rel-pagination/index.ts +1 -0
- package/dist/components/rel-pagination/rel-pagination.ts +376 -0
- package/dist/components/rel-popover/README.md +568 -0
- package/dist/components/rel-popover/index.ts +2 -0
- package/dist/components/rel-popover/rel-popover-content.ts +55 -0
- package/dist/components/rel-popover/rel-popover.ts +327 -0
- package/dist/components/rel-progress/README.md +110 -0
- package/dist/components/rel-progress/rel-progress.ts +58 -20
- package/dist/components/rel-quote-page/README.md +166 -0
- package/dist/components/rel-quote-page/rel-quote-page.ts +816 -0
- package/dist/components/rel-radio/README.md +120 -0
- package/dist/components/rel-radio/rel-radio.ts +41 -73
- package/dist/components/rel-resizable/README.md +140 -0
- package/dist/components/rel-resizable/index.ts +3 -0
- package/dist/components/rel-resizable/rel-resizable-group.ts +374 -0
- package/dist/components/rel-resizable/rel-resizable-handle.ts +149 -0
- package/dist/components/rel-resizable/rel-resizable-panel.ts +47 -0
- package/dist/components/rel-segmented-button/README.md +141 -0
- package/dist/components/rel-segmented-button/rel-segmented-button.ts +18 -13
- package/dist/components/rel-select/README.md +107 -0
- package/dist/components/rel-select/rel-select.ts +14 -14
- package/dist/components/rel-sheet/README.md +224 -0
- package/dist/components/rel-sheet/rel-sheet.ts +683 -0
- package/dist/components/rel-sidebar/README.md +209 -0
- package/dist/components/rel-sidebar/rel-sidebar.ts +1158 -0
- package/dist/components/rel-slider/README.md +135 -0
- package/dist/components/rel-slider/rel-slider.ts +19 -7
- package/dist/components/rel-snackbar/README.md +134 -0
- package/dist/components/rel-snackbar/rel-snackbar.ts +73 -2
- package/dist/components/rel-stepper/README.md +160 -0
- package/dist/components/rel-stepper/rel-stepper.ts +29 -8
- package/dist/components/rel-switch/README.md +102 -0
- package/dist/components/rel-switch/rel-switch.ts +22 -11
- package/dist/components/rel-tab/README.md +163 -0
- package/dist/components/rel-tab/rel-tab.ts +46 -22
- package/dist/components/rel-table/README.md +178 -0
- package/dist/components/rel-table/rel-table-body.ts +16 -0
- package/dist/components/rel-table/rel-table-caption.ts +22 -0
- package/dist/components/rel-table/rel-table-cell.ts +49 -0
- package/dist/components/rel-table/rel-table-footer.ts +18 -0
- package/dist/components/rel-table/rel-table-head.ts +33 -0
- package/dist/components/rel-table/rel-table-header.ts +16 -0
- package/dist/components/rel-table/rel-table-row.ts +32 -0
- package/dist/components/rel-table/rel-table.ts +47 -0
- package/dist/components/rel-textfield/README.md +90 -0
- package/dist/components/rel-textfield/rel-textfield.ts +37 -21
- package/dist/components/rel-toast/README.md +148 -0
- package/dist/components/rel-toast/rel-toast.ts +32 -14
- package/dist/components/rel-tooltip/README.md +103 -0
- package/dist/components/rel-tooltip/rel-tooltip.ts +9 -9
- package/dist/index.d.mts +846 -7
- package/dist/index.d.ts +846 -7
- package/dist/index.js +10860 -1803
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10820 -1809
- package/dist/index.mjs.map +1 -1
- package/dist/styles/vars.css +293 -183
- package/dist/vars-ITL2K3KO.css +294 -0
- package/package.json +2 -2
- package/dist/components/rel-accordion/rel-accordion.stories.ts +0 -313
- package/dist/components/rel-alert/rel-alert.stories.ts +0 -412
- package/dist/components/rel-avatar/rel-avatar.stories.ts +0 -327
- package/dist/components/rel-badge/rel-badge.stories.ts +0 -350
- package/dist/components/rel-breadcrumb/rel-breadcrumb.stories.ts +0 -306
- package/dist/components/rel-button/rel-button.stories.ts +0 -356
- package/dist/components/rel-card/rel-card.stories.ts +0 -299
- package/dist/components/rel-cardmedia/rel-cardmedia.stories.ts +0 -368
- package/dist/components/rel-checkbox/rel-checkbox.stories.ts +0 -414
- package/dist/components/rel-chip/rel-chip.stories.ts +0 -552
- package/dist/components/rel-container/rel-container.stories.ts +0 -239
- package/dist/components/rel-divider/rel-divider.stories.ts +0 -229
- package/dist/components/rel-layout/rel-layout.stories.ts +0 -713
- package/dist/components/rel-menu/rel-menu.stories.ts +0 -910
- package/dist/components/rel-progress/rel-progress.stories.ts +0 -817
- package/dist/components/rel-radio/rel-radio.stories.ts +0 -1048
- package/dist/components/rel-segmented-button/rel-segmented-button.stories.ts +0 -1079
- package/dist/components/rel-select/rel-select.stories.ts +0 -1201
- package/dist/components/rel-slider/rel-slider.stories.ts +0 -730
- package/dist/components/rel-snackbar/rel-snackbar.stories.ts +0 -808
- package/dist/components/rel-stepper/rel-stepper.stories.ts +0 -752
- package/dist/components/rel-switch/rel-switch.stories.ts +0 -441
- package/dist/components/rel-tab/rel-tab.stories.ts +0 -492
- package/dist/components/rel-textfield/rel-textfield.stories.ts +0 -710
- package/dist/components/rel-toast/rel-toast.stories.ts +0 -394
- package/dist/components/rel-tooltip/rel-tooltip.stories.ts +0 -364
|
@@ -1,492 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/web-components";
|
|
2
|
-
import { html } from "lit";
|
|
3
|
-
import { useState } from "@storybook/preview-api";
|
|
4
|
-
import "./rel-tab";
|
|
5
|
-
import type { TabItem } from "./rel-tab";
|
|
6
|
-
|
|
7
|
-
const meta: Meta = {
|
|
8
|
-
title: "Components/Tab",
|
|
9
|
-
component: "rel-tab",
|
|
10
|
-
tags: ["autodocs"],
|
|
11
|
-
argTypes: {
|
|
12
|
-
activeIndex: {
|
|
13
|
-
control: { type: "number" },
|
|
14
|
-
description: "The index of the currently active tab",
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export default meta;
|
|
20
|
-
type Story = StoryObj;
|
|
21
|
-
|
|
22
|
-
const basicTabs: TabItem[] = [
|
|
23
|
-
{ label: "Home" },
|
|
24
|
-
{ label: "Profile" },
|
|
25
|
-
{ label: "Settings" },
|
|
26
|
-
];
|
|
27
|
-
|
|
28
|
-
const tabsWithBadges: TabItem[] = [
|
|
29
|
-
{ label: "Messages", badge: 5 },
|
|
30
|
-
{ label: "Notifications", badge: 12 },
|
|
31
|
-
{ label: "Updates", badge: 3 },
|
|
32
|
-
];
|
|
33
|
-
|
|
34
|
-
const tabsWithDisabled: TabItem[] = [
|
|
35
|
-
{ label: "Active" },
|
|
36
|
-
{ label: "Disabled", disabled: true },
|
|
37
|
-
{ label: "Another Active" },
|
|
38
|
-
];
|
|
39
|
-
|
|
40
|
-
const manyTabs: TabItem[] = [
|
|
41
|
-
{ label: "Dashboard" },
|
|
42
|
-
{ label: "Analytics" },
|
|
43
|
-
{ label: "Reports" },
|
|
44
|
-
{ label: "Settings" },
|
|
45
|
-
{ label: "Users" },
|
|
46
|
-
{ label: "Billing" },
|
|
47
|
-
];
|
|
48
|
-
|
|
49
|
-
const mixedTabs: TabItem[] = [
|
|
50
|
-
{ label: "Overview" },
|
|
51
|
-
{ label: "Messages", badge: 8 },
|
|
52
|
-
{ label: "Archived", disabled: true },
|
|
53
|
-
{ label: "Settings" },
|
|
54
|
-
];
|
|
55
|
-
|
|
56
|
-
export const Default: Story = {
|
|
57
|
-
render: () => html`
|
|
58
|
-
<rel-tab .tabs=${basicTabs}></rel-tab>
|
|
59
|
-
`,
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
export const WithBadges: Story = {
|
|
63
|
-
render: () => html`
|
|
64
|
-
<rel-tab .tabs=${tabsWithBadges}></rel-tab>
|
|
65
|
-
`,
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
export const WithDisabled: Story = {
|
|
69
|
-
render: () => html`
|
|
70
|
-
<rel-tab .tabs=${tabsWithDisabled}></rel-tab>
|
|
71
|
-
`,
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
export const ManyTabs: Story = {
|
|
75
|
-
render: () => html`
|
|
76
|
-
<rel-tab .tabs=${manyTabs}></rel-tab>
|
|
77
|
-
`,
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
export const Mixed: Story = {
|
|
81
|
-
render: () => html`
|
|
82
|
-
<rel-tab .tabs=${mixedTabs}></rel-tab>
|
|
83
|
-
`,
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
export const WithContent: Story = {
|
|
87
|
-
render: () => html`
|
|
88
|
-
<rel-tab .tabs=${basicTabs}>
|
|
89
|
-
<div style="padding: 20px; background: #f9f9f9; border-radius: 8px;">
|
|
90
|
-
<h3 style="margin-top: 0;">Tab Content Area</h3>
|
|
91
|
-
<p style="color: #666;">
|
|
92
|
-
This is the content area for the selected tab. You can put any
|
|
93
|
-
content here.
|
|
94
|
-
</p>
|
|
95
|
-
</div>
|
|
96
|
-
</rel-tab>
|
|
97
|
-
`,
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
export const Interactive: Story = {
|
|
101
|
-
render: () => {
|
|
102
|
-
const handleTabChange = (e: CustomEvent) => {
|
|
103
|
-
console.log("Tab changed to index:", e.detail.index);
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
return html`
|
|
107
|
-
<rel-tab
|
|
108
|
-
.tabs=${basicTabs}
|
|
109
|
-
@tab-change=${handleTabChange}
|
|
110
|
-
></rel-tab>
|
|
111
|
-
<p style="margin-top: 20px; color: #666;">
|
|
112
|
-
Open the console to see tab change events
|
|
113
|
-
</p>
|
|
114
|
-
`;
|
|
115
|
-
},
|
|
116
|
-
};
|
|
117
|
-
|
|
118
|
-
// New comprehensive stories
|
|
119
|
-
|
|
120
|
-
export const TwoTabs: Story = {
|
|
121
|
-
render: () => html`
|
|
122
|
-
<rel-tab .tabs=${[
|
|
123
|
-
{ label: "View" },
|
|
124
|
-
{ label: "Edit" }
|
|
125
|
-
]}></rel-tab>
|
|
126
|
-
`,
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
export const FiveTabs: Story = {
|
|
130
|
-
render: () => html`
|
|
131
|
-
<rel-tab .tabs=${[
|
|
132
|
-
{ label: "Overview" },
|
|
133
|
-
{ label: "Details" },
|
|
134
|
-
{ label: "Analytics" },
|
|
135
|
-
{ label: "History" },
|
|
136
|
-
{ label: "Settings" }
|
|
137
|
-
]}></rel-tab>
|
|
138
|
-
`,
|
|
139
|
-
};
|
|
140
|
-
|
|
141
|
-
export const OverflowTabs: Story = {
|
|
142
|
-
render: () => html`
|
|
143
|
-
<div style="max-width: 600px;">
|
|
144
|
-
<rel-tab .tabs=${[
|
|
145
|
-
{ label: "Dashboard" },
|
|
146
|
-
{ label: "Performance Metrics" },
|
|
147
|
-
{ label: "System Analytics" },
|
|
148
|
-
{ label: "User Management" },
|
|
149
|
-
{ label: "Configuration" },
|
|
150
|
-
{ label: "Reports & Exports" },
|
|
151
|
-
{ label: "Audit Logs" },
|
|
152
|
-
{ label: "API Documentation" }
|
|
153
|
-
]}></rel-tab>
|
|
154
|
-
</div>
|
|
155
|
-
<p style="margin-top: 20px; color: #666; font-size: 0.9rem;">
|
|
156
|
-
Container width is limited to demonstrate overflow behavior
|
|
157
|
-
</p>
|
|
158
|
-
`,
|
|
159
|
-
};
|
|
160
|
-
|
|
161
|
-
export const BadgesWithActiveState: Story = {
|
|
162
|
-
render: () => html`
|
|
163
|
-
<div style="margin-bottom: 30px;">
|
|
164
|
-
<h4 style="margin-bottom: 10px;">First tab active (with badge)</h4>
|
|
165
|
-
<rel-tab .tabs=${[
|
|
166
|
-
{ label: "Alerts", badge: 3 },
|
|
167
|
-
{ label: "Inbox", badge: 15 },
|
|
168
|
-
{ label: "Sent" }
|
|
169
|
-
]} .activeIndex=${0}></rel-tab>
|
|
170
|
-
</div>
|
|
171
|
-
<div style="margin-bottom: 30px;">
|
|
172
|
-
<h4 style="margin-bottom: 10px;">Second tab active (with badge)</h4>
|
|
173
|
-
<rel-tab .tabs=${[
|
|
174
|
-
{ label: "Alerts", badge: 3 },
|
|
175
|
-
{ label: "Inbox", badge: 15 },
|
|
176
|
-
{ label: "Sent" }
|
|
177
|
-
]} .activeIndex=${1}></rel-tab>
|
|
178
|
-
</div>
|
|
179
|
-
<div>
|
|
180
|
-
<h4 style="margin-bottom: 10px;">Third tab active (no badge)</h4>
|
|
181
|
-
<rel-tab .tabs=${[
|
|
182
|
-
{ label: "Alerts", badge: 3 },
|
|
183
|
-
{ label: "Inbox", badge: 15 },
|
|
184
|
-
{ label: "Sent" }
|
|
185
|
-
]} .activeIndex=${2}></rel-tab>
|
|
186
|
-
</div>
|
|
187
|
-
`,
|
|
188
|
-
};
|
|
189
|
-
|
|
190
|
-
export const DisabledVariations: Story = {
|
|
191
|
-
render: () => html`
|
|
192
|
-
<div style="margin-bottom: 30px;">
|
|
193
|
-
<h4 style="margin-bottom: 10px;">First tab disabled</h4>
|
|
194
|
-
<rel-tab .tabs=${[
|
|
195
|
-
{ label: "Disabled Tab", disabled: true },
|
|
196
|
-
{ label: "Active Tab" },
|
|
197
|
-
{ label: "Another Tab" }
|
|
198
|
-
]}></rel-tab>
|
|
199
|
-
</div>
|
|
200
|
-
<div style="margin-bottom: 30px;">
|
|
201
|
-
<h4 style="margin-bottom: 10px;">Middle tab disabled with badge</h4>
|
|
202
|
-
<rel-tab .tabs=${[
|
|
203
|
-
{ label: "Available" },
|
|
204
|
-
{ label: "Coming Soon", badge: 2, disabled: true },
|
|
205
|
-
{ label: "Active" }
|
|
206
|
-
]}></rel-tab>
|
|
207
|
-
</div>
|
|
208
|
-
<div>
|
|
209
|
-
<h4 style="margin-bottom: 10px;">Multiple disabled tabs</h4>
|
|
210
|
-
<rel-tab .tabs=${[
|
|
211
|
-
{ label: "Public" },
|
|
212
|
-
{ label: "Premium", disabled: true },
|
|
213
|
-
{ label: "Enterprise", disabled: true },
|
|
214
|
-
{ label: "Settings" }
|
|
215
|
-
]}></rel-tab>
|
|
216
|
-
</div>
|
|
217
|
-
`,
|
|
218
|
-
};
|
|
219
|
-
|
|
220
|
-
export const ContentSwitching: Story = {
|
|
221
|
-
render: () => {
|
|
222
|
-
let activeIndex = 0;
|
|
223
|
-
|
|
224
|
-
const tabContent = [
|
|
225
|
-
{
|
|
226
|
-
title: "Dashboard Overview",
|
|
227
|
-
content: "Welcome to your dashboard! Here you can see all your key metrics and recent activity at a glance."
|
|
228
|
-
},
|
|
229
|
-
{
|
|
230
|
-
title: "Performance Analytics",
|
|
231
|
-
content: "View detailed performance metrics, trends, and insights to optimize your system's efficiency."
|
|
232
|
-
},
|
|
233
|
-
{
|
|
234
|
-
title: "User Settings",
|
|
235
|
-
content: "Manage your account preferences, notifications, and privacy settings from this panel."
|
|
236
|
-
}
|
|
237
|
-
];
|
|
238
|
-
|
|
239
|
-
const handleTabChange = (e: CustomEvent) => {
|
|
240
|
-
activeIndex = e.detail.index;
|
|
241
|
-
const contentEl = document.querySelector('#dynamic-content');
|
|
242
|
-
if (contentEl) {
|
|
243
|
-
contentEl.innerHTML = `
|
|
244
|
-
<h3 style="margin-top: 0; color: #111;">${tabContent[activeIndex].title}</h3>
|
|
245
|
-
<p style="color: #666; line-height: 1.6;">${tabContent[activeIndex].content}</p>
|
|
246
|
-
`;
|
|
247
|
-
}
|
|
248
|
-
};
|
|
249
|
-
|
|
250
|
-
setTimeout(() => {
|
|
251
|
-
const contentEl = document.querySelector('#dynamic-content');
|
|
252
|
-
if (contentEl) {
|
|
253
|
-
contentEl.innerHTML = `
|
|
254
|
-
<h3 style="margin-top: 0; color: #111;">${tabContent[0].title}</h3>
|
|
255
|
-
<p style="color: #666; line-height: 1.6;">${tabContent[0].content}</p>
|
|
256
|
-
`;
|
|
257
|
-
}
|
|
258
|
-
}, 0);
|
|
259
|
-
|
|
260
|
-
return html`
|
|
261
|
-
<rel-tab
|
|
262
|
-
.tabs=${[
|
|
263
|
-
{ label: "Dashboard" },
|
|
264
|
-
{ label: "Analytics" },
|
|
265
|
-
{ label: "Settings" }
|
|
266
|
-
]}
|
|
267
|
-
@tab-change=${handleTabChange}
|
|
268
|
-
>
|
|
269
|
-
<div id="dynamic-content" style="padding: 20px; background: #f9f9f9; border-radius: 8px; min-height: 100px;">
|
|
270
|
-
</div>
|
|
271
|
-
</rel-tab>
|
|
272
|
-
`;
|
|
273
|
-
},
|
|
274
|
-
};
|
|
275
|
-
|
|
276
|
-
export const EmailClient: Story = {
|
|
277
|
-
render: () => {
|
|
278
|
-
let activeIndex = 0;
|
|
279
|
-
|
|
280
|
-
const emailContent = [
|
|
281
|
-
{
|
|
282
|
-
title: "Inbox",
|
|
283
|
-
html: `
|
|
284
|
-
<div style="display: flex; flex-direction: column; gap: 12px;">
|
|
285
|
-
<div style="padding: 12px; background: white; border: 1px solid #e5e5e5; border-radius: 6px;">
|
|
286
|
-
<div style="font-weight: 600; margin-bottom: 4px;">Team Meeting Tomorrow</div>
|
|
287
|
-
<div style="font-size: 0.85rem; color: #666;">John Doe - 2 hours ago</div>
|
|
288
|
-
</div>
|
|
289
|
-
<div style="padding: 12px; background: white; border: 1px solid #e5e5e5; border-radius: 6px;">
|
|
290
|
-
<div style="font-weight: 600; margin-bottom: 4px;">Project Update Required</div>
|
|
291
|
-
<div style="font-size: 0.85rem; color: #666;">Sarah Smith - 5 hours ago</div>
|
|
292
|
-
</div>
|
|
293
|
-
<div style="padding: 12px; background: white; border: 1px solid #e5e5e5; border-radius: 6px;">
|
|
294
|
-
<div style="font-weight: 600; margin-bottom: 4px;">Welcome to the Platform</div>
|
|
295
|
-
<div style="font-size: 0.85rem; color: #666;">Support Team - Yesterday</div>
|
|
296
|
-
</div>
|
|
297
|
-
</div>
|
|
298
|
-
`
|
|
299
|
-
},
|
|
300
|
-
{
|
|
301
|
-
title: "Unread Messages",
|
|
302
|
-
html: `
|
|
303
|
-
<div style="display: flex; flex-direction: column; gap: 12px;">
|
|
304
|
-
<div style="padding: 12px; background: #fffaeb; border: 1px solid #ffd666; border-radius: 6px;">
|
|
305
|
-
<div style="font-weight: 600; margin-bottom: 4px;">Urgent: Security Alert</div>
|
|
306
|
-
<div style="font-size: 0.85rem; color: #666;">Security Team - 1 hour ago</div>
|
|
307
|
-
</div>
|
|
308
|
-
<div style="padding: 12px; background: #fffaeb; border: 1px solid #ffd666; border-radius: 6px;">
|
|
309
|
-
<div style="font-weight: 600; margin-bottom: 4px;">Invoice #1234 Available</div>
|
|
310
|
-
<div style="font-size: 0.85rem; color: #666;">Billing - 3 hours ago</div>
|
|
311
|
-
</div>
|
|
312
|
-
</div>
|
|
313
|
-
`
|
|
314
|
-
},
|
|
315
|
-
{
|
|
316
|
-
title: "Sent Messages",
|
|
317
|
-
html: `
|
|
318
|
-
<div style="display: flex; flex-direction: column; gap: 12px;">
|
|
319
|
-
<div style="padding: 12px; background: white; border: 1px solid #e5e5e5; border-radius: 6px;">
|
|
320
|
-
<div style="font-weight: 600; margin-bottom: 4px;">Re: Project Timeline</div>
|
|
321
|
-
<div style="font-size: 0.85rem; color: #666;">Sent to: Mike Johnson - Today</div>
|
|
322
|
-
</div>
|
|
323
|
-
<div style="padding: 12px; background: white; border: 1px solid #e5e5e5; border-radius: 6px;">
|
|
324
|
-
<div style="font-weight: 600; margin-bottom: 4px;">Weekly Report Submission</div>
|
|
325
|
-
<div style="font-size: 0.85rem; color: #666;">Sent to: Manager - Yesterday</div>
|
|
326
|
-
</div>
|
|
327
|
-
</div>
|
|
328
|
-
`
|
|
329
|
-
},
|
|
330
|
-
{
|
|
331
|
-
title: "Spam",
|
|
332
|
-
html: `
|
|
333
|
-
<div style="padding: 20px; text-align: center; color: #666;">
|
|
334
|
-
<div style="font-size: 3rem; margin-bottom: 10px;">🗑️</div>
|
|
335
|
-
<div>No spam messages</div>
|
|
336
|
-
</div>
|
|
337
|
-
`
|
|
338
|
-
}
|
|
339
|
-
];
|
|
340
|
-
|
|
341
|
-
const handleTabChange = (e: CustomEvent) => {
|
|
342
|
-
activeIndex = e.detail.index;
|
|
343
|
-
const contentEl = document.querySelector('#email-content');
|
|
344
|
-
if (contentEl) {
|
|
345
|
-
contentEl.innerHTML = `
|
|
346
|
-
<h3 style="margin-top: 0; margin-bottom: 16px; color: #111;">${emailContent[activeIndex].title}</h3>
|
|
347
|
-
${emailContent[activeIndex].html}
|
|
348
|
-
`;
|
|
349
|
-
}
|
|
350
|
-
};
|
|
351
|
-
|
|
352
|
-
setTimeout(() => {
|
|
353
|
-
const contentEl = document.querySelector('#email-content');
|
|
354
|
-
if (contentEl) {
|
|
355
|
-
contentEl.innerHTML = `
|
|
356
|
-
<h3 style="margin-top: 0; margin-bottom: 16px; color: #111;">${emailContent[0].title}</h3>
|
|
357
|
-
${emailContent[0].html}
|
|
358
|
-
`;
|
|
359
|
-
}
|
|
360
|
-
}, 0);
|
|
361
|
-
|
|
362
|
-
return html`
|
|
363
|
-
<div style="max-width: 800px; border: 1px solid #e5e5e5; border-radius: 8px; overflow: hidden;">
|
|
364
|
-
<rel-tab
|
|
365
|
-
.tabs=${[
|
|
366
|
-
{ label: "Inbox", badge: 15 },
|
|
367
|
-
{ label: "Unread", badge: 2 },
|
|
368
|
-
{ label: "Sent" },
|
|
369
|
-
{ label: "Spam" }
|
|
370
|
-
]}
|
|
371
|
-
@tab-change=${handleTabChange}
|
|
372
|
-
>
|
|
373
|
-
<div id="email-content" style="padding: 20px; background: #fafafa; min-height: 300px;">
|
|
374
|
-
</div>
|
|
375
|
-
</rel-tab>
|
|
376
|
-
</div>
|
|
377
|
-
`;
|
|
378
|
-
},
|
|
379
|
-
};
|
|
380
|
-
|
|
381
|
-
export const EcommerceDashboard: Story = {
|
|
382
|
-
render: () => {
|
|
383
|
-
let activeIndex = 0;
|
|
384
|
-
|
|
385
|
-
const dashboardContent = [
|
|
386
|
-
{
|
|
387
|
-
title: "Today's Overview",
|
|
388
|
-
html: `
|
|
389
|
-
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px;">
|
|
390
|
-
<div style="padding: 20px; background: white; border-radius: 8px; border: 1px solid #e5e5e5;">
|
|
391
|
-
<div style="font-size: 0.85rem; color: #666; margin-bottom: 8px;">Revenue</div>
|
|
392
|
-
<div style="font-size: 1.5rem; font-weight: 600; color: #111;">$12,345</div>
|
|
393
|
-
<div style="font-size: 0.75rem; color: #00f49c; margin-top: 4px;">+12.5% from yesterday</div>
|
|
394
|
-
</div>
|
|
395
|
-
<div style="padding: 20px; background: white; border-radius: 8px; border: 1px solid #e5e5e5;">
|
|
396
|
-
<div style="font-size: 0.85rem; color: #666; margin-bottom: 8px;">Orders</div>
|
|
397
|
-
<div style="font-size: 1.5rem; font-weight: 600; color: #111;">342</div>
|
|
398
|
-
<div style="font-size: 0.75rem; color: #00f49c; margin-top: 4px;">+8.3% from yesterday</div>
|
|
399
|
-
</div>
|
|
400
|
-
<div style="padding: 20px; background: white; border-radius: 8px; border: 1px solid #e5e5e5;">
|
|
401
|
-
<div style="font-size: 0.85rem; color: #666; margin-bottom: 8px;">Customers</div>
|
|
402
|
-
<div style="font-size: 1.5rem; font-weight: 600; color: #111;">1,234</div>
|
|
403
|
-
<div style="font-size: 0.75rem; color: #ff0400; margin-top: 4px;">-2.1% from yesterday</div>
|
|
404
|
-
</div>
|
|
405
|
-
</div>
|
|
406
|
-
`
|
|
407
|
-
},
|
|
408
|
-
{
|
|
409
|
-
title: "Pending Orders",
|
|
410
|
-
html: `
|
|
411
|
-
<div style="background: white; border-radius: 8px; border: 1px solid #e5e5e5; overflow: hidden;">
|
|
412
|
-
<div style="padding: 12px; border-bottom: 1px solid #e5e5e5; font-weight: 600;">Order #1001</div>
|
|
413
|
-
<div style="padding: 12px; border-bottom: 1px solid #e5e5e5;">Status: <span style="color: #ff9800;">Processing</span></div>
|
|
414
|
-
<div style="padding: 12px;">Customer: John Smith</div>
|
|
415
|
-
</div>
|
|
416
|
-
`
|
|
417
|
-
},
|
|
418
|
-
{
|
|
419
|
-
title: "Products",
|
|
420
|
-
html: `
|
|
421
|
-
<div style="display: grid; gap: 12px;">
|
|
422
|
-
<div style="padding: 16px; background: white; border-radius: 8px; border: 1px solid #e5e5e5;">
|
|
423
|
-
<div style="font-weight: 600; margin-bottom: 8px;">Premium Widget</div>
|
|
424
|
-
<div style="font-size: 0.85rem; color: #666;">In Stock: 156 units</div>
|
|
425
|
-
</div>
|
|
426
|
-
<div style="padding: 16px; background: white; border-radius: 8px; border: 1px solid #e5e5e5;">
|
|
427
|
-
<div style="font-weight: 600; margin-bottom: 8px;">Deluxe Gadget</div>
|
|
428
|
-
<div style="font-size: 0.85rem; color: #666;">In Stock: 89 units</div>
|
|
429
|
-
</div>
|
|
430
|
-
</div>
|
|
431
|
-
`
|
|
432
|
-
},
|
|
433
|
-
{
|
|
434
|
-
title: "Recent Activity",
|
|
435
|
-
html: `
|
|
436
|
-
<div style="display: flex; flex-direction: column; gap: 12px;">
|
|
437
|
-
<div style="padding: 12px; background: white; border-radius: 6px; border: 1px solid #e5e5e5;">
|
|
438
|
-
<div style="font-size: 0.85rem; color: #666;">2 minutes ago</div>
|
|
439
|
-
<div style="margin-top: 4px;">New order placed - $249.99</div>
|
|
440
|
-
</div>
|
|
441
|
-
<div style="padding: 12px; background: white; border-radius: 6px; border: 1px solid #e5e5e5;">
|
|
442
|
-
<div style="font-size: 0.85rem; color: #666;">15 minutes ago</div>
|
|
443
|
-
<div style="margin-top: 4px;">Product review submitted</div>
|
|
444
|
-
</div>
|
|
445
|
-
<div style="padding: 12px; background: white; border-radius: 6px; border: 1px solid #e5e5e5;">
|
|
446
|
-
<div style="font-size: 0.85rem; color: #666;">1 hour ago</div>
|
|
447
|
-
<div style="margin-top: 4px;">Customer support ticket resolved</div>
|
|
448
|
-
</div>
|
|
449
|
-
</div>
|
|
450
|
-
`
|
|
451
|
-
}
|
|
452
|
-
];
|
|
453
|
-
|
|
454
|
-
const handleTabChange = (e: CustomEvent) => {
|
|
455
|
-
activeIndex = e.detail.index;
|
|
456
|
-
const contentEl = document.querySelector('#ecommerce-content');
|
|
457
|
-
if (contentEl) {
|
|
458
|
-
contentEl.innerHTML = `
|
|
459
|
-
<h3 style="margin-top: 0; margin-bottom: 20px; color: #111;">${dashboardContent[activeIndex].title}</h3>
|
|
460
|
-
${dashboardContent[activeIndex].html}
|
|
461
|
-
`;
|
|
462
|
-
}
|
|
463
|
-
};
|
|
464
|
-
|
|
465
|
-
setTimeout(() => {
|
|
466
|
-
const contentEl = document.querySelector('#ecommerce-content');
|
|
467
|
-
if (contentEl) {
|
|
468
|
-
contentEl.innerHTML = `
|
|
469
|
-
<h3 style="margin-top: 0; margin-bottom: 20px; color: #111;">${dashboardContent[0].title}</h3>
|
|
470
|
-
${dashboardContent[0].html}
|
|
471
|
-
`;
|
|
472
|
-
}
|
|
473
|
-
}, 0);
|
|
474
|
-
|
|
475
|
-
return html`
|
|
476
|
-
<div style="max-width: 900px;">
|
|
477
|
-
<rel-tab
|
|
478
|
-
.tabs=${[
|
|
479
|
-
{ label: "Overview" },
|
|
480
|
-
{ label: "Orders", badge: 8 },
|
|
481
|
-
{ label: "Products" },
|
|
482
|
-
{ label: "Activity", badge: 23 }
|
|
483
|
-
]}
|
|
484
|
-
@tab-change=${handleTabChange}
|
|
485
|
-
>
|
|
486
|
-
<div id="ecommerce-content" style="padding: 24px; background: #fafafa; border-radius: 8px; min-height: 280px;">
|
|
487
|
-
</div>
|
|
488
|
-
</rel-tab>
|
|
489
|
-
</div>
|
|
490
|
-
`;
|
|
491
|
-
},
|
|
492
|
-
};
|