@iyulab/components 2.32.0 → 2.34.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 (73) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/dist/assets/locales/ar.json.js +3 -1
  3. package/dist/assets/locales/de.json.js +3 -1
  4. package/dist/assets/locales/en.json.js +3 -1
  5. package/dist/assets/locales/es.json.js +3 -1
  6. package/dist/assets/locales/fr.json.js +3 -1
  7. package/dist/assets/locales/id.json.js +3 -1
  8. package/dist/assets/locales/ja.json.js +3 -1
  9. package/dist/assets/locales/ko.json.js +3 -1
  10. package/dist/assets/locales/pt-BR.json.js +3 -1
  11. package/dist/assets/locales/ru.json.js +3 -1
  12. package/dist/assets/locales/th.json.js +3 -1
  13. package/dist/assets/locales/vi.json.js +3 -1
  14. package/dist/assets/locales/zh-CN.json.js +3 -1
  15. package/dist/assets/locales/zh-TW.json.js +3 -1
  16. package/dist/components/auto-scroll/UAutoScroll.d.ts +14 -0
  17. package/dist/components/auto-scroll/UAutoScroll.js +25 -2
  18. package/dist/components/badge/UBadge.d.ts +2 -0
  19. package/dist/components/badge/UBadge.js +4 -2
  20. package/dist/components/badge/UBadge.styles.js +11 -2
  21. package/dist/components/breadcrumb-item/UBreadcrumbItem.d.ts +2 -0
  22. package/dist/components/breadcrumb-item/UBreadcrumbItem.js +6 -4
  23. package/dist/components/breadcrumb-item/UBreadcrumbItem.styles.js +11 -2
  24. package/dist/components/button/UButton.d.ts +2 -0
  25. package/dist/components/button/UButton.js +4 -2
  26. package/dist/components/button/UButton.styles.js +11 -2
  27. package/dist/components/card/UCard.d.ts +9 -0
  28. package/dist/components/card/UCard.js +4 -0
  29. package/dist/components/card/UCard.styles.js +29 -0
  30. package/dist/components/carousel/UCarousel.d.ts +23 -1
  31. package/dist/components/carousel/UCarousel.js +64 -5
  32. package/dist/components/dialog/UDialog.d.ts +3 -0
  33. package/dist/components/dialog/UDialog.js +8 -1
  34. package/dist/components/dialog/UDialog.styles.js +10 -3
  35. package/dist/components/drawer/UDrawer.d.ts +3 -0
  36. package/dist/components/drawer/UDrawer.js +8 -1
  37. package/dist/components/drawer/UDrawer.styles.js +10 -3
  38. package/dist/components/input/UInput.d.ts +2 -0
  39. package/dist/components/input/UInput.js +4 -2
  40. package/dist/components/input/UInput.styles.js +11 -2
  41. package/dist/components/menu-item/UMenuItem.d.ts +2 -0
  42. package/dist/components/menu-item/UMenuItem.js +4 -2
  43. package/dist/components/menu-item/UMenuItem.styles.js +11 -2
  44. package/dist/components/option/UOption.d.ts +2 -0
  45. package/dist/components/option/UOption.js +4 -2
  46. package/dist/components/option/UOption.styles.js +16 -2
  47. package/dist/components/radio/URadio.styles.js +5 -2
  48. package/dist/components/select/USelect.d.ts +21 -2
  49. package/dist/components/select/USelect.js +144 -41
  50. package/dist/components/select/USelect.styles.js +60 -22
  51. package/dist/components/steps/USteps.d.ts +11 -2
  52. package/dist/components/steps/USteps.js +16 -4
  53. package/dist/components/steps/USteps.styles.js +57 -0
  54. package/dist/components/tab/UTab.d.ts +2 -0
  55. package/dist/components/tab/UTab.js +4 -2
  56. package/dist/components/tab/UTab.styles.js +16 -2
  57. package/dist/components/tab-panel/UTabPanel.styles.js +14 -14
  58. package/dist/components/tree-item/UTreeItem.d.ts +2 -0
  59. package/dist/components/tree-item/UTreeItem.js +4 -2
  60. package/dist/components/tree-item/UTreeItem.styles.js +11 -2
  61. package/dist/utilities/Locale.d.ts +1 -1
  62. package/dist/utilities/slotPresence.d.ts +21 -0
  63. package/dist/utilities/slotPresence.js +41 -0
  64. package/dist/utilities/unattended.d.ts +5 -0
  65. package/dist/utilities/unattended.js +7 -0
  66. package/package.json +1 -1
  67. package/skills/iyulab-components/references/components/auto-scroll.md +5 -0
  68. package/skills/iyulab-components/references/components/card.md +12 -0
  69. package/skills/iyulab-components/references/components/carousel.md +19 -1
  70. package/skills/iyulab-components/references/components/dialog.md +1 -0
  71. package/skills/iyulab-components/references/components/drawer.md +1 -0
  72. package/skills/iyulab-components/references/components/select.md +16 -11
  73. package/skills/iyulab-components/references/components/steps.md +24 -4
