@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,107 @@
1
+ import { LitElement, html, css } from 'lit';
2
+ import { tokenStyles } from '../shared-styles.js';
3
+
4
+ export class ArcScrollArea extends LitElement {
5
+ static properties = {
6
+ maxHeight: { type: String, attribute: 'max-height', reflect: true },
7
+ orientation: { type: String, reflect: true },
8
+ };
9
+
10
+ static styles = [
11
+ tokenStyles,
12
+ css`
13
+ :host {
14
+ display: block;
15
+ position: relative;
16
+ }
17
+
18
+ .scroll-area {
19
+ overflow: hidden;
20
+ scroll-behavior: smooth;
21
+ border-radius: inherit;
22
+ }
23
+
24
+ /* Orientation variants */
25
+ :host([orientation="vertical"]) .scroll-area,
26
+ :host(:not([orientation])) .scroll-area {
27
+ overflow-y: auto;
28
+ overflow-x: hidden;
29
+ }
30
+
31
+ :host([orientation="horizontal"]) .scroll-area {
32
+ overflow-x: auto;
33
+ overflow-y: hidden;
34
+ }
35
+
36
+ :host([orientation="both"]) .scroll-area {
37
+ overflow: auto;
38
+ }
39
+
40
+ /* Webkit scrollbar styling */
41
+ .scroll-area::-webkit-scrollbar {
42
+ width: 6px;
43
+ height: 6px;
44
+ }
45
+
46
+ .scroll-area::-webkit-scrollbar-track {
47
+ background: var(--bg-elevated);
48
+ border-radius: var(--radius-full);
49
+ }
50
+
51
+ .scroll-area::-webkit-scrollbar-thumb {
52
+ background: var(--border-bright);
53
+ border-radius: var(--radius-full);
54
+ transition: background var(--transition-fast);
55
+ }
56
+
57
+ .scroll-area::-webkit-scrollbar-thumb:hover {
58
+ background: var(--text-ghost);
59
+ }
60
+
61
+ .scroll-area::-webkit-scrollbar-corner {
62
+ background: var(--bg-elevated);
63
+ }
64
+
65
+ /* Firefox scrollbar styling */
66
+ .scroll-area {
67
+ scrollbar-width: thin;
68
+ scrollbar-color: var(--border-bright) var(--bg-elevated);
69
+ }
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.maxHeight = '';
86
+ this.orientation = 'vertical';
87
+ }
88
+
89
+ render() {
90
+ const styles = this.maxHeight ? `max-height: ${this.maxHeight}` : '';
91
+
92
+ return html`
93
+ <div
94
+ class="scroll-area"
95
+ style=${styles}
96
+ tabindex="0"
97
+ role="region"
98
+ aria-label="Scrollable content"
99
+ part="scroll-area"
100
+ >
101
+ <slot></slot>
102
+ </div>
103
+ `;
104
+ }
105
+ }
106
+
107
+ customElements.define('arc-scroll-area', ArcScrollArea);
@@ -0,0 +1,85 @@
1
+ import { LitElement, html, css } from 'lit';
2
+ import { tokenStyles } from '../shared-styles.js';
3
+
4
+ export class ArcSkeleton extends LitElement {
5
+ static properties = {
6
+ variant: { type: String, reflect: true },
7
+ width: { type: String },
8
+ height: { type: String },
9
+ };
10
+
11
+ static styles = [
12
+ tokenStyles,
13
+ css`
14
+ :host { display: block; }
15
+
16
+ @keyframes shimmer {
17
+ 0% { background-position: -200% 0; }
18
+ 100% { background-position: 200% 0; }
19
+ }
20
+
21
+ .skeleton {
22
+ background: linear-gradient(
23
+ 90deg,
24
+ var(--bg-elevated) 25%,
25
+ var(--border-subtle) 37%,
26
+ var(--bg-elevated) 63%
27
+ );
28
+ background-size: 200% 100%;
29
+ animation: shimmer 1.8s ease-in-out infinite;
30
+ }
31
+
32
+ :host([variant="text"]) .skeleton {
33
+ width: 100%;
34
+ height: 1em;
35
+ border-radius: var(--radius-sm);
36
+ }
37
+
38
+ :host([variant="circle"]) .skeleton {
39
+ border-radius: var(--radius-full);
40
+ }
41
+
42
+ :host([variant="rect"]) .skeleton {
43
+ border-radius: var(--radius-md);
44
+ }
45
+
46
+ @media (prefers-reduced-motion: reduce) {
47
+ :host *,
48
+ :host *::before,
49
+ :host *::after {
50
+ animation-duration: 0.01ms !important;
51
+ animation-iteration-count: 1 !important;
52
+ transition-duration: 0.01ms !important;
53
+ }
54
+ }
55
+ `,
56
+ ];
57
+
58
+ constructor() {
59
+ super();
60
+ this.variant = 'text';
61
+ this.width = '';
62
+ this.height = '';
63
+ }
64
+
65
+ render() {
66
+ const styles = [
67
+ this.width ? `width:${this.width}` : '',
68
+ this.height ? `height:${this.height}` : '',
69
+ this.variant === 'circle' && !this.height && this.width ? `height:${this.width}` : '',
70
+ ].filter(Boolean).join(';');
71
+
72
+ return html`
73
+ <div
74
+ class="skeleton"
75
+ part="skeleton"
76
+ role="status"
77
+ aria-label="Loading"
78
+ aria-busy="true"
79
+ style=${styles}
80
+ ></div>
81
+ `;
82
+ }
83
+ }
84
+
85
+ customElements.define('arc-skeleton', ArcSkeleton);
@@ -0,0 +1,77 @@
1
+ import { LitElement, html, css } from 'lit';
2
+ import { tokenStyles } from '../shared-styles.js';
3
+
4
+ export class ArcSpinner extends LitElement {
5
+ static properties = {
6
+ size: { type: String, reflect: true },
7
+ variant: { type: String, reflect: true },
8
+ };
9
+
10
+ static styles = [
11
+ tokenStyles,
12
+ css`
13
+ :host { display: inline-flex; }
14
+
15
+ @keyframes spin {
16
+ to { transform: rotate(360deg); }
17
+ }
18
+
19
+ .spinner {
20
+ border-radius: var(--radius-full);
21
+ border-style: solid;
22
+ border-color: var(--accent-primary);
23
+ border-top-color: transparent;
24
+ animation: spin 0.75s linear infinite;
25
+ box-sizing: border-box;
26
+ }
27
+
28
+ :host([size="sm"]) .spinner { width: 16px; height: 16px; border-width: 2px; }
29
+ :host([size="md"]) .spinner { width: 24px; height: 24px; border-width: 2.5px; }
30
+ :host([size="lg"]) .spinner { width: 40px; height: 40px; border-width: 3px; }
31
+
32
+ :host([variant="primary"]) .spinner {
33
+ border-color: var(--accent-primary);
34
+ border-top-color: transparent;
35
+ }
36
+
37
+ :host([variant="secondary"]) .spinner {
38
+ border-color: var(--accent-secondary);
39
+ border-top-color: transparent;
40
+ }
41
+
42
+ :host([variant="white"]) .spinner {
43
+ border-color: var(--text-primary);
44
+ border-top-color: transparent;
45
+ }
46
+
47
+ @media (prefers-reduced-motion: reduce) {
48
+ :host *,
49
+ :host *::before,
50
+ :host *::after {
51
+ animation-duration: 0.01ms !important;
52
+ animation-iteration-count: 1 !important;
53
+ transition-duration: 0.01ms !important;
54
+ }
55
+ }
56
+ `,
57
+ ];
58
+
59
+ constructor() {
60
+ super();
61
+ this.size = 'md';
62
+ this.variant = 'primary';
63
+ }
64
+
65
+ render() {
66
+ return html`
67
+ <div
68
+ class="spinner"
69
+ part="spinner"
70
+ role="status"
71
+ aria-label="Loading"
72
+ ></div>
73
+ `;
74
+ }
75
+ }
76
+
77
+ customElements.define('arc-spinner', ArcSpinner);
@@ -0,0 +1,68 @@
1
+ import { LitElement, html, css } from 'lit';
2
+ import { tokenStyles } from '../shared-styles.js';
3
+
4
+ export class ArcStack extends LitElement {
5
+ static properties = {
6
+ direction: { type: String, reflect: true },
7
+ gap: { type: String, reflect: true },
8
+ align: { type: String, reflect: true },
9
+ justify: { type: String, reflect: true },
10
+ wrap: { type: Boolean, reflect: true },
11
+ };
12
+
13
+ static styles = [
14
+ tokenStyles,
15
+ css`
16
+ :host {
17
+ display: flex;
18
+ flex-direction: column;
19
+ gap: var(--space-md);
20
+ align-items: stretch;
21
+ justify-content: flex-start;
22
+ }
23
+
24
+ /* Direction */
25
+ :host([direction="horizontal"]) { flex-direction: row; }
26
+ :host([direction="vertical"]) { flex-direction: column; }
27
+
28
+ /* Gap */
29
+ :host([gap="xs"]) { gap: var(--space-xs); }
30
+ :host([gap="sm"]) { gap: var(--space-sm); }
31
+ :host([gap="md"]) { gap: var(--space-md); }
32
+ :host([gap="lg"]) { gap: var(--space-lg); }
33
+ :host([gap="xl"]) { gap: var(--space-xl); }
34
+ :host([gap="2xl"]) { gap: var(--space-2xl); }
35
+
36
+ /* Align */
37
+ :host([align="start"]) { align-items: flex-start; }
38
+ :host([align="center"]) { align-items: center; }
39
+ :host([align="end"]) { align-items: flex-end; }
40
+ :host([align="stretch"]) { align-items: stretch; }
41
+
42
+ /* Justify */
43
+ :host([justify="start"]) { justify-content: flex-start; }
44
+ :host([justify="center"]) { justify-content: center; }
45
+ :host([justify="end"]) { justify-content: flex-end; }
46
+ :host([justify="between"]) { justify-content: space-between; }
47
+ :host([justify="around"]) { justify-content: space-around; }
48
+
49
+ /* Wrap */
50
+ :host([wrap]) { flex-wrap: wrap; }
51
+ `,
52
+ ];
53
+
54
+ constructor() {
55
+ super();
56
+ this.direction = 'vertical';
57
+ this.gap = 'md';
58
+ this.align = 'stretch';
59
+ this.justify = 'start';
60
+ this.wrap = false;
61
+ }
62
+
63
+ render() {
64
+ return html`<slot></slot>`;
65
+ }
66
+ }
67
+
68
+ customElements.define('arc-stack', ArcStack);
@@ -0,0 +1,72 @@
1
+ import { LitElement, html, css } from 'lit';
2
+ import { tokenStyles } from '../shared-styles.js';
3
+
4
+ export class ArcStat extends LitElement {
5
+ static properties = {
6
+ value: { type: String },
7
+ label: { type: String },
8
+ };
9
+
10
+ static styles = [
11
+ tokenStyles,
12
+ css`
13
+ :host { display: block; }
14
+
15
+ .stat {
16
+ display: flex;
17
+ flex-direction: column;
18
+ align-items: center;
19
+ gap: var(--space-sm);
20
+ text-align: center;
21
+ padding: var(--space-lg) var(--space-md);
22
+ }
23
+
24
+ .stat__value {
25
+ font-size: clamp(32px, 4.5vw, 48px);
26
+ font-weight: 200;
27
+ letter-spacing: -1px;
28
+ line-height: 1;
29
+ background: var(--gradient-accent-text);
30
+ -webkit-background-clip: text;
31
+ -webkit-text-fill-color: transparent;
32
+ background-clip: text;
33
+ filter: drop-shadow(0 0 16px rgba(var(--accent-primary-rgb),0.3))
34
+ drop-shadow(0 0 40px rgba(var(--accent-secondary-rgb),0.12));
35
+ }
36
+
37
+ .stat__rule {
38
+ width: 24px;
39
+ height: 1px;
40
+ background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
41
+ opacity: 0.4;
42
+ }
43
+
44
+ .stat__label {
45
+ font-family: var(--font-accent);
46
+ font-weight: 600;
47
+ font-size: var(--label-inline-size);
48
+ letter-spacing: var(--label-inline-spacing);
49
+ text-transform: uppercase;
50
+ color: var(--text-muted);
51
+ }
52
+ `,
53
+ ];
54
+
55
+ constructor() {
56
+ super();
57
+ this.value = '';
58
+ this.label = '';
59
+ }
60
+
61
+ render() {
62
+ return html`
63
+ <div class="stat" part="stat">
64
+ <span class="stat__value" part="value">${this.value}</span>
65
+ <span class="stat__rule"></span>
66
+ <span class="stat__label" part="label">${this.label}</span>
67
+ </div>
68
+ `;
69
+ }
70
+ }
71
+
72
+ customElements.define('arc-stat', ArcStat);
@@ -0,0 +1,22 @@
1
+ import { LitElement, html, css } from 'lit';
2
+
3
+ export class ArcStep extends LitElement {
4
+ static properties = {
5
+ label: { type: String, reflect: true },
6
+ };
7
+
8
+ static styles = css`
9
+ :host { display: none; }
10
+ `;
11
+
12
+ constructor() {
13
+ super();
14
+ this.label = '';
15
+ }
16
+
17
+ render() {
18
+ return html`<slot></slot>`;
19
+ }
20
+ }
21
+
22
+ customElements.define('arc-step', ArcStep);
@@ -0,0 +1,202 @@
1
+ import { LitElement, html, css } from 'lit';
2
+ import { tokenStyles } from '../shared-styles.js';
3
+ import './step.js';
4
+
5
+ export class ArcStepper extends LitElement {
6
+ static properties = {
7
+ active: { type: Number, reflect: true },
8
+ _steps: { state: true },
9
+ };
10
+
11
+ static styles = [
12
+ tokenStyles,
13
+ css`
14
+ :host { display: block; }
15
+
16
+ .stepper {
17
+ display: flex;
18
+ align-items: flex-start;
19
+ gap: var(--space-xs);
20
+ }
21
+
22
+ .step {
23
+ display: flex;
24
+ flex-direction: column;
25
+ align-items: center;
26
+ flex: 1;
27
+ position: relative;
28
+ padding: 0 var(--space-sm);
29
+ }
30
+
31
+ .step__header {
32
+ display: flex;
33
+ align-items: center;
34
+ width: 100%;
35
+ position: relative;
36
+ }
37
+
38
+ .step__circle {
39
+ width: 36px;
40
+ height: 36px;
41
+ border-radius: var(--radius-full);
42
+ display: flex;
43
+ align-items: center;
44
+ justify-content: center;
45
+ font-family: var(--font-accent);
46
+ font-size: var(--text-sm);
47
+ font-weight: 700;
48
+ letter-spacing: 1px;
49
+ flex-shrink: 0;
50
+ position: relative;
51
+ z-index: 1;
52
+ transition: background var(--transition-base),
53
+ color var(--transition-base),
54
+ border-color var(--transition-base),
55
+ box-shadow var(--transition-base);
56
+ margin: 0 auto;
57
+ box-sizing: border-box;
58
+ }
59
+
60
+ /* Upcoming (default) */
61
+ .step__circle {
62
+ background: var(--bg-elevated);
63
+ color: var(--text-ghost);
64
+ border: 1px solid var(--border-default);
65
+ }
66
+
67
+ /* Active */
68
+ .step--active .step__circle {
69
+ background: transparent;
70
+ color: var(--accent-primary);
71
+ border: 2px solid var(--accent-primary);
72
+ box-shadow: 0 0 12px rgba(var(--accent-primary-rgb), 0.25);
73
+ }
74
+
75
+ /* Completed */
76
+ .step--completed .step__circle {
77
+ background: var(--accent-primary);
78
+ color: var(--text-primary);
79
+ border: 2px solid var(--accent-primary);
80
+ }
81
+
82
+ .step__line {
83
+ position: absolute;
84
+ top: 50%;
85
+ height: 1px;
86
+ background: var(--border-default);
87
+ transform: translateY(-50%);
88
+ }
89
+
90
+ .step__line--left {
91
+ left: calc(-1 * var(--space-xs) - var(--space-sm));
92
+ right: calc(50% + 20px);
93
+ }
94
+
95
+ .step__line--right {
96
+ left: calc(50% + 20px);
97
+ right: calc(-1 * var(--space-xs) - var(--space-sm));
98
+ }
99
+
100
+ .step--completed .step__line--left,
101
+ .step--active .step__line--left {
102
+ background: var(--accent-primary);
103
+ }
104
+
105
+ .step--completed .step__line--right {
106
+ background: var(--accent-primary);
107
+ }
108
+
109
+ .step__label {
110
+ margin-top: var(--space-md);
111
+ font-family: var(--font-accent);
112
+ font-size: var(--text-xs);
113
+ font-weight: 600;
114
+ letter-spacing: 2px;
115
+ text-transform: uppercase;
116
+ color: var(--text-muted);
117
+ text-align: center;
118
+ transition: color var(--transition-base);
119
+ }
120
+
121
+ .step--active .step__label {
122
+ color: var(--text-primary);
123
+ }
124
+
125
+ .step--completed .step__label {
126
+ color: var(--text-secondary);
127
+ }
128
+
129
+ .step__check {
130
+ font-size: var(--text-sm);
131
+ line-height: 1;
132
+ }
133
+
134
+ .stepper__slot-host { display: none; }
135
+
136
+ @media (prefers-reduced-motion: reduce) {
137
+ :host *,
138
+ :host *::before,
139
+ :host *::after {
140
+ animation-duration: 0.01ms !important;
141
+ animation-iteration-count: 1 !important;
142
+ transition-duration: 0.01ms !important;
143
+ }
144
+ }
145
+ `,
146
+ ];
147
+
148
+ constructor() {
149
+ super();
150
+ this.active = 0;
151
+ this._steps = [];
152
+ }
153
+
154
+ _onSlotChange(e) {
155
+ this._steps = e.target.assignedElements({ flatten: true })
156
+ .filter(el => el.tagName === 'ARC-STEP');
157
+ }
158
+
159
+ _getStepState(index) {
160
+ if (index < this.active) return 'completed';
161
+ if (index === this.active) return 'active';
162
+ return 'upcoming';
163
+ }
164
+
165
+ render() {
166
+ return html`
167
+ <div class="stepper__slot-host">
168
+ <slot @slotchange=${this._onSlotChange}></slot>
169
+ </div>
170
+ <div class="stepper" part="stepper" role="list" aria-label="Progress">
171
+ ${this._steps.map((step, i) => {
172
+ const state = this._getStepState(i);
173
+ const label = step.label || '';
174
+ const isFirst = i === 0;
175
+ const isLast = i === this._steps.length - 1;
176
+
177
+ return html`
178
+ <div
179
+ class="step step--${state}"
180
+ part="step"
181
+ role="listitem"
182
+ aria-current=${state === 'active' ? 'step' : 'false'}
183
+ >
184
+ <div class="step__header">
185
+ ${!isFirst ? html`<span class="step__line step__line--left" part="line"></span>` : ''}
186
+ <span class="step__circle" part="circle">
187
+ ${state === 'completed'
188
+ ? html`<span class="step__check" aria-hidden="true">&#10003;</span>`
189
+ : i + 1}
190
+ </span>
191
+ ${!isLast ? html`<span class="step__line step__line--right" part="line"></span>` : ''}
192
+ </div>
193
+ <span class="step__label" part="label">${label}</span>
194
+ </div>
195
+ `;
196
+ })}
197
+ </div>
198
+ `;
199
+ }
200
+ }
201
+
202
+ customElements.define('arc-stepper', ArcStepper);