@reliability-design/web 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/dist/components/rel-accordion/rel-accordion.stories.ts +313 -0
  2. package/dist/components/rel-accordion/rel-accordion.ts +114 -0
  3. package/dist/components/rel-alert/rel-alert.stories.ts +412 -0
  4. package/dist/components/rel-alert/rel-alert.ts +194 -0
  5. package/dist/components/rel-avatar/rel-avatar.stories.ts +327 -0
  6. package/dist/components/rel-avatar/rel-avatar.ts +100 -0
  7. package/dist/components/rel-badge/rel-badge.stories.ts +350 -0
  8. package/dist/components/rel-badge/rel-badge.ts +70 -0
  9. package/dist/components/rel-breadcrumb/rel-breadcrumb.stories.ts +306 -0
  10. package/dist/components/rel-breadcrumb/rel-breadcrumb.ts +97 -0
  11. package/dist/components/rel-button/rel-button.stories.ts +356 -0
  12. package/dist/components/rel-button/rel-button.ts +204 -0
  13. package/dist/components/rel-card/rel-card.stories.ts +299 -0
  14. package/dist/components/rel-card/rel-card.ts +33 -0
  15. package/dist/components/rel-cardmedia/rel-cardmedia.stories.ts +368 -0
  16. package/dist/components/rel-cardmedia/rel-cardmedia.ts +80 -0
  17. package/dist/components/rel-checkbox/rel-checkbox.stories.ts +414 -0
  18. package/dist/components/rel-checkbox/rel-checkbox.ts +164 -0
  19. package/dist/components/rel-chip/rel-chip.stories.ts +552 -0
  20. package/dist/components/rel-chip/rel-chip.ts +261 -0
  21. package/dist/components/rel-container/rel-container.stories.ts +239 -0
  22. package/dist/components/rel-container/rel-container.ts +74 -0
  23. package/dist/components/rel-divider/rel-divider.stories.ts +229 -0
  24. package/dist/components/rel-divider/rel-divider.ts +44 -0
  25. package/dist/components/rel-layout/rel-layout.stories.ts +713 -0
  26. package/dist/components/rel-layout/rel-layout.ts +60 -0
  27. package/dist/components/rel-menu/rel-menu.stories.ts +910 -0
  28. package/dist/components/rel-menu/rel-menu.ts +319 -0
  29. package/dist/components/rel-progress/rel-progress.stories.ts +817 -0
  30. package/dist/components/rel-progress/rel-progress.ts +182 -0
  31. package/dist/components/rel-radio/rel-radio.stories.ts +1048 -0
  32. package/dist/components/rel-radio/rel-radio.ts +187 -0
  33. package/dist/components/rel-segmented-button/rel-segmented-button.stories.ts +1079 -0
  34. package/dist/components/rel-segmented-button/rel-segmented-button.ts +150 -0
  35. package/dist/components/rel-select/rel-select.stories.ts +1201 -0
  36. package/dist/components/rel-select/rel-select.ts +261 -0
  37. package/dist/components/rel-slider/rel-slider.stories.ts +730 -0
  38. package/dist/components/rel-slider/rel-slider.ts +440 -0
  39. package/dist/components/rel-snackbar/rel-snackbar.stories.ts +808 -0
  40. package/dist/components/rel-snackbar/rel-snackbar.ts +212 -0
  41. package/dist/components/rel-stepper/rel-stepper.stories.ts +752 -0
  42. package/dist/components/rel-stepper/rel-stepper.ts +425 -0
  43. package/dist/components/rel-switch/rel-switch.stories.ts +441 -0
  44. package/dist/components/rel-switch/rel-switch.ts +161 -0
  45. package/dist/components/rel-tab/rel-tab.stories.ts +492 -0
  46. package/dist/components/rel-tab/rel-tab.ts +145 -0
  47. package/dist/components/rel-textfield/rel-textfield.stories.ts +710 -0
  48. package/dist/components/rel-textfield/rel-textfield.ts +224 -0
  49. package/dist/components/rel-toast/rel-toast.stories.ts +394 -0
  50. package/dist/components/rel-toast/rel-toast.ts +154 -0
  51. package/dist/components/rel-tooltip/rel-tooltip.stories.ts +364 -0
  52. package/dist/components/rel-tooltip/rel-tooltip.ts +80 -0
  53. package/dist/index.d.mts +372 -0
  54. package/dist/index.d.ts +372 -0
  55. package/dist/index.js +4593 -0
  56. package/dist/index.js.map +1 -0
  57. package/dist/index.mjs +4544 -0
  58. package/dist/index.mjs.map +1 -0
  59. package/dist/styles/vars.css +184 -0
  60. package/package.json +32 -0