@@ -97,6 +97,63 @@ var styles = css`
97
97
  background: var(--steps-connector-done-color, var(--u-txt-color-weak, #616161));
98
98
  }
99
99
 
100
+
101
+ .step[data-status="skipped"] {
102
+ color: var(--u-txt-color-weaker, #757575);
103
+ }
104
+ .step[data-status="skipped"] .marker {
105
+ border-style: dashed;
106
+ }
107
+
108
+
109
+ :host([appearance="bars"]) .base {
110
+ align-items: flex-start;
111
+ }
112
+ :host([appearance="bars"]) .list {
113
+ display: grid;
114
+ align-items: start;
115
+ gap: var(--u-space-sm, 8px);
116
+ }
117
+ :host([appearance="bars"]) .step {
118
+ flex-direction: column;
119
+ align-items: stretch;
120
+ gap: 2px;
121
+ min-width: 0;
122
+ white-space: normal;
123
+ }
124
+ :host([appearance="bars"]) .marker {
125
+ width: auto;
126
+ height: var(--steps-bar-height, 6px);
127
+ margin-bottom: var(--u-space-xs, 6px);
128
+ border: 0;
129
+ border-radius: var(--u-radius-pill, 9999px);
130
+ background: var(--u-border-color, #E0E0E0);
131
+ }
132
+ :host([appearance="bars"]) .step[data-status="complete"] .marker,
133
+ :host([appearance="bars"]) .step[data-status="current"] .marker {
134
+ border: 0;
135
+ background: var(--steps-bar-color, var(--u-primary-color, #1976D2));
136
+ }
137
+ :host([appearance="bars"]) .step[data-status="hold"] .marker {
138
+ border: 0;
139
+ background: var(--u-warning-color, #FDD835);
140
+ }
141
+ :host([appearance="bars"]) .step[data-status="skipped"] .marker {
142
+ border: 0;
143
+ background: var(--u-border-color, #E0E0E0);
144
+ }
145
+ :host([appearance="bars"]) .title {
146
+ font-size: var(--u-text-body-size, 14px);
147
+ color: var(--u-txt-color, #212121);
148
+ }
149
+ :host([appearance="bars"]) .step[data-status="upcoming"] .title,
150
+ :host([appearance="bars"]) .step[data-status="skipped"] .title {
151
+ color: var(--u-txt-color-weak, #616161);
152
+ }
153
+ :host([appearance="bars"]) .description {
154
+ font-variant-numeric: tabular-nums;
155
+ }
156
+
100
157
  .sr-only {
101
158
  position: absolute;
102
159
  width: 1px;
@@ -21,6 +21,8 @@ export type TabCountAppearance = 'badge' | 'plain';
21
21
  */
22
22
  export declare class UTab extends UElement {
23
23
  static styles: import('lit').CSSResultGroup[];
24
+ /** 접두 · 접미 슬롯이 찼는가 — 그 옆 간격은 섀도 안 상자가 갖는다(`::slotted` 여백은 문서의 전역 리셋에 진다). */
25
+ private readonly affixes;
24
26
  /** 탭 비활성화 여부 */
25
27
  disabled: boolean;
26
28
  /** 탭 닫기 가능 여부 */
@@ -2,6 +2,7 @@ import { Locale } from "../../utilities/Locale.js";
2
2
  import { UElement } from "../UElement.js";
3
3
  import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorateMetadata.js";
4
4
  import __decorate from "../../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorate.js";
5
+ import { SlotPresence } from "../../utilities/slotPresence.js";
5
6
  import "../button/UButton.js";
6
7
  import "../icon/UIcon.js";
7
8
  import { formatNumber } from "../../utilities/format.js";
@@ -17,6 +18,7 @@ var UTab = class UTab extends UElement {
17
18
  }
18
19
  constructor(..._args) {
19
20
  super(..._args);
21
+ this.affixes = new SlotPresence(this, ["prefix", "suffix"]);
20
22
  this.disabled = false;
21
23
  this.removable = false;
22
24
  this.value = "";
@@ -91,11 +93,11 @@ var UTab = class UTab extends UElement {
91
93
  }
92
94
  renderLabel() {
93
95
  return html`
94
- <slot name="prefix"></slot>
96
+ <span class="affix affix-prefix" ?hidden=${!this.affixes.has("prefix")}><slot name="prefix"></slot></span>
95
97
  <slot></slot>
96
98
  ${this.count == null || Number.isNaN(this.count) ? nothing : html`<span class="count ${(this.countAppearance ?? _UTab.countAppearance) === "plain" ? "plain" : "badge"}"
97
99
  part="count">${formatNumber(this.count)}</span>`}
98
- <slot name="suffix"></slot>
100
+ <span class="affix affix-suffix" ?hidden=${!this.affixes.has("suffix")}><slot name="suffix"></slot></span>
99
101
  `;
100
102
  }
101
103
  };
@@ -27,6 +27,11 @@ var styles = css`
27
27
 
28
28
  min-height: var(--u-target-size, 0px);
29
29
  border-radius: inherit;
30
+
31
+
32
+ border-style: solid;
33
+ border-width: var(--_tab-border-width, 0);
34
+ border-color: var(--_tab-border-color, transparent);
30
35
  }
