@arclux/arc-ui 1.0.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 (135) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +64 -0
  3. package/package.json +186 -0
  4. package/src/content/accordion-item.js +27 -0
  5. package/src/content/accordion.js +151 -0
  6. package/src/content/animated-number.js +160 -0
  7. package/src/content/aspect-ratio.js +78 -0
  8. package/src/content/avatar-group.js +101 -0
  9. package/src/content/avatar.js +92 -0
  10. package/src/content/badge.js +98 -0
  11. package/src/content/callout.js +141 -0
  12. package/src/content/card.js +75 -0
  13. package/src/content/carousel.js +300 -0
  14. package/src/content/code-block.js +152 -0
  15. package/src/content/collapsible.js +142 -0
  16. package/src/content/color-swatch.js +86 -0
  17. package/src/content/column.js +28 -0
  18. package/src/content/data-table.js +332 -0
  19. package/src/content/divider.js +153 -0
  20. package/src/content/empty-state.js +78 -0
  21. package/src/content/feature-card.js +142 -0
  22. package/src/content/highlight.js +63 -0
  23. package/src/content/icon-library.js +30 -0
  24. package/src/content/icon-registry.js +39 -0
  25. package/src/content/icon.js +95 -0
  26. package/src/content/index.js +44 -0
  27. package/src/content/infinite-scroll.js +144 -0
  28. package/src/content/kbd.js +40 -0
  29. package/src/content/markdown.js +294 -0
  30. package/src/content/marquee.js +166 -0
  31. package/src/content/meter.js +167 -0
  32. package/src/content/scroll-area.js +107 -0
  33. package/src/content/skeleton.js +85 -0
  34. package/src/content/spinner.js +77 -0
  35. package/src/content/stack.js +68 -0
  36. package/src/content/stat.js +72 -0
  37. package/src/content/step.js +22 -0
  38. package/src/content/stepper.js +202 -0
  39. package/src/content/table.js +134 -0
  40. package/src/content/tag.js +156 -0
  41. package/src/content/text.js +111 -0
  42. package/src/content/timeline-item.js +29 -0
  43. package/src/content/timeline.js +170 -0
  44. package/src/content/truncate.js +161 -0
  45. package/src/content/value-card.js +94 -0
  46. package/src/feedback/alert.js +187 -0
  47. package/src/feedback/command-item.js +28 -0
  48. package/src/feedback/command-palette.js +346 -0
  49. package/src/feedback/context-menu.js +299 -0
  50. package/src/feedback/dialog.js +298 -0
  51. package/src/feedback/dropdown-menu.js +259 -0
  52. package/src/feedback/hover-card.js +186 -0
  53. package/src/feedback/index.js +17 -0
  54. package/src/feedback/modal.js +226 -0
  55. package/src/feedback/notification-panel.js +196 -0
  56. package/src/feedback/popover.js +184 -0
  57. package/src/feedback/progress.js +169 -0
  58. package/src/feedback/sheet.js +249 -0
  59. package/src/feedback/toast.js +207 -0
  60. package/src/feedback/tooltip.js +189 -0
  61. package/src/icons/lucide.d.ts +1915 -0
  62. package/src/icons/lucide.js +1915 -0
  63. package/src/icons/phosphor.d.ts +1517 -0
  64. package/src/icons/phosphor.js +1517 -0
  65. package/src/icons/types.d.ts +8 -0
  66. package/src/index.js +9 -0
  67. package/src/input/button.js +127 -0
  68. package/src/input/calendar.js +340 -0
  69. package/src/input/checkbox.js +159 -0
  70. package/src/input/chip.js +120 -0
  71. package/src/input/color-picker.js +461 -0
  72. package/src/input/combobox.js +295 -0
  73. package/src/input/copy-button.js +144 -0
  74. package/src/input/date-picker.js +534 -0
  75. package/src/input/file-upload.js +333 -0
  76. package/src/input/form.js +179 -0
  77. package/src/input/icon-button.js +179 -0
  78. package/src/input/index.js +31 -0
  79. package/src/input/input.js +158 -0
  80. package/src/input/multi-select.js +392 -0
  81. package/src/input/number-input.js +239 -0
  82. package/src/input/otp-input.js +221 -0
  83. package/src/input/pin-input.js +294 -0
  84. package/src/input/radio-group.js +177 -0
  85. package/src/input/radio.js +28 -0
  86. package/src/input/rating.js +195 -0
  87. package/src/input/search.js +371 -0
  88. package/src/input/segmented-control.js +174 -0
  89. package/src/input/select.js +267 -0
  90. package/src/input/slider.js +217 -0
  91. package/src/input/sortable-list.js +345 -0
  92. package/src/input/suggestion.js +26 -0
  93. package/src/input/textarea.js +203 -0
  94. package/src/input/theme-toggle.js +196 -0
  95. package/src/input/toggle.js +166 -0
  96. package/src/layout/app-shell.js +266 -0
  97. package/src/layout/auth-shell.js +153 -0
  98. package/src/layout/container.js +37 -0
  99. package/src/layout/dashboard-grid.js +62 -0
  100. package/src/layout/index.js +15 -0
  101. package/src/layout/page-header.js +100 -0
  102. package/src/layout/page-layout.js +112 -0
  103. package/src/layout/resizable.js +221 -0
  104. package/src/layout/section.js +54 -0
  105. package/src/layout/settings-layout.js +91 -0
  106. package/src/layout/split-pane.js +172 -0
  107. package/src/layout/status-bar.js +84 -0
  108. package/src/layout/toolbar.js +92 -0
  109. package/src/navigation/breadcrumb-item.js +26 -0
  110. package/src/navigation/breadcrumb.js +129 -0
  111. package/src/navigation/drawer.js +183 -0
  112. package/src/navigation/footer.js +99 -0
  113. package/src/navigation/index.js +22 -0
  114. package/src/navigation/link.js +120 -0
  115. package/src/navigation/nav-item.js +46 -0
  116. package/src/navigation/navigation-menu.js +687 -0
  117. package/src/navigation/pagination.js +186 -0
  118. package/src/navigation/scroll-spy.js +198 -0
  119. package/src/navigation/scroll-to-top.js +163 -0
  120. package/src/navigation/sidebar-link.js +28 -0
  121. package/src/navigation/sidebar-section.js +45 -0
  122. package/src/navigation/sidebar.js +336 -0
  123. package/src/navigation/spy-link.js +26 -0
  124. package/src/navigation/tab.js +26 -0
  125. package/src/navigation/tabs.js +202 -0
  126. package/src/navigation/top-bar.js +263 -0
  127. package/src/navigation/tree-item.js +38 -0
  128. package/src/navigation/tree-view.js +255 -0
  129. package/src/shared/index.js +6 -0
  130. package/src/shared/menu-divider.js +9 -0
  131. package/src/shared/menu-item.js +30 -0
  132. package/src/shared/option.js +31 -0
  133. package/src/shared-styles.js +81 -0
  134. package/src/tokens.js +445 -0
  135. package/types/index.d.ts +973 -0
