@reliability-design/web 1.0.2 → 1.0.3
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/rel-accordion.ts +27 -22
- package/dist/components/rel-alert/rel-alert.ts +98 -66
- package/dist/components/rel-avatar/rel-avatar.ts +8 -15
- package/dist/components/rel-badge/rel-badge.ts +23 -16
- package/dist/components/rel-breadcrumb/rel-breadcrumb.ts +12 -12
- package/dist/components/rel-button/rel-button.ts +39 -59
- package/dist/components/rel-card/rel-card.ts +11 -10
- package/dist/components/rel-cardmedia/rel-cardmedia.ts +11 -17
- package/dist/components/rel-checkbox/rel-checkbox.ts +18 -35
- package/dist/components/rel-chip/rel-chip.ts +37 -128
- package/dist/components/rel-container/rel-container.ts +1 -6
- package/dist/components/rel-divider/rel-divider.ts +37 -37
- package/dist/components/rel-layout/rel-layout.ts +12 -14
- package/dist/components/rel-progress/rel-progress.ts +26 -15
- package/dist/components/rel-radio/rel-radio.ts +32 -72
- package/dist/components/rel-snackbar/rel-snackbar.ts +6 -0
- package/dist/components/rel-stepper/rel-stepper.ts +23 -2
- package/dist/components/rel-switch/rel-switch.ts +7 -5
- package/dist/components/rel-tab/rel-tab.ts +10 -8
- package/dist/components/rel-textfield/rel-textfield.ts +2 -2
- package/dist/index.d.mts +11 -7
- package/dist/index.d.ts +11 -7
- package/dist/index.js +367 -475
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +383 -489
- package/dist/index.mjs.map +1 -1
- package/dist/vars-6ZIUPIU4.css +184 -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,364 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/web-components-vite';
|
|
2
|
-
import { html } from 'lit';
|
|
3
|
-
import './rel-tooltip';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* The Tooltip component displays helpful text when hovering over an element.
|
|
7
|
-
* Built with Lit web components for framework-agnostic usage.
|
|
8
|
-
*
|
|
9
|
-
* ## Features
|
|
10
|
-
* - **2 Positions**: above, below
|
|
11
|
-
* - **Optional Tail**: Arrow pointer to target element
|
|
12
|
-
* - **Hover Activation**: Shows on mouse hover
|
|
13
|
-
* - **Centered Alignment**: Auto-centers above/below target
|
|
14
|
-
* - **Smooth Animation**: Fade-in transition
|
|
15
|
-
*/
|
|
16
|
-
const meta: Meta = {
|
|
17
|
-
title: 'Components/Tooltip',
|
|
18
|
-
tags: ['autodocs'],
|
|
19
|
-
component: 'rel-tooltip',
|
|
20
|
-
argTypes: {
|
|
21
|
-
text: {
|
|
22
|
-
control: 'text',
|
|
23
|
-
description: 'Tooltip text to display',
|
|
24
|
-
table: {
|
|
25
|
-
type: { summary: 'string' },
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
position: {
|
|
29
|
-
control: { type: 'select' },
|
|
30
|
-
options: ['above', 'below'],
|
|
31
|
-
description: 'Position relative to the target element',
|
|
32
|
-
table: {
|
|
33
|
-
defaultValue: { summary: 'above' },
|
|
34
|
-
type: { summary: 'string' },
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
showTail: {
|
|
38
|
-
control: 'boolean',
|
|
39
|
-
description: 'Show arrow/tail pointing to target',
|
|
40
|
-
table: {
|
|
41
|
-
defaultValue: { summary: false },
|
|
42
|
-
type: { summary: 'boolean' },
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
export default meta;
|
|
49
|
-
type Story = StoryObj;
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Default tooltip - appears above with no tail
|
|
53
|
-
*/
|
|
54
|
-
export const Default: Story = {
|
|
55
|
-
render: () => html`
|
|
56
|
-
<div style="padding: 80px; text-align: center;">
|
|
57
|
-
<rel-tooltip text="This is a tooltip">
|
|
58
|
-
<button style="padding: 12px 24px; background: #111; color: white; border: none; border-radius: 6px; cursor: pointer;">
|
|
59
|
-
Hover me
|
|
60
|
-
</button>
|
|
61
|
-
</rel-tooltip>
|
|
62
|
-
</div>
|
|
63
|
-
`,
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* Tooltip above - displays above the element
|
|
68
|
-
*/
|
|
69
|
-
export const TooltipAbove: Story = {
|
|
70
|
-
render: () => html`
|
|
71
|
-
<div style="padding: 80px; text-align: center;">
|
|
72
|
-
<rel-tooltip text="Tooltip above" position="above">
|
|
73
|
-
<button style="padding: 12px 24px; background: #111; color: white; border: none; border-radius: 6px; cursor: pointer;">
|
|
74
|
-
Hover for tooltip above
|
|
75
|
-
</button>
|
|
76
|
-
</rel-tooltip>
|
|
77
|
-
</div>
|
|
78
|
-
`,
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* Tooltip below - displays below the element
|
|
83
|
-
*/
|
|
84
|
-
export const TooltipBelow: Story = {
|
|
85
|
-
render: () => html`
|
|
86
|
-
<div style="padding: 80px; text-align: center;">
|
|
87
|
-
<rel-tooltip text="Tooltip below" position="below">
|
|
88
|
-
<button style="padding: 12px 24px; background: #111; color: white; border: none; border-radius: 6px; cursor: pointer;">
|
|
89
|
-
Hover for tooltip below
|
|
90
|
-
</button>
|
|
91
|
-
</rel-tooltip>
|
|
92
|
-
</div>
|
|
93
|
-
`,
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* With tail above - tooltip with arrow pointing down
|
|
98
|
-
*/
|
|
99
|
-
export const WithTailAbove: Story = {
|
|
100
|
-
render: () => html`
|
|
101
|
-
<div style="padding: 80px; text-align: center;">
|
|
102
|
-
<rel-tooltip text="Tooltip with tail" position="above" showTail>
|
|
103
|
-
<button style="padding: 12px 24px; background: #111; color: white; border: none; border-radius: 6px; cursor: pointer;">
|
|
104
|
-
Hover me
|
|
105
|
-
</button>
|
|
106
|
-
</rel-tooltip>
|
|
107
|
-
</div>
|
|
108
|
-
`,
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* With tail below - tooltip with arrow pointing up
|
|
113
|
-
*/
|
|
114
|
-
export const WithTailBelow: Story = {
|
|
115
|
-
render: () => html`
|
|
116
|
-
<div style="padding: 80px; text-align: center;">
|
|
117
|
-
<rel-tooltip text="Tooltip with tail" position="below" showTail>
|
|
118
|
-
<button style="padding: 12px 24px; background: #111; color: white; border: none; border-radius: 6px; cursor: pointer;">
|
|
119
|
-
Hover me
|
|
120
|
-
</button>
|
|
121
|
-
</rel-tooltip>
|
|
122
|
-
</div>
|
|
123
|
-
`,
|
|
124
|
-
};
|
|
125
|
-
|
|
126
|
-
/**
|
|
127
|
-
* Without tail - simple tooltip with no arrow
|
|
128
|
-
*/
|
|
129
|
-
export const WithoutTail: Story = {
|
|
130
|
-
render: () => html`
|
|
131
|
-
<div style="padding: 80px; text-align: center;">
|
|
132
|
-
<rel-tooltip text="Simple tooltip" showTail="false">
|
|
133
|
-
<button style="padding: 12px 24px; background: #111; color: white; border: none; border-radius: 6px; cursor: pointer;">
|
|
134
|
-
Hover me
|
|
135
|
-
</button>
|
|
136
|
-
</rel-tooltip>
|
|
137
|
-
</div>
|
|
138
|
-
`,
|
|
139
|
-
};
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* On icon - tooltip on icon element
|
|
143
|
-
*/
|
|
144
|
-
export const OnIcon: Story = {
|
|
145
|
-
render: () => html`
|
|
146
|
-
<div style="padding: 80px; text-align: center;">
|
|
147
|
-
<rel-tooltip text="Settings" position="above" showTail>
|
|
148
|
-
<span style="font-size: 24px; cursor: pointer;">⚙️</span>
|
|
149
|
-
</rel-tooltip>
|
|
150
|
-
</div>
|
|
151
|
-
`,
|
|
152
|
-
};
|
|
153
|
-
|
|
154
|
-
/**
|
|
155
|
-
* On button - tooltip on button element
|
|
156
|
-
*/
|
|
157
|
-
export const OnButton: Story = {
|
|
158
|
-
render: () => html`
|
|
159
|
-
<div style="padding: 80px; text-align: center;">
|
|
160
|
-
<rel-tooltip text="Click to save changes" position="above" showTail>
|
|
161
|
-
<button style="padding: 12px 24px; background: #0edb90; color: #111; border: none; border-radius: 6px; cursor: pointer; font-weight: 600;">
|
|
162
|
-
Save
|
|
163
|
-
</button>
|
|
164
|
-
</rel-tooltip>
|
|
165
|
-
</div>
|
|
166
|
-
`,
|
|
167
|
-
};
|
|
168
|
-
|
|
169
|
-
/**
|
|
170
|
-
* On text - tooltip on inline text
|
|
171
|
-
*/
|
|
172
|
-
export const OnText: Story = {
|
|
173
|
-
render: () => html`
|
|
174
|
-
<div style="padding: 80px; text-align: center; font-size: 16px;">
|
|
175
|
-
This is a sentence with a
|
|
176
|
-
<rel-tooltip text="Additional information here" position="above" showTail>
|
|
177
|
-
<span style="text-decoration: underline; cursor: help; color: #0066cc;">
|
|
178
|
-
tooltip on this text
|
|
179
|
-
</span>
|
|
180
|
-
</rel-tooltip>
|
|
181
|
-
inline.
|
|
182
|
-
</div>
|
|
183
|
-
`,
|
|
184
|
-
};
|
|
185
|
-
|
|
186
|
-
/**
|
|
187
|
-
* Long text - tooltip with longer message
|
|
188
|
-
*/
|
|
189
|
-
export const LongText: Story = {
|
|
190
|
-
render: () => html`
|
|
191
|
-
<div style="padding: 80px; text-align: center;">
|
|
192
|
-
<rel-tooltip text="This is a longer tooltip message with more detailed information" position="above" showTail>
|
|
193
|
-
<button style="padding: 12px 24px; background: #111; color: white; border: none; border-radius: 6px; cursor: pointer;">
|
|
194
|
-
Hover for long tooltip
|
|
195
|
-
</button>
|
|
196
|
-
</rel-tooltip>
|
|
197
|
-
</div>
|
|
198
|
-
`,
|
|
199
|
-
};
|
|
200
|
-
|
|
201
|
-
/**
|
|
202
|
-
* Short text - tooltip with brief message
|
|
203
|
-
*/
|
|
204
|
-
export const ShortText: Story = {
|
|
205
|
-
render: () => html`
|
|
206
|
-
<div style="padding: 80px; text-align: center;">
|
|
207
|
-
<rel-tooltip text="Help" position="above" showTail>
|
|
208
|
-
<span style="font-size: 24px; cursor: pointer;">❓</span>
|
|
209
|
-
</rel-tooltip>
|
|
210
|
-
</div>
|
|
211
|
-
`,
|
|
212
|
-
};
|
|
213
|
-
|
|
214
|
-
/**
|
|
215
|
-
* Multiple tooltips - several tooltips on one page
|
|
216
|
-
*/
|
|
217
|
-
export const MultipleTooltips: Story = {
|
|
218
|
-
render: () => html`
|
|
219
|
-
<div style="padding: 80px; display: flex; gap: 24px; justify-content: center; align-items: center;">
|
|
220
|
-
<rel-tooltip text="Edit" position="above" showTail>
|
|
221
|
-
<button style="padding: 8px 16px; background: #111; color: white; border: none; border-radius: 6px; cursor: pointer;">
|
|
222
|
-
✏️
|
|
223
|
-
</button>
|
|
224
|
-
</rel-tooltip>
|
|
225
|
-
|
|
226
|
-
<rel-tooltip text="Delete" position="above" showTail>
|
|
227
|
-
<button style="padding: 8px 16px; background: #d50000; color: white; border: none; border-radius: 6px; cursor: pointer;">
|
|
228
|
-
🗑️
|
|
229
|
-
</button>
|
|
230
|
-
</rel-tooltip>
|
|
231
|
-
|
|
232
|
-
<rel-tooltip text="Download" position="above" showTail>
|
|
233
|
-
<button style="padding: 8px 16px; background: #111; color: white; border: none; border-radius: 6px; cursor: pointer;">
|
|
234
|
-
⬇️
|
|
235
|
-
</button>
|
|
236
|
-
</rel-tooltip>
|
|
237
|
-
|
|
238
|
-
<rel-tooltip text="Share" position="above" showTail>
|
|
239
|
-
<button style="padding: 8px 16px; background: #111; color: white; border: none; border-radius: 6px; cursor: pointer;">
|
|
240
|
-
📤
|
|
241
|
-
</button>
|
|
242
|
-
</rel-tooltip>
|
|
243
|
-
</div>
|
|
244
|
-
`,
|
|
245
|
-
};
|
|
246
|
-
|
|
247
|
-
/**
|
|
248
|
-
* All positions - comparison of above and below
|
|
249
|
-
*/
|
|
250
|
-
export const AllPositions: Story = {
|
|
251
|
-
render: () => html`
|
|
252
|
-
<div style="padding: 80px; display: flex; flex-direction: column; gap: 120px; align-items: center;">
|
|
253
|
-
<div>
|
|
254
|
-
<h4 style="margin-bottom: 16px; text-align: center;">Position: Above</h4>
|
|
255
|
-
<rel-tooltip text="Appears above" position="above" showTail>
|
|
256
|
-
<button style="padding: 12px 24px; background: #111; color: white; border: none; border-radius: 6px; cursor: pointer;">
|
|
257
|
-
Hover me
|
|
258
|
-
</button>
|
|
259
|
-
</rel-tooltip>
|
|
260
|
-
</div>
|
|
261
|
-
|
|
262
|
-
<div>
|
|
263
|
-
<h4 style="margin-bottom: 16px; text-align: center;">Position: Below</h4>
|
|
264
|
-
<rel-tooltip text="Appears below" position="below" showTail>
|
|
265
|
-
<button style="padding: 12px 24px; background: #111; color: white; border: none; border-radius: 6px; cursor: pointer;">
|
|
266
|
-
Hover me
|
|
267
|
-
</button>
|
|
268
|
-
</rel-tooltip>
|
|
269
|
-
</div>
|
|
270
|
-
</div>
|
|
271
|
-
`,
|
|
272
|
-
};
|
|
273
|
-
|
|
274
|
-
/**
|
|
275
|
-
* Tail variations - with and without tail
|
|
276
|
-
*/
|
|
277
|
-
export const TailVariations: Story = {
|
|
278
|
-
render: () => html`
|
|
279
|
-
<div style="padding: 80px; display: flex; gap: 48px; justify-content: center;">
|
|
280
|
-
<div style="text-align: center;">
|
|
281
|
-
<h4 style="margin-bottom: 16px;">Without Tail</h4>
|
|
282
|
-
<rel-tooltip text="No arrow" position="above">
|
|
283
|
-
<button style="padding: 12px 24px; background: #111; color: white; border: none; border-radius: 6px; cursor: pointer;">
|
|
284
|
-
Hover me
|
|
285
|
-
</button>
|
|
286
|
-
</rel-tooltip>
|
|
287
|
-
</div>
|
|
288
|
-
|
|
289
|
-
<div style="text-align: center;">
|
|
290
|
-
<h4 style="margin-bottom: 16px;">With Tail</h4>
|
|
291
|
-
<rel-tooltip text="With arrow" position="above" showTail>
|
|
292
|
-
<button style="padding: 12px 24px; background: #111; color: white; border: none; border-radius: 6px; cursor: pointer;">
|
|
293
|
-
Hover me
|
|
294
|
-
</button>
|
|
295
|
-
</rel-tooltip>
|
|
296
|
-
</div>
|
|
297
|
-
</div>
|
|
298
|
-
`,
|
|
299
|
-
};
|
|
300
|
-
|
|
301
|
-
/**
|
|
302
|
-
* Icon toolbar - realistic toolbar with tooltips
|
|
303
|
-
*/
|
|
304
|
-
export const IconToolbar: Story = {
|
|
305
|
-
render: () => html`
|
|
306
|
-
<div style="padding: 80px;">
|
|
307
|
-
<div style="display: inline-flex; gap: 4px; background: #f5f5f5; padding: 8px; border-radius: 8px;">
|
|
308
|
-
<rel-tooltip text="Bold (Ctrl+B)" position="below" showTail>
|
|
309
|
-
<button style="padding: 8px 12px; background: white; border: 1px solid #ddd; border-radius: 4px; cursor: pointer; font-weight: bold;">
|
|
310
|
-
B
|
|
311
|
-
</button>
|
|
312
|
-
</rel-tooltip>
|
|
313
|
-
|
|
314
|
-
<rel-tooltip text="Italic (Ctrl+I)" position="below" showTail>
|
|
315
|
-
<button style="padding: 8px 12px; background: white; border: 1px solid #ddd; border-radius: 4px; cursor: pointer; font-style: italic;">
|
|
316
|
-
I
|
|
317
|
-
</button>
|
|
318
|
-
</rel-tooltip>
|
|
319
|
-
|
|
320
|
-
<rel-tooltip text="Underline (Ctrl+U)" position="below" showTail>
|
|
321
|
-
<button style="padding: 8px 12px; background: white; border: 1px solid #ddd; border-radius: 4px; cursor: pointer; text-decoration: underline;">
|
|
322
|
-
U
|
|
323
|
-
</button>
|
|
324
|
-
</rel-tooltip>
|
|
325
|
-
|
|
326
|
-
<rel-tooltip text="Strikethrough" position="below" showTail>
|
|
327
|
-
<button style="padding: 8px 12px; background: white; border: 1px solid #ddd; border-radius: 4px; cursor: pointer; text-decoration: line-through;">
|
|
328
|
-
S
|
|
329
|
-
</button>
|
|
330
|
-
</rel-tooltip>
|
|
331
|
-
</div>
|
|
332
|
-
</div>
|
|
333
|
-
`,
|
|
334
|
-
};
|
|
335
|
-
|
|
336
|
-
/**
|
|
337
|
-
* Help icons - tooltips on help icons
|
|
338
|
-
*/
|
|
339
|
-
export const HelpIcons: Story = {
|
|
340
|
-
render: () => html`
|
|
341
|
-
<div style="padding: 80px; display: flex; flex-direction: column; gap: 24px; max-width: 400px;">
|
|
342
|
-
<div style="display: flex; align-items: center; gap: 8px;">
|
|
343
|
-
<label style="font-weight: 500;">Username</label>
|
|
344
|
-
<rel-tooltip text="Your unique identifier for login" position="above" showTail>
|
|
345
|
-
<span style="cursor: help; color: #666;">ℹ️</span>
|
|
346
|
-
</rel-tooltip>
|
|
347
|
-
</div>
|
|
348
|
-
|
|
349
|
-
<div style="display: flex; align-items: center; gap: 8px;">
|
|
350
|
-
<label style="font-weight: 500;">Password</label>
|
|
351
|
-
<rel-tooltip text="Must be at least 8 characters with letters and numbers" position="above" showTail>
|
|
352
|
-
<span style="cursor: help; color: #666;">ℹ️</span>
|
|
353
|
-
</rel-tooltip>
|
|
354
|
-
</div>
|
|
355
|
-
|
|
356
|
-
<div style="display: flex; align-items: center; gap: 8px;">
|
|
357
|
-
<label style="font-weight: 500;">Two-Factor Auth</label>
|
|
358
|
-
<rel-tooltip text="Adds an extra layer of security to your account" position="above" showTail>
|
|
359
|
-
<span style="cursor: help; color: #666;">ℹ️</span>
|
|
360
|
-
</rel-tooltip>
|
|
361
|
-
</div>
|
|
362
|
-
</div>
|
|
363
|
-
`,
|
|
364
|
-
};
|