@iyulab/components 2.31.0 → 2.32.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/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.32.0] - 2026-10-23
4
+
5
+ ### Added
6
+
7
+ - **`u-auto-scroll`** — a box that scrolls its own overflowing content, slowly, for a screen nobody touches (a wall
8
+ display, a kiosk): it waits at the top, scrolls to the end, waits, and starts over. It stands still under the
9
+ pointer or with focus inside, never moves for reduced motion, scrolls by hand as usual, and starts over from the
10
+ top when it comes back into view (a carousel returning to its slide). `duration` fits one round into a fixed time —
11
+ a 20-second slide — whatever the list's length.
12
+ - **`u-carousel` `pagination-style="labels"`** — a row under the slides naming each slide (its `aria-label`) with a
13
+ progress bar: passed tabs are full and the current one fills over `autoplay-interval` while rotating. For a
14
+ rotating wall display read from across the room. Parts `dot-label`, `dot-track`, `dot-progress`. The stop/start
15
+ button now follows the type ladder (24px at the default 13px label step), so it grows on a large-text screen.
16
+ - **`Theme.override(theme)`** — applies a theme to the document without changing or storing the user's preference
17
+ (`get()` keeps answering it); `null` returns to the preference. For a screen that owns its background, such as a
18
+ floor board that stays dark.
19
+
20
+ ## [2.31.1] - 2026-10-23
21
+
22
+ ### Fixed
23
+
24
+ - `u-avatar` initials now meet WCAG AA contrast. The default background moves from `--u-neutral-500` to `--u-neutral-700`
25
+ (fallback `#9E9E9E` → `#616161`): white initials measured 2.68 (light) and 2.69 (dark) on the old step and 6.19 · 6.08
26
+ on the new one. Avatars without a `background` of their own render a step darker.
27
+
3
28
  ## [2.31.0] - 2026-10-23
4
29
 
5
30
  ### Added
package/README.md CHANGED
@@ -132,7 +132,7 @@ npx skills add ./node_modules/@iyulab/components
132
132
 
133
133
  **Navigation** — `u-menu`, `u-menu-item`, `u-tab-panel`, `u-tab-nav`, `u-breadcrumb`, `u-breadcrumb-item`, `u-pagination`, `u-tree`, `u-tree-item`
134
134
 
135
- **Layout & Display** — `u-avatar`, `u-card`, `u-carousel`, `u-divider`, `u-expander`, `u-icon`, `u-panel`, `u-split-panel`, `u-tag`, `u-text`
135
+ **Layout & Display** — `u-auto-scroll`, `u-avatar`, `u-card`, `u-carousel`, `u-divider`, `u-expander`, `u-icon`, `u-panel`, `u-split-panel`, `u-tag`, `u-text`
136
136
 
137
137
  ## Theming
138
138
 