@@ -0,0 +1,207 @@
1
+ import { LitElement, html, css } from 'lit';
2
+ import { tokenStyles } from '../shared-styles.js';
3
+
4
+ export class ArcToast extends LitElement {
5
+ static properties = {
6
+ position: { type: String, reflect: true },
7
+ duration: { type: Number },
8
+ _toasts: { state: true },
9
+ };
10
+
11
+ static styles = [
12
+ tokenStyles,
13
+ css`
14
+ :host { display: block; }
15
+
16
+ .toast-container {
17
+ position: fixed;
18
+ z-index: 2000;
19
+ display: flex;
20
+ flex-direction: column;
21
+ gap: var(--space-sm);
22
+ pointer-events: none;
23
+ max-width: 400px;
24
+ width: 100%;
25
+ }
26
+
27
+ /* Positions */
28
+ :host([position="top-right"]) .toast-container,
29
+ :host(:not([position])) .toast-container {
30
+ top: var(--space-lg); right: var(--space-lg);
31
+ }
32
+ :host([position="top-left"]) .toast-container {
33
+ top: var(--space-lg); left: var(--space-lg);
34
+ }
35
+ :host([position="top-center"]) .toast-container {
36
+ top: var(--space-lg); left: 50%; transform: translateX(-50%);
37
+ }
38
+ :host([position="bottom-right"]) .toast-container {
39
+ bottom: var(--space-lg); right: var(--space-lg);
40
+ }
41
+ :host([position="bottom-left"]) .toast-container {
42
+ bottom: var(--space-lg); left: var(--space-lg);
43
+ }
44
+ :host([position="bottom-center"]) .toast-container {
45
+ bottom: var(--space-lg); left: 50%; transform: translateX(-50%);
46
+ }
47
+
48
+ .toast {
49
+ pointer-events: auto;
50
+ position: relative;
51
+ display: flex;
52
+ align-items: center;
53
+ gap: var(--space-sm);
54
+ padding: var(--space-sm) var(--space-md);
55
+ border-radius: var(--radius-md);
56
+ background: var(--bg-elevated);
57
+ border: 1px solid var(--border-default);
58
+ box-shadow: var(--shadow-overlay);
59
+ animation: toast-in 300ms var(--ease-out-expo);
60
+ font-family: var(--font-body);
61
+ font-size: var(--text-sm);
62
+ color: var(--text-secondary);
63
+ overflow: hidden;
64
+ }
65
+
66
+ /* Bottom gradient indicator */
67
+ .toast::after {
68
+ content: '';
69
+ position: absolute;
70
+ bottom: 0;
71
+ left: 0;
72
+ right: 0;
73
+ height: 2px;
74
+ background: var(--gradient-divider);
75
+ }
76
+
77
+ .toast--info::after {
78
+ background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
79
+ }
80
+ .toast--success::after {
81
+ background: linear-gradient(90deg, transparent, var(--color-success), transparent);
82
+ }
83
+ .toast--warning::after {
84
+ background: linear-gradient(90deg, transparent, var(--color-warning), transparent);
85
+ }
86
+ .toast--error::after {
87
+ background: linear-gradient(90deg, transparent, var(--color-error), transparent);
88
+ }
89
+
90
+ .toast__icon {
91
+ font-size: var(--text-sm);
92
+ flex-shrink: 0;
93
+ line-height: 1;
94
+ }
95
+
96
+ .toast--info .toast__icon { color: var(--accent-primary); }
97
+ .toast--success .toast__icon { color: var(--color-success); }
98
+ .toast--warning .toast__icon { color: var(--color-warning); }
99
+ .toast--error .toast__icon { color: var(--color-error); }
100
+
101
+ .toast__message { flex: 1; }
102
+
103
+ .toast__dismiss {
104
+ background: none;
105
+ border: none;
106
+ color: var(--text-ghost);
107
+ cursor: pointer;
108
+ font-size: var(--text-sm);
109
+ padding: var(--space-xs);
110
+ border-radius: var(--radius-sm);
111
+ transition: color var(--transition-fast);
112
+ line-height: 1;
113
+ }
114
+
115
+ .toast__dismiss:hover { color: var(--text-primary); }
116
+
117
+ .toast.is-exiting {
118
+ animation: toast-out 200ms ease-in forwards;
119
+ }
120
+
121
+ @keyframes toast-in {
122
+ from { opacity: 0; transform: translateY(-8px) scale(0.96); }
123
+ to { opacity: 1; transform: translateY(0) scale(1); }
124
+ }
125
+
126
+ @keyframes toast-out {
127
+ to { opacity: 0; transform: translateY(-8px) scale(0.96); }
128
+ }
129
+
130
+ @media (prefers-reduced-motion: reduce) {
131
+ .toast, .toast.is-exiting { animation: none; }
132
+ }
133
+
134
+ @media (max-width: 640px) {
135
+ .toast-container {
136
+ right: var(--space-sm);
137
+ left: var(--space-sm);
138
+ max-width: none;
139
+ }
140
+ }
141
+ `,
142
+ ];
143
+
144
+ constructor() {
145
+ super();
146
+ this.position = 'top-right';
147
+ this.duration = 4000;
148
+ this._toasts = [];
149
+ this._counter = 0;
150
+ }
151
+
152
+ _getIcon(variant) {
153
+ switch (variant) {
154
+ case 'success': return '\u2713';
155
+ case 'warning': return '\u26A0';
156
+ case 'error': return '\u2717';
157
+ default: return '\u2139';
158
+ }
159
+ }
160
+
161
+ show({ message, variant = 'info', duration }) {
162
+ const id = ++this._counter;
163
+ const dur = duration ?? this.duration;
164
+ this._toasts = [...this._toasts, { id, message, variant }];
165
+
166
+ if (dur > 0) {
167
+ setTimeout(() => this._dismiss(id), dur);
168
+ }
169
+ }
170
+
171
+ _dismiss(id) {
172
+ if (!this._toasts.some(t => t.id === id)) return;
173
+ const el = this.shadowRoot.querySelector(`[data-toast-id="${id}"]`);
174
+ if (el) {
175
+ el.classList.add('is-exiting');
176
+ const cleanup = () => {
177
+ this._toasts = this._toasts.filter(t => t.id !== id);
178
+ this.dispatchEvent(new CustomEvent('arc-dismiss', {
179
+ detail: { id },
180
+ bubbles: true,
181
+ composed: true,
182
+ }));
183
+ };
184
+ el.addEventListener('animationend', cleanup, { once: true });
185
+ // Safety fallback if animation doesn't fire (e.g. prefers-reduced-motion)
186
+ setTimeout(cleanup, 300);
187
+ } else {
188
+ this._toasts = this._toasts.filter(t => t.id !== id);
189
+ }
190
+ }
191
+
192
+ render() {
193
+ return html`
194
+ <div class="toast-container" role="status" aria-live="polite" aria-atomic="false" part="container">
195
+ ${this._toasts.map(t => html`
196
+ <div class="toast toast--${t.variant}" data-toast-id=${t.id} part="toast">
197
+ <span class="toast__icon" aria-hidden="true">${this._getIcon(t.variant)}</span>
198
+ <span class="toast__message">${t.message}</span>
199
+ <button class="toast__dismiss" @click=${() => this._dismiss(t.id)} aria-label="Dismiss">&times;</button>
200
+ </div>
201
+ `)}
202
+ </div>
203
+ `;
204
+ }
205
+ }
206
+
207
+ customElements.define('arc-toast', ArcToast);
@@ -0,0 +1,189 @@
1
+ import { LitElement, html, css } from 'lit';
2
+ import { tokenStyles } from '../shared-styles.js';
3
+
4
+ export class ArcTooltip extends LitElement {
5
+ static properties = {
6
+ content: { type: String },
7
+ position: { type: String, reflect: true },
8
+ delay: { type: Number },
9
+ _visible: { state: true },
10
+ };
11
+
12
+ static styles = [
13
+ tokenStyles,
14
+ css`
15
+ :host {
16
+ display: inline-block;
17
+ position: relative;
18
+ }
19
+
20
+ .tooltip__trigger {
21
+ display: inline-block;
22
+ }
23
+
24
+ .tooltip__popup {
25
+ position: absolute;
26
+ z-index: 1000;
27
+ background: var(--bg-elevated);
28
+ border: 1px solid var(--border-default);
29
+ border-radius: var(--radius-sm);
30
+ padding: var(--space-xs) var(--space-sm);
31
+ font-family: var(--font-body);
32
+ font-size: var(--text-sm);
33
+ color: var(--text-primary);
34
+ white-space: nowrap;
35
+ pointer-events: none;
36
+ opacity: 0;
37
+ transition: opacity var(--transition-fast);
38
+ box-shadow: var(--shadow-overlay);
39
+ }
40
+
41
+ :host .tooltip__popup.is-visible {
42
+ opacity: 1;
43
+ }
44
+
45
+ /* Arrow */
46
+ .tooltip__arrow {
47
+ position: absolute;
48
+ width: 8px;
49
+ height: 8px;
50
+ background: var(--bg-elevated);
51
+ border: 1px solid var(--border-default);
52
+ transform: rotate(45deg);
53
+ }
54
+
55
+ /* Positions */
56
+ :host(:not([position])) .tooltip__popup,
57
+ :host([position="top"]) .tooltip__popup {
58
+ bottom: calc(100% + 8px);
59
+ left: 50%;
60
+ transform: translateX(-50%);
61
+ }
62
+ :host(:not([position])) .tooltip__arrow,
63
+ :host([position="top"]) .tooltip__arrow {
64
+ bottom: -5px;
65
+ left: 50%;
66
+ transform: translateX(-50%) rotate(45deg);
67
+ border-top: none;
68
+ border-left: none;
69
+ }
70
+
71
+ :host([position="bottom"]) .tooltip__popup {
72
+ top: calc(100% + 8px);
73
+ left: 50%;
74
+ transform: translateX(-50%);
75
+ }
76
+ :host([position="bottom"]) .tooltip__arrow {
77
+ top: -5px;
78
+ left: 50%;
79
+ transform: translateX(-50%) rotate(45deg);
80
+ border-bottom: none;
81
+ border-right: none;
82
+ }
83
+
84
+ :host([position="left"]) .tooltip__popup {
85
+ right: calc(100% + 8px);
86
+ top: 50%;
87
+ transform: translateY(-50%);
88
+ }
89
+ :host([position="left"]) .tooltip__arrow {
90
+ right: -5px;
91
+ top: 50%;
92
+ transform: translateY(-50%) rotate(45deg);
93
+ border-bottom: none;
94
+ border-left: none;
95
+ }
96
+
97
+ :host([position="right"]) .tooltip__popup {
98
+ left: calc(100% + 8px);
99
+ top: 50%;
100
+ transform: translateY(-50%);
101
+ }
102
+ :host([position="right"]) .tooltip__arrow {
103
+ left: -5px;
104
+ top: 50%;
105
+ transform: translateY(-50%) rotate(45deg);
106
+ border-top: none;
107
+ border-right: none;
108
+ }
109
+
110
+ @media (prefers-reduced-motion: reduce) {
111
+ :host *,
112
+ :host *::before,
113
+ :host *::after {
114
+ animation-duration: 0.01ms !important;
115
+ animation-iteration-count: 1 !important;
116
+ transition-duration: 0.01ms !important;
117
+ }
118
+ }
119
+ `,
120
+ ];
121
+
122
+ static _idCounter = 0;
123
+
124
+ constructor() {
125
+ super();
126
+ this.content = '';
127
+ this.position = 'top';
128
+ this.delay = 200;
129
+ this._visible = false;
130
+ this._showTimeout = null;
131
+ this._tooltipId = `tooltip-${++ArcTooltip._idCounter}`;
132
+ this._onKeyDown = this._onKeyDown.bind(this);
133
+ }
134
+
135
+ connectedCallback() {
136
+ super.connectedCallback();
137
+ this.addEventListener('keydown', this._onKeyDown);
138
+ }
139
+
140
+ disconnectedCallback() {
141
+ super.disconnectedCallback();
142
+ this.removeEventListener('keydown', this._onKeyDown);
143
+ clearTimeout(this._showTimeout);
144
+ }
145
+
146
+ _onKeyDown(e) {
147
+ if (e.key === 'Escape' && this._visible) {
148
+ this._hide();
149
+ }
150
+ }
151
+
152
+ _show() {
153
+ this._showTimeout = setTimeout(() => {
154
+ this._visible = true;
155
+ }, this.delay);
156
+ }
157
+
158
+ _hide() {
159
+ clearTimeout(this._showTimeout);
160
+ this._visible = false;
161
+ }
162
+
163
+ render() {
164
+ return html`
165
+ <div
166
+ class="tooltip__trigger"
167
+ @mouseenter=${this._show}
168
+ @mouseleave=${this._hide}
169
+ @focusin=${this._show}
170
+ @focusout=${this._hide}
171
+ aria-describedby=${this._tooltipId}
172
+ part="trigger"
173
+ >
174
+ <slot></slot>
175
+ </div>
176
+ <div
177
+ class="tooltip__popup ${this._visible ? 'is-visible' : ''}"
178
+ role="tooltip"
179
+ id=${this._tooltipId}
180
+ part="popup"
181
+ >
182
+ ${this.content}
183
+ <div class="tooltip__arrow"></div>
184
+ </div>
185
+ `;
186
+ }
187
+ }
188
+
189
+ customElements.define('arc-tooltip', ArcTooltip);