@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,183 @@
1
+ import { LitElement, html, css } from 'lit';
2
+ import { tokenStyles } from '../shared-styles.js';
3
+
4
+ export class ArcDrawer extends LitElement {
5
+ static properties = {
6
+ open: { type: Boolean, reflect: true },
7
+ position: { type: String, reflect: true },
8
+ heading: { type: String },
9
+ };
10
+
11
+ static styles = [
12
+ tokenStyles,
13
+ css`
14
+ :host { display: contents; }
15
+
16
+ .drawer__backdrop {
17
+ position: fixed;
18
+ inset: 0;
19
+ z-index: 200;
20
+ background: var(--overlay-backdrop);
21
+ opacity: 0;
22
+ visibility: hidden;
23
+ transition:
24
+ opacity var(--transition-base),
25
+ visibility var(--transition-base);
26
+ }
27
+
28
+ :host([open]) .drawer__backdrop {
29
+ opacity: 1;
30
+ visibility: visible;
31
+ }
32
+
33
+ .drawer__panel {
34
+ position: fixed;
35
+ top: 0;
36
+ bottom: 0;
37
+ z-index: 201;
38
+ width: 300px;
39
+ max-width: 85vw;
40
+ background: var(--bg-surface);
41
+ border-right: 1px solid var(--border-subtle);
42
+ display: flex;
43
+ flex-direction: column;
44
+ transition: transform var(--transition-base) var(--ease-out-expo);
45
+ }
46
+
47
+ :host(:not([position])) .drawer__panel,
48
+ :host([position="left"]) .drawer__panel {
49
+ left: 0;
50
+ transform: translateX(-100%);
51
+ }
52
+
53
+ :host([position="right"]) .drawer__panel {
54
+ right: 0;
55
+ left: auto;
56
+ border-right: none;
57
+ border-left: 1px solid var(--border-subtle);
58
+ transform: translateX(100%);
59
+ }
60
+
61
+ :host([open]) .drawer__panel {
62
+ transform: translateX(0);
63
+ }
64
+
65
+ .drawer__header {
66
+ display: flex;
67
+ align-items: center;
68
+ justify-content: space-between;
69
+ padding: var(--space-md) var(--space-lg);
70
+ border-bottom: 1px solid var(--border-subtle);
71
+ flex-shrink: 0;
72
+ }
73
+
74
+ .drawer__title {
75
+ font-family: var(--font-accent);
76
+ font-weight: 600;
77
+ font-size: var(--text-sm);
78
+ letter-spacing: 2px;
79
+ text-transform: uppercase;
80
+ color: var(--text-primary);
81
+ }
82
+
83
+ .drawer__close {
84
+ background: none;
85
+ border: none;
86
+ color: var(--text-muted);
87
+ cursor: pointer;
88
+ width: 32px;
89
+ height: 32px;
90
+ display: flex;
91
+ align-items: center;
92
+ justify-content: center;
93
+ border-radius: var(--radius-sm);
94
+ transition: color var(--transition-fast), background var(--transition-fast);
95
+ }
96
+
97
+ .drawer__close:hover {
98
+ color: var(--text-primary);
99
+ background: var(--bg-hover);
100
+ }
101
+
102
+ .drawer__body {
103
+ flex: 1;
104
+ overflow-y: auto;
105
+ }
106
+
107
+ @media (prefers-reduced-motion: reduce) {
108
+ :host *,
109
+ :host *::before,
110
+ :host *::after {
111
+ animation-duration: 0.01ms !important;
112
+ animation-iteration-count: 1 !important;
113
+ transition-duration: 0.01ms !important;
114
+ }
115
+ }
116
+ `,
117
+ ];
118
+
119
+ constructor() {
120
+ super();
121
+ this.open = false;
122
+ this.position = 'left';
123
+ this.heading = '';
124
+ this._onKeyDown = this._onKeyDown.bind(this);
125
+ }
126
+
127
+ updated(changed) {
128
+ if (changed.has('open')) {
129
+ if (this.open) {
130
+ document.addEventListener('keydown', this._onKeyDown);
131
+ document.body.style.overflow = 'hidden';
132
+ } else {
133
+ document.removeEventListener('keydown', this._onKeyDown);
134
+ document.body.style.overflow = '';
135
+ }
136
+ }
137
+ }
138
+
139
+ disconnectedCallback() {
140
+ super.disconnectedCallback();
141
+ document.removeEventListener('keydown', this._onKeyDown);
142
+ document.body.style.overflow = '';
143
+ }
144
+
145
+ _onKeyDown(e) {
146
+ if (e.key === 'Escape') {
147
+ this._close();
148
+ }
149
+ }
150
+
151
+ _close() {
152
+ this.open = false;
153
+ this.dispatchEvent(new CustomEvent('arc-close', {
154
+ bubbles: true,
155
+ composed: true,
156
+ }));
157
+ }
158
+
159
+ _backdropClick() {
160
+ this._close();
161
+ }
162
+
163
+ render() {
164
+ return html`
165
+ <div class="drawer__backdrop" @click=${this._backdropClick} part="backdrop"></div>
166
+ <aside class="drawer__panel" role="dialog" aria-modal="true" aria-label=${this.heading || 'Drawer'} part="panel">
167
+ <div class="drawer__header" part="header">
168
+ <span class="drawer__title" part="title">${this.heading}</span>
169
+ <button class="drawer__close" @click=${this._close} aria-label="Close" part="close">
170
+ <svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor">
171
+ <path d="M3.72 3.72a.75.75 0 011.06 0L8 6.94l3.22-3.22a.75.75 0 111.06 1.06L9.06 8l3.22 3.22a.75.75 0 11-1.06 1.06L8 9.06l-3.22 3.22a.75.75 0 01-1.06-1.06L6.94 8 3.72 4.78a.75.75 0 010-1.06z"/>
172
+ </svg>
173
+ </button>
174
+ </div>
175
+ <div class="drawer__body" part="body">
176
+ <slot></slot>
177
+ </div>
178
+ </aside>
179
+ `;
180
+ }
181
+ }
182
+
183
+ customElements.define('arc-drawer', ArcDrawer);
@@ -0,0 +1,99 @@
1
+ import { LitElement, html, css } from 'lit';
2
+ import { tokenStyles } from '../shared-styles.js';
3
+
4
+ export class ArcFooter extends LitElement {
5
+ static properties = {
6
+ compact: { type: Boolean, reflect: true },
7
+ border: { type: Boolean, reflect: true },
8
+ };
9
+
10
+ static styles = [
11
+ tokenStyles,
12
+ css`
13
+ :host {
14
+ display: block;
15
+ background: var(--bg-deep);
16
+ color: var(--text-secondary);
17
+ font-family: var(--font-body);
18
+ font-size: var(--body-size);
19
+ }
20
+
21
+ :host([border]) .footer {
22
+ border-top: 1px solid var(--border-subtle);
23
+ }
24
+
25
+ .footer {
26
+ padding: var(--space-2xl) var(--space-xl) var(--space-xl);
27
+ }
28
+
29
+ :host([compact]) .footer {
30
+ padding: var(--space-lg) var(--space-md) var(--space-md);
31
+ }
32
+
33
+ .footer__brand {
34
+ margin-bottom: var(--space-xl);
35
+ }
36
+
37
+ :host([compact]) .footer__brand {
38
+ margin-bottom: var(--space-md);
39
+ }
40
+
41
+ .footer__columns {
42
+ display: grid;
43
+ grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
44
+ gap: var(--space-xl);
45
+ margin-bottom: var(--space-xl);
46
+ }
47
+
48
+ :host([compact]) .footer__columns {
49
+ gap: var(--space-md);
50
+ margin-bottom: var(--space-md);
51
+ }
52
+
53
+ .footer__social {
54
+ display: flex;
55
+ align-items: center;
56
+ gap: var(--space-md);
57
+ margin-bottom: var(--space-lg);
58
+ }
59
+
60
+ :host([compact]) .footer__social {
61
+ margin-bottom: var(--space-sm);
62
+ }
63
+
64
+ .footer__legal {
65
+ padding-top: var(--space-md);
66
+ border-top: 1px solid var(--border-subtle);
67
+ color: var(--text-muted);
68
+ font-size: var(--text-sm);
69
+ }
70
+ `,
71
+ ];
72
+
73
+ constructor() {
74
+ super();
75
+ this.compact = false;
76
+ this.border = true;
77
+ }
78
+
79
+ render() {
80
+ return html`
81
+ <footer class="footer" part="base">
82
+ <div class="footer__brand" part="brand">
83
+ <slot name="logo"></slot>
84
+ </div>
85
+ <div class="footer__columns" part="columns">
86
+ <slot></slot>
87
+ </div>
88
+ <div class="footer__social" part="social">
89
+ <slot name="social"></slot>
90
+ </div>
91
+ <div class="footer__legal" part="legal">
92
+ <slot name="legal"></slot>
93
+ </div>
94
+ </footer>
95
+ `;
96
+ }
97
+ }
98
+
99
+ customElements.define('arc-footer', ArcFooter);
@@ -0,0 +1,22 @@
1
+ // ARC UI — Navigation tier
2
+ // Navigation, routing, and menu components
3
+
4
+ export { ArcBreadcrumb } from './breadcrumb.js';
5
+ export { ArcBreadcrumbItem } from './breadcrumb-item.js';
6
+ export { ArcDrawer } from './drawer.js';
7
+ export { ArcFooter } from './footer.js';
8
+ export { ArcLink } from './link.js';
9
+ export { ArcNavItem } from './nav-item.js';
10
+ export { ArcNavigationMenu } from './navigation-menu.js';
11
+ export { ArcPagination } from './pagination.js';
12
+ export { ArcScrollSpy } from './scroll-spy.js';
13
+ export { ArcScrollToTop } from './scroll-to-top.js';
14
+ export { ArcSidebar } from './sidebar.js';
15
+ export { ArcSidebarLink } from './sidebar-link.js';
16
+ export { ArcSidebarSection } from './sidebar-section.js';
17
+ export { ArcSpyLink } from './spy-link.js';
18
+ export { ArcTab } from './tab.js';
19
+ export { ArcTabs } from './tabs.js';
20
+ export { ArcTopBar } from './top-bar.js';
21
+ export { ArcTreeItem } from './tree-item.js';
22
+ export { ArcTreeView } from './tree-view.js';
@@ -0,0 +1,120 @@
1
+ import { LitElement, html, css } from 'lit';
2
+ import { tokenStyles } from '../shared-styles.js';
3
+
4
+ export class ArcLink extends LitElement {
5
+ static properties = {
6
+ href: { type: String },
7
+ variant: { type: String, reflect: true },
8
+ active: { type: Boolean, reflect: true },
9
+ external: { type: Boolean },
10
+ };
11
+
12
+ static styles = [
13
+ tokenStyles,
14
+ css`
15
+ :host { display: inline; }
16
+
17
+ .link {
18
+ font-family: var(--font-body);
19
+ font-size: inherit;
20
+ color: var(--accent-primary);
21
+ text-decoration: none;
22
+ cursor: pointer;
23
+ transition:
24
+ color var(--transition-fast),
25
+ opacity var(--transition-fast);
26
+ border: none;
27
+ background: none;
28
+ padding: 0;
29
+ min-height: var(--touch-min);
30
+ display: inline-flex;
31
+ align-items: center;
32
+ }
33
+
34
+ .link:hover {
35
+ text-decoration: underline;
36
+ text-underline-offset: 3px;
37
+ }
38
+
39
+ :host([variant="muted"]) .link {
40
+ color: var(--text-muted);
41
+ }
42
+ :host([variant="muted"]) .link:hover {
43
+ color: var(--text-primary);
44
+ }
45
+
46
+ :host([variant="nav"]) .link {
47
+ color: var(--text-secondary);
48
+ font-size: var(--text-sm);
49
+ display: inline-flex;
50
+ align-items: center;
51
+ gap: var(--space-xs);
52
+ }
53
+ :host([variant="nav"]) .link:hover {
54
+ color: var(--text-primary);
55
+ text-decoration: none;
56
+ }
57
+
58
+ :host([active]) .link {
59
+ color: var(--accent-primary);
60
+ }
61
+
62
+ .link:focus-visible {
63
+ outline: none;
64
+ box-shadow: var(--focus-ring);
65
+ border-radius: var(--radius-xs);
66
+ }
67
+
68
+ .link__external-icon {
69
+ display: inline-block;
70
+ width: 12px;
71
+ height: 12px;
72
+ margin-left: 2px; /* cosmetic micro-spacing for external icon */
73
+ vertical-align: middle;
74
+ opacity: 0.6;
75
+ }
76
+
77
+ @media (prefers-reduced-motion: reduce) {
78
+ :host *,
79
+ :host *::before,
80
+ :host *::after {
81
+ animation-duration: 0.01ms !important;
82
+ animation-iteration-count: 1 !important;
83
+ transition-duration: 0.01ms !important;
84
+ }
85
+ }
86
+ `,
87
+ ];
88
+
89
+ constructor() {
90
+ super();
91
+ this.href = '';
92
+ this.variant = 'default';
93
+ this.active = false;
94
+ this.external = false;
95
+ }
96
+
97
+ render() {
98
+ const target = this.external ? '_blank' : undefined;
99
+ const rel = this.external ? 'noopener noreferrer' : undefined;
100
+
101
+ return html`
102
+ <a
103
+ class="link"
104
+ href=${this.href}
105
+ target=${target || ''}
106
+ rel=${rel || ''}
107
+ part="link"
108
+ >
109
+ <slot></slot>
110
+ ${this.external ? html`
111
+ <svg class="link__external-icon" viewBox="0 0 16 16" fill="currentColor">
112
+ <path d="M3.75 2A1.75 1.75 0 002 3.75v8.5c0 .966.784 1.75 1.75 1.75h8.5A1.75 1.75 0 0014 12.25v-3.5a.75.75 0 00-1.5 0v3.5a.25.25 0 01-.25.25h-8.5a.25.25 0 01-.25-.25v-8.5a.25.25 0 01.25-.25h3.5a.75.75 0 000-1.5h-3.5zm6.75 0a.75.75 0 000 1.5h1.94L8.22 7.72a.75.75 0 001.06 1.06l4.22-4.22v1.94a.75.75 0 001.5 0V2.75a.75.75 0 00-.75-.75h-4.5z"/>
113
+ </svg>
114
+ ` : ''}
115
+ </a>
116
+ `;
117
+ }
118
+ }
119
+
120
+ customElements.define('arc-link', ArcLink);
@@ -0,0 +1,46 @@
1
+ import { LitElement, html, css } from 'lit';
2
+
3
+ /**
4
+ * @arc-prism interactive — nav item, child of arc-navigation-menu
5
+ */
6
+ export class ArcNavItem extends LitElement {
7
+ static properties = {
8
+ href: { type: String, reflect: true },
9
+ active: { type: Boolean, reflect: true },
10
+ description: { type: String },
11
+ };
12
+
13
+ static styles = css`
14
+ :host { display: contents; }
15
+ `;
16
+
17
+ constructor() {
18
+ super();
19
+ this.href = '';
20
+ this.active = false;
21
+ this.description = '';
22
+ }
23
+
24
+ get label() {
25
+ return [...this.childNodes]
26
+ .filter(n => n.nodeType === Node.TEXT_NODE)
27
+ .map(n => n.textContent.trim())
28
+ .filter(Boolean)
29
+ .join(' ');
30
+ }
31
+
32
+ /** Nested arc-nav-item children for dropdown menus */
33
+ get children() {
34
+ return [...this.querySelectorAll(':scope > arc-nav-item')];
35
+ }
36
+
37
+ get hasChildren() {
38
+ return this.children.length > 0;
39
+ }
40
+
41
+ render() {
42
+ return html`<slot></slot>`;
43
+ }
44
+ }
45
+
46
+ customElements.define('arc-nav-item', ArcNavItem);