@arclux/arc-ui 1.4.0 → 1.5.1
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/package.json +1 -1
- package/src/content/accordion.js +3 -0
- package/src/content/avatar.js +35 -4
- package/src/content/badge.js +6 -0
- package/src/content/callout.js +50 -1
- package/src/content/card.js +16 -5
- package/src/content/data-table.js +2 -2
- package/src/content/divider.js +40 -2
- package/src/content/skeleton.js +20 -9
- package/src/content/stat.js +35 -2
- package/src/content/tag.js +6 -0
- package/src/feedback/alert.js +9 -1
- package/src/feedback/modal.js +19 -4
- package/src/feedback/progress.js +23 -1
- package/src/feedback/toast.js +31 -3
- package/src/input/button.js +26 -3
- package/src/input/checkbox.js +10 -0
- package/src/input/file-upload.js +1 -1
- package/src/input/form.js +2 -2
- package/src/input/input.js +31 -3
- package/src/input/radio-group.js +10 -0
- package/src/input/select.js +31 -1
- package/src/input/textarea.js +28 -6
- package/src/input/toggle.js +11 -0
- package/src/layout/container.js +16 -4
- package/src/navigation/breadcrumb.js +4 -2
- package/src/navigation/footer.js +9 -1
- package/src/navigation/link.js +15 -4
- package/src/navigation/navigation-menu.js +29 -4
- package/src/navigation/pagination.js +35 -24
- package/src/navigation/scroll-to-top.js +1 -1
- package/src/navigation/sidebar.js +19 -1
- package/src/navigation/tabs.js +30 -1
- package/src/navigation/top-bar.js +9 -1
- package/src/shared-styles.js +6 -0
|
@@ -6,6 +6,7 @@ export class ArcPagination extends LitElement {
|
|
|
6
6
|
total: { type: Number },
|
|
7
7
|
current: { type: Number, reflect: true },
|
|
8
8
|
siblings: { type: Number },
|
|
9
|
+
compact: { type: Boolean, reflect: true },
|
|
9
10
|
};
|
|
10
11
|
|
|
11
12
|
static styles = [
|
|
@@ -61,6 +62,15 @@ export class ArcPagination extends LitElement {
|
|
|
61
62
|
box-shadow: 0 0 12px rgba(var(--accent-primary-rgb), 0.4);
|
|
62
63
|
}
|
|
63
64
|
|
|
65
|
+
/* Compact: show current/total between prev/next */
|
|
66
|
+
.pagination__compact-label {
|
|
67
|
+
font-family: var(--font-mono);
|
|
68
|
+
font-size: var(--text-sm);
|
|
69
|
+
color: var(--text-muted);
|
|
70
|
+
padding: 0 var(--space-sm);
|
|
71
|
+
white-space: nowrap;
|
|
72
|
+
}
|
|
73
|
+
|
|
64
74
|
.pagination__ellipsis {
|
|
65
75
|
display: inline-flex;
|
|
66
76
|
align-items: center;
|
|
@@ -89,6 +99,7 @@ export class ArcPagination extends LitElement {
|
|
|
89
99
|
this.total = 1;
|
|
90
100
|
this.current = 1;
|
|
91
101
|
this.siblings = 1;
|
|
102
|
+
this.compact = false;
|
|
92
103
|
}
|
|
93
104
|
|
|
94
105
|
_getPageRange() {
|
|
@@ -138,21 +149,32 @@ export class ArcPagination extends LitElement {
|
|
|
138
149
|
|
|
139
150
|
render() {
|
|
140
151
|
const pages = this._getPageRange();
|
|
152
|
+
const prevBtn = html`
|
|
153
|
+
<button class="pagination__btn" @click=${this._prev} ?disabled=${this.current <= 1} aria-label="Previous page" part="prev">
|
|
154
|
+
<svg width="14" height="14" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true">
|
|
155
|
+
<path d="M10.78 3.22a.75.75 0 010 1.06L7.06 8l3.72 3.72a.75.75 0 11-1.06 1.06l-4.25-4.25a.75.75 0 010-1.06l4.25-4.25a.75.75 0 011.06 0z"/>
|
|
156
|
+
</svg>
|
|
157
|
+
</button>`;
|
|
158
|
+
const nextBtn = html`
|
|
159
|
+
<button class="pagination__btn" @click=${this._next} ?disabled=${this.current >= this.total} aria-label="Next page" part="next">
|
|
160
|
+
<svg width="14" height="14" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true">
|
|
161
|
+
<path d="M5.22 12.78a.75.75 0 010-1.06L8.94 8 5.22 4.28a.75.75 0 011.06-1.06l4.25 4.25a.75.75 0 010 1.06l-4.25 4.25a.75.75 0 01-1.06 0z"/>
|
|
162
|
+
</svg>
|
|
163
|
+
</button>`;
|
|
164
|
+
|
|
165
|
+
if (this.compact) {
|
|
166
|
+
return html`
|
|
167
|
+
<nav class="pagination" role="navigation" aria-label="Pagination" part="pagination">
|
|
168
|
+
${prevBtn}
|
|
169
|
+
<span class="pagination__compact-label" part="label">${this.current} / ${this.total}</span>
|
|
170
|
+
${nextBtn}
|
|
171
|
+
</nav>
|
|
172
|
+
`;
|
|
173
|
+
}
|
|
141
174
|
|
|
142
175
|
return html`
|
|
143
176
|
<nav class="pagination" role="navigation" aria-label="Pagination" part="pagination">
|
|
144
|
-
|
|
145
|
-
class="pagination__btn"
|
|
146
|
-
@click=${this._prev}
|
|
147
|
-
?disabled=${this.current <= 1}
|
|
148
|
-
aria-label="Previous page"
|
|
149
|
-
part="prev"
|
|
150
|
-
>
|
|
151
|
-
<svg width="14" height="14" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true">
|
|
152
|
-
<path d="M10.78 3.22a.75.75 0 010 1.06L7.06 8l3.72 3.72a.75.75 0 11-1.06 1.06l-4.25-4.25a.75.75 0 010-1.06l4.25-4.25a.75.75 0 011.06 0z"/>
|
|
153
|
-
</svg>
|
|
154
|
-
</button>
|
|
155
|
-
|
|
177
|
+
${prevBtn}
|
|
156
178
|
${pages.map(page =>
|
|
157
179
|
page === '...'
|
|
158
180
|
? html`<span class="pagination__ellipsis" part="ellipsis" aria-hidden="true">…</span>`
|
|
@@ -166,18 +188,7 @@ export class ArcPagination extends LitElement {
|
|
|
166
188
|
>${page}</button>
|
|
167
189
|
`
|
|
168
190
|
)}
|
|
169
|
-
|
|
170
|
-
<button
|
|
171
|
-
class="pagination__btn"
|
|
172
|
-
@click=${this._next}
|
|
173
|
-
?disabled=${this.current >= this.total}
|
|
174
|
-
aria-label="Next page"
|
|
175
|
-
part="next"
|
|
176
|
-
>
|
|
177
|
-
<svg width="14" height="14" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true">
|
|
178
|
-
<path d="M5.22 12.78a.75.75 0 010-1.06L8.94 8 5.22 4.28a.75.75 0 011.06-1.06l4.25 4.25a.75.75 0 010 1.06l-4.25 4.25a.75.75 0 01-1.06 0z"/>
|
|
179
|
-
</svg>
|
|
180
|
-
</button>
|
|
191
|
+
${nextBtn}
|
|
181
192
|
</nav>
|
|
182
193
|
`;
|
|
183
194
|
}
|
|
@@ -7,7 +7,7 @@ import { tokenStyles } from '../shared-styles.js';
|
|
|
7
7
|
export class ArcScrollToTop extends LitElement {
|
|
8
8
|
static properties = {
|
|
9
9
|
threshold: { type: Number },
|
|
10
|
-
smooth: { type: Boolean },
|
|
10
|
+
smooth: { type: Boolean, reflect: true },
|
|
11
11
|
position: { type: String, reflect: true },
|
|
12
12
|
offset: { type: String },
|
|
13
13
|
_visible: { state: true },
|
|
@@ -7,6 +7,7 @@ export class ArcSidebar extends LitElement {
|
|
|
7
7
|
static properties = {
|
|
8
8
|
active: { type: String, reflect: true },
|
|
9
9
|
collapsed: { type: Boolean, reflect: true },
|
|
10
|
+
position: { type: String, reflect: true },
|
|
10
11
|
width: { type: String },
|
|
11
12
|
glow: { type: Boolean, reflect: true },
|
|
12
13
|
_sections: { state: true },
|
|
@@ -55,7 +56,7 @@ export class ArcSidebar extends LitElement {
|
|
|
55
56
|
pointer-events: none;
|
|
56
57
|
}
|
|
57
58
|
|
|
58
|
-
/* Border line — solid default */
|
|
59
|
+
/* Border line — solid default (right edge) */
|
|
59
60
|
.sidebar::after {
|
|
60
61
|
content: '';
|
|
61
62
|
position: absolute;
|
|
@@ -66,6 +67,22 @@ export class ArcSidebar extends LitElement {
|
|
|
66
67
|
background: var(--border-subtle);
|
|
67
68
|
}
|
|
68
69
|
|
|
70
|
+
/* Right position — border on left edge */
|
|
71
|
+
:host([position="right"]) .sidebar::after {
|
|
72
|
+
right: auto;
|
|
73
|
+
left: 0;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
:host([position="right"][glow]) .sidebar::before {
|
|
77
|
+
right: auto;
|
|
78
|
+
left: 0;
|
|
79
|
+
background: radial-gradient(
|
|
80
|
+
ellipse at 0% 10%,
|
|
81
|
+
rgba(var(--accent-primary-rgb), 0.03),
|
|
82
|
+
transparent 60%
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
|
|
69
86
|
/* Glow border variant */
|
|
70
87
|
:host([glow]) .sidebar::after {
|
|
71
88
|
background: var(--glow-line-blue);
|
|
@@ -247,6 +264,7 @@ export class ArcSidebar extends LitElement {
|
|
|
247
264
|
super();
|
|
248
265
|
this.active = '';
|
|
249
266
|
this.collapsed = false;
|
|
267
|
+
this.position = 'left';
|
|
250
268
|
this.width = '260px';
|
|
251
269
|
this.glow = false;
|
|
252
270
|
this._sections = [];
|
package/src/navigation/tabs.js
CHANGED
|
@@ -7,6 +7,8 @@ export class ArcTabs extends LitElement {
|
|
|
7
7
|
/** @deprecated Use <arc-tab> children instead */
|
|
8
8
|
items: { type: Array },
|
|
9
9
|
selected: { type: Number, reflect: true },
|
|
10
|
+
align: { type: String, reflect: true },
|
|
11
|
+
variant: { type: String, reflect: true },
|
|
10
12
|
_tabs: { state: true },
|
|
11
13
|
};
|
|
12
14
|
|
|
@@ -23,6 +25,10 @@ export class ArcTabs extends LitElement {
|
|
|
23
25
|
overflow-y: hidden;
|
|
24
26
|
}
|
|
25
27
|
|
|
28
|
+
/* Alignment */
|
|
29
|
+
:host([align="center"]) .tabs__list { justify-content: center; }
|
|
30
|
+
:host([align="end"]) .tabs__list { justify-content: flex-end; }
|
|
31
|
+
|
|
26
32
|
.tabs__tab {
|
|
27
33
|
font-family: var(--font-accent);
|
|
28
34
|
font-weight: 600;
|
|
@@ -37,7 +43,7 @@ export class ArcTabs extends LitElement {
|
|
|
37
43
|
cursor: pointer;
|
|
38
44
|
border-bottom: 2px solid transparent;
|
|
39
45
|
margin-bottom: -1px;
|
|
40
|
-
transition: color var(--transition-fast), border-color var(--transition-fast);
|
|
46
|
+
transition: color var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
|
|
41
47
|
white-space: nowrap;
|
|
42
48
|
}
|
|
43
49
|
|
|
@@ -46,6 +52,27 @@ export class ArcTabs extends LitElement {
|
|
|
46
52
|
color: var(--accent-primary);
|
|
47
53
|
border-bottom-color: var(--accent-primary);
|
|
48
54
|
}
|
|
55
|
+
|
|
56
|
+
/* Pills variant */
|
|
57
|
+
:host([variant="pills"]) .tabs__list {
|
|
58
|
+
border-bottom: none;
|
|
59
|
+
gap: var(--space-xs);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
:host([variant="pills"]) .tabs__tab {
|
|
63
|
+
border-bottom: none;
|
|
64
|
+
margin-bottom: 0;
|
|
65
|
+
border-radius: var(--radius-sm);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
:host([variant="pills"]) .tabs__tab:hover {
|
|
69
|
+
background: rgba(255, 255, 255, 0.08);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
:host([variant="pills"]) .tabs__tab[aria-selected="true"] {
|
|
73
|
+
background: rgba(var(--accent-primary-rgb), 0.1);
|
|
74
|
+
color: var(--accent-primary);
|
|
75
|
+
}
|
|
49
76
|
.tabs__tab:focus-visible {
|
|
50
77
|
outline: none;
|
|
51
78
|
box-shadow: var(--focus-ring);
|
|
@@ -82,6 +109,8 @@ export class ArcTabs extends LitElement {
|
|
|
82
109
|
super();
|
|
83
110
|
this.items = [];
|
|
84
111
|
this.selected = 0;
|
|
112
|
+
this.align = 'start';
|
|
113
|
+
this.variant = 'underline';
|
|
85
114
|
this._tabs = [];
|
|
86
115
|
}
|
|
87
116
|
|
|
@@ -11,6 +11,7 @@ export class ArcTopBar extends LitElement {
|
|
|
11
11
|
menuOpen: { type: Boolean, attribute: 'menu-open', reflect: true },
|
|
12
12
|
mobileMenu: { type: String, attribute: 'mobile-menu' },
|
|
13
13
|
menuPosition: { type: String, attribute: 'menu-position' },
|
|
14
|
+
navAlign: { type: String, attribute: 'nav-align' },
|
|
14
15
|
};
|
|
15
16
|
|
|
16
17
|
static styles = [
|
|
@@ -185,6 +186,7 @@ export class ArcTopBar extends LitElement {
|
|
|
185
186
|
this.menuOpen = false;
|
|
186
187
|
this.mobileMenu = 'sidebar';
|
|
187
188
|
this.menuPosition = 'left';
|
|
189
|
+
this.navAlign = 'center';
|
|
188
190
|
this._onExternalToggle = this._onExternalToggle.bind(this);
|
|
189
191
|
this._onScroll = this._onScroll.bind(this);
|
|
190
192
|
}
|
|
@@ -212,6 +214,12 @@ export class ArcTopBar extends LitElement {
|
|
|
212
214
|
this.menuOpen = e.detail?.value ?? !this.menuOpen;
|
|
213
215
|
}
|
|
214
216
|
|
|
217
|
+
get _navJustify() {
|
|
218
|
+
if (this.navAlign === 'left') return 'flex-start';
|
|
219
|
+
if (this.navAlign === 'right') return 'flex-end';
|
|
220
|
+
return 'center';
|
|
221
|
+
}
|
|
222
|
+
|
|
215
223
|
_toggleMenu() {
|
|
216
224
|
this.menuOpen = !this.menuOpen;
|
|
217
225
|
const eventName = this.mobileMenu === 'nav' ? 'arc-mobile-menu-toggle' : 'arc-toggle';
|
|
@@ -252,7 +260,7 @@ export class ArcTopBar extends LitElement {
|
|
|
252
260
|
${this.heading ? html`<span class="topbar__heading">${this.heading}</span>` : ''}
|
|
253
261
|
<slot name="subtitle"></slot>
|
|
254
262
|
</a>
|
|
255
|
-
<div class="topbar__center" part="center">
|
|
263
|
+
<div class="topbar__center" part="center" style="justify-content:${this._navJustify}">
|
|
256
264
|
<slot name="center"></slot>
|
|
257
265
|
</div>
|
|
258
266
|
<div class="topbar__actions" part="actions">
|
package/src/shared-styles.js
CHANGED
|
@@ -11,6 +11,12 @@ import { css } from 'lit';
|
|
|
11
11
|
* as fallback defaults.
|
|
12
12
|
*/
|
|
13
13
|
export const tokenStyles = css`
|
|
14
|
+
*, *::before, *::after {
|
|
15
|
+
margin: 0;
|
|
16
|
+
padding: 0;
|
|
17
|
+
box-sizing: border-box;
|
|
18
|
+
}
|
|
19
|
+
|
|
14
20
|
:host {
|
|
15
21
|
--font-body: 'Host Grotesk', system-ui, sans-serif;
|
|
16
22
|
--font-accent: 'Tektur', system-ui, sans-serif;
|