@@ -0,0 +1,62 @@
1
+ import { UElement } from '../UElement.js';
2
+ /**
3
+ * 넘치는 내용을 스스로 천천히 굴리는 상자 — 아무도 손대지 않는 화면(벽걸이 보드, 키오스크)에서 한 화면보다 긴 목록을
4
+ * 끝까지 보이게 한다.
5
+ *
6
+ * 한 바퀴: 맨 위에서 `pause` 만큼 멈춤 → `speed`(px/초)로 끝까지 → 끝에서 `pause` 만큼 멈춤 → 맨 위로. 내용이 넘치지 않으면
7
+ * 움직이지 않는다. 사람이 손을 대면 비킨다 — 포인터가 위에 있거나 초점이 안에 있으면 멈추고, 직접 굴리는 것은 언제나 된다.
8
+ * 동작 줄이기(`prefers-reduced-motion: reduce`)를 켠 사용자에게는 움직이지 않는다(WCAG 2.2.2 — 손으로 굴리면 된다).
9
+ * 화면에서 사라졌다가 다시 보이면(캐러셀이 그 장으로 돌아오면) 맨 위부터 다시 시작한다.
10
+ *
11
+ * 넘치는 동안 호스트는 키보드로 닿는 스크롤 영역이다(`tabindex="0"` — 소비자가 단 값은 덮지 않는다).
12
+ *
13
+ * @slot - 굴릴 내용
14
+ */
15
+ export declare class UAutoScroll extends UElement {
16
+ static styles: import('lit').CSSResultGroup[];
17
+ /** 굴리는 속도 (px/초) — `duration` 을 주면 그것이 정한다 */
18
+ speed: number;
19
+ /**
20
+ * 한 바퀴(위에서 멈춤 + 굴림 + 끝에서 멈춤)에 쓸 시간 (ms). 주면 속도는 남은 거리와 이 시간에서 나온다 — 캐러셀의 한 장처럼
21
+ * 보이는 시간이 정해진 자리에서, 목록 길이와 상관없이 그 시간 안에 끝까지 보이게 한다. 0 이면 `speed` 를 쓴다.
22
+ */
23
+ duration: number;
24
+ /** 맨 위와 끝에서 멈추는 시간 (ms) */
25
+ pause: number;
26
+ /** 굴리지 않는다 — 손으로만 굴린다 */
27
+ paused: boolean;
28
+ private readonly aria;
29
+ private frame?;
30
+ private waitUntil;
31
+ /** 한 바퀴의 자리 — 맨 위에서 멈춤 · 굴림 · 끝에서 멈춤. */
32
+ private phase;
33
+ /** 지금 굴리는 구간을 시작한 시각과 그때의 위치 — 소수 픽셀도 잃지 않는다(scrollTop 만 더하면 느린 속도에서 0 이 된다). */
34
+ private legStart?;
35
+ private legFrom;
36
+ private hovered;
37
+ private focused;
38
+ private visible;
39
+ private reducedMotion?;
40
+ private intersection?;
41
+ private resize?;
42
+ connectedCallback(): void;
43
+ disconnectedCallback(): void;
44
+ /** 맨 위로 돌아가 한 바퀴를 처음부터 시작한다. */
45
+ restart(): void;
46
+ protected render(): import('lit-html').TemplateResult<1>;
47
+ private get overflowing();
48
+ private get moving();
49
+ private tick;
50
+ /** px/초 — `duration` 이 있으면 남은 거리를 그 시간에서 두 번의 멈춤을 뺀 동안에 간다(최소 1초). */
51
+ private pace;
52
+ private syncTabStop;
53
+ private onPointerEnter;
54
+ private onPointerLeave;
55
+ private onFocusIn;
56
+ private onFocusOut;
57
+ }
58
+ declare global {
59
+ interface HTMLElementTagNameMap {
60
+ 'u-auto-scroll': UAutoScroll;
61
+ }
62
+ }
@@ -0,0 +1,126 @@
1
+ import { UElement } from "../UElement.js";
2
+ import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorateMetadata.js";
3
+ import __decorate from "../../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorate.js";
4
+ import { HostAria } from "../../utilities/hostAria.js";
5
+ import { styles } from "./UAutoScroll.styles.js";
6
+ import { html } from "lit";
7
+ import { customElement, property } from "lit/decorators.js";
8
+ // src/components/auto-scroll/UAutoScroll.ts
9
+ var UAutoScroll = class UAutoScroll extends UElement {
10
+ constructor(..._args) {
11
+ super(..._args);
12
+ this.speed = 30;
13
+ this.duration = 0;
14
+ this.pause = 3e3;
15
+ this.paused = false;
16
+ this.aria = new HostAria(this);
17
+ this.waitUntil = 0;
18
+ this.phase = "top";
19
+ this.legFrom = 0;
20
+ this.hovered = false;
21
+ this.focused = false;
22
+ this.visible = false;
23
+ this.tick = (time) => {
24
+ this.frame = requestAnimationFrame(this.tick);
25
+ if (!this.moving || !this.overflowing) {
26
+ this.legStart = void 0;
27
+ return;
28
+ }
29
+ if (time < this.waitUntil) return;
30
+ if (this.phase === "top") this.phase = "down";
31
+ if (this.phase === "end") {
32
+ this.restart();
33
+ return;
34
+ }
35
+ if (this.legStart === void 0) {
36
+ this.legStart = time;
37
+ this.legFrom = this.scrollTop;
38
+ }
39
+ const end = this.scrollHeight - this.clientHeight;
40
+ const position = Math.min(end, this.legFrom + this.pace(end - this.legFrom) * (time - this.legStart) / 1e3);
41
+ this.scrollTop = position;
42
+ if (position >= end) {
43
+ this.phase = "end";
44
+ this.legStart = void 0;
45
+ this.waitUntil = time + this.pause;
46
+ }
47
+ };
48
+ this.syncTabStop = () => {
49
+ this.aria.set("tabindex", this.overflowing ? "0" : null);
50
+ };
51
+ this.onPointerEnter = (e) => {
52
+ if (e.pointerType === "mouse") this.hovered = true;
53
+ };
54
+ this.onPointerLeave = () => {
55
+ this.hovered = false;
56
+ };
57
+ this.onFocusIn = () => {
58
+ this.focused = true;
59
+ };
60
+ this.onFocusOut = (e) => {
61
+ if (!this.contains(e.relatedTarget)) this.focused = false;
62
+ };
63
+ }
64
+ static {
65
+ this.styles = [super.styles, styles];
66
+ }
67
+ connectedCallback() {
68
+ super.connectedCallback();
69
+ this.reducedMotion = window.matchMedia?.("(prefers-reduced-motion: reduce)");
70
+ this.addEventListener("pointerenter", this.onPointerEnter);
71
+ this.addEventListener("pointerleave", this.onPointerLeave);
72
+ this.addEventListener("focusin", this.onFocusIn);
73
+ this.addEventListener("focusout", this.onFocusOut);
74
+ this.intersection = new IntersectionObserver((entries) => {
75
+ const now = entries.some((e) => e.isIntersecting);
76
+ if (now && !this.visible) this.restart();
77
+ this.visible = now;
78
+ });
79
+ this.intersection.observe(this);
80
+ this.resize = new ResizeObserver(() => this.syncTabStop());
81
+ this.resize.observe(this);
82
+ this.frame = requestAnimationFrame(this.tick);
83
+ }
84
+ disconnectedCallback() {
85
+ if (this.frame) cancelAnimationFrame(this.frame);
86
+ this.frame = void 0;
87
+ this.intersection?.disconnect();
88
+ this.resize?.disconnect();
89
+ this.removeEventListener("pointerenter", this.onPointerEnter);
90
+ this.removeEventListener("pointerleave", this.onPointerLeave);
91
+ this.removeEventListener("focusin", this.onFocusIn);
92
+ this.removeEventListener("focusout", this.onFocusOut);
93
+ super.disconnectedCallback();
94
+ }
95
+ /** 맨 위로 돌아가 한 바퀴를 처음부터 시작한다. */
96
+ restart() {
97
+ this.scrollTop = 0;
98
+ this.legStart = void 0;
99
+ this.phase = "top";
100
+ this.waitUntil = performance.now() + this.pause;
101
+ }
102
+ render() {
103
+ return html`<slot @slotchange=${this.syncTabStop}></slot>`;
104
+ }
105
+ get overflowing() {
106
+ return this.scrollHeight - this.clientHeight > 1;
107
+ }
108
+ get moving() {
109
+ return !this.paused && !this.hovered && !this.focused && this.visible && !this.reducedMotion?.matches;
110
+ }
111
+ /** px/초 — `duration` 이 있으면 남은 거리를 그 시간에서 두 번의 멈춤을 뺀 동안에 간다(최소 1초). */
112
+ pace(distance) {
113
+ if (!(this.duration > 0)) return this.speed;
114
+ const travel = Math.max(1e3, this.duration - 2 * this.pause);
115
+ return Math.max(1, distance) / (travel / 1e3);
116
+ }
117
+ };
118
+ __decorate([property({ type: Number }), __decorateMetadata("design:type", Object)], UAutoScroll.prototype, "speed", void 0);
119
+ __decorate([property({ type: Number }), __decorateMetadata("design:type", Object)], UAutoScroll.prototype, "duration", void 0);
120
+ __decorate([property({ type: Number }), __decorateMetadata("design:type", Object)], UAutoScroll.prototype, "pause", void 0);
121
+ __decorate([property({
122
+ type: Boolean,
123
+ reflect: true
124
+ }), __decorateMetadata("design:type", Object)], UAutoScroll.prototype, "paused", void 0);
125
+ UAutoScroll = __decorate([customElement("u-auto-scroll")], UAutoScroll);
126
+ export { UAutoScroll };
@@ -0,0 +1 @@
1
+ export declare const styles: import('lit').CSSResult;
@@ -0,0 +1,16 @@
1
+ import { css } from "lit";
2
+ // src/components/auto-scroll/UAutoScroll.styles.ts
3
+ var styles = css`
4
+ :host {
5
+ display: block;
6
+ min-height: 0;
7
+ overflow-y: auto;
8
+ overscroll-behavior: contain;
9
+ scrollbar-width: thin;
10
+ }
11
+ :host(:focus-visible) {
12
+ outline: 2px solid var(--u-focus-ring-color, #1565C0);
13
+ outline-offset: 2px;
14
+ }
15
+ `;
16
+ export { styles };
@@ -10,7 +10,7 @@ var styles = css`
10
10
  font-family: var(--u-font-base);
11
11
  font-weight: 600;
12
12
  color: var(--u-neutral-0, #FFFFFF);
13
- background-color: var(--u-neutral-500, #9E9E9E);
13
+ background-color: var(--u-neutral-700, #616161);
14
14
  vertical-align: middle;
15
15
  overflow: hidden;
16
16
  user-select: none;
@@ -18,7 +18,10 @@ import { UElement } from '../UElement.js';
18
18
  * @csspart prev-button - 이전 버튼
19
19
  * @csspart next-button - 다음 버튼
20
20
  * @csspart indicator - 페이지네이션 컨테이너
21
- * @csspart dot - 페이지네이션 점
21
+ * @csspart dot - 페이지네이션 점 (`pagination-style="labels"` 이면 이름 칸)
22
+ * @csspart dot-label - 이름 칸의 글자 (`labels` 일 때만)
23
+ * @csspart dot-track - 이름 칸의 진행 막대 자리 (`labels` 일 때만)
24
+ * @csspart dot-progress - 진행 막대의 채움 — 넘기는 동안 현재 칸이 간격만큼 차오른다 (`labels` 일 때만)
22
25
  * @csspart rotation-button - 자동 넘김 정지/시작 버튼 (`autoplay` 일 때만, 인디케이터 안)
23
26
  */
24
27
  export declare class UCarousel extends UElement {
@@ -33,6 +36,12 @@ export declare class UCarousel extends UElement {
33
36
  navigation: boolean;
34
37
  /** 페이지 페이지네이션 표시 */
35
38
  pagination: boolean;
39
+ /**
40
+ * 페이지네이션 모양 — `dots`(기본, 슬라이드 위에 겹친 점) · `labels`(슬라이드 아래 줄에 각 슬라이드의 이름과 진행 막대).
41
+ * `labels` 는 벽걸이 화면처럼 «지금 어느 장이고 다음은 무엇이며 언제 넘어가는가» 를 멀리서 읽어야 할 때다. 이름은 슬라이드에
42
+ * 단 `aria-label` 이고(없으면 순번), 넘기는 동안 현재 칸의 막대가 `autoplay-interval` 만큼 차오른다.
43
+ */
44
+ paginationStyle: 'dots' | 'labels';
36
45
  /** 드래그로 슬라이드 이동 */
37
46
  draggable: boolean;
38
47
  /** 한 화면에 표시할 슬라이드 수 */
@@ -74,6 +83,10 @@ export declare class UCarousel extends UElement {
74
83
  protected willUpdate(changedProperties: PropertyValues): void;
75
84
  protected updated(changedProperties: PropertyValues): void;
76
85
  render(): import('lit-html').TemplateResult<1>;
86
+ /** 이름 칸 — 지나온 칸은 찬 막대, 현재 칸은 넘기는 동안 간격만큼 차오르는 막대(멈추면 빈 막대). */
87
+ private renderLabels;
88
+ /** 한 칸의 이름 — 그 칸 첫 슬라이드에 소비자가 단 `aria-label`, 없으면 순번. */
89
+ private pageLabel;
77
90
  prev: () => void;
78
91
  next: () => void;
79
92
  goTo: (index: number) => void;
@@ -9,6 +9,7 @@ import { styles } from "./UCarousel.styles.js";
9
9
  import { html, nothing } from "lit";
10
10
  import { customElement, property, state } from "lit/decorators.js";
11
11
  import { ifDefined } from "lit/directives/if-defined.js";
12
+ import { keyed } from "lit/directives/keyed.js";
12
13
  // src/components/carousel/UCarousel.ts
13
14
  var UCarousel = class UCarousel extends UElement {
14
15
  constructor(..._args) {
@@ -18,6 +19,7 @@ var UCarousel = class UCarousel extends UElement {
18
19
  this.loop = false;
19
20
  this.navigation = false;
20
21
  this.pagination = false;
22
+ this.paginationStyle = "dots";
21
23
  this.draggable = false;
22
24
  this.slidesPerView = 1;
23
25
  this.slidesPerMove = 1;
@@ -211,7 +213,7 @@ var UCarousel = class UCarousel extends UElement {
211
213
  <u-icon lib="internal" name=${this.rotationStopped ? "player-play-fill" : "player-pause-fill"}></u-icon>
212
214
  </button>
213
215
  ` : nothing}