@@ -0,0 +1,229 @@
1
+ import type { Meta, StoryObj } from '@storybook/web-components-vite';
2
+ import { html } from 'lit';
3
+ import './rel-divider';
4
+
5
+ /**
6
+ * The Divider component is a simple visual separator for content sections.
7
+ * Built with Lit web components for framework-agnostic usage with full token support.
8
+ *
9
+ * ## Features
10
+ * - **2 Orientations**: horizontal (default), vertical
11
+ * - **Token-Based Styling**: Uses design system tokens for colors and spacing
12
+ * - **ARIA Support**: Includes proper role="separator" for accessibility
13
+ * - **Flexible Layout**: Adapts to parent container
14
+ */
15
+ const meta: Meta = {
16
+ title: 'Components/Divider',
17
+ tags: ['autodocs'],
18
+ component: 'rel-divider',
19
+ argTypes: {
20
+ orientation: {
21
+ control: { type: 'select' },
22
+ options: ['horizontal', 'vertical'],
23
+ description: 'Divider orientation',
24
+ table: {
25
+ defaultValue: { summary: 'horizontal' },
26
+ type: { summary: 'string' },
27
+ },
28
+ },
29
+ },
30
+ render: (args) => html`
31
+ <rel-divider orientation="${args.orientation || 'horizontal'}"></rel-divider>
32
+ `,
33
+ };
34
+
35
+ export default meta;
36
+ type Story = StoryObj;
37
+
38
+ /**
39
+ * Default horizontal divider
40
+ */
41
+ export const Default: Story = {
42
+ args: {
43
+ orientation: 'horizontal',
44
+ },
45
+ };
46
+
47
+ /**
48
+ * Horizontal divider - separates content vertically
49
+ */
50
+ export const Horizontal: Story = {
51
+ render: () => html`
52
+ <div style="padding: 24px; background: #f5f5f5;">
53
+ <p style="margin: 0 0 16px; color: #333;">Section 1: This is some content above the divider.</p>
54
+ <rel-divider orientation="horizontal"></rel-divider>
55
+ <p style="margin: 16px 0 0; color: #333;">Section 2: This is some content below the divider.</p>
56
+ </div>
57
+ `,
58
+ };
59
+
60
+ /**
61
+ * Vertical divider - separates content horizontally
62
+ */
63
+ export const Vertical: Story = {
64
+ render: () => html`
65
+ <div style="display: flex; align-items: center; padding: 24px; background: #f5f5f5; height: 100px;">
66
+ <div style="flex: 1; color: #333; text-align: center;">
67
+ <strong>Left Section</strong>
68
+ <p style="margin: 8px 0 0; font-size: 14px;">Content on the left</p>
69
+ </div>
70
+ <rel-divider orientation="vertical"></rel-divider>
71
+ <div style="flex: 1; color: #333; text-align: center;">
72
+ <strong>Right Section</strong>
73
+ <p style="margin: 8px 0 0; font-size: 14px;">Content on the right</p>
74
+ </div>
75
+ </div>
76
+ `,
77
+ };
78
+
79
+ /**
80
+ * Multiple horizontal dividers
81
+ */
82
+ export const MultipleHorizontal: Story = {
83
+ render: () => html`
84
+ <div style="padding: 24px; background: #f5f5f5;">
85
+ <div style="color: #333;">
86
+ <h3 style="margin: 0 0 8px;">Section 1</h3>
87
+ <p style="margin: 0;">First section content with important information.</p>
88
+ </div>
89
+
90
+ <rel-divider orientation="horizontal"></rel-divider>
91
+
92
+ <div style="color: #333;">
93
+ <h3 style="margin: 0 0 8px;">Section 2</h3>
94
+ <p style="margin: 0;">Second section with different content.</p>
95
+ </div>
96
+
97
+ <rel-divider orientation="horizontal"></rel-divider>
98
+
99
+ <div style="color: #333;">
100
+ <h3 style="margin: 0 0 8px;">Section 3</h3>
101
+ <p style="margin: 0;">Third section completing the layout.</p>
102
+ </div>
103
+ </div>
104
+ `,
105
+ };
106
+
107
+ /**
108
+ * Multiple vertical dividers
109
+ */
110
+ export const MultipleVertical: Story = {
111
+ render: () => html`
112
+ <div style="display: flex; align-items: stretch; padding: 24px; background: #f5f5f5; height: 120px;">
113
+ <div style="flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; color: #333;">
114
+ <strong>Column 1</strong>
115
+ <p style="margin: 8px 0 0; font-size: 13px;">First</p>
116
+ </div>
117
+
118
+ <rel-divider orientation="vertical"></rel-divider>
119
+
120
+ <div style="flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; color: #333;">
121
+ <strong>Column 2</strong>
122
+ <p style="margin: 8px 0 0; font-size: 13px;">Second</p>
123
+ </div>
124
+
125
+ <rel-divider orientation="vertical"></rel-divider>
126
+
127
+ <div style="flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; color: #333;">
128
+ <strong>Column 3</strong>
129
+ <p style="margin: 8px 0 0; font-size: 13px;">Third</p>
130
+ </div>
131
+ </div>
132
+ `,
133
+ };
134
+
135
+ /**
136
+ * In a card layout
137
+ */
138
+ export const InCardLayout: Story = {
139
+ render: () => html`
140
+ <div style="max-width: 500px; background: white; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); padding: 24px;">
141
+ <h2 style="margin: 0 0 8px; color: #333; font-size: 20px;">User Profile</h2>
142
+ <p style="margin: 0; color: #666; font-size: 14px;">Personal information</p>
143
+
144
+ <rel-divider orientation="horizontal"></rel-divider>
145
+
146
+ <div style="color: #333;">
147
+ <div style="margin-bottom: 12px;">
148
+ <strong>Name:</strong> John Doe
149
+ </div>
150
+ <div style="margin-bottom: 12px;">
151
+ <strong>Email:</strong> john.doe@example.com
152
+ </div>
153
+ <div>
154
+ <strong>Role:</strong> Developer
155
+ </div>
156
+ </div>
157
+
158
+ <rel-divider orientation="horizontal"></rel-divider>
159
+
160
+ <div style="display: flex; gap: 12px;">
161
+ <button style="flex: 1; padding: 10px; background: #0059F4; color: white; border: none; border-radius: 6px; cursor: pointer; font-weight: 600;">
162
+ Edit Profile
163
+ </button>
164
+ <button style="flex: 1; padding: 10px; background: #f5f5f5; color: #333; border: none; border-radius: 6px; cursor: pointer; font-weight: 600;">
165
+ Cancel
166
+ </button>
167
+ </div>
168
+ </div>
169
+ `,
170
+ };
171
+
172
+ /**
173
+ * In a navigation layout
174
+ */
175
+ export const InNavigation: Story = {
176
+ render: () => html`
177
+ <div style="display: flex; align-items: center; padding: 16px 24px; background: white; box-shadow: 0 2px 8px rgba(0,0,0,0.1);">
178
+ <div style="font-weight: 700; font-size: 18px; color: #333; margin-right: 24px;">
179
+ Logo
180
+ </div>
181
+
182
+ <rel-divider orientation="vertical" style="height: 30px;"></rel-divider>
183
+
184
+ <nav style="display: flex; align-items: center; gap: 24px; margin-left: 24px; flex: 1;">
185
+ <a href="#" style="color: #333; text-decoration: none; font-weight: 500;">Home</a>
186
+ <a href="#" style="color: #333; text-decoration: none; font-weight: 500;">Products</a>
187
+ <a href="#" style="color: #333; text-decoration: none; font-weight: 500;">About</a>
188
+ <a href="#" style="color: #333; text-decoration: none; font-weight: 500;">Contact</a>
189
+ </nav>
190
+
191
+ <rel-divider orientation="vertical" style="height: 30px;"></rel-divider>
192
+
193
+ <button style="margin-left: 24px; padding: 8px 16px; background: #0059F4; color: white; border: none; border-radius: 6px; cursor: pointer; font-weight: 600;">
194
+ Sign In
195
+ </button>
196
+ </div>
197
+ `,
198
+ };
199
+
200
+ /**
201
+ * All orientations showcase
202
+ */
203
+ export const AllOrientations: Story = {
204
+ render: () => html`
205
+ <div style="display: flex; flex-direction: column; gap: 32px; padding: 24px;">
206
+ <div>
207
+ <h3 style="margin-bottom: 16px; font-size: 16px; font-weight: 600; color: #333;">Horizontal Divider</h3>
208
+ <div style="background: #f5f5f5; padding: 20px;">
209
+ <p style="margin: 0; color: #333;">Content above</p>
210
+ <rel-divider orientation="horizontal"></rel-divider>
211
+ <p style="margin: 0; color: #333;">Content below</p>
212
+ </div>
213
+ </div>
214
+
215
+ <div>
216
+ <h3 style="margin-bottom: 16px; font-size: 16px; font-weight: 600; color: #333;">Vertical Divider</h3>
217
+ <div style="display: flex; background: #f5f5f5; padding: 20px; height: 80px;">
218
+ <div style="flex: 1; display: flex; align-items: center; justify-content: center; color: #333;">
219
+ Left
220
+ </div>
221
+ <rel-divider orientation="vertical"></rel-divider>
222
+ <div style="flex: 1; display: flex; align-items: center; justify-content: center; color: #333;">
223
+ Right
224
+ </div>
225
+ </div>
226
+ </div>
227
+ </div>
228
+ `,
229
+ };
@@ -0,0 +1,44 @@
1
+ import { LitElement, html, css } from "lit";
2
+ import { customElement, property } from "lit/decorators.js";
3
+
4
+ @customElement("rel-divider")
5
+ export class RelDivider extends LitElement {
6
+ @property({ type: String }) orientation: "horizontal" | "vertical" = "horizontal";
7
+
8
+ static styles = css`
9
+ :host {
10
+ display: block;
11
+ }
12
+
13
+ .rel-divider {
14
+ position: relative;
15
+ display: flex;
16
+ background: transparent;
17
+ font-family: var(--rel-fontFamilies-primary);
18
+ color: var(--rel-colors-gray-primary);
19
+ }
20
+
21
+ /* Horizontal */
22
+ .rel-divider.horizontal {
23
+ width: 100%;
24
+ height: var(--rel-borders-width-stroke-100);
25
+ background-color: var(--rel-colors-gray-border);
26
+ margin: var(--rel-spacing-space-md) 0;
27
+ }
28
+
29
+ /* Vertical */
30
+ .rel-divider.vertical {
31
+ width: var(--rel-borders-width-stroke-100);
32
+ background-color: var(--rel-colors-gray-border);
33
+ margin: 0 var(--rel-spacing-space-md);
34
+ align-self: stretch;
35
+ height: 100%;
36
+ }
37
+ `;
38
+
39
+ render() {
40
+ return html`
41
+ <div class="rel-divider ${this.orientation}" role="separator"></div>
42
+ `;
43
+ }
44
+ }