@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,101 @@
|
|
|
1
|
+
import { LitElement, html, css } from 'lit';
|
|
2
|
+
import { tokenStyles } from '../shared-styles.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @arc-prism hybrid — stacked layout works without JS; overflow "+N" counter requires JS
|
|
6
|
+
*/
|
|
7
|
+
export class ArcAvatarGroup extends LitElement {
|
|
8
|
+
static properties = {
|
|
9
|
+
max: { type: Number },
|
|
10
|
+
overlap: { type: String, reflect: true },
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
static styles = [
|
|
14
|
+
tokenStyles,
|
|
15
|
+
css`
|
|
16
|
+
:host { display: inline-flex; }
|
|
17
|
+
|
|
18
|
+
.group {
|
|
19
|
+
display: flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
::slotted(*) {
|
|
24
|
+
position: relative;
|
|
25
|
+
box-sizing: border-box;
|
|
26
|
+
box-shadow: 0 0 0 3px var(--bg-deep);
|
|
27
|
+
border-radius: var(--radius-full);
|
|
28
|
+
transition: transform var(--transition-fast), box-shadow var(--transition-fast);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
::slotted(:hover) {
|
|
32
|
+
transform: translateY(-2px) scale(1.08);
|
|
33
|
+
z-index: 100 !important;
|
|
34
|
+
box-shadow: 0 0 0 3px var(--bg-deep), 0 4px 12px rgba(0, 0, 0, 0.3);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.group__overflow {
|
|
38
|
+
display: inline-flex;
|
|
39
|
+
align-items: center;
|
|
40
|
+
justify-content: center;
|
|
41
|
+
font-family: var(--font-accent);
|
|
42
|
+
font-weight: 600;
|
|
43
|
+
font-size: var(--text-sm);
|
|
44
|
+
letter-spacing: 0.5px;
|
|
45
|
+
color: var(--text-ghost);
|
|
46
|
+
user-select: none;
|
|
47
|
+
padding-left: var(--space-sm);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
:host([overlap="sm"]) .group__overflow { padding-left: var(--space-xs); }
|
|
51
|
+
:host([overlap="lg"]) .group__overflow { padding-left: var(--space-md); }
|
|
52
|
+
|
|
53
|
+
@media (prefers-reduced-motion: reduce) {
|
|
54
|
+
:host *,
|
|
55
|
+
:host *::before,
|
|
56
|
+
:host *::after {
|
|
57
|
+
animation-duration: 0.01ms !important;
|
|
58
|
+
animation-iteration-count: 1 !important;
|
|
59
|
+
transition-duration: 0.01ms !important;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
`,
|
|
63
|
+
];
|
|
64
|
+
|
|
65
|
+
constructor() {
|
|
66
|
+
super();
|
|
67
|
+
this.max = Infinity;
|
|
68
|
+
this.overlap = 'md';
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/** @private */
|
|
72
|
+
_handleSlotChange(e) {
|
|
73
|
+
const nodes = e.target.assignedElements();
|
|
74
|
+
const overflow = nodes.length - this.max;
|
|
75
|
+
const margins = { sm: -8, md: -12, lg: -16 };
|
|
76
|
+
const ml = margins[this.overlap] ?? margins.md;
|
|
77
|
+
|
|
78
|
+
nodes.forEach((node, i) => {
|
|
79
|
+
node.style.display = i < this.max ? '' : 'none';
|
|
80
|
+
node.style.zIndex = nodes.length - i;
|
|
81
|
+
node.style.marginLeft = i === 0 ? '0' : `${ml}px`;
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
const counter = this.shadowRoot.querySelector('.group__overflow');
|
|
85
|
+
if (counter) {
|
|
86
|
+
counter.style.display = overflow > 0 ? '' : 'none';
|
|
87
|
+
counter.textContent = `+${overflow}`;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
render() {
|
|
92
|
+
return html`
|
|
93
|
+
<div class="group" part="group" role="group" aria-label="Avatar group">
|
|
94
|
+
<slot @slotchange=${this._handleSlotChange}></slot>
|
|
95
|
+
<span class="group__overflow" part="overflow" style="display:none"></span>
|
|
96
|
+
</div>
|
|
97
|
+
`;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
customElements.define('arc-avatar-group', ArcAvatarGroup);
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { LitElement, html, css } from 'lit';
|
|
2
|
+
import { tokenStyles } from '../shared-styles.js';
|
|
3
|
+
|
|
4
|
+
export class ArcAvatar extends LitElement {
|
|
5
|
+
static properties = {
|
|
6
|
+
src: { type: String },
|
|
7
|
+
name: { type: String, reflect: true },
|
|
8
|
+
size: { type: String, reflect: true },
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
static styles = [
|
|
12
|
+
tokenStyles,
|
|
13
|
+
css`
|
|
14
|
+
:host { display: inline-flex; }
|
|
15
|
+
|
|
16
|
+
.avatar {
|
|
17
|
+
display: inline-flex;
|
|
18
|
+
align-items: center;
|
|
19
|
+
justify-content: center;
|
|
20
|
+
border-radius: var(--radius-full);
|
|
21
|
+
border: 1px solid var(--border-default);
|
|
22
|
+
overflow: hidden;
|
|
23
|
+
background: var(--bg-elevated);
|
|
24
|
+
transition: border-color var(--transition-base), box-shadow var(--transition-base);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.avatar:hover {
|
|
28
|
+
border-color: var(--border-bright);
|
|
29
|
+
box-shadow: 0 0 12px rgba(var(--accent-primary-rgb), 0.15);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
:host([size="sm"]) .avatar { width: 32px; height: 32px; }
|
|
33
|
+
:host([size="md"]) .avatar { width: 40px; height: 40px; }
|
|
34
|
+
:host([size="lg"]) .avatar { width: 56px; height: 56px; }
|
|
35
|
+
|
|
36
|
+
.avatar__img {
|
|
37
|
+
width: 100%;
|
|
38
|
+
height: 100%;
|
|
39
|
+
object-fit: cover;
|
|
40
|
+
border-radius: var(--radius-full);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.avatar__initials {
|
|
44
|
+
font-family: var(--font-accent);
|
|
45
|
+
font-weight: 600;
|
|
46
|
+
color: var(--text-primary);
|
|
47
|
+
text-transform: uppercase;
|
|
48
|
+
user-select: none;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
:host([size="sm"]) .avatar__initials { font-size: var(--text-xs); }
|
|
52
|
+
:host([size="md"]) .avatar__initials { font-size: var(--text-sm); }
|
|
53
|
+
:host([size="lg"]) .avatar__initials { font-size: var(--text-lg); }
|
|
54
|
+
|
|
55
|
+
@media (prefers-reduced-motion: reduce) {
|
|
56
|
+
:host *,
|
|
57
|
+
:host *::before,
|
|
58
|
+
:host *::after {
|
|
59
|
+
animation-duration: 0.01ms !important;
|
|
60
|
+
animation-iteration-count: 1 !important;
|
|
61
|
+
transition-duration: 0.01ms !important;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
`,
|
|
65
|
+
];
|
|
66
|
+
|
|
67
|
+
constructor() {
|
|
68
|
+
super();
|
|
69
|
+
this.src = '';
|
|
70
|
+
this.name = '';
|
|
71
|
+
this.size = 'md';
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/** @private */
|
|
75
|
+
_getInitials() {
|
|
76
|
+
return this.name ? this.name.charAt(0).toUpperCase() : '?';
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
render() {
|
|
80
|
+
const content = this.src
|
|
81
|
+
? html`<img class="avatar__img" part="img" src=${this.src} alt=${this.name || 'Avatar'} />`
|
|
82
|
+
: html`<span class="avatar__initials" part="initials">${this._getInitials()}</span>`;
|
|
83
|
+
|
|
84
|
+
return html`
|
|
85
|
+
<div class="avatar" part="avatar" role="img" aria-label=${this.name || 'Avatar'}>
|
|
86
|
+
${content}
|
|
87
|
+
</div>
|
|
88
|
+
`;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
customElements.define('arc-avatar', ArcAvatar);
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { LitElement, html, css } from 'lit';
|
|
2
|
+
import { tokenStyles } from '../shared-styles.js';
|
|
3
|
+
|
|
4
|
+
export class ArcBadge extends LitElement {
|
|
5
|
+
static properties = {
|
|
6
|
+
variant: { type: String, reflect: true },
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
static styles = [
|
|
10
|
+
tokenStyles,
|
|
11
|
+
css`
|
|
12
|
+
:host { display: inline-flex; }
|
|
13
|
+
|
|
14
|
+
.badge {
|
|
15
|
+
display: inline-flex;
|
|
16
|
+
align-items: center;
|
|
17
|
+
gap: var(--space-xs);
|
|
18
|
+
font-family: var(--font-accent);
|
|
19
|
+
font-weight: 600;
|
|
20
|
+
font-size: var(--text-xs);
|
|
21
|
+
letter-spacing: 2px;
|
|
22
|
+
text-transform: uppercase;
|
|
23
|
+
color: var(--text-muted);
|
|
24
|
+
padding: var(--space-xs) var(--space-sm);
|
|
25
|
+
border: 1px solid var(--border-default);
|
|
26
|
+
border-radius: var(--radius-sm);
|
|
27
|
+
background: var(--bg-hover);
|
|
28
|
+
transition: box-shadow 200ms ease, border-color 200ms ease;
|
|
29
|
+
line-height: 1.4;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
:host([variant="primary"]) .badge {
|
|
33
|
+
border-color: var(--accent-primary-border);
|
|
34
|
+
color: var(--accent-primary);
|
|
35
|
+
background: rgba(var(--accent-primary-rgb), 0.06);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
:host([variant="secondary"]) .badge {
|
|
39
|
+
border-color: var(--accent-secondary-border);
|
|
40
|
+
color: var(--accent-secondary);
|
|
41
|
+
background: rgba(var(--accent-secondary-rgb), 0.06);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
:host([variant="success"]) .badge {
|
|
45
|
+
border-color: rgba(var(--color-success-rgb), 0.2);
|
|
46
|
+
color: var(--color-success);
|
|
47
|
+
background: rgba(var(--color-success-rgb), 0.06);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
:host([variant="warning"]) .badge {
|
|
51
|
+
border-color: rgba(var(--color-warning-rgb), 0.2);
|
|
52
|
+
color: var(--color-warning);
|
|
53
|
+
background: rgba(var(--color-warning-rgb), 0.06);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
:host([variant="error"]) .badge {
|
|
57
|
+
border-color: rgba(var(--color-error-rgb), 0.2);
|
|
58
|
+
color: var(--color-error);
|
|
59
|
+
background: rgba(var(--color-error-rgb), 0.06);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
:host([variant="info"]) .badge {
|
|
63
|
+
border-color: rgba(var(--color-info-rgb), 0.2);
|
|
64
|
+
color: var(--color-info);
|
|
65
|
+
background: rgba(var(--color-info-rgb), 0.06);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
:host(:hover) .badge { border-color: var(--border-bright); }
|
|
69
|
+
:host([variant="primary"]:hover) .badge { box-shadow: 0 0 12px rgba(var(--accent-primary-rgb), 0.15); }
|
|
70
|
+
:host([variant="secondary"]:hover) .badge { box-shadow: 0 0 12px rgba(var(--accent-secondary-rgb), 0.15); }
|
|
71
|
+
:host([variant="success"]:hover) .badge { box-shadow: 0 0 12px rgba(var(--color-success-rgb), 0.15); }
|
|
72
|
+
:host([variant="warning"]:hover) .badge { box-shadow: 0 0 12px rgba(var(--color-warning-rgb), 0.15); }
|
|
73
|
+
:host([variant="error"]:hover) .badge { box-shadow: 0 0 12px rgba(var(--color-error-rgb), 0.15); }
|
|
74
|
+
:host([variant="info"]:hover) .badge { box-shadow: 0 0 12px rgba(var(--color-info-rgb), 0.15); }
|
|
75
|
+
|
|
76
|
+
@media (prefers-reduced-motion: reduce) {
|
|
77
|
+
:host *,
|
|
78
|
+
:host *::before,
|
|
79
|
+
:host *::after {
|
|
80
|
+
animation-duration: 0.01ms !important;
|
|
81
|
+
animation-iteration-count: 1 !important;
|
|
82
|
+
transition-duration: 0.01ms !important;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
`,
|
|
86
|
+
];
|
|
87
|
+
|
|
88
|
+
constructor() {
|
|
89
|
+
super();
|
|
90
|
+
this.variant = 'default';
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
render() {
|
|
94
|
+
return html`<span class="badge" part="badge"><slot></slot></span>`;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
customElements.define('arc-badge', ArcBadge);
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { LitElement, html, css } from 'lit';
|
|
2
|
+
import { tokenStyles } from '../shared-styles.js';
|
|
3
|
+
import './icon.js';
|
|
4
|
+
|
|
5
|
+
export class ArcCallout extends LitElement {
|
|
6
|
+
static properties = {
|
|
7
|
+
variant: { type: String, reflect: true },
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
static styles = [
|
|
11
|
+
tokenStyles,
|
|
12
|
+
css`
|
|
13
|
+
:host { display: block; }
|
|
14
|
+
|
|
15
|
+
.callout {
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
gap: var(--space-sm);
|
|
19
|
+
padding: var(--space-md) var(--space-lg);
|
|
20
|
+
border-radius: var(--radius-md);
|
|
21
|
+
border: 1px solid var(--border-default);
|
|
22
|
+
background: var(--bg-card);
|
|
23
|
+
font-family: var(--font-body);
|
|
24
|
+
font-size: var(--text-sm);
|
|
25
|
+
line-height: 1.7;
|
|
26
|
+
color: var(--text-secondary);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.callout__header {
|
|
30
|
+
display: flex;
|
|
31
|
+
align-items: center;
|
|
32
|
+
gap: var(--space-sm);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.callout__icon {
|
|
36
|
+
flex-shrink: 0;
|
|
37
|
+
display: flex;
|
|
38
|
+
align-items: center;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.callout__label {
|
|
42
|
+
font-family: var(--font-accent);
|
|
43
|
+
font-size: var(--text-xs);
|
|
44
|
+
font-weight: 600;
|
|
45
|
+
letter-spacing: 1.5px;
|
|
46
|
+
text-transform: uppercase;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.callout__content {
|
|
50
|
+
min-width: 0;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/* ── Info ── */
|
|
54
|
+
:host([variant="info"]) .callout {
|
|
55
|
+
border-color: rgba(var(--accent-primary-rgb), 0.12);
|
|
56
|
+
background: rgba(var(--accent-primary-rgb), 0.04);
|
|
57
|
+
}
|
|
58
|
+
:host([variant="info"]) .callout__icon { color: var(--accent-primary); }
|
|
59
|
+
:host([variant="info"]) .callout__label { color: var(--accent-primary); }
|
|
60
|
+
|
|
61
|
+
/* ── Warning ── */
|
|
62
|
+
:host([variant="warning"]) .callout {
|
|
63
|
+
border-color: rgba(var(--color-warning-rgb), 0.15);
|
|
64
|
+
background: rgba(var(--color-warning-rgb), 0.04);
|
|
65
|
+
}
|
|
66
|
+
:host([variant="warning"]) .callout__icon { color: var(--color-warning); }
|
|
67
|
+
:host([variant="warning"]) .callout__label { color: var(--color-warning); }
|
|
68
|
+
|
|
69
|
+
/* ── Tip ── */
|
|
70
|
+
:host([variant="tip"]) .callout {
|
|
71
|
+
border-color: rgba(var(--color-success-rgb), 0.15);
|
|
72
|
+
background: rgba(var(--color-success-rgb), 0.04);
|
|
73
|
+
}
|
|
74
|
+
:host([variant="tip"]) .callout__icon { color: var(--color-success); }
|
|
75
|
+
:host([variant="tip"]) .callout__label { color: var(--color-success); }
|
|
76
|
+
|
|
77
|
+
/* ── Danger ── */
|
|
78
|
+
:host([variant="danger"]) .callout {
|
|
79
|
+
border-color: rgba(var(--color-error-rgb), 0.15);
|
|
80
|
+
background: rgba(var(--color-error-rgb), 0.04);
|
|
81
|
+
}
|
|
82
|
+
:host([variant="danger"]) .callout__icon { color: var(--color-error); }
|
|
83
|
+
:host([variant="danger"]) .callout__label { color: var(--color-error); }
|
|
84
|
+
|
|
85
|
+
@media (prefers-reduced-motion: reduce) {
|
|
86
|
+
:host *,
|
|
87
|
+
:host *::before,
|
|
88
|
+
:host *::after {
|
|
89
|
+
animation-duration: 0.01ms !important;
|
|
90
|
+
animation-iteration-count: 1 !important;
|
|
91
|
+
transition-duration: 0.01ms !important;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
`,
|
|
95
|
+
];
|
|
96
|
+
|
|
97
|
+
constructor() {
|
|
98
|
+
super();
|
|
99
|
+
this.variant = 'info';
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/** @private */
|
|
103
|
+
_getDefaultIcon() {
|
|
104
|
+
const icons = {
|
|
105
|
+
info: 'info',
|
|
106
|
+
warning: 'warning',
|
|
107
|
+
tip: 'lightbulb',
|
|
108
|
+
danger: 'x-circle',
|
|
109
|
+
};
|
|
110
|
+
return icons[this.variant] || icons.info;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/** @private */
|
|
114
|
+
_getLabel() {
|
|
115
|
+
const labels = {
|
|
116
|
+
info: 'Note',
|
|
117
|
+
warning: 'Warning',
|
|
118
|
+
tip: 'Tip',
|
|
119
|
+
danger: 'Danger',
|
|
120
|
+
};
|
|
121
|
+
return labels[this.variant] || labels.info;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
render() {
|
|
125
|
+
return html`
|
|
126
|
+
<div class="callout" part="callout" role="note">
|
|
127
|
+
<div class="callout__header" part="header">
|
|
128
|
+
<span class="callout__icon" part="icon" aria-hidden="true">
|
|
129
|
+
<slot name="icon"><arc-icon name=${this._getDefaultIcon()} size="sm"></arc-icon></slot>
|
|
130
|
+
</span>
|
|
131
|
+
<span class="callout__label" part="label">${this._getLabel()}</span>
|
|
132
|
+
</div>
|
|
133
|
+
<div class="callout__content" part="content">
|
|
134
|
+
<slot></slot>
|
|
135
|
+
</div>
|
|
136
|
+
</div>
|
|
137
|
+
`;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
customElements.define('arc-callout', ArcCallout);
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { LitElement, html, css } from 'lit';
|
|
2
|
+
import { tokenStyles } from '../shared-styles.js';
|
|
3
|
+
|
|
4
|
+
export class ArcCard extends LitElement {
|
|
5
|
+
static properties = {
|
|
6
|
+
href: { type: String },
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
static styles = [
|
|
10
|
+
tokenStyles,
|
|
11
|
+
css`
|
|
12
|
+
:host { display: block; }
|
|
13
|
+
|
|
14
|
+
.card {
|
|
15
|
+
position: relative;
|
|
16
|
+
border-radius: var(--radius-lg);
|
|
17
|
+
padding: 1px;
|
|
18
|
+
background: var(--border-subtle);
|
|
19
|
+
transition: background var(--transition-slow);
|
|
20
|
+
text-decoration: none;
|
|
21
|
+
display: flex;
|
|
22
|
+
flex-direction: column;
|
|
23
|
+
height: 100%;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
:host([href]) .card:hover {
|
|
27
|
+
background: linear-gradient(135deg, rgba(var(--accent-primary-rgb),0.3), rgba(var(--accent-secondary-rgb),0.15), var(--border-default));
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.card__inner {
|
|
31
|
+
position: relative;
|
|
32
|
+
background: var(--bg-card);
|
|
33
|
+
border-radius: calc(var(--radius-lg) - 1px);
|
|
34
|
+
padding: var(--space-xl) var(--space-lg);
|
|
35
|
+
flex: 1;
|
|
36
|
+
min-height: 0;
|
|
37
|
+
transition: box-shadow var(--transition-slow);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.card:hover .card__inner {
|
|
41
|
+
box-shadow: inset 0 1px 0 var(--bg-hover), var(--glow-card-hover);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.card:focus-visible { outline: none; box-shadow: var(--focus-glow); border-radius: var(--radius-lg); }
|
|
45
|
+
|
|
46
|
+
@media (max-width: 768px) {
|
|
47
|
+
.card__inner { padding: var(--space-lg) var(--space-md); }
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
@media (prefers-reduced-motion: reduce) {
|
|
51
|
+
:host *,
|
|
52
|
+
:host *::before,
|
|
53
|
+
:host *::after {
|
|
54
|
+
animation-duration: 0.01ms !important;
|
|
55
|
+
animation-iteration-count: 1 !important;
|
|
56
|
+
transition-duration: 0.01ms !important;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
`,
|
|
60
|
+
];
|
|
61
|
+
|
|
62
|
+
constructor() {
|
|
63
|
+
super();
|
|
64
|
+
this.href = '';
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
render() {
|
|
68
|
+
if (this.href) {
|
|
69
|
+
return html`<a class="card" href=${this.href} part="card"><div class="card__inner" part="inner"><slot></slot></div></a>`;
|
|
70
|
+
}
|
|
71
|
+
return html`<div class="card" part="card"><div class="card__inner" part="inner"><slot></slot></div></div>`;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
customElements.define('arc-card', ArcCard);
|