@wcomp/elementum 0.0.0-stage → 0.2.0

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 (102) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +282 -2
  3. package/custom-elements.json +3613 -0
  4. package/mcp/server.js +593 -0
  5. package/package.json +77 -4
  6. package/skills/elementum-break-ui/CATALOG.md +11 -0
  7. package/skills/elementum-break-ui/SKILL.md +16 -0
  8. package/skills/elementum-mobile/SKILL.md +18 -0
  9. package/skills/elementum-motion/SKILL.md +18 -0
  10. package/skills/elementum-motion/STANDARDS.md +15 -0
  11. package/skills/elementum-penpot/SKILL.md +45 -0
  12. package/skills/elementum-ui/CATALOG.md +14 -0
  13. package/skills/elementum-ui/SKILL.md +21 -0
  14. package/src/ag-ui.js +474 -0
  15. package/src/behaviors/index.js +760 -0
  16. package/src/components/el-accordion.js +201 -0
  17. package/src/components/el-alert-dialog.js +186 -0
  18. package/src/components/el-alert.js +254 -0
  19. package/src/components/el-aspect-ratio.js +73 -0
  20. package/src/components/el-autocomplete.js +775 -0
  21. package/src/components/el-avatar.js +271 -0
  22. package/src/components/el-badge.js +131 -0
  23. package/src/components/el-border-beam.js +135 -0
  24. package/src/components/el-breadcrumb.js +203 -0
  25. package/src/components/el-button.js +231 -0
  26. package/src/components/el-calendar.js +436 -0
  27. package/src/components/el-callout.js +158 -0
  28. package/src/components/el-card.js +298 -0
  29. package/src/components/el-carousel.js +308 -0
  30. package/src/components/el-chart.js +632 -0
  31. package/src/components/el-checkbox-card.js +221 -0
  32. package/src/components/el-checkbox.js +208 -0
  33. package/src/components/el-chip.js +276 -0
  34. package/src/components/el-code-block.js +230 -0
  35. package/src/components/el-collapsible.js +124 -0
  36. package/src/components/el-command.js +556 -0
  37. package/src/components/el-context-menu.js +328 -0
  38. package/src/components/el-data-list.js +210 -0
  39. package/src/components/el-datepicker.js +192 -0
  40. package/src/components/el-dialog.js +272 -0
  41. package/src/components/el-diff-viewer.js +441 -0
  42. package/src/components/el-drawer.js +782 -0
  43. package/src/components/el-dropdown.js +182 -0
  44. package/src/components/el-dropzone.js +242 -0
  45. package/src/components/el-empty-state.js +130 -0
  46. package/src/components/el-field.js +394 -0
  47. package/src/components/el-form.js +185 -0
  48. package/src/components/el-input.js +229 -0
  49. package/src/components/el-inset.js +90 -0
  50. package/src/components/el-insight-card.js +263 -0
  51. package/src/components/el-kbd.js +151 -0
  52. package/src/components/el-menubar.js +254 -0
  53. package/src/components/el-meter.js +183 -0
  54. package/src/components/el-navbar.js +294 -0
  55. package/src/components/el-navigation-menu.js +327 -0
  56. package/src/components/el-number-field.js +510 -0
  57. package/src/components/el-number-flow.js +164 -0
  58. package/src/components/el-otp-input.js +266 -0
  59. package/src/components/el-pagination.js +231 -0
  60. package/src/components/el-popover.js +288 -0
  61. package/src/components/el-preview-card.js +202 -0
  62. package/src/components/el-progress.js +179 -0
  63. package/src/components/el-prompt-input.js +383 -0
  64. package/src/components/el-radio-card.js +360 -0
  65. package/src/components/el-radio.js +257 -0
  66. package/src/components/el-rating.js +165 -0
  67. package/src/components/el-reasoning-card.js +293 -0
  68. package/src/components/el-resizable.js +324 -0
  69. package/src/components/el-router.js +305 -0
  70. package/src/components/el-scroll-area.js +150 -0
  71. package/src/components/el-segmented-control.js +282 -0
  72. package/src/components/el-select.js +220 -0
  73. package/src/components/el-separator.js +85 -0
  74. package/src/components/el-sidebar.js +386 -0
  75. package/src/components/el-skeleton.js +156 -0
  76. package/src/components/el-slider.js +351 -0
  77. package/src/components/el-sources.js +288 -0
  78. package/src/components/el-spinner.js +159 -0
  79. package/src/components/el-streaming-text.js +199 -0
  80. package/src/components/el-switch.js +221 -0
  81. package/src/components/el-table.js +397 -0
  82. package/src/components/el-tabs.js +235 -0
  83. package/src/components/el-task-list.js +230 -0
  84. package/src/components/el-textarea.js +175 -0
  85. package/src/components/el-theme-switch.js +120 -0
  86. package/src/components/el-timeline.js +254 -0
  87. package/src/components/el-toast.js +778 -0
  88. package/src/components/el-toggle.js +311 -0
  89. package/src/components/el-tool-call.js +386 -0
  90. package/src/components/el-toolbar.js +183 -0
  91. package/src/components/el-tooltip.js +172 -0
  92. package/src/components/el-tree-view.js +261 -0
  93. package/src/components/el-visually-hidden.js +32 -0
  94. package/src/elementum.js +504 -0
  95. package/src/index.d.ts +1093 -0
  96. package/src/index.js +112 -0
  97. package/src/signal.js +215 -0
  98. package/src/ssr.js +136 -0
  99. package/src/template.js +321 -0
  100. package/src/tokens.css +416 -0
  101. package/tokens/figma-tokens.json +69 -0
  102. package/tokens/penpot-tokens.json +98 -0
