@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.
- package/LICENSE +21 -0
- package/README.md +64 -0
- package/package.json +186 -0
- package/src/content/accordion-item.js +27 -0
- package/src/content/accordion.js +151 -0
- package/src/content/animated-number.js +160 -0
- package/src/content/aspect-ratio.js +78 -0
- package/src/content/avatar-group.js +101 -0
- package/src/content/avatar.js +92 -0
- package/src/content/badge.js +98 -0
- package/src/content/callout.js +141 -0
- package/src/content/card.js +75 -0
- package/src/content/carousel.js +300 -0
- package/src/content/code-block.js +152 -0
- package/src/content/collapsible.js +142 -0
- package/src/content/color-swatch.js +86 -0
- package/src/content/column.js +28 -0
- package/src/content/data-table.js +332 -0
- package/src/content/divider.js +153 -0
- package/src/content/empty-state.js +78 -0
- package/src/content/feature-card.js +142 -0
- package/src/content/highlight.js +63 -0
- package/src/content/icon-library.js +30 -0
- package/src/content/icon-registry.js +39 -0
- package/src/content/icon.js +95 -0
- package/src/content/index.js +44 -0
- package/src/content/infinite-scroll.js +144 -0
- package/src/content/kbd.js +40 -0
- package/src/content/markdown.js +294 -0
- package/src/content/marquee.js +166 -0
- package/src/content/meter.js +167 -0
- package/src/content/scroll-area.js +107 -0
- package/src/content/skeleton.js +85 -0
- package/src/content/spinner.js +77 -0
- package/src/content/stack.js +68 -0
- package/src/content/stat.js +72 -0
- package/src/content/step.js +22 -0
- package/src/content/stepper.js +202 -0
- package/src/content/table.js +134 -0
- package/src/content/tag.js +156 -0
- package/src/content/text.js +111 -0
- package/src/content/timeline-item.js +29 -0
- package/src/content/timeline.js +170 -0
- package/src/content/truncate.js +161 -0
- package/src/content/value-card.js +94 -0
- package/src/feedback/alert.js +187 -0
- package/src/feedback/command-item.js +28 -0
- package/src/feedback/command-palette.js +346 -0
- package/src/feedback/context-menu.js +299 -0
- package/src/feedback/dialog.js +298 -0
- package/src/feedback/dropdown-menu.js +259 -0
- package/src/feedback/hover-card.js +186 -0
- package/src/feedback/index.js +17 -0
- package/src/feedback/modal.js +226 -0
- package/src/feedback/notification-panel.js +196 -0
- package/src/feedback/popover.js +184 -0
- package/src/feedback/progress.js +169 -0
- package/src/feedback/sheet.js +249 -0
- package/src/feedback/toast.js +207 -0
- package/src/feedback/tooltip.js +189 -0
- package/src/icons/lucide.d.ts +1915 -0
- package/src/icons/lucide.js +1915 -0
- package/src/icons/phosphor.d.ts +1517 -0
- package/src/icons/phosphor.js +1517 -0
- package/src/icons/types.d.ts +8 -0
- package/src/index.js +9 -0
- package/src/input/button.js +127 -0
- package/src/input/calendar.js +340 -0
- package/src/input/checkbox.js +159 -0
- package/src/input/chip.js +120 -0
- package/src/input/color-picker.js +461 -0
- package/src/input/combobox.js +295 -0
- package/src/input/copy-button.js +144 -0
- package/src/input/date-picker.js +534 -0
- package/src/input/file-upload.js +333 -0
- package/src/input/form.js +179 -0
- package/src/input/icon-button.js +179 -0
- package/src/input/index.js +31 -0
- package/src/input/input.js +158 -0
- package/src/input/multi-select.js +392 -0
- package/src/input/number-input.js +239 -0
- package/src/input/otp-input.js +221 -0
- package/src/input/pin-input.js +294 -0
- package/src/input/radio-group.js +177 -0
- package/src/input/radio.js +28 -0
- package/src/input/rating.js +195 -0
- package/src/input/search.js +371 -0
- package/src/input/segmented-control.js +174 -0
- package/src/input/select.js +267 -0
- package/src/input/slider.js +217 -0
- package/src/input/sortable-list.js +345 -0
- package/src/input/suggestion.js +26 -0
- package/src/input/textarea.js +203 -0
- package/src/input/theme-toggle.js +196 -0
- package/src/input/toggle.js +166 -0
- package/src/layout/app-shell.js +266 -0
- package/src/layout/auth-shell.js +153 -0
- package/src/layout/container.js +37 -0
- package/src/layout/dashboard-grid.js +62 -0
- package/src/layout/index.js +15 -0
- package/src/layout/page-header.js +100 -0
- package/src/layout/page-layout.js +112 -0
- package/src/layout/resizable.js +221 -0
- package/src/layout/section.js +54 -0
- package/src/layout/settings-layout.js +91 -0
- package/src/layout/split-pane.js +172 -0
- package/src/layout/status-bar.js +84 -0
- package/src/layout/toolbar.js +92 -0
- package/src/navigation/breadcrumb-item.js +26 -0
- package/src/navigation/breadcrumb.js +129 -0
- package/src/navigation/drawer.js +183 -0
- package/src/navigation/footer.js +99 -0
- package/src/navigation/index.js +22 -0
- package/src/navigation/link.js +120 -0
- package/src/navigation/nav-item.js +46 -0
- package/src/navigation/navigation-menu.js +687 -0
- package/src/navigation/pagination.js +186 -0
- package/src/navigation/scroll-spy.js +198 -0
- package/src/navigation/scroll-to-top.js +163 -0
- package/src/navigation/sidebar-link.js +28 -0
- package/src/navigation/sidebar-section.js +45 -0
- package/src/navigation/sidebar.js +336 -0
- package/src/navigation/spy-link.js +26 -0
- package/src/navigation/tab.js +26 -0
- package/src/navigation/tabs.js +202 -0
- package/src/navigation/top-bar.js +263 -0
- package/src/navigation/tree-item.js +38 -0
- package/src/navigation/tree-view.js +255 -0
- package/src/shared/index.js +6 -0
- package/src/shared/menu-divider.js +9 -0
- package/src/shared/menu-item.js +30 -0
- package/src/shared/option.js +31 -0
- package/src/shared-styles.js +81 -0
- package/src/tokens.js +445 -0
- package/types/index.d.ts +973 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { LitElement, html, css } from 'lit';
|
|
2
|
+
import { tokenStyles } from '../shared-styles.js';
|
|
3
|
+
|
|
4
|
+
export class ArcSection extends LitElement {
|
|
5
|
+
static properties = {
|
|
6
|
+
label: { type: String },
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
static styles = [
|
|
10
|
+
tokenStyles,
|
|
11
|
+
css`
|
|
12
|
+
:host { display: block; }
|
|
13
|
+
|
|
14
|
+
.section {
|
|
15
|
+
width: 100%;
|
|
16
|
+
max-width: var(--max-width);
|
|
17
|
+
margin-inline: auto;
|
|
18
|
+
padding: var(--space-3xl) var(--space-lg);
|
|
19
|
+
scroll-margin-top: var(--space-md);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
@media (max-width: 768px) {
|
|
23
|
+
.section { padding: var(--space-2xl) var(--space-md); }
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.section__label {
|
|
27
|
+
display: block;
|
|
28
|
+
font-family: var(--font-accent);
|
|
29
|
+
font-weight: var(--section-title-weight);
|
|
30
|
+
font-size: var(--section-title-size);
|
|
31
|
+
letter-spacing: var(--section-title-spacing);
|
|
32
|
+
text-transform: uppercase;
|
|
33
|
+
color: var(--text-muted);
|
|
34
|
+
margin-bottom: var(--space-lg);
|
|
35
|
+
}
|
|
36
|
+
`,
|
|
37
|
+
];
|
|
38
|
+
|
|
39
|
+
constructor() {
|
|
40
|
+
super();
|
|
41
|
+
this.label = '';
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
render() {
|
|
45
|
+
return html`
|
|
46
|
+
<section class="section" part="section">
|
|
47
|
+
${this.label ? html`<span class="section__label" part="label">${this.label}</span>` : ''}
|
|
48
|
+
<slot></slot>
|
|
49
|
+
</section>
|
|
50
|
+
`;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
customElements.define('arc-section', ArcSection);
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { LitElement, html, css } from 'lit';
|
|
2
|
+
import { tokenStyles } from '../shared-styles.js';
|
|
3
|
+
|
|
4
|
+
export class ArcSettingsLayout extends LitElement {
|
|
5
|
+
static properties = {
|
|
6
|
+
navPosition: { type: String, reflect: true, attribute: 'nav-position' },
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
static styles = [
|
|
10
|
+
tokenStyles,
|
|
11
|
+
css`
|
|
12
|
+
:host {
|
|
13
|
+
display: block;
|
|
14
|
+
box-sizing: border-box;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/* Left nav layout */
|
|
18
|
+
.settings-layout--left {
|
|
19
|
+
display: grid;
|
|
20
|
+
grid-template-columns: 220px 1fr;
|
|
21
|
+
min-height: 100%;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.settings-layout--left .nav {
|
|
25
|
+
padding: var(--space-lg);
|
|
26
|
+
background: var(--bg-card);
|
|
27
|
+
border-right: 1px solid var(--border-subtle);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.settings-layout--left .content {
|
|
31
|
+
padding: var(--space-xl);
|
|
32
|
+
flex: 1;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/* Top nav layout */
|
|
36
|
+
.settings-layout--top {
|
|
37
|
+
display: flex;
|
|
38
|
+
flex-direction: column;
|
|
39
|
+
min-height: 100%;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.settings-layout--top .nav {
|
|
43
|
+
padding: var(--space-lg);
|
|
44
|
+
background: var(--bg-card);
|
|
45
|
+
border-bottom: 1px solid var(--border-subtle);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.settings-layout--top .content {
|
|
49
|
+
padding: var(--space-xl);
|
|
50
|
+
flex: 1;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
@media (max-width: 768px) {
|
|
54
|
+
.settings-layout--left {
|
|
55
|
+
display: flex;
|
|
56
|
+
flex-direction: column;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.settings-layout--left .nav {
|
|
60
|
+
border-right: none;
|
|
61
|
+
border-bottom: 1px solid var(--border-subtle);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
`,
|
|
65
|
+
];
|
|
66
|
+
|
|
67
|
+
constructor() {
|
|
68
|
+
super();
|
|
69
|
+
this.navPosition = 'left';
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
render() {
|
|
73
|
+
const layoutClass =
|
|
74
|
+
this.navPosition === 'top'
|
|
75
|
+
? 'settings-layout--top'
|
|
76
|
+
: 'settings-layout--left';
|
|
77
|
+
|
|
78
|
+
return html`
|
|
79
|
+
<div class="${layoutClass}" part="layout">
|
|
80
|
+
<div class="nav" part="nav">
|
|
81
|
+
<slot name="nav"></slot>
|
|
82
|
+
</div>
|
|
83
|
+
<div class="content" part="content">
|
|
84
|
+
<slot></slot>
|
|
85
|
+
</div>
|
|
86
|
+
</div>
|
|
87
|
+
`;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
customElements.define('arc-settings-layout', ArcSettingsLayout);
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { LitElement, html, css } from 'lit';
|
|
2
|
+
import { tokenStyles } from '../shared-styles.js';
|
|
3
|
+
|
|
4
|
+
export class ArcSplitPane extends LitElement {
|
|
5
|
+
static properties = {
|
|
6
|
+
orientation: { type: String, reflect: true },
|
|
7
|
+
ratio: { type: Number },
|
|
8
|
+
minRatio: { type: Number, attribute: 'min-ratio' },
|
|
9
|
+
maxRatio: { type: Number, attribute: 'max-ratio' },
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
static styles = [
|
|
13
|
+
tokenStyles,
|
|
14
|
+
css`
|
|
15
|
+
:host {
|
|
16
|
+
display: block;
|
|
17
|
+
height: 100%;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.split-pane {
|
|
21
|
+
display: flex;
|
|
22
|
+
height: 100%;
|
|
23
|
+
width: 100%;
|
|
24
|
+
overflow: hidden;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
:host([orientation='vertical']) .split-pane {
|
|
28
|
+
flex-direction: column;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.split-pane__primary,
|
|
32
|
+
.split-pane__secondary {
|
|
33
|
+
overflow: auto;
|
|
34
|
+
min-width: 0;
|
|
35
|
+
min-height: 0;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.split-pane__secondary {
|
|
39
|
+
flex: 1;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.split-pane__handle {
|
|
43
|
+
flex-shrink: 0;
|
|
44
|
+
background: var(--border-subtle);
|
|
45
|
+
transition: background 0.15s ease;
|
|
46
|
+
user-select: none;
|
|
47
|
+
touch-action: none;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.split-pane__handle:hover,
|
|
51
|
+
.split-pane__handle--dragging {
|
|
52
|
+
background: var(--border-bright);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
:host([orientation='horizontal']) .split-pane__handle {
|
|
56
|
+
width: 4px;
|
|
57
|
+
cursor: col-resize;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
:host([orientation='vertical']) .split-pane__handle {
|
|
61
|
+
height: 4px;
|
|
62
|
+
cursor: row-resize;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
:host .split-pane--dragging {
|
|
66
|
+
user-select: none;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
@media (prefers-reduced-motion: reduce) {
|
|
70
|
+
:host *,
|
|
71
|
+
:host *::before,
|
|
72
|
+
:host *::after {
|
|
73
|
+
animation-duration: 0.01ms !important;
|
|
74
|
+
animation-iteration-count: 1 !important;
|
|
75
|
+
transition-duration: 0.01ms !important;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
`,
|
|
79
|
+
];
|
|
80
|
+
|
|
81
|
+
constructor() {
|
|
82
|
+
super();
|
|
83
|
+
this.orientation = 'horizontal';
|
|
84
|
+
this.ratio = 0.5;
|
|
85
|
+
this.minRatio = 0.15;
|
|
86
|
+
this.maxRatio = 0.85;
|
|
87
|
+
this._dragging = false;
|
|
88
|
+
this._containerEl = null;
|
|
89
|
+
this._onMouseMove = this._onMouseMove.bind(this);
|
|
90
|
+
this._onMouseUp = this._onMouseUp.bind(this);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
_onMouseDown(e) {
|
|
94
|
+
e.preventDefault();
|
|
95
|
+
this._dragging = true;
|
|
96
|
+
this._containerEl = this.shadowRoot.querySelector('.split-pane');
|
|
97
|
+
window.addEventListener('mousemove', this._onMouseMove);
|
|
98
|
+
window.addEventListener('mouseup', this._onMouseUp);
|
|
99
|
+
this.requestUpdate();
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
_onMouseMove(e) {
|
|
103
|
+
if (!this._dragging) return;
|
|
104
|
+
|
|
105
|
+
const container = this._containerEl;
|
|
106
|
+
if (!container) return;
|
|
107
|
+
const rect = container.getBoundingClientRect();
|
|
108
|
+
let newRatio;
|
|
109
|
+
|
|
110
|
+
if (this.orientation === 'horizontal') {
|
|
111
|
+
newRatio = (e.clientX - rect.left) / rect.width;
|
|
112
|
+
} else {
|
|
113
|
+
newRatio = (e.clientY - rect.top) / rect.height;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
newRatio = Math.max(this.minRatio, Math.min(this.maxRatio, newRatio));
|
|
117
|
+
this.ratio = newRatio;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
_onMouseUp() {
|
|
121
|
+
if (!this._dragging) return;
|
|
122
|
+
this._dragging = false;
|
|
123
|
+
this._containerEl = null;
|
|
124
|
+
window.removeEventListener('mousemove', this._onMouseMove);
|
|
125
|
+
window.removeEventListener('mouseup', this._onMouseUp);
|
|
126
|
+
this.requestUpdate();
|
|
127
|
+
|
|
128
|
+
this.dispatchEvent(
|
|
129
|
+
new CustomEvent('arc-resize', {
|
|
130
|
+
detail: { ratio: this.ratio },
|
|
131
|
+
bubbles: true,
|
|
132
|
+
composed: true,
|
|
133
|
+
})
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
disconnectedCallback() {
|
|
138
|
+
super.disconnectedCallback();
|
|
139
|
+
window.removeEventListener('mousemove', this._onMouseMove);
|
|
140
|
+
window.removeEventListener('mouseup', this._onMouseUp);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
render() {
|
|
144
|
+
const primarySize = `${this.ratio * 100}%`;
|
|
145
|
+
const draggingClass = this._dragging ? 'split-pane--dragging' : '';
|
|
146
|
+
const handleDragging = this._dragging ? 'split-pane__handle--dragging' : '';
|
|
147
|
+
|
|
148
|
+
return html`
|
|
149
|
+
<div class="split-pane ${draggingClass}" part="base">
|
|
150
|
+
<div
|
|
151
|
+
class="split-pane__primary"
|
|
152
|
+
part="primary"
|
|
153
|
+
style="${this.orientation === 'horizontal'
|
|
154
|
+
? `width: ${primarySize}`
|
|
155
|
+
: `height: ${primarySize}`}"
|
|
156
|
+
>
|
|
157
|
+
<slot name="primary"></slot>
|
|
158
|
+
</div>
|
|
159
|
+
<div
|
|
160
|
+
class="split-pane__handle ${handleDragging}"
|
|
161
|
+
part="handle"
|
|
162
|
+
@mousedown=${this._onMouseDown}
|
|
163
|
+
></div>
|
|
164
|
+
<div class="split-pane__secondary" part="secondary">
|
|
165
|
+
<slot name="secondary"></slot>
|
|
166
|
+
</div>
|
|
167
|
+
</div>
|
|
168
|
+
`;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
customElements.define('arc-split-pane', ArcSplitPane);
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { LitElement, html, css } from 'lit';
|
|
2
|
+
import { tokenStyles } from '../shared-styles.js';
|
|
3
|
+
|
|
4
|
+
export class ArcStatusBar extends LitElement {
|
|
5
|
+
static properties = {
|
|
6
|
+
position: { type: String, reflect: true },
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
static styles = [
|
|
10
|
+
tokenStyles,
|
|
11
|
+
css`
|
|
12
|
+
:host {
|
|
13
|
+
display: block;
|
|
14
|
+
font-family: var(--font-mono);
|
|
15
|
+
font-size: var(--text-sm);
|
|
16
|
+
color: var(--text-muted);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
:host([position='fixed']) {
|
|
20
|
+
position: fixed;
|
|
21
|
+
bottom: 0;
|
|
22
|
+
left: 0;
|
|
23
|
+
right: 0;
|
|
24
|
+
z-index: 100;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.status-bar {
|
|
28
|
+
display: flex;
|
|
29
|
+
align-items: center;
|
|
30
|
+
height: 28px;
|
|
31
|
+
padding: 0 var(--space-sm);
|
|
32
|
+
background: var(--bg-deep);
|
|
33
|
+
border-top: 1px solid var(--border-subtle);
|
|
34
|
+
gap: var(--space-sm);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.status-bar__left {
|
|
38
|
+
display: flex;
|
|
39
|
+
align-items: center;
|
|
40
|
+
gap: var(--space-sm);
|
|
41
|
+
flex-shrink: 0;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.status-bar__center {
|
|
45
|
+
display: flex;
|
|
46
|
+
align-items: center;
|
|
47
|
+
gap: var(--space-sm);
|
|
48
|
+
flex: 1;
|
|
49
|
+
justify-content: center;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.status-bar__right {
|
|
53
|
+
display: flex;
|
|
54
|
+
align-items: center;
|
|
55
|
+
gap: var(--space-sm);
|
|
56
|
+
flex-shrink: 0;
|
|
57
|
+
margin-left: auto;
|
|
58
|
+
}
|
|
59
|
+
`,
|
|
60
|
+
];
|
|
61
|
+
|
|
62
|
+
constructor() {
|
|
63
|
+
super();
|
|
64
|
+
this.position = 'static';
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
render() {
|
|
68
|
+
return html`
|
|
69
|
+
<div class="status-bar" part="base" role="status">
|
|
70
|
+
<div class="status-bar__left" part="left">
|
|
71
|
+
<slot name="left"></slot>
|
|
72
|
+
</div>
|
|
73
|
+
<div class="status-bar__center" part="center">
|
|
74
|
+
<slot></slot>
|
|
75
|
+
</div>
|
|
76
|
+
<div class="status-bar__right" part="right">
|
|
77
|
+
<slot name="right"></slot>
|
|
78
|
+
</div>
|
|
79
|
+
</div>
|
|
80
|
+
`;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
customElements.define('arc-status-bar', ArcStatusBar);
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { LitElement, html, css } from 'lit';
|
|
2
|
+
import { tokenStyles } from '../shared-styles.js';
|
|
3
|
+
|
|
4
|
+
export class ArcToolbar extends LitElement {
|
|
5
|
+
static properties = {
|
|
6
|
+
sticky: { type: Boolean, reflect: true },
|
|
7
|
+
size: { type: String, reflect: true },
|
|
8
|
+
border: { type: Boolean, reflect: true },
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
static styles = [
|
|
12
|
+
tokenStyles,
|
|
13
|
+
css`
|
|
14
|
+
:host {
|
|
15
|
+
display: block;
|
|
16
|
+
font-family: var(--font-body);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
:host([sticky]) {
|
|
20
|
+
position: sticky;
|
|
21
|
+
top: 0;
|
|
22
|
+
z-index: 50;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.toolbar {
|
|
26
|
+
display: flex;
|
|
27
|
+
align-items: center;
|
|
28
|
+
height: 48px;
|
|
29
|
+
padding: 0 var(--space-md);
|
|
30
|
+
background: var(--bg-card);
|
|
31
|
+
gap: var(--space-sm);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
:host([size='sm']) .toolbar {
|
|
35
|
+
height: 36px;
|
|
36
|
+
padding: 0 var(--space-sm);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
:host([border]) .toolbar {
|
|
40
|
+
border-bottom: 1px solid var(--border-subtle);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.toolbar__start {
|
|
44
|
+
display: flex;
|
|
45
|
+
align-items: center;
|
|
46
|
+
gap: var(--space-sm);
|
|
47
|
+
flex-shrink: 0;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.toolbar__center {
|
|
51
|
+
display: flex;
|
|
52
|
+
align-items: center;
|
|
53
|
+
gap: var(--space-sm);
|
|
54
|
+
flex: 1;
|
|
55
|
+
justify-content: center;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.toolbar__end {
|
|
59
|
+
display: flex;
|
|
60
|
+
align-items: center;
|
|
61
|
+
gap: var(--space-sm);
|
|
62
|
+
flex-shrink: 0;
|
|
63
|
+
margin-left: auto;
|
|
64
|
+
}
|
|
65
|
+
`,
|
|
66
|
+
];
|
|
67
|
+
|
|
68
|
+
constructor() {
|
|
69
|
+
super();
|
|
70
|
+
this.sticky = false;
|
|
71
|
+
this.size = 'md';
|
|
72
|
+
this.border = true;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
render() {
|
|
76
|
+
return html`
|
|
77
|
+
<div class="toolbar" part="base" role="toolbar">
|
|
78
|
+
<div class="toolbar__start" part="start">
|
|
79
|
+
<slot name="start"></slot>
|
|
80
|
+
</div>
|
|
81
|
+
<div class="toolbar__center" part="center">
|
|
82
|
+
<slot></slot>
|
|
83
|
+
</div>
|
|
84
|
+
<div class="toolbar__end" part="end">
|
|
85
|
+
<slot name="end"></slot>
|
|
86
|
+
</div>
|
|
87
|
+
</div>
|
|
88
|
+
`;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
customElements.define('arc-toolbar', ArcToolbar);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { LitElement, html, css } from 'lit';
|
|
2
|
+
|
|
3
|
+
export class ArcBreadcrumbItem extends LitElement {
|
|
4
|
+
static properties = {
|
|
5
|
+
href: { type: String, reflect: true },
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
static styles = css`
|
|
9
|
+
:host { display: none; }
|
|
10
|
+
`;
|
|
11
|
+
|
|
12
|
+
constructor() {
|
|
13
|
+
super();
|
|
14
|
+
this.href = '';
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
get label() {
|
|
18
|
+
return this.textContent.trim();
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
render() {
|
|
22
|
+
return html`<slot></slot>`;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
customElements.define('arc-breadcrumb-item', ArcBreadcrumbItem);
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { LitElement, html, css } from 'lit';
|
|
2
|
+
import { tokenStyles } from '../shared-styles.js';
|
|
3
|
+
import './breadcrumb-item.js';
|
|
4
|
+
|
|
5
|
+
export class ArcBreadcrumb extends LitElement {
|
|
6
|
+
static properties = {
|
|
7
|
+
_items: { state: true },
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
static styles = [
|
|
11
|
+
tokenStyles,
|
|
12
|
+
css`
|
|
13
|
+
:host { display: block; }
|
|
14
|
+
|
|
15
|
+
.breadcrumb {
|
|
16
|
+
display: flex;
|
|
17
|
+
align-items: center;
|
|
18
|
+
gap: var(--space-xs);
|
|
19
|
+
font-family: var(--font-accent);
|
|
20
|
+
font-size: var(--text-xs);
|
|
21
|
+
font-weight: 600;
|
|
22
|
+
letter-spacing: 2px;
|
|
23
|
+
text-transform: uppercase;
|
|
24
|
+
flex-wrap: wrap;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.breadcrumb__item {
|
|
28
|
+
display: inline-flex;
|
|
29
|
+
align-items: center;
|
|
30
|
+
gap: var(--space-xs);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.breadcrumb__link {
|
|
34
|
+
color: var(--text-muted);
|
|
35
|
+
text-decoration: none;
|
|
36
|
+
transition: color var(--transition-fast);
|
|
37
|
+
background: none;
|
|
38
|
+
border: none;
|
|
39
|
+
padding: var(--touch-pad) var(--space-xs);
|
|
40
|
+
cursor: pointer;
|
|
41
|
+
font: inherit;
|
|
42
|
+
font-size: inherit;
|
|
43
|
+
min-height: var(--touch-min);
|
|
44
|
+
display: inline-flex;
|
|
45
|
+
align-items: center;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.breadcrumb__link:hover {
|
|
49
|
+
color: var(--text-primary);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.breadcrumb__link:focus-visible {
|
|
53
|
+
outline: none;
|
|
54
|
+
box-shadow: var(--focus-ring);
|
|
55
|
+
border-radius: var(--radius-xs);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.breadcrumb__current {
|
|
59
|
+
color: var(--text-primary);
|
|
60
|
+
font-weight: 500;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.breadcrumb__separator {
|
|
64
|
+
color: var(--text-ghost);
|
|
65
|
+
font-size: var(--text-sm);
|
|
66
|
+
user-select: none;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.breadcrumb__slot-host { display: none; }
|
|
70
|
+
|
|
71
|
+
@media (prefers-reduced-motion: reduce) {
|
|
72
|
+
:host *,
|
|
73
|
+
:host *::before,
|
|
74
|
+
:host *::after {
|
|
75
|
+
animation-duration: 0.01ms !important;
|
|
76
|
+
animation-iteration-count: 1 !important;
|
|
77
|
+
transition-duration: 0.01ms !important;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
`,
|
|
81
|
+
];
|
|
82
|
+
|
|
83
|
+
constructor() {
|
|
84
|
+
super();
|
|
85
|
+
this._items = [];
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
_onSlotChange(e) {
|
|
89
|
+
this._items = e.target.assignedElements({ flatten: true })
|
|
90
|
+
.filter(el => el.tagName === 'ARC-BREADCRUMB-ITEM');
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
_handleClick(href) {
|
|
94
|
+
this.dispatchEvent(new CustomEvent('arc-navigate', {
|
|
95
|
+
detail: { href },
|
|
96
|
+
bubbles: true,
|
|
97
|
+
composed: true,
|
|
98
|
+
}));
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
render() {
|
|
102
|
+
return html`
|
|
103
|
+
<div class="breadcrumb__slot-host">
|
|
104
|
+
<slot @slotchange=${this._onSlotChange}></slot>
|
|
105
|
+
</div>
|
|
106
|
+
<nav class="breadcrumb" aria-label="Breadcrumb" part="breadcrumb">
|
|
107
|
+
${this._items.map((item, i) => {
|
|
108
|
+
const isLast = i === this._items.length - 1;
|
|
109
|
+
return html`
|
|
110
|
+
<span class="breadcrumb__item">
|
|
111
|
+
${isLast
|
|
112
|
+
? html`<span class="breadcrumb__current" aria-current="page" part="current">${item.label}</span>`
|
|
113
|
+
: html`
|
|
114
|
+
${item.href
|
|
115
|
+
? html`<a class="breadcrumb__link" href=${item.href} part="link">${item.label}</a>`
|
|
116
|
+
: html`<button class="breadcrumb__link" @click=${() => this._handleClick(item.href)} part="link">${item.label}</button>`
|
|
117
|
+
}
|
|
118
|
+
<span class="breadcrumb__separator" aria-hidden="true" part="separator">/</span>
|
|
119
|
+
`
|
|
120
|
+
}
|
|
121
|
+
</span>
|
|
122
|
+
`;
|
|
123
|
+
})}
|
|
124
|
+
</nav>
|
|
125
|
+
`;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
customElements.define('arc-breadcrumb', ArcBreadcrumb);
|