31
36
 
32
37
  :host(:hover:not([disabled])) {
@@ -37,10 +42,19 @@ var styles = css`
37
42
  cursor: not-allowed;
38
43
  }
39
44
 
40
- ::slotted([slot="prefix"]) {
45
+
46
+ .affix {
47
+ display: inline-flex;
48
+ align-items: center;
49
+ flex: none;
50
+ }
51
+ .affix[hidden] {
52
+ display: none;
53
+ }
54
+ .affix-prefix {
41
55
  margin-right: 0.2em;
42
56
  }
43
- ::slotted([slot="suffix"]) {
57
+ .affix-suffix {
44
58
  margin-left: 0.2em;
45
59
  }
46
60
 
@@ -141,36 +141,36 @@ var styles = css`
141
141
  background-color: var(--u-neutral-0, #FFFFFF);
142
142
  }
143
143
 
144
+
145
+ :host([appearance="card"]) ::slotted(u-tab) {
146
+ --_tab-border-color: var(--u-border-color, #E0E0E0);
147
+ }
144
148
  :host([appearance="card"][placement="top"]) ::slotted(u-tab) {
145
- border-bottom: 1px solid var(--u-border-color, #E0E0E0);
146
- border-right: 1px solid var(--u-border-color, #E0E0E0);
149
+ --_tab-border-width: 0 1px 1px 0;
147
150
  }
148
151
  :host([appearance="card"][placement="top"]) ::slotted(u-tab[active]) {
149
- border-bottom: none;
152
+ --_tab-border-width: 0 1px 0 0;
150
153
  }
151
154
 
152
155
  :host([appearance="card"][placement="bottom"]) ::slotted(u-tab) {
153
- border-top: 1px solid var(--u-border-color, #E0E0E0);
154
- border-right: 1px solid var(--u-border-color, #E0E0E0);
156
+ --_tab-border-width: 1px 1px 0 0;
155
157
  }
156
158
  :host([appearance="card"][placement="bottom"]) ::slotted(u-tab[active]) {
157
- border-top: none;
159
+ --_tab-border-width: 0 1px 0 0;
158
160
  }
159
161
 
160
162
  :host([appearance="card"][placement="left"]) ::slotted(u-tab) {
161
- border-right: 1px solid var(--u-border-color, #E0E0E0);
162
- border-bottom: 1px solid var(--u-border-color, #E0E0E0);
163
+ --_tab-border-width: 0 1px 1px 0;
163
164
  }
164
165
  :host([appearance="card"][placement="left"]) ::slotted(u-tab[active]) {
165
- border-right: none;
166
+ --_tab-border-width: 0 0 1px 0;
166
167
  }
167
168
 
168
169
  :host([appearance="card"][placement="right"]) ::slotted(u-tab) {
169
- border-left: 1px solid var(--u-border-color, #E0E0E0);
170
- border-bottom: 1px solid var(--u-border-color, #E0E0E0);
170
+ --_tab-border-width: 0 0 1px 1px;
171
171
  }
172
172
  :host([appearance="card"][placement="right"]) ::slotted(u-tab[active]) {
173
- border-left: none;
173
+ --_tab-border-width: 0 0 1px 0;
174
174
  }
175
175
 
176
176
 
@@ -182,11 +182,11 @@ var styles = css`
182
182
  border-radius: var(--u-radius-xl, 8px);
183
183
  }
184
184
  :host([appearance="pill"]) ::slotted(u-tab) {
185
- border: 1px solid transparent;
185
+ --_tab-border-width: 1px;
186
186
  border-radius: var(--u-radius-lg, 6px);
187
187
  }
188
188
  :host([appearance="pill"]) ::slotted(u-tab[active]) {
189
- border-color: var(--u-border-color, #E0E0E0);
189
+ --_tab-border-color: var(--u-border-color, #E0E0E0);
190
190
  background-color: var(--u-neutral-0, #FFFFFF);
191
191
  box-shadow: var(--u-shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 1px rgba(0, 0, 0, 0.04));
192
192
  }
@@ -21,6 +21,8 @@ export type TreeItemTrigger = 'item' | 'icon';
21
21
  */
22
22
  export declare class UTreeItem extends UElement {
23
23
  static styles: import('lit').CSSResultGroup[];
24
+ /** 접두 · 접미 슬롯이 찼는가 — 그 옆 간격은 섀도 안 상자가 갖는다(`::slotted` 여백은 문서의 전역 리셋에 진다). */
25
+ private readonly affixes;
24
26
  /** 비활성화 여부 */
25
27
  disabled: boolean;
26
28
  /** 펼침/접힌 상태 */
@@ -3,6 +3,7 @@ import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.155.0/hel
3
3
  import __decorate from "../../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorate.js";
4
4
  import { HostAria } from "../../utilities/hostAria.js";
5
5
  import "../spinner/USpinner.js";
6
+ import { SlotPresence } from "../../utilities/slotPresence.js";
6
7
  import "../icon/UIcon.js";
7
8
  import { isFromNestedControl } from "../../utilities/nestedControl.js";
8
9
  import { styles } from "./UTreeItem.styles.js";
@@ -16,6 +17,7 @@ var UTreeItem = class UTreeItem extends UElement {
16
17
  }
17
18
  constructor(..._args) {
18
19
  super(..._args);
20
+ this.affixes = new SlotPresence(this, ["prefix", "suffix"]);
19
21
  this.disabled = false;
20
22
  this.expanded = false;
21
23
  this.selectable = false;
@@ -144,11 +146,11 @@ var UTreeItem = class UTreeItem extends UElement {
144
146
  ></u-icon>
145
147
  </span>
146
148
 
147
- <slot name="prefix"></slot>
149
+ <span class="affix affix-prefix" ?hidden=${!this.affixes.has("prefix")}><slot name="prefix"></slot></span>
148
150
  <div class="content" part="content">
149
151
  <slot @slotchange=${this.handleSlotChange}></slot>
150
152
  </div>
151
- <slot name="suffix"></slot>
153
+ <span class="affix affix-suffix" ?hidden=${!this.affixes.has("suffix")}><slot name="suffix"></slot></span>
152
154
  </div>
153
155
 
154
156
  <div class="subtree" part="subtree" ?hidden=${!this.expanded || this.leaf}>
@@ -44,10 +44,19 @@ var styles = css`
44
44
  background-color: color-mix(in srgb, var(--tree-item-color) 15%, var(--u-bg-color, #FFFFFF));
45
45
  }
46
46
 
47
- ::slotted([slot="prefix"]) {
47
+
48
+ .affix {
49
+ display: inline-flex;
50
+ align-items: center;
51
+ flex: none;
52
+ }
53
+ .affix[hidden] {
54
+ display: none;
55
+ }
56
+ .affix-prefix {
48
57
  margin-right: 0.2em;
49
58
  }
50
- ::slotted([slot="suffix"]) {
59
+ .affix-suffix {
51
60
  margin-left: 0.2em;
52
61
  }
53
62
 
@@ -4,7 +4,7 @@ export type SupportedLocale = 'en' | 'ko' | 'ja' | 'zh-CN' | 'zh-TW' | 'es' | 'f
4
4
  /** 내장 로케일은 자동완성되지만, 임의의 BCP47 태그도 그대로 받는다. */
5
5
  export type LocaleTag = SupportedLocale | (string & {});
6
6
  /** 라이브러리가 제공하는 chrome 문자열 키. 지금은 검증 메시지뿐이지만 이후 다른 UI 문구도 추가될 수 있다. */
7
- export type LocaleMessageKey = 'valueMissing' | 'badInput' | 'typeMismatch' | 'patternMismatch' | 'rangeUnderflow' | 'rangeOverflow' | 'stepMismatch' | 'tooShort' | 'tooLong' | 'increment' | 'decrement' | 'clear' | 'today' | 'time' | 'showPassword' | 'hidePassword' | 'previousSlide' | 'nextSlide' | 'goToSlide' | 'carousel' | 'slide' | 'slideOf' | 'stopSlideRotation' | 'startSlideRotation' | 'chooseDate' | 'chooseDateRange' | 'yesterday' | 'last7Days' | 'last30Days' | 'last3Months' | 'last6Months' | 'thisWeek' | 'lastWeek' | 'thisMonth' | 'lastMonth' | 'thisYear' | 'quickRanges' | 'rangeStartChosen' | 'previousMonth' | 'nextMonth' | 'close' | 'copy' | 'copied' | 'chooseFile' | 'noFileChosen' | 'filesSelected' | 'resizePanels' | 'loading' | 'breadcrumb' | 'search' | 'noMatches' | 'alertError' | 'alertWarning' | 'alertSuccess' | 'alertInfo' | 'alertNotice' | 'alertMessage' | 'remove' | 'closeTab' | 'confirm' | 'cancel' | 'ok' | 'stepComplete' | 'stepOnHold' | 'apply' | 'dateUnavailable' | 'startTime' | 'endTime' | 'timeAm' | 'timePm' | 'pagination' | 'previousPage' | 'nextPage' | 'pageN' | 'rowsPerPage' | 'rangeOfTotal';
7
+ export type LocaleMessageKey = 'valueMissing' | 'badInput' | 'typeMismatch' | 'patternMismatch' | 'rangeUnderflow' | 'rangeOverflow' | 'stepMismatch' | 'tooShort' | 'tooLong' | 'increment' | 'decrement' | 'clear' | 'today' | 'time' | 'showPassword' | 'hidePassword' | 'previousSlide' | 'nextSlide' | 'goToSlide' | 'carousel' | 'slide' | 'slideOf' | 'stopSlideRotation' | 'startSlideRotation' | 'chooseDate' | 'chooseDateRange' | 'yesterday' | 'last7Days' | 'last30Days' | 'last3Months' | 'last6Months' | 'thisWeek' | 'lastWeek' | 'thisMonth' | 'lastMonth' | 'thisYear' | 'quickRanges' | 'rangeStartChosen' | 'previousMonth' | 'nextMonth' | 'close' | 'copy' | 'copied' | 'chooseFile' | 'noFileChosen' | 'filesSelected' | 'resizePanels' | 'loading' | 'breadcrumb' | 'search' | 'noMatches' | 'alertError' | 'alertWarning' | 'alertSuccess' | 'alertInfo' | 'alertNotice' | 'alertMessage' | 'remove' | 'closeTab' | 'confirm' | 'cancel' | 'ok' | 'stepComplete' | 'stepOnHold' | 'stepSkipped' | 'apply' | 'dateUnavailable' | 'startTime' | 'endTime' | 'timeAm' | 'timePm' | 'pagination' | 'previousPage' | 'nextPage' | 'pageN' | 'rowsPerPage' | 'rangeOfTotal';
8
8
  type LocaleTable = Record<LocaleMessageKey, string>;
9
9
  /**
10
10
  * 글자가 검색어를 담는가 — 사람이 «찾았다» 고 여기는 일치. 글자마다 거르는 칸(`u-select` 의 검색 등)이 쓴다.
@@ -0,0 +1,21 @@
1
+ import { ReactiveController, ReactiveControllerHost } from 'lit';
2
+ /**
3
+ * 이름 붙은 슬롯(`prefix` · `suffix` 등)에 라이트 DOM 자식이 꽂혀 있는가 — 슬롯을 감싼 섀도 안 상자를 비었을 때 그리지 않으려고 쓴다.
4
+ *
5
+ * 슬롯 옆 간격을 `::slotted()` 의 여백으로 주면 문서의 전역 리셋(Tailwind preflight 류 `* { margin: 0 }`)에 진다 — 캡슐화 문맥이
6
+ * 다르면 문서 쪽 normal 선언이 이긴다. 간격은 섀도 안 상자가 갖고, 그 상자는 꽂힌 것이 있을 때만 선다.
7
+ *
8
+ * 첫 렌더 전에도 답하도록 `slotchange` 가 아니라 자식 목록을 본다(직속 자식의 `slot` 속성).
9
+ */
10
+ export declare class SlotPresence implements ReactiveController {
11
+ private readonly host;
12
+ private readonly names;
13
+ private present;
14
+ private readonly observer;
15
+ constructor(host: ReactiveControllerHost & HTMLElement, names: readonly string[]);
16
+ /** 그 이름의 슬롯에 꽂힌 자식이 있는가. */
17
+ has(name: string): boolean;
18
+ hostConnected(): void;
19
+ hostDisconnected(): void;
20
+ private sync;
21
+ }
@@ -0,0 +1,41 @@
1
+ // src/utilities/slotPresence.ts
2
+ /**
3
+ * 이름 붙은 슬롯(`prefix` · `suffix` 등)에 라이트 DOM 자식이 꽂혀 있는가 — 슬롯을 감싼 섀도 안 상자를 비었을 때 그리지 않으려고 쓴다.
4
+ *
5
+ * 슬롯 옆 간격을 `::slotted()` 의 여백으로 주면 문서의 전역 리셋(Tailwind preflight 류 `* { margin: 0 }`)에 진다 — 캡슐화 문맥이
6
+ * 다르면 문서 쪽 normal 선언이 이긴다. 간격은 섀도 안 상자가 갖고, 그 상자는 꽂힌 것이 있을 때만 선다.
7
+ *
8
+ * 첫 렌더 전에도 답하도록 `slotchange` 가 아니라 자식 목록을 본다(직속 자식의 `slot` 속성).
9
+ */
10
+ var SlotPresence = class {
11
+ constructor(host, names) {
12
+ this.host = host;
13
+ this.names = names;
14
+ this.present = /* @__PURE__ */ new Set();
15
+ this.observer = new MutationObserver(() => this.sync());
16
+ host.addController(this);
17
+ }
18
+ /** 그 이름의 슬롯에 꽂힌 자식이 있는가. */
19
+ has(name) {
20
+ return this.present.has(name);
21
+ }
22
+ hostConnected() {
23
+ this.sync();
24
+ this.observer.observe(this.host, {
25
+ childList: true,
26
+ attributes: true,
27
+ attributeFilter: ["slot"],
28
+ subtree: true
29
+ });
30
+ }
31
+ hostDisconnected() {
32
+ this.observer.disconnect();
33
+ }
34
+ sync() {
35
+ const next = new Set(this.names.filter((name) => Array.from(this.host.children).some((c) => c.slot === name)));
36
+ if (next.size === this.present.size && [...next].every((n) => this.present.has(n))) return;
37
+ this.present = next;
38
+ this.host.requestUpdate();
39
+ }
40
+ };
41
+ export { SlotPresence };
@@ -0,0 +1,5 @@
1
+ /**
2
+ * `unattended`(아무도 앞에서 조작하지 않는 화면 — 벽걸이 보드 · 로비 · 키오스크)에서 키보드 초점으로 멈춘 회전 · 굴림이 다시
3
+ * 움직이기까지 손대지 않은 시간. `u-carousel` 과 `u-auto-scroll` 이 같은 값을 쓴다.
4
+ */
5
+ export declare const UNATTENDED_IDLE_MS = 30000;
@@ -0,0 +1,7 @@
1
+ // src/utilities/unattended.ts
2
+ /**
3
+ * `unattended`(아무도 앞에서 조작하지 않는 화면 — 벽걸이 보드 · 로비 · 키오스크)에서 키보드 초점으로 멈춘 회전 · 굴림이 다시
4
+ * 움직이기까지 손대지 않은 시간. `u-carousel` 과 `u-auto-scroll` 이 같은 값을 쓴다.
5
+ */
6
+ var UNATTENDED_IDLE_MS = 3e4;
7
+ export { UNATTENDED_IDLE_MS };
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.32.0",
4
+ "version": "2.34.0",
5
5
  "keywords": [
6
6
  "iyulab",
7
7
  "components",
@@ -12,6 +12,9 @@ production floor, a kiosk, a lobby screen — so a list longer than the screen i
12
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
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
14
  over it or focus is inside it, and scrolling by hand always works (it carries on from where the person left it).
15
+ On a full-screen wall display the cursor is always over it and a tap leaves focus in it, so set `unattended` there:
16
+ the pointer and focus from a tap no longer stop it, and keyboard focus stops it only until `resume-delay` (30 seconds)
17
+ passes untouched — the pair of `u-carousel`'s `unattended`. `paused` still stops it.
15
18
  For a user who asked for reduced motion (`prefers-reduced-motion: reduce`) it does not move at all. When it leaves the
16
19
  screen and comes back — a carousel returning to its slide — it starts over from the top.
17
20
 
@@ -50,6 +53,8 @@ Otherwise it scrolls at `speed`.
50
53
  | `duration` | `number` | `0` | — | Time for one round (wait + scroll + wait), in ms; the speed follows from the distance. `0` uses `speed` |
51
54
  | `pause` | `number` | `3000` | — | Wait at the top and at the end, in ms |
52
55
  | `paused` | `boolean` | `false` | ✓ | Do not scroll by itself — by hand only |
56
+ | `unattended` | `boolean` | `false` | ✓ | A screen nobody operates — the pointer over it and focus that came from a tap do not stop it; keyboard focus does, until `resumeDelay` passes without a key press or a click |
57
+ | `resumeDelay` | `number` | `30000` | — | `resume-delay` — with `unattended`, the idle time in ms before a stop caused by keyboard focus ends |
53
58
 
54
59
  ## Methods
55
60
 
@@ -33,6 +33,17 @@ border carries hover, and the card does not lift (a lifting card shakes a grid r
33
33
  — buttons, links — out of a link card; an `<a>` cannot contain them. The link's accessible name is all of the card's
34
34
  text unless the host has an `aria-label`, which moves to the link.
35
35
 
36
+ **A card that must be read first (`tone`).** `warning`, `danger`, `success` and `info` give the card that status's
37
+ soft face and border — «Check these 2», «Blocked» — and `primary` keeps the face and draws the main colour around it,
38
+ for the one card on a screen that holds the next action. The card's heading says what the tone means; colour alone
39
+ does not. The tone paints the inner box, so a `--card-border-color` set on the host from outside (a theme sheet does)
40
+ does not cover it.
41
+
42
+ ```html
43
+ <u-card tone="warning"><h2 slot="header">Check these 2</h2>…</u-card>
44
+ <u-card tone="primary"><h2 slot="header">Next</h2>…<u-button>Assign 100 copies</u-button></u-card>
45
+ ```
46
+
36
47
  ---
37
48
 
38
49
  ## Slots
@@ -52,6 +63,7 @@ text unless the host has an `aria-label`, which moves to the link.
52
63
  | `shadowless` | `boolean` | `false` | ✓ | Remove drop shadow |
53
64
  | `appearance` | `'outlined'\|'plain'` | `'outlined'` | ✓ | `outlined` border and drop shadow · `plain` no border and no shadow (layout only) |
54
65
  | `hoverable` | `boolean` | `false` | ✓ | Lift effect on hover |
66
+ | `tone` | `'primary'\|'info'\|'success'\|'warning'\|'danger'` | — | ✓ | Emphasis — a status face and border, or (`primary`) a main-colour border |
55
67
  | `href` | `string` | — | ✓ | Makes the whole card a link to this URL |
56
68
  | `target` | `string` | — | | Link target (with `href`) |
57
69
  | `rel` | `string` | — | | Link relationship (with `href`) |
@@ -23,7 +23,8 @@ Slide carousel. Each direct child element becomes one slide.
23
23
 
24
24
  With `autoplay`, the carousel renders a stop/start button as the first control of its indicator
25
25
  row (WCAG 2.2.2). Rotation pauses while the mouse is over the carousel and stops when keyboard focus
26
- moves into it, until the user presses start (WAI-ARIA APG carousel pattern). Slides are
26
+ moves into it, until the user presses start (WAI-ARIA APG carousel pattern) — on a screen nobody operates, see
27
+ `unattended` below. Slides are
27
28
  `aria-live="off"` while rotating and `polite` when stopped. For a user who has asked for reduced
28
29
  motion (`prefers-reduced-motion: reduce`) the carousel starts stopped — the start button turns
29
30
  rotation on — and it stops if that setting is turned on while the page is open.
@@ -51,6 +52,19 @@ the current tab fills over `autoplay-interval` while the carousel rotates. When
51
52
 
52
53
  Give the carousel a height (`flex: 1` in a full-screen column, or a fixed height) — the row takes its share of it.
53
54
 
55
+ ### Nobody at the screen — `unattended`
56
+
57
+ A full-screen wall display always has the mouse cursor over it, and someone who tapped a slide once leaves focus in it —
58
+ under the rules for a carousel a person is using, the board would stop on that slide for good, and the people reading
59
+ it from across the room would take a stopped board for a current one. `unattended` changes two of those rules: the
60
+ pointer never pauses rotation, and rotation stopped by keyboard focus starts again after `resume-delay` (30 seconds by
61
+ default) without a key press or a click in it. The stop button still stops it, and that stop stays (WCAG 2.2.2).
62
+ `startRotation()` / `stopRotation()` do what the button does, from code.
63
+
64
+ ```html
65
+ <u-carousel autoplay loop unattended pagination pagination-style="labels" autoplay-interval="20000" aria-label="Floor board">…</u-carousel>
66
+ ```
67
+
54
68
  ---
55
69
 
56
70
  ## Slots
@@ -70,6 +84,8 @@ Give the carousel a height (`flex: 1` in a full-screen column, or a fixed height
70
84
  | `pagination` | `boolean` | `false` | Show dot pagination |
71
85
  | `paginationStyle` | `'dots'\|'labels'` | `'dots'` | `pagination-style` — `labels` puts a row under the slides: each slide's name and a progress bar (see below) |
72
86
  | `draggable` | `boolean` | `false` | Drag to navigate |
87
+ | `unattended` | `boolean` | `false` | A screen nobody operates — the pointer does not pause rotation, and a stop caused by keyboard focus ends after `resumeDelay` (see above) |
88
+ | `resumeDelay` | `number` | `30000` | `resume-delay` — with `unattended`, the idle time in ms before rotation stopped by keyboard focus starts again |
73
89
  | `slidesPerView` | `number` | `1` | Visible slides at once |
74
90
  | `slidesPerMove` | `number` | `1` | Slides to advance per step |
75
91
  | `gap` | `number` | `0` | Gap between slides in px |
@@ -82,6 +98,8 @@ Give the carousel a height (`flex: 1` in a full-screen column, or a fixed height
82
98
  | `prev()` | Go to previous slide |
83
99
  | `next()` | Go to next slide |
84
100
  | `goTo(index)` | Jump to a specific slide index |
101
+ | `startRotation()` | Start automatic rotation again — whatever stopped it (the stop button, keyboard focus, reduced motion) |
102
+ | `stopRotation()` | Stop automatic rotation, as the stop button does |
85
103
 
86
104
  ## CSS Parts
87
105
 
@@ -94,4 +94,5 @@ message that needs a response.
94
94
  | `panel` | The dialog panel |
95
95
  | `header` | Header area |
96
96
  | `body` | Body area |
97
+ | `footer` | Footer area around the `footer` slot — its padding and top divider (not drawn when the slot is empty). They live here, not on the slotted element, so a document-wide reset such as Tailwind's preflight cannot strip them |
97
98
  | `close-btn` | Close button |
@@ -65,6 +65,7 @@ Same as `u-dialog`: exposed as a **`dialog`** (`aria-modal` when modal), named b
65
65
  | `panel` | Drawer panel |
66
66
  | `header` | Header area |
67
67
  | `body` | Body area |
68
+ | `footer` | Footer area around the `footer` slot — its padding and top divider (not drawn when the slot is empty). They live here, not on the slotted element, so a document-wide reset such as Tailwind's preflight cannot strip them |
68
69
  | `close-btn` | Close button |
69
70
 
70
71
  ## CSS Custom Properties
@@ -73,20 +73,25 @@ Options of different kinds can be grouped under headings with [`u-option-group`]
73
73
  |--------|-------------|
74
74
  | `validate()` | Validate; sets `invalid` |
75
75
  | `reset()` | Reset value |
76
- | `focus(options?)` | Focus the trigger |
76
+ | `focus(options?)` | Focus the trigger (its search input, when `searchable`) |
77
77
  | `blur()` | Blur the trigger |
78
78
 
79
79
  ## Keyboard & accessibility
80
80
 
81
- The trigger is a `role="combobox"`. Without `searchable` the dropdown holds a `role="listbox"`
82
- and opening it focuses the first option. With `searchable` the dropdown is a `role="dialog"`
83
- (named by `label`, or "Search") that holds the search field and the listbox; opening it focuses
84
- the search field, so typing filters at once. While there is a query, the first visible option is the
85
- **active candidate** — shown like a hovered option and announced through the search field's
86
- `aria-activedescendant` — and `Enter` picks it (closing the list, or toggling it with `multiple`); the
87
- `Enter` that commits an IME composition does not. From the search field `ArrowDown`/`ArrowUp` move to
88
- the first/last visible option; on an option, arrows, `Home`/`End`, `Enter`/`Space` (select) and
89
- `Escape` (close) work as usual.
81
+ Without `searchable` the trigger is a `role="combobox"` (APG *select-only combobox*) whose dropdown holds a
82
+ `role="listbox"`; opening it focuses the first option. Typing on the closed trigger is **type-ahead**: a letter picks
83
+ the next option whose text starts with it (repeat the letter to cycle), and letters typed within half a second form a
84
+ word (`ch` → *cherry*); on an open list the same keys move the focus instead of picking.
85
+
86
+ With `searchable` the combobox is an **editable input inside the trigger** (APG *editable combobox with list
87
+ autocomplete*): `Tab` lands in it, and typing — including the first syllable of an IME composition — opens the list and
88
+ becomes the query at once, so nothing typed is lost. While there is a query the selected value is hidden behind it
89
+ (`multiple` keeps its chips and types after them). The first visible option is the **active candidate** — shown like a
90
+ hovered option and announced through the input's `aria-activedescendant` — and `Enter` picks it (closing the list, or
91
+ toggling it with `multiple`); the `Enter` that commits an IME composition does not. `ArrowDown`/`ArrowUp` open a closed
92
+ list and, on an open one, move to the first/last visible option; letters typed on an option go back to the input.
93
+ `Escape` closes the list (the focus stays in the input) and closing clears the query, so the trigger shows the value
94
+ again. On an option, arrows, `Home`/`End`, `Enter`/`Space` (select) and `Escape` (close) work as usual.
90
95
 
91
96
  ## CSS Parts
92
97
 
@@ -95,7 +100,7 @@ the first/last visible option; on an option, arrows, `Home`/`End`, `Enter`/`Spac
95
100
  | `field` | Outer field wrapper |
96
101
  | `container` | Trigger area |
97
102
  | `popover` | Dropdown list container |
98
- | `search-input` | Search input inside dropdown |
103
+ | `search-input` | The search input inside the trigger (the combobox, when `searchable`) |
99
104
  | `no-matches` | *No matches* status line in the dropdown (empty and hidden otherwise) |
100
105
 
101
106
  ## CSS Custom Properties
@@ -26,9 +26,26 @@ moving to the next step is the consumer's own action, placed beside it. For seve
26
26
  ```
27
27
 
28
28
  Status is told by marker shape as well as colour — complete = check, current = heavy ring,
29
- hold = warning tint, upcoming = empty ring. Assistive tech hears the current step through
30
- `aria-current="step"` and complete/hold through a hidden status word (`stepComplete`,
31
- `stepOnHold` locale keys).
29
+ hold = warning tint, upcoming = empty ring, skipped = dashed ring. Assistive tech hears the current step through
30
+ `aria-current="step"` and complete/hold/skipped through a hidden status word (`stepComplete`,
31
+ `stepOnHold`, `stepSkipped` locale keys). `skipped` is a step this record's route does not have — an order with no
32
+ proof still shows «Proof», passed over.
33
+
34
+ ### Bars — `appearance="bars"`
35
+
36
+ Each step takes an equal column: a bar on top, the step's name and its description (a date) under it. The travelled
37
+ and current bars are filled, upcoming and skipped ones empty, a held step's bar is the warning colour; the current
38
+ step's name is bold. For a detail page's header, where seven steps each carry a date.
39
+
40
+ ```html
41
+ <u-steps appearance="bars" current="3" .items=${[
42
+ { label: 'Intake', description: '10/21' },
43
+ { label: 'Proof', description: 'none', status: 'skipped' },
44
+ { label: 'Check', description: '10/21' },
45
+ { label: 'Plate', description: '10/21 · batch 50' },
46
+ { label: 'Print' }, { label: 'Foil · pack' }, { label: 'Ship' },
47
+ ]}></u-steps>
48
+ ```
32
49
 
33
50
  ---
34
51
 
@@ -39,8 +56,9 @@ hold = warning tint, upcoming = empty ring. Assistive tech hears the current ste
39
56
  | `items` | `StepItem[]` | `[]` | — | `{ label, description?, status? }` (property only) |
40
57
  | `current` | `number` | — | — | Index of the current step; steps without `status` before it are `complete`, after it `upcoming` |
41
58
  | `label` | `string` | — | — | Track name shown at the start; also the list's accessible name |
59
+ | `appearance` | `'line'\|'bars'` | `'line'` | ✓ | `line` markers and connectors · `bars` a bar per step with the text under it |
42
60
 
43
- `StepStatus` = `'complete' | 'current' | 'hold' | 'upcoming'`. An item's own `status` wins over
61
+ `StepStatus` = `'complete' | 'current' | 'hold' | 'upcoming' | 'skipped'`. An item's own `status` wins over
44
62
  the inference from `current`.
45
63
 
46
64
  ## CSS Parts
@@ -64,3 +82,5 @@ the inference from `current`.
64
82
  | `--steps-connector-color` | Connector not yet travelled |
65
83
  | `--steps-connector-done-color` | Travelled connector and complete marker |
66
84
  | `--steps-label-width` | Width of the track name (default 56px) |
85
+ | `--steps-bar-height` | Bar thickness with `bars` (default 6px) |
86
+ | `--steps-bar-color` | Filled bar colour with `bars` (default the primary colour) |