214
- ${!this.showDots ? nothing : Array.from({ length: this.pageCount }, (_, i) => html`
216
+ ${!this.showDots ? nothing : this.paginationStyle === "labels" ? this.renderLabels() : Array.from({ length: this.pageCount }, (_, i) => html`
215
217
  <button part="dot" class="dot"
216
218
  aria-label=${Locale.getValue("goToSlide", { n: i + 1 })}
217
219
  aria-current=${i === this.currentPage ? "true" : "false"}
@@ -222,6 +224,28 @@ var UCarousel = class UCarousel extends UElement {
222
224
  </div>
223
225
  `;
224
226
  }
227
+ /** 이름 칸 — 지나온 칸은 찬 막대, 현재 칸은 넘기는 동안 간격만큼 차오르는 막대(멈추면 빈 막대). */
228
+ renderLabels() {
229
+ const current = this.currentPage;
230
+ return Array.from({ length: this.pageCount }, (_, i) => {
231
+ const fill = i === current && this.rotating ? keyed(`${this.index}`, html`<span part="dot-progress" class="tab-fill running"
232
+ style="animation-duration: ${this.autoplayInterval}ms"></span>`) : html`<span part="dot-progress" class="tab-fill" ?full=${i < current}></span>`;
233
+ return html`
234
+ <button part="dot" class="tab"
235
+ aria-current=${i === current ? "true" : "false"}
236
+ ?active=${i === current}
237
+ @click=${() => this.goTo(Math.min(i * this.perMove, this.maxIndex))}>
238
+ <span part="dot-label" class="tab-label">${this.pageLabel(i)}</span>
239
+ <span part="dot-track" class="tab-track">${fill}</span>
240
+ </button>
241
+ `;
242
+ });
243
+ }
244
+ /** 한 칸의 이름 — 그 칸 첫 슬라이드에 소비자가 단 `aria-label`, 없으면 순번. */
245
+ pageLabel(page) {
246
+ const slide = this.slides[Math.min(page * this.perMove, this.maxIndex)];
247
+ return !(slide ? this.ownedSlideAttrs.get(slide)?.includes("aria-label") : true) && slide?.getAttribute("aria-label") || String(page + 1);
248
+ }
225
249
  startAutoplay() {
226
250
  this.stopAutoplay();
227
251
  this.autoplayTimer = window.setInterval(() => {
@@ -295,6 +319,11 @@ __decorate([property({
295
319
  type: Boolean,
296
320
  reflect: true
297
321
  }), __decorateMetadata("design:type", Object)], UCarousel.prototype, "pagination", void 0);
322
+ __decorate([property({
323
+ type: String,
324
+ reflect: true,
325
+ attribute: "pagination-style"
326
+ }), __decorateMetadata("design:type", String)], UCarousel.prototype, "paginationStyle", void 0);
298
327
  __decorate([property({
299
328
  type: Boolean,
300
329
  reflect: true
@@ -78,12 +78,12 @@ var styles = css`
78
78
  align-items: center;
79
79
  justify-content: center;
80
80
 
81
- width: max(24px, var(--u-target-size, 0px));
82
- height: max(24px, var(--u-target-size, 0px));
81
+ width: max(calc(var(--u-text-label-size, 13px) * 24 / 13), var(--u-target-size, 0px));
82
+ height: max(calc(var(--u-text-label-size, 13px) * 24 / 13), var(--u-target-size, 0px));
83
83
  padding: 0;
84
84
  border: none;
85
85
  border-radius: var(--u-radius-circle, 50%);
86
- font-size: 12px;
86
+ font-size: calc(var(--u-text-label-size, 13px) * 12 / 13);
87
87
  color: var(--u-neutral-900, #212121);
88
88
  background-color: var(--u-neutral-100, #F5F5F5);
89
89
  box-shadow: var(--u-shadow-md, 0 2px 8px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.05));
@@ -132,6 +132,73 @@ var styles = css`
132
132
  .dot:hover {
133
133
  background-color: var(--u-neutral-200, #EEEEEE);
134
134
  }
135
+
136
+ :host([pagination-style="labels"]) {
137
+ display: flex;
138
+ flex-direction: column;
139
+ }
140
+ :host([pagination-style="labels"]) .slides-wrapper {
141
+ flex: 1 1 auto;
142
+ min-height: 0;
143
+ }
144
+ :host([pagination-style="labels"]) .indicator {
145
+ position: static;
146
+ transform: none;
147
+ display: flex;
148
+ align-items: end;
149
+ gap: var(--u-space-lg, 16px);
150
+ padding-top: var(--u-space-lg, 16px);
151
+ }
152
+ .tab {
153
+ flex: 1 1 0;
154
+ min-width: 0;
155
+ display: flex;
156
+ flex-direction: column;
157
+ gap: var(--u-space-sm, 8px);
158
+ padding: var(--u-space-xs, 6px) 0;
159
+ border: 0;
160
+ background: none;
161
+ font: inherit;
162
+ font-size: var(--u-text-label-size, 13px);
163
+ text-align: start;
164
+ color: var(--u-txt-color-weak, #616161);
165
+ cursor: pointer;
166
+ }
167
+ .tab[active] {
168
+ font-weight: 700;
169
+ color: var(--u-txt-color, #212121);
170
+ }
171
+ .tab-label {
172
+ overflow: hidden;
173
+ white-space: nowrap;
174
+ text-overflow: ellipsis;
175
+ }
176
+ .tab-track {
177
+ display: block;
178
+ height: 6px;
179
+ border-radius: var(--u-radius-pill, 9999px);
180
+ background: var(--u-border-color, #E0E0E0);
181
+ overflow: hidden;
182
+ }
183
+ .tab-fill {
184
+ display: block;
185
+ width: 0;
186
+ height: 100%;
187
+ background: currentColor;
188
+ }
189
+ .tab-fill[full] {
190
+ width: 100%;
191
+ }
192
+ .tab-fill.running {
193
+ animation-name: u-carousel-progress;
194
+ animation-timing-function: linear;
195
+ animation-fill-mode: forwards;
196
+ }
197
+ @keyframes u-carousel-progress {
198
+ from { width: 0; }
199
+ to { width: 100%; }
200
+ }
201
+
135
202
  .dot[active] {
136
203
  --_dot-w: 24px;
137
204
 
package/dist/index.d.ts CHANGED
@@ -10,6 +10,7 @@ export * from './components/breadcrumb-item/UBreadcrumbItem.js';
10
10
  export * from './components/button/UButton.js';
11
11
  export * from './components/button-group/UButtonGroup.js';
12
12
  export * from './components/card/UCard.js';
13
+ export * from './components/auto-scroll/UAutoScroll.js';
13
14
  export * from './components/carousel/UCarousel.js';
14
15
  export * from './components/checkbox/UCheckbox.js';
15
16
  export * from './components/chip/UChip.js';
package/dist/index.js CHANGED
@@ -22,6 +22,7 @@ import { UTooltip } from "./components/tooltip/UTooltip.js";
22
22
  import { UIconButton } from "./components/icon-button/UIconButton.js";
23
23
  import { UButtonGroup } from "./components/button-group/UButtonGroup.js";
24
24
  import { UCard } from "./components/card/UCard.js";
25
+ import { UAutoScroll } from "./components/auto-scroll/UAutoScroll.js";
25
26
  import { UCarousel } from "./components/carousel/UCarousel.js";
26
27
  import { UCheckbox } from "./components/checkbox/UCheckbox.js";
27
28
  import { UTag } from "./components/tag/UTag.js";
@@ -70,4 +71,4 @@ import { Dialog } from "./utilities/Dialog.js";
70
71
  import { Theme } from "./utilities/Theme.js";
71
72
  import { Toast } from "./utilities/Toast.js";
72
73
  import { decodeDelimited, decodeTsv, encodeTsv } from "./utilities/tsv.js";
73
- export { ALERT_STATUSES, BrowserStorage, CompositionTracker, Dialog, IconCache, IconRegistry, Locale, OverlayManager, Theme, Toast, UAlert, UAvatar, UBadge, UBreadcrumb, UBreadcrumbItem, UButton, UButtonGroup, UCard, UCarousel, UCheckbox, UChip, UCopyButton, UDatePicker, UDateRangePicker, UDialog, UDivider, UDrawer, UElement, UExpander, UField, UFileInput, UFloatingElement, UForm, UFormControlElement, UIcon, UIconButton, UInput, UMenu, UMenuItem, UOption, UOptionGroup, UOverlayElement, UPagination, UPanel, UPopover, UProgressBar, UProgressRing, URadio, URating, USelect, USkeleton, USlider, USpinner, USplitPanel, USteps, USwitch, UTab, UTabNav, UTabPanel, UTag, UText, UTextarea, UTooltip, UTree, UTreeItem, arrayAttrConverter, booleanAttrConverter, collectOptions, copyFromKey, createDevWarner, dateAttrConverter, dateTextPattern, decodeDelimited, decodeTsv, defaultSearchMatch, devWarnOnce, encodeTsv, foldForSearch, formatCurrency, formatDate, formatDateRange, formatDateRangeText, formatDateText, formatDateTimeRangeText, formatDateTimeText, formatNumber, getDefaultBaseUrl, getParentElement, hangulKeystrokes, initialsOf, isCoarsePointer, isFocusCandidate, isFromControl, isHangul, isImeComposing, isTextEntry, jsonAttrConverter, localOffset, parseDate, parseDateRange, parseDateTime, parseDateTimeRange, parseNumber, pasteFromKey, querySelectorAllWithin, querySelectorDeep, querySelectorWithin, readDateValue, replayInput, resetDevWarnings, setDefaultBaseUrl, urlAttrConverter, writeInstant, writePlainDate, writePlainDateTime };
74
+ export { ALERT_STATUSES, BrowserStorage, CompositionTracker, Dialog, IconCache, IconRegistry, Locale, OverlayManager, Theme, Toast, UAlert, UAutoScroll, UAvatar, UBadge, UBreadcrumb, UBreadcrumbItem, UButton, UButtonGroup, UCard, UCarousel, UCheckbox, UChip, UCopyButton, UDatePicker, UDateRangePicker, UDialog, UDivider, UDrawer, UElement, UExpander, UField, UFileInput, UFloatingElement, UForm, UFormControlElement, UIcon, UIconButton, UInput, UMenu, UMenuItem, UOption, UOptionGroup, UOverlayElement, UPagination, UPanel, UPopover, UProgressBar, UProgressRing, URadio, URating, USelect, USkeleton, USlider, USpinner, USplitPanel, USteps, USwitch, UTab, UTabNav, UTabPanel, UTag, UText, UTextarea, UTooltip, UTree, UTreeItem, arrayAttrConverter, booleanAttrConverter, collectOptions, copyFromKey, createDevWarner, dateAttrConverter, dateTextPattern, decodeDelimited, decodeTsv, defaultSearchMatch, devWarnOnce, encodeTsv, foldForSearch, formatCurrency, formatDate, formatDateRange, formatDateRangeText, formatDateText, formatDateTimeRangeText, formatDateTimeText, formatNumber, getDefaultBaseUrl, getParentElement, hangulKeystrokes, initialsOf, isCoarsePointer, isFocusCandidate, isFromControl, isHangul, isImeComposing, isTextEntry, jsonAttrConverter, localOffset, parseDate, parseDateRange, parseDateTime, parseDateTimeRange, parseNumber, pasteFromKey, querySelectorAllWithin, querySelectorDeep, querySelectorWithin, readDateValue, replayInput, resetDevWarnings, setDefaultBaseUrl, urlAttrConverter, writeInstant, writePlainDate, writePlainDateTime };
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import { UAutoScroll as UAutoScrollElement } from '@iyulab/components/dist/components/auto-scroll/UAutoScroll.js';
3
+
4
+ type UAutoScrollOwnProps = Omit<UAutoScrollElement, keyof HTMLElement>;
5
+
6
+ export declare const UAutoScroll: React.ForwardRefExoticComponent<
7
+ Partial<Omit<UAutoScrollElement, Exclude<keyof React.HTMLAttributes<UAutoScrollElement>, keyof UAutoScrollOwnProps>>>
8
+ & Omit<React.HTMLAttributes<UAutoScrollElement>, keyof UAutoScrollOwnProps | never>
9
+ & React.RefAttributes<UAutoScrollElement>
10
+ & {
11
+ }
12
+ >;
13
+
14
+ export type UAutoScrollProps = React.ComponentProps<typeof UAutoScroll>;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { createComponent } from '@lit/react';
3
+ import { UAutoScroll as UAutoScrollElement } from '@iyulab/components/dist/components/auto-scroll/UAutoScroll.js';
4
+
5
+ export const UAutoScroll = createComponent({
6
+ react: React,
7
+ tagName: 'u-auto-scroll',
8
+ elementClass: UAutoScrollElement,
9
+ events: {},
10
+ });
@@ -48,4 +48,5 @@ export { UBreadcrumbItem, UBreadcrumbItemProps } from './UBreadcrumbItem';
48
48
  export { UBreadcrumb, UBreadcrumbProps } from './UBreadcrumb';
49
49
  export { UBadge, UBadgeProps } from './UBadge';
50
50
  export { UAvatar, UAvatarProps } from './UAvatar';
51
+ export { UAutoScroll, UAutoScrollProps } from './UAutoScroll';
51
52
  export { UAlert, UAlertProps } from './UAlert';
@@ -48,4 +48,5 @@ export { UBreadcrumbItem } from './UBreadcrumbItem.js';
48
48
  export { UBreadcrumb } from './UBreadcrumb.js';
49
49
  export { UBadge } from './UBadge.js';
50
50
  export { UAvatar } from './UAvatar.js';
51
+ export { UAutoScroll } from './UAutoScroll.js';
51
52
  export { UAlert } from './UAlert.js';
@@ -63,6 +63,21 @@ export declare class Theme {
63
63
  * 현재 문서에 적용할 테마를 설정합니다.
64
64
  */
65
65
  static set(theme: ThemeType): void;
66
+ /** 지금 걸린 일시 테마({@link override}) — 없으면 선호가 적용된다. */
67
+ private static overridden;
68
+ /**
69
+ * 선호를 바꾸지 않고 **지금 문서에만** 테마를 겁니다 — 저장하지 않고, `get()`(선호)도 그대로입니다.
70
+ * `null` 이면 걷고 선호(`set()` 으로 고른 값, 또는 system 의 OS 값)로 돌아갑니다.
71
+ *
72
+ * 화면 하나가 자기 바탕을 정할 때 씁니다 — 벽에 거는 현장 보드는 사용자가 밝은 테마를 골랐어도 어둡게 서야 하고,
73
+ * 그 화면을 떠나면 사용자의 선택으로 돌아와야 합니다. `set()` 으로 하면 그 선택을 덮어 저장해 버립니다.
74
+ *
75
+ * ```ts
76
+ * Theme.override('dark'); // 보드에 들어올 때
77
+ * Theme.override(null); // 떠날 때 — 선호로 돌아간다
78
+ * ```
79
+ */
80
+ static override(theme: 'light' | 'dark' | null): void;
66
81
  /** 시스템 테마 변경을 처리하는 메서드 */
67
82
  private static handleSystemThemeChanged;
68
83
  /** 마지막으로 지정된 브랜드 시드. 테마가 바뀌면 이 값으로 램프를 다시 계산한다. */
@@ -138,12 +138,12 @@ var Theme = class {
138
138
  } else if (theme === "dark") {
139
139
  media.removeEventListener("change", this.handleSystemThemeChanged);
140
140
  document.documentElement.setAttribute("data-theme", "dark");
141
- document.documentElement.setAttribute("theme", "dark");
141
+ if (!this.overridden) document.documentElement.setAttribute("theme", "dark");
142
142
  this.log("dark theme applied (data-theme=dark, theme=dark)");
143
143
  } else if (theme === "light") {
144
144
  media.removeEventListener("change", this.handleSystemThemeChanged);
145
145
  document.documentElement.setAttribute("data-theme", "light");
146
- document.documentElement.setAttribute("theme", "light");
146
+ if (!this.overridden) document.documentElement.setAttribute("theme", "light");
147
147
  this.log("light theme applied (data-theme=light, theme=light)");
148
148
  } else throw new Error(`Invalid theme: ${theme}. Use 'light', 'dark', or 'system'.`);
149
149
  } catch (e) {
@@ -155,8 +155,36 @@ var Theme = class {
155
155
  this.log("saved theme to storage", theme);
156
156
  }
157
157
  }
158
+ static {
159
+ this.overridden = null;
160
+ }
161
+ /**
162
+ * 선호를 바꾸지 않고 **지금 문서에만** 테마를 겁니다 — 저장하지 않고, `get()`(선호)도 그대로입니다.
163
+ * `null` 이면 걷고 선호(`set()` 으로 고른 값, 또는 system 의 OS 값)로 돌아갑니다.
164
+ *
165
+ * 화면 하나가 자기 바탕을 정할 때 씁니다 — 벽에 거는 현장 보드는 사용자가 밝은 테마를 골랐어도 어둡게 서야 하고,
166
+ * 그 화면을 떠나면 사용자의 선택으로 돌아와야 합니다. `set()` 으로 하면 그 선택을 덮어 저장해 버립니다.
167
+ *
168
+ * ```ts
169
+ * Theme.override('dark'); // 보드에 들어올 때
170
+ * Theme.override(null); // 떠날 때 — 선호로 돌아간다
171
+ * ```
172
+ */
173
+ static override(theme) {
174
+ this.overridden = theme;
175
+ const root = document.documentElement;
176
+ if (theme) root.setAttribute("theme", theme);
177
+ else {
178
+ const preference = this.get();
179
+ const applied = preference === "dark" || preference === "light" ? preference : window.matchMedia?.("(prefers-color-scheme: dark)").matches ? "dark" : "light";
180
+ root.setAttribute("theme", applied);
181
+ }
182
+ this.applyAccent();
183
+ this.log("theme override", theme ?? "(cleared)");
184
+ }
158
185
  static {
159
186
  this.handleSystemThemeChanged = (_) => {
187
+ if (this.overridden) return;
160
188
  if (document.documentElement.getAttribute("data-theme") === "system") {
161
189
  const isDark = window.matchMedia("(prefers-color-scheme: dark)").matches;
162
190
  document.documentElement.setAttribute("theme", isDark ? "dark" : "light");
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@iyulab/components",
3
3
  "description": "web-components library based on lit-element made by iyulab",
4
- "version": "2.31.0",
4
+ "version": "2.32.0",
5
5
  "keywords": [
6
6
  "iyulab",
7
7
  "components",
@@ -118,7 +118,8 @@ set on the host yourself always wins and is never overwritten.
118
118
  ### Layout & Display
119
119
 
120
120
  - [`u-card`](./references/components/card.md) — Content card with media, header, and footer slots
121
- - [`u-carousel`](./references/components/carousel.md) — Slide carousel with autoplay, navigation, and pagination
121
+ - [`u-auto-scroll`](./references/components/auto-scroll.md) — A box that scrolls its overflowing content by itself, for a screen nobody touches (wall display, kiosk)
122
+ - [`u-carousel`](./references/components/carousel.md) — Slide carousel with autoplay, navigation, and pagination (dots, or named tabs with progress for a wall display)
122
123
  - [`u-split-panel`](./references/components/split-panel.md) — Resizable two-panel layout
123
124
  - [`u-panel`](./references/components/panel.md) — General-purpose content panel
124
125
  - [`u-expander`](./references/components/expander.md) — Disclosure section; header toggles the body open/closed
@@ -0,0 +1,58 @@
1
+ # u-auto-scroll
2
+
3
+ ```ts
4
+ import '@iyulab/components/dist/components/auto-scroll/UAutoScroll.js';
5
+ ```
6
+
7
+ **Tag:** `u-auto-scroll`
8
+
9
+ A box that scrolls its own overflowing content, slowly, for a screen nobody touches — a wall display on the
10
+ production floor, a kiosk, a lobby screen — so a list longer than the screen is still read to its end.
11
+
12
+ One round: it waits `pause` at the top, scrolls to the end at `speed` (px per second), waits `pause` at the end and
13
+ returns to the top. Content that fits does not move. It steps aside for a person: it stands still while the mouse is
14
+ over it or focus is inside it, and scrolling by hand always works (it carries on from where the person left it).
15
+ For a user who asked for reduced motion (`prefers-reduced-motion: reduce`) it does not move at all. When it leaves the
16
+ screen and comes back — a carousel returning to its slide — it starts over from the top.
17
+
18
+ While its content overflows, the box is a keyboard scroll region (`tabindex="0"`; a `tabindex` you set is kept).
19
+
20
+ ```html
21
+ <!-- A rotating floor board: each slide's list runs to its end within the slide -->
22
+ <u-carousel autoplay loop pagination pagination-style="labels" autoplay-interval="20000" style="height: 100vh">
23
+ <section aria-label="Late" style="display: flex; flex-direction: column">
24
+ <h1>Late orders</h1>
25
+ <u-auto-scroll duration="20000" pause="3000" style="flex: 1">
26
+ <ol>…</ol>
27
+ </u-auto-scroll>
28
+ </section>
29
+ </u-carousel>
30
+ ```
31
+
32
+ Give it a height — a fixed one, or `flex: 1` in a column with `min-height: 0` (the host sets it). Where the time on
33
+ screen is fixed — a carousel slide shown for 20 seconds — set `duration` to that time: the box then works out its own
34
+ speed from the distance, so a list of any length reaches its end within the slide (the two waits come out of it).
35
+ Otherwise it scrolls at `speed`.
36
+
37
+ ---
38
+
39
+ ## Slots
40
+
41
+ | Name | Description |
42
+ |------|-------------|
43
+ | *(default)* | The content to scroll |
44
+
45
+ ## Properties
46
+
47
+ | Property | Type | Default | Reflect | Description |
48
+ |----------|------|---------|---------|-------------|
49
+ | `speed` | `number` | `30` | — | Scroll speed in px per second — `duration` overrides it |
50
+ | `duration` | `number` | `0` | — | Time for one round (wait + scroll + wait), in ms; the speed follows from the distance. `0` uses `speed` |
51
+ | `pause` | `number` | `3000` | — | Wait at the top and at the end, in ms |
52
+ | `paused` | `boolean` | `false` | ✓ | Do not scroll by itself — by hand only |
53
+
54
+ ## Methods
55
+
56
+ | Method | Description |
57
+ |--------|-------------|
58
+ | `restart()` | Back to the top, and start the round over |
@@ -34,6 +34,23 @@ position ("2 of 5"). Name the carousel with `aria-label` on the host — a regio
34
34
  landmark. A `role`, `aria-roledescription` or `aria-label` you put on a slide is kept; only the empty
35
35
  ones are filled.
36
36
 
37
+ ### A rotating wall display — `pagination-style="labels"`
38
+
39
+ For a screen read from across a room, the dots are not enough: the viewer has to see which page this is, what comes
40
+ next and when it changes. `labels` draws a row under the slides (never over them — it would cover a list's last
41
+ row): each tab is named by its slide's `aria-label` (the position when there is none), the passed tabs are full, and
42
+ the current tab fills over `autoplay-interval` while the carousel rotates. When rotation stops, the fill stops too.
43
+
44
+ ```html
45
+ <u-carousel autoplay loop pagination pagination-style="labels" autoplay-interval="20000" aria-label="Floor board">
46
+ <section aria-label="Late">…</section>
47
+ <section aria-label="Stages">…</section>
48
+ <section aria-label="Batches">…</section>
49
+ </u-carousel>
50
+ ```
51
+
52
+ Give the carousel a height (`flex: 1` in a full-screen column, or a fixed height) — the row takes its share of it.
53
+
37
54
  ---
38
55
 
39
56
  ## Slots
@@ -51,6 +68,7 @@ ones are filled.
51
68
  | `loop` | `boolean` | `false` | Loop from last to first |
52
69
  | `navigation` | `boolean` | `false` | Show prev/next buttons |
53
70
  | `pagination` | `boolean` | `false` | Show dot pagination |
71
+ | `paginationStyle` | `'dots'\|'labels'` | `'dots'` | `pagination-style` — `labels` puts a row under the slides: each slide's name and a progress bar (see below) |
54
72
  | `draggable` | `boolean` | `false` | Drag to navigate |
55
73
  | `slidesPerView` | `number` | `1` | Visible slides at once |
56
74
  | `slidesPerMove` | `number` | `1` | Slides to advance per step |
@@ -73,5 +91,8 @@ ones are filled.
73
91
  | `prev-button` | Previous navigation button |
74
92
  | `next-button` | Next navigation button |
75
93
  | `indicator` | Pagination indicator wrapper |
76
- | `dot` | Individual pagination dot |
94
+ | `dot` | Individual pagination dot — with `labels`, one named tab |
95
+ | `dot-label` | A tab's name (`labels` only) |
96
+ | `dot-track` | A tab's progress track (`labels` only) |
97
+ | `dot-progress` | A tab's fill — runs over `autoplay-interval` on the current tab while rotating (`labels` only) |
77
98
  | `rotation-button` | Stop/start button (only with `autoplay`, inside the indicator) |
@@ -61,6 +61,15 @@ changes**, because those targets are relative to the page background.
61
61
  > `iyu.base`, so an unlayered `:root` override applies in both themes. Scope a mode-specific value
62
62
  > yourself with `:root[theme="dark"] { … }`.
63
63
 
64
+ ## A screen with its own theme
65
+
66
+ `Theme.override('dark')` applies a theme to the document without touching the user's preference: nothing is stored,
67
+ `get()` still answers the preference, `resolved()` and `<html theme>` answer the override. `Theme.override(null)` clears
68
+ it and returns to the preference (under `'system'`, the OS value at that moment). A preference set while an override
69
+ is on waits until it is cleared. Use it for a screen that owns its background — a floor board on a TV stays dark even
70
+ where the user chose light — and clear it when that screen goes (`@iyulab/modern-app` does both for a route with
71
+ `metadata: { theme }`).
72
+
64
73
  ## API
65
74
 
66
75
  | Member | Type | Description |
@@ -69,6 +78,7 @@ changes**, because those targets are relative to the page background.
69
78
  | `Theme.get()` | `ThemeType \| undefined` | Get current theme |
70
79
  | `Theme.set(theme)` | `void` | Set theme (`'light'`, `'dark'`, `'system'`) |
71
80
  | `Theme.resolved()` | `'light' \| 'dark'` | The theme actually applied — use this, not `get()`, for brightness branches |
81
+ | `Theme.override(theme)` | `void` | Apply `'light'` / `'dark'` without changing or storing the preference; `null` returns to the preference |
72
82
  | `Theme.accent(seed)` | `void` | Derive the `--u-primary-*` ramp from a brand color; `null` clears it |
73
83
  | `Theme.isInitialized` | `boolean` | Whether `init()` has been called |
74
84