@@ -0,0 +1,254 @@
1
+ /**
2
+ * <el-timeline> & <el-timeline-item>
3
+ * Accessible activity and event progression trail inspired by shadcn/ui.
4
+ * Supports status indicators (completed, active, pending, error),
5
+ * dates/timestamps, connecting connector lines, and custom icons.
6
+ */
7
+
8
+ import { Elementum } from '../elementum.js';
9
+ import { html, css } from '../template.js';
10
+ import { signal } from '../signal.js';
11
+
12
+ export class ElTimelineItem extends Elementum {
13
+ static observedAttributes = ['status', 'title', 'date', 'label'];
14
+
15
+ status = signal('pending'); // 'completed' | 'active' | 'pending' | 'error'
16
+ itemTitle = signal('');
17
+ date = signal('');
18
+ label = signal('');
19
+
20
+ static styles = css`
21
+ :host {
22
+ display: flex;
23
+ position: relative;
24
+ padding-bottom: 24px;
25
+ box-sizing: border-box;
26
+ font-family: var(--el-font-sans, system-ui, sans-serif);
27
+ }
28
+
29
+ :host(:last-of-type) {
30
+ padding-bottom: 0;
31
+ }
32
+
33
+ .gutter {
34
+ display: flex;
35
+ flex-direction: column;
36
+ align-items: center;
37
+ margin-right: 16px;
38
+ flex-shrink: 0;
39
+ }
40
+
41
+ .node {
42
+ width: 20px;
43
+ height: 20px;
44
+ border-radius: 999px;
45
+ display: flex;
46
+ align-items: center;
47
+ justify-content: center;
48
+ background: var(--el-surface-base, #ffffff);
49
+ border: 2px solid var(--el-surface-border, #cbd5e1);
50
+ color: var(--el-text-muted, #64748b);
51
+ font-size: 11px;
52
+ z-index: 2;
53
+ box-sizing: border-box;
54
+ }
55
+
56
+ :host([status="completed"]) .node {
57
+ background: var(--el-color-success, #16a34a);
58
+ border-color: var(--el-color-success, #16a34a);
59
+ color: #ffffff;
60
+ }
61
+
62
+ :host([status="active"]) .node {
63
+ background: var(--el-color-primary, #2563eb);
64
+ border-color: var(--el-color-primary, #2563eb);
65
+ color: #ffffff;
66
+ box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
67
+ }
68
+
69
+ :host([status="error"]) .node {
70
+ background: var(--el-color-danger, #dc2626);
71
+ border-color: var(--el-color-danger, #dc2626);
72
+ color: #ffffff;
73
+ }
74
+
75
+ :root[data-theme="dark"] .node {
76
+ background: #1e293b;
77
+ border-color: #475569;
78
+ }
79
+
80
+ .line {
81
+ width: 2px;
82
+ flex: 1;
83
+ background: var(--el-surface-border, #e2e8f0);
84
+ margin-top: 4px;
85
+ margin-bottom: -4px;
86
+ }
87
+
88
+ :root[data-theme="dark"] .line {
89
+ background: #334155;
90
+ }
91
+
92
+ :host(:last-of-type) .line {
93
+ display: none;
94
+ }
95
+
96
+ .content {
97
+ flex: 1;
98
+ padding-top: 1px;
99
+ }
100
+
101
+ .header-row {
102
+ display: flex;
103
+ align-items: baseline;
104
+ justify-content: space-between;
105
+ gap: 8px;
106
+ margin-bottom: 4px;
107
+ }
108
+
109
+ .title {
110
+ font-size: 0.95rem;
111
+ font-weight: 600;
112
+ color: var(--el-text-primary, #0f172a);
113
+ margin: 0;
114
+ }
115
+
116
+ :root[data-theme="dark"] .title {
117
+ color: #f8fafc;
118
+ }
119
+
120
+ .date {
121
+ font-size: 0.75rem;
122
+ color: var(--el-text-muted, #94a3b8);
123
+ white-space: nowrap;
124
+ }
125
+
126
+ .description {
127
+ font-size: 0.875rem;
128
+ color: var(--el-text-secondary, #475569);
129
+ line-height: 1.45;
130
+ }
131
+
132
+ :root[data-theme="dark"] .description {
133
+ color: #94a3b8;
134
+ }
135
+
136
+ :host-context(el-timeline[orientation="horizontal"]),
137
+ :host([orientation="horizontal"]) {
138
+ flex-direction: column;
139
+ padding-bottom: 0;
140
+ padding-right: 24px;
141
+ flex: 1;
142
+ min-width: 140px;
143
+ }
144
+
145
+ :host-context(el-timeline[orientation="horizontal"]) .gutter,
146
+ :host([orientation="horizontal"]) .gutter {
147
+ flex-direction: row;
148
+ margin-right: 0;
149
+ margin-bottom: 8px;
150
+ width: 100%;
151
+ }
152
+
153
+ :host-context(el-timeline[orientation="horizontal"]) .line,
154
+ :host([orientation="horizontal"]) .line {
155
+ width: 100%;
156
+ height: 2px;
157
+ margin-top: 0;
158
+ margin-bottom: 0;
159
+ margin-left: 8px;
160
+ }
161
+ `;
162
+
163
+ connected() {
164
+ this.#syncAttrs();
165
+ }
166
+
167
+ attributeChanged(name, oldValue, newValue) {
168
+ this.#syncAttrs();
169
+ return true;
170
+ }
171
+
172
+ #syncAttrs() {
173
+ this.status.value = this.getAttribute('status') || 'pending';
174
+ this.itemTitle.value = this.getAttribute('title') || '';
175
+ this.date.value = this.getAttribute('date') || '';
176
+ this.label.value = this.getAttribute('label') || '';
177
+ if (!this.hasAttribute('status')) this.setAttribute('status', 'pending');
178
+ }
179
+
180
+ render() {
181
+ return html`
182
+ <div class="gutter" part="gutter">
183
+ <div class="node" part="node">
184
+ <slot name="icon">
185
+ ${() => (this.status.value === 'completed' ? '✓' : '')}
186
+ </slot>
187
+ </div>
188
+ <div class="line" part="line"></div>
189
+ </div>
190
+ <div class="content" part="content">
191
+ <div class="header-row">
192
+ ${() => (this.itemTitle.value ? html`<h5 class="title" part="title">${() => this.itemTitle.value}</h5>` : '')}
193
+ ${() => (this.date.value ? html`<span class="date" part="date">${() => this.date.value}</span>` : '')}
194
+ </div>
195
+ <div class="description" part="description">
196
+ <slot>${() => this.label.value}</slot>
197
+ </div>
198
+ </div>
199
+ `;
200
+ }
201
+ }
202
+
203
+ export class ElTimeline extends Elementum {
204
+ static observedAttributes = ['orientation', 'reverse'];
205
+
206
+ orientation = signal('vertical');
207
+ reverse = signal(false);
208
+
209
+ connected() {
210
+ this.#syncAttrs();
211
+ }
212
+
213
+ attributeChanged(name, oldValue, newValue) {
214
+ this.#syncAttrs();
215
+ return true;
216
+ }
217
+
218
+ #syncAttrs() {
219
+ this.orientation.value = this.getAttribute('orientation') || 'vertical';
220
+ this.reverse.value = this.hasAttribute('reverse');
221
+ }
222
+
223
+ static styles = css`
224
+ :host {
225
+ display: flex;
226
+ flex-direction: column;
227
+ width: 100%;
228
+ box-sizing: border-box;
229
+ }
230
+
231
+ :host([orientation="horizontal"]) {
232
+ flex-direction: row;
233
+ align-items: flex-start;
234
+ overflow-x: auto;
235
+ }
236
+
237
+ :host([reverse]) {
238
+ flex-direction: column-reverse;
239
+ }
240
+
241
+ :host([orientation="horizontal"][reverse]) {
242
+ flex-direction: row-reverse;
243
+ }
244
+ `;
245
+
246
+ render() {
247
+ return html`<slot></slot>`;
248
+ }
249
+ }
250
+
251
+ if (typeof customElements !== 'undefined') {
252
+ if (!customElements.get('el-timeline-item')) customElements.define('el-timeline-item', ElTimelineItem);
253
+ if (!customElements.get('el-timeline')) customElements.define('el-timeline', ElTimeline);
254
+ }