@iyulab/components 2.6.0 → 2.8.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 (65) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/dist/assets/locales/ar.json.js +7 -1
  3. package/dist/assets/locales/de.json.js +7 -1
  4. package/dist/assets/locales/en.json.js +7 -1
  5. package/dist/assets/locales/es.json.js +7 -1
  6. package/dist/assets/locales/fr.json.js +7 -1
  7. package/dist/assets/locales/id.json.js +7 -1
  8. package/dist/assets/locales/ja.json.js +7 -1
  9. package/dist/assets/locales/ko.json.js +7 -1
  10. package/dist/assets/locales/pt-BR.json.js +7 -1
  11. package/dist/assets/locales/ru.json.js +7 -1
  12. package/dist/assets/locales/th.json.js +7 -1
  13. package/dist/assets/locales/vi.json.js +7 -1
  14. package/dist/assets/locales/zh-CN.json.js +7 -1
  15. package/dist/assets/locales/zh-TW.json.js +7 -1
  16. package/dist/components/UElement.d.ts +10 -0
  17. package/dist/components/UElement.js +18 -0
  18. package/dist/components/UFormControlElement.d.ts +5 -0
  19. package/dist/components/UFormControlElement.js +8 -0
  20. package/dist/components/alert/UAlert.js +16 -2
  21. package/dist/components/breadcrumb/UBreadcrumb.js +1 -1
  22. package/dist/components/calendar/UCalendar.js +1 -1
  23. package/dist/components/calendar/picker.styles.js +22 -1
  24. package/dist/components/carousel/UCarousel.d.ts +15 -0
  25. package/dist/components/carousel/UCarousel.js +45 -3
  26. package/dist/components/checkbox/UCheckbox.js +1 -1
  27. package/dist/components/chip/UChip.js +1 -1
  28. package/dist/components/copy-button/UCopyButton.js +1 -1
  29. package/dist/components/date-picker/UDatePicker.d.ts +4 -0
  30. package/dist/components/date-picker/UDatePicker.js +8 -2
  31. package/dist/components/date-picker/UDatePicker.styles.js +4 -0
  32. package/dist/components/date-range-picker/UDateRangePicker.d.ts +4 -0
  33. package/dist/components/date-range-picker/UDateRangePicker.js +8 -2
  34. package/dist/components/date-range-picker/UDateRangePicker.styles.js +4 -0
  35. package/dist/components/dialog/UDialog.js +1 -1
  36. package/dist/components/drawer/UDrawer.js +1 -1
  37. package/dist/components/file-input/UFileInput.js +1 -1
  38. package/dist/components/file-input/UFileInput.styles.js +7 -0
  39. package/dist/components/input/UInput.d.ts +2 -0
  40. package/dist/components/input/UInput.js +6 -1
  41. package/dist/components/radio/URadio.js +1 -1
  42. package/dist/components/rating/URating.js +1 -1
  43. package/dist/components/select/USelect.d.ts +2 -0
  44. package/dist/components/select/USelect.js +2 -1
  45. package/dist/components/select/USelect.styles.js +12 -3
  46. package/dist/components/slider/USlider.js +1 -1
  47. package/dist/components/spinner/USpinner.d.ts +4 -0
  48. package/dist/components/spinner/USpinner.js +8 -1
  49. package/dist/components/split-panel/USplitPanel.d.ts +2 -0
  50. package/dist/components/split-panel/USplitPanel.js +6 -1
  51. package/dist/components/steps/USteps.js +1 -1
  52. package/dist/components/switch/USwitch.js +1 -1
  53. package/dist/components/tab/UTab.js +1 -1
  54. package/dist/components/textarea/UTextarea.js +1 -1
  55. package/dist/index.js +1 -1
  56. package/dist/utilities/Dialog.js +1 -1
  57. package/dist/utilities/Locale.d.ts +12 -1
  58. package/dist/utilities/Locale.js +32 -0
  59. package/package.json +1 -1
  60. package/skills/iyulab-components/references/components/alert.md +1 -1
  61. package/skills/iyulab-components/references/components/carousel.md +6 -0
  62. package/skills/iyulab-components/references/components/date-picker.md +1 -0
  63. package/skills/iyulab-components/references/components/date-range-picker.md +1 -0
  64. package/skills/iyulab-components/references/components/select.md +1 -0
  65. package/skills/iyulab-components/references/utilities/locale.md +15 -0
@@ -10,6 +10,10 @@ import { UElement } from '../UElement.js';
10
10
  * (WAI-ARIA APG Carousel · WCAG 2.2.2). 사용자가 동작 줄이기(`prefers-reduced-motion: reduce`)를
11
11
  * 켜 두었으면 정지 상태로 시작하고(시작 버튼으로 켤 수 있다), 보는 중에 그 설정이 켜지면 멈춘다.
12
12
  *
13
+ * 보조기기에는 WAI-ARIA APG Carousel 구조로 나간다 — 호스트는 «캐러셀» 역할 설명을 단 영역(`region`), 각 슬라이드는
14
+ * «슬라이드» 역할 설명과 «n / 전체» 이름을 단 그룹이다. 캐러셀의 이름은 호스트의 `aria-label` 로 준다(영역은 이름이
15
+ * 있어야 랜드마크다). 슬라이드에 소비자가 이미 단 `role`·`aria-roledescription`·`aria-label` 은 덮지 않는다.
16
+ *
13
17
  * @csspart slides - 슬라이드 컨테이너
14
18
  * @csspart prev-button - 이전 버튼
15
19
  * @csspart next-button - 다음 버튼
@@ -47,6 +51,11 @@ export declare class UCarousel extends UElement {
47
51
  /** 포인터가 캐러셀 위에 있다 — 그동안만 잠시 멈춘다. */
48
52
  private hovered;
49
53
  private autoplayTimer?;
54
+ /** 호스트 역할(region · «캐러셀» 역할 설명) — 소비자의 `role` 속성이 있으면 그것이 이긴다. */
55
+ private readonly internals;
56
+ /** 지금 슬롯에 꽂힌 슬라이드와, 그중 우리가 단 속성(소비자가 단 것은 여기 없다 — 덮지도 회수하지도 않는다). */
57
+ private slides;
58
+ private readonly ownedSlideAttrs;
50
59
  /** `prefers-reduced-motion: reduce` 질의 — 연결된 동안만 듣는다. */
51
60
  private reducedMotion?;
52
61
  private dragStartX;
@@ -71,6 +80,12 @@ export declare class UCarousel extends UElement {
71
80
  private startAutoplay;
72
81
  private stopAutoplay;
73
82
  private handleSlotChange;
83
+ /** 렌더 밖에서 적어 둔 로케일 문장(호스트 역할 설명 · 슬라이드 이름)을 새 로케일로 다시 적는다. */
84
+ protected localeChanged(): void;
85
+ /** 슬라이드를 «n / 전체» 이름의 그룹으로 — 처음 볼 때 비어 있던 속성만 우리 것으로 삼고, 그것만 갱신한다. */
86
+ private labelSlide;
87
+ /** 슬롯을 떠난 슬라이드에서 우리가 단 속성을 걷는다. */
88
+ private releaseSlide;
74
89
  private handleDragStart;
75
90
  private handlePointerDown;
76
91
  private handlePointerMove;
@@ -1,7 +1,7 @@
1
+ import { Locale } from "../../utilities/Locale.js";
1
2
  import { UElement } from "../UElement.js";
2
3
  import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorateMetadata.js";
3
4
  import __decorate from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorate.js";
4
- import { Locale } from "../../utilities/Locale.js";
5
5
  import "../button/UButton.js";
6
6
  import "../icon/UIcon.js";
7
7
  import { styles } from "./UCarousel.styles.js";
@@ -27,6 +27,9 @@ var UCarousel = class UCarousel extends UElement {
27
27
  this.dragOffset = 0;
28
28
  this.rotationStopped = false;
29
29
  this.hovered = false;
30
+ this.internals = "attachInternals" in this ? this.attachInternals() : void 0;
31
+ this.slides = [];
32
+ this.ownedSlideAttrs = /* @__PURE__ */ new WeakMap();
30
33
  this.dragStartX = 0;
31
34
  this.dragStartTime = 0;
32
35
  this.pointerDown = false;
@@ -133,6 +136,10 @@ var UCarousel = class UCarousel extends UElement {
133
136
  }
134
137
  connectedCallback() {
135
138
  super.connectedCallback();
139
+ if (this.internals) {
140
+ this.internals.role = "region";
141
+ this.internals.ariaRoleDescription = Locale.getValue("carousel");
142
+ }
136
143
  this.addEventListener("focusin", this.handleFocusIn);
137
144
  this.addEventListener("pointerenter", this.handlePointerEnter);
138
145
  this.addEventListener("pointerleave", this.handlePointerLeave);
@@ -229,10 +236,45 @@ var UCarousel = class UCarousel extends UElement {
229
236
  }
230
237
  }
231
238
  handleSlotChange(e) {
232
- const slot = e.target;
233
- this.slideCount = slot.assignedElements().length;
239
+ const next = e.target.assignedElements();
240
+ for (const gone of this.slides) if (!next.includes(gone)) this.releaseSlide(gone);
241
+ this.slides = next;
242
+ next.forEach((slide, i) => this.labelSlide(slide, i, next.length));
243
+ this.slideCount = next.length;
234
244
  if (this.index >= this.slideCount) this.index = Math.max(0, this.slideCount - 1);
235
245
  }
246
+ /** 렌더 밖에서 적어 둔 로케일 문장(호스트 역할 설명 · 슬라이드 이름)을 새 로케일로 다시 적는다. */
247
+ localeChanged() {
248
+ if (this.internals) this.internals.ariaRoleDescription = Locale.getValue("carousel");
249
+ this.slides.forEach((slide, i) => this.labelSlide(slide, i, this.slides.length));
250
+ super.localeChanged();
251
+ }
252
+ /** 슬라이드를 «n / 전체» 이름의 그룹으로 — 처음 볼 때 비어 있던 속성만 우리 것으로 삼고, 그것만 갱신한다. */
253
+ labelSlide(slide, i, total) {
254
+ let owned = this.ownedSlideAttrs.get(slide);
255
+ if (!owned) {
256
+ owned = [
257
+ "role",
258
+ "aria-roledescription",
259
+ "aria-label"
260
+ ].filter((name) => !slide.hasAttribute(name));
261
+ this.ownedSlideAttrs.set(slide, owned);
262
+ }
263
+ const values = {
264
+ role: "group",
265
+ "aria-roledescription": Locale.getValue("slide"),
266
+ "aria-label": Locale.getValue("slideOf", {
267
+ n: i + 1,
268
+ total
269
+ })
270
+ };
271
+ for (const name of owned) slide.setAttribute(name, values[name]);
272
+ }
273
+ /** 슬롯을 떠난 슬라이드에서 우리가 단 속성을 걷는다. */
274
+ releaseSlide(slide) {
275
+ for (const name of this.ownedSlideAttrs.get(slide) ?? []) slide.removeAttribute(name);
276
+ this.ownedSlideAttrs.delete(slide);
277
+ }
236
278
  };
237
279
  __decorate([property({
238
280
  type: Boolean,
@@ -1,7 +1,7 @@
1
+ import { Locale } from "../../utilities/Locale.js";
1
2
  import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorateMetadata.js";
2
3
  import __decorate from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorate.js";
3
4
  import { UFormControlElement } from "../UFormControlElement.js";
4
- import { Locale } from "../../utilities/Locale.js";
5
5
  import "../icon/UIcon.js";
6
6
  import { styles } from "./UCheckbox.styles.js";
7
7
  import { html } from "lit";
@@ -1,7 +1,7 @@
1
+ import { Locale } from "../../utilities/Locale.js";
1
2
  import { UElement } from "../UElement.js";
2
3
  import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorateMetadata.js";
3
4
  import __decorate from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorate.js";
4
- import { Locale } from "../../utilities/Locale.js";
5
5
  import "../button/UButton.js";
6
6
  import "../icon/UIcon.js";
7
7
  import "../tooltip/UTooltip.js";
@@ -1,7 +1,7 @@
1
+ import { Locale } from "../../utilities/Locale.js";
1
2
  import { UElement } from "../UElement.js";
2
3
  import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorateMetadata.js";
3
4
  import __decorate from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorate.js";
4
- import { Locale } from "../../utilities/Locale.js";
5
5
  import "../button/UButton.js";
6
6
  import "../icon/UIcon.js";
7
7
  import "../icon-button/UIconButton.js";
@@ -51,6 +51,8 @@ export type { DateDisabledFn } from '../calendar/dates.js';
51
51
  * the container width in forms and grid cells.
52
52
  * @cssprop --u-date-picker-width - host `width` (default: auto). Set `100%` where `block` alone
53
53
  * does not stretch the host (e.g. inside a flex container).
54
+ * @cssprop --date-picker-min-text - minimum width of the text area (default: 4ch). When the suffix buttons (clear · calendar) share a
55
+ * narrow box, the field overflows its host instead of folding the text to nothing.
54
56
  * @cssprop --date-picker-popover-width - width of the calendar popover (default: 296px, independent of trigger width — a fixed-width calendar reads more naturally)
55
57
  *
56
58
  * @event change - fires when the user clicks a date cell, confirms via keyboard, changes the
@@ -114,6 +116,8 @@ export declare class UDatePicker extends UFormControlElement<string> {
114
116
  private get working();
115
117
  /** The value as the text box shows it: `YYYY-MM-DD`, or `YYYY-MM-DD HH:mm` in `mode="datetime"`. */
116
118
  private shownText;
119
+ /** 보이는 접미 버튼 수 — 글자 영역 하한(`min-inline-size`)이 그만큼의 받는 상자를 뺀다. 아래 `?hidden` 조건과 같다. */
120
+ private suffixButtonCount;
117
121
  render(): import('lit-html').TemplateResult<1>;
118
122
  private renderCalendar;
119
123
  private renderTimeRow;
@@ -1,7 +1,7 @@
1
+ import { Locale } from "../../utilities/Locale.js";
1
2
  import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorateMetadata.js";
2
3
  import __decorate from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorate.js";
3
4
  import { UFormControlElement } from "../UFormControlElement.js";
4
- import { Locale } from "../../utilities/Locale.js";
5
5
  import "../button/UButton.js";
6
6
  import "../icon/UIcon.js";
7
7
  import { dateTextPattern, formatDateText, formatDateTimeText, parseDate, parseDateTime } from "../../utilities/format.js";
@@ -165,6 +165,11 @@ var UDatePicker = class UDatePicker extends UFormControlElement {
165
165
  const { date, time } = splitValue(this.value);
166
166
  return this.mode === "datetime" ? formatDateTimeText(`${toISODate(date)}T${time}`, this.format, void 0, this.seconds) : formatDateText(toISODate(date), this.format);
167
167
  }
168
+ /** 보이는 접미 버튼 수 — 글자 영역 하한(`min-inline-size`)이 그만큼의 받는 상자를 뺀다. 아래 `?hidden` 조건과 같다. */
169
+ suffixButtonCount() {
170
+ if (this.effectivelyDisabled || this.readonly) return 0;
171
+ return (this.clearable && this.value ? 1 : 0) + 1;
172
+ }
168
173
  render() {
169
174
  const datetime = this.mode === "datetime";
170
175
  return html`
@@ -176,7 +181,8 @@ var UDatePicker = class UDatePicker extends UFormControlElement {
176
181
  .description=${this.description}
177
182
  .validationMessage=${this.validationMessage}
178
183
  >
179
- <div class="container" part="container" @click=${this.textEntry.handleContainerClick}>
184
+ <div class="container" part="container" @click=${this.textEntry.handleContainerClick}
185
+ style=${`--_icons: ${this.suffixButtonCount()}`}>
180
186
  <input class="text-input" part="input"
181
187
  type="text"
182
188
  inputmode=${datetime ? "text" : "numeric"}
@@ -19,6 +19,10 @@ var styles = css`
19
19
  }
20
20
 
21
21
  /* mode="date": the trigger is a text box — it takes the container's room and reads like its text. */
22
+ /* 글자 영역 하한(공용 피커 시트의 min-inline-size 가 읽는다). */
23
+ .container {
24
+ --_min-text: var(--date-picker-min-text, 4ch);
25
+ }
22
26
  .text-input {
23
27
  flex: 1 1 auto;
24
28
  min-width: 0;
@@ -67,6 +67,8 @@ export type { DateRangePreset, DateRangePresetName, DateRangePresetOption } from
67
67
  * fill the container width in forms and grid cells.
68
68
  * @cssprop --u-date-range-picker-width - host `width` (default: auto). Set `100%` where `block`
69
69
  * alone does not stretch the host (e.g. inside a flex container).
70
+ * @cssprop --date-range-picker-min-text - minimum width of the text area (default: 4ch). When the suffix buttons (clear · calendar) share a
71
+ * narrow box, the field overflows its host instead of folding the text to nothing.
70
72
  *
71
73
  * @event change - fires when the user completes a range or clears it (with `confirm`, when Apply
72
74
  * commits a different value). Programmatic value
@@ -142,6 +144,8 @@ export declare class UDateRangePicker extends UFormControlElement<string> {
142
144
  private parseTyped;
143
145
  protected shouldValidate(changed: PropertyValues): boolean;
144
146
  protected updated(changed: PropertyValues): void;
147
+ /** 보이는 접미 버튼 수 — 글자 영역 하한(`min-inline-size`)이 그만큼의 받는 상자를 뺀다. 아래 `?hidden` 조건과 같다. */
148
+ private suffixButtonCount;
145
149
  render(): import('lit-html').TemplateResult<1>;
146
150
  private renderCalendar;
147
151
  private renderTimeRow;
@@ -1,7 +1,7 @@
1
+ import { Locale } from "../../utilities/Locale.js";
1
2
  import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorateMetadata.js";
2
3
  import __decorate from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorate.js";
3
4
  import { UFormControlElement } from "../UFormControlElement.js";
4
- import { Locale } from "../../utilities/Locale.js";
5
5
  import "../button/UButton.js";
6
6
  import { devWarnOnce } from "../../utilities/devWarning.js";
7
7
  import "../icon/UIcon.js";
@@ -200,6 +200,11 @@ var UDateRangePicker = class UDateRangePicker extends UFormControlElement {
200
200
  if (changed.has("open")) this.internals?.states[this.open ? "add" : "delete"]("open");
201
201
  if (changed.has("open") && this.open) this.textEntry.calendarOpened(this.start ? dayPart(this.start) : /* @__PURE__ */ new Date());
202
202
  }
203
+ /** 보이는 접미 버튼 수 — 글자 영역 하한(`min-inline-size`)이 그만큼의 받는 상자를 뺀다. 아래 `?hidden` 조건과 같다. */
204
+ suffixButtonCount() {
205
+ if (this.effectivelyDisabled || this.readonly) return 0;
206
+ return (this.clearable && this.value ? 1 : 0) + 1;
207
+ }
203
208
  render() {
204
209
  const pattern = this.mode === "datetime" ? `${dateTextPattern(this.format)} ${this.seconds ? "HH:mm:ss" : "HH:mm"}` : dateTextPattern(this.format);
205
210
  return html`
@@ -211,7 +216,8 @@ var UDateRangePicker = class UDateRangePicker extends UFormControlElement {
211
216
  .description=${this.description}
212
217
  .validationMessage=${this.validationMessage}
213
218
  >
214
- <div class="container" part="container" @click=${this.textEntry.handleContainerClick}>
219
+ <div class="container" part="container" @click=${this.textEntry.handleContainerClick}
220
+ style=${`--_icons: ${this.suffixButtonCount()}`}>
215
221
  <input class="text-input" part="input"
216
222
  type="text"
217
223
  autocomplete="off"
@@ -79,6 +79,10 @@ var styles = css`
79
79
  }
80
80
 
81
81
  /* The trigger is a text box — it takes the container's room and reads like its text. */
82
+ /* 글자 영역 하한(공용 피커 시트의 min-inline-size 가 읽는다). */
83
+ .container {
84
+ --_min-text: var(--date-range-picker-min-text, 4ch);
85
+ }
82
86
  .text-input {
83
87
  flex: 1 1 auto;
84
88
  min-width: 0;
@@ -1,7 +1,7 @@
1
+ import { Locale } from "../../utilities/Locale.js";
1
2
  import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorateMetadata.js";
2
3
  import __decorate from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorate.js";
3
4
  import { UOverlayElement } from "../UOverlayElement.js";
4
- import { Locale } from "../../utilities/Locale.js";
5
5
  import "../button/UButton.js";
6
6
  import "../icon/UIcon.js";
7
7
  import { styles } from "./UDialog.styles.js";
@@ -1,7 +1,7 @@
1
+ import { Locale } from "../../utilities/Locale.js";
1
2
  import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorateMetadata.js";
2
3
  import __decorate from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorate.js";
3
4
  import { UOverlayElement } from "../UOverlayElement.js";
4
- import { Locale } from "../../utilities/Locale.js";
5
5
  import "../button/UButton.js";
6
6
  import "../icon/UIcon.js";
7
7
  import { styles } from "./UDrawer.styles.js";
@@ -1,7 +1,7 @@
1
+ import { Locale } from "../../utilities/Locale.js";
1
2
  import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorateMetadata.js";
2
3
  import __decorate from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorate.js";
3
4
  import { UFormControlElement } from "../UFormControlElement.js";
4
- import { Locale } from "../../utilities/Locale.js";
5
5
  import "../icon/UIcon.js";
6
6
  import "../field/UField.js";
7
7
  import { styles } from "./UFileInput.styles.js";
@@ -66,6 +66,13 @@ var styles = css`
66
66
  color: var(--u-icon-color, #616161);
67
67
  font-size: 1em;
68
68
  cursor: pointer;
69
+ /* 받는 영역 — 글리프는 1em 그대로, 상자만 ≥ 24px(WCAG 2.2 SC 2.5.8) · 호스트 하한(--u-target-size)이면 그 값.
70
+ u-input·u-select 와 같은 식이다. 위·아래·왼쪽(파일 이름 쪽, 타깃 아님)은 음수 여백으로 넓혀 줄 높이와 배치를 지키고,
71
+ 오른쪽은 필드 끝이라 넓히지 않는다(호스트 밖으로 나가 이웃을 덮지 않게) — 글리프가 그만큼 안쪽으로 온다. */
72
+ --_target-pad: max(0.25em, calc(12px - 0.5em), calc(var(--u-target-size, 0px) / 2 - 0.5em));
73
+ box-sizing: content-box;
74
+ padding: var(--_target-pad);
75
+ margin: calc(-1 * var(--_target-pad)) 0 calc(-1 * var(--_target-pad)) calc(-1 * var(--_target-pad));
69
76
  transition: color var(--u-duration-normal, 220ms) var(--u-ease-standard, cubic-bezier(0.2, 0, 0, 1));
70
77
  }
71
78
  .clear-btn:hover {
@@ -115,6 +115,8 @@ export declare class UInput extends UFormControlElement<string> {
115
115
  * `string`이라 `valueAsString` 같은 변환 없이 그대로 넘긴다. */
116
116
  protected willUpdate(changedProperties: PropertyValues): void;
117
117
  protected updated(changedProperties: PropertyValues): void;
118
+ /** The shown number uses the locale's decimal separator — re-show it in the new locale (unless the user is typing in it). */
119
+ protected localeChanged(): void;
118
120
  /** Canonical `value` → the text shown: the locale's decimal separator, no grouping inserted. */
119
121
  private displayNumber;
120
122
  /** Writes what the user typed into `value` (canonical, or `""` when it is not a number). */
@@ -1,8 +1,8 @@
1
+ import { Locale } from "../../utilities/Locale.js";
1
2
  import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorateMetadata.js";
2
3
  import __decorate from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorate.js";
3
4
  import { UFormControlElement } from "../UFormControlElement.js";
4
5
  import { isImeComposing } from "../../utilities/keyboard.js";
5
- import { Locale } from "../../utilities/Locale.js";
6
6
  import "../spinner/USpinner.js";
7
7
  import "../icon/UIcon.js";
8
8
  import { parseNumber } from "../../utilities/format.js";
@@ -305,6 +305,11 @@ var UInput = class UInput extends UFormControlElement {
305
305
  super.updated(changedProperties);
306
306
  if (changedProperties.has("value")) this.internals?.setFormValue(this.value ?? "");
307
307
  }
308
+ /** The shown number uses the locale's decimal separator — re-show it in the new locale (unless the user is typing in it). */
309
+ localeChanged() {
310
+ if (this.type === "number" && this.shadowRoot?.activeElement !== this.inputEl) this.numberText = this.displayNumber(this.value ?? "");
311
+ super.localeChanged();
312
+ }
308
313
  /** Canonical `value` → the text shown: the locale's decimal separator, no grouping inserted. */
309
314
  displayNumber(value) {
310
315
  if ((value ? parseNumber(value, "en") : null) === null) return value;
@@ -1,7 +1,7 @@
1
+ import { Locale } from "../../utilities/Locale.js";
1
2
  import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorateMetadata.js";
2
3
  import __decorate from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorate.js";
3
4
  import { UFormControlElement } from "../UFormControlElement.js";
4
- import { Locale } from "../../utilities/Locale.js";
5
5
  import "../field/UField.js";
6
6
  import { UOption } from "../option/UOption.js";
7
7
  import { styles } from "./URadio.styles.js";
@@ -1,7 +1,7 @@
1
+ import { Locale } from "../../utilities/Locale.js";
1
2
  import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorateMetadata.js";
2
3
  import __decorate from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorate.js";
3
4
  import { UFormControlElement } from "../UFormControlElement.js";
4
- import { Locale } from "../../utilities/Locale.js";
5
5
  import "../icon/UIcon.js";
6
6
  import "../field/UField.js";
7
7
  import { styles } from "./URating.styles.js";
@@ -25,6 +25,8 @@ import { UPopover } from '../popover/UPopover.js';
25
25
  * 컨테이너 폭을 채우려면 `block`으로 지정한다.
26
26
  * @cssprop --u-select-width - 호스트의 width (기본값: auto). flex 컨테이너처럼 block만으로는
27
27
  * 늘어나지 않는 맥락에서 `100%`로 지정한다.
28
+ * @cssprop --select-min-text - 표시 글자 영역의 최소 폭 (기본값: 4ch). 지우기·펼침 화살표가 좁은 칸을 나눠도 글자가 0 으로
29
+ * 접히지 않는다 — 그보다 좁으면 칸이 호스트 밖으로 넘친다(보이는 실패).
28
30
  * @cssprop --select-popover-width - 팝오버의 너비 (기본값: 앵커(트리거) 너비, strategy와 무관하게 동일).
29
31
  * 옵션 텍스트가 길어도 이 값을 넘겨 넓어지지 않으며, 넘치는 텍스트는 UOption에서 ellipsis 처리된다.
30
32
  * @cssprop --select-popover-min-height - 팝오버의 최소 높이 (기본값: 0px)
@@ -1,7 +1,7 @@
1
+ import { Locale } from "../../utilities/Locale.js";
1
2
  import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorateMetadata.js";
2
3
  import __decorate from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorate.js";
3
4
  import { UFormControlElement } from "../UFormControlElement.js";
4
- import { Locale } from "../../utilities/Locale.js";
5
5
  import "../spinner/USpinner.js";
6
6
  import "../icon/UIcon.js";
7
7
  import "../field/UField.js";
@@ -178,6 +178,7 @@ var USelect = class USelect extends UFormControlElement {
178
178
  </span>
179
179
 
180
180
  <div class="container" part="container" tabindex=${this.effectivelyDisabled ? "-1" : "0"}
181
+ style=${`--_clear: ${this.clearable && this.hasValue && !this.effectivelyDisabled && !this.readonly ? 1 : 0}`}
181
182
  role="combobox"
182
183
  aria-disabled=${ifDefined(this.effectivelyDisabled ? "true" : void 0)}
183
184
  aria-label=${ifDefined(this.resolvedAriaLabel)}
@@ -36,6 +36,16 @@ var styles = css`
36
36
  overflow-clip-margin: 1px;
37
37
  user-select: none;
38
38
  cursor: pointer;
39
+ /* 지우기 «x» 의 받는 여백 — 아래 접미 버튼 규칙과 글자 하한이 함께 읽는다. */
40
+ --_target-pad: max(0.25em, calc(12px - 0.5em), calc(var(--u-target-size, 0px) / 2 - 0.5em));
41
+ /* 글자 영역의 하한 — 지우기(받는 상자) · 펼침 화살표가 한 줄을 나눌 때 주어진 폭이 좁으면 표시 글자가 0 까지 접혀
42
+ «무엇이 골라졌는지 보이지 않는» 채 정상처럼 그려졌다. 하한 아래로는 칸이 호스트 밖으로 넘친다 — 보이는 실패다.
43
+ 지우기 몫 = 글리프 1em + 받는 여백(왼쪽은 표시 글자 쪽으로 넓히고 오른쪽은 화살표 간격과 맞댄다) · 화살표(또는 스피너) 몫 =
44
+ 1em + 앞 간격 0.25em. 지우기가 보이는지(--_clear)는 렌더가 정한다. */
45
+ min-inline-size: calc(
46
+ 2px + 2 * var(--u-field-padding-inline, 0.6em) + var(--select-min-text, 4ch)
47
+ + var(--_clear, 0) * (1em + var(--_target-pad)) + 1.25em
48
+ );
39
49
  }
40
50
  :host([readonly]) .container,
41
51
  :host(:disabled) .container {
@@ -187,9 +197,8 @@ var styles = css`
187
197
  위아래는 컨테이너 여백(0.3em) 쪽으로 넓힌다. 음수 여백이라 배치·트리거 높이는 그대로다 — 트리거의 줄은
188
198
  1em 이라 세로 패딩만 주면 트리거가 8px 커진다. */
189
199
  .suffix-item[role="button"] {
190
- /* 받는 여백 = u-input 과 같은 식 — 글자 크기와 무관하게 ≥ 24px */
191
- /* 호스트 하한(--u-target-size)이 있으면 상자가 그 값이 되도록 — 미설정이면 0 이라 종전 24px 그대로. */
192
- --_target-pad: max(0.25em, calc(12px - 0.5em), calc(var(--u-target-size, 0px) / 2 - 0.5em));
200
+ /* 받는 여백(--_target-pad)은 컨테이너가 정한다 — u-input 과 같은 식: 글자 크기와 무관하게 ≥ 24px,
201
+ 호스트 하한(--u-target-size)이 있으면 상자가 그 값. */
193
202
  box-sizing: content-box;
194
203
  /* 오른쪽은 펼침 화살표와 종전처럼 0.25em 만 맞댄다 — 글자가 작아 늘어난 폭은 왼쪽(값 글자 쪽, 타깃 아님)으로 넓힌다.
195
204
  16px 에서는 P = 0.25em 이라 종전 배치와 같다. */
@@ -1,7 +1,7 @@
1
+ import { Locale } from "../../utilities/Locale.js";
1
2
  import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorateMetadata.js";
2
3
  import __decorate from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorate.js";
3
4
  import { UFormControlElement } from "../UFormControlElement.js";
4
- import { Locale } from "../../utilities/Locale.js";
5
5
  import "../tooltip/UTooltip.js";
6
6
  import "../field/UField.js";
7
7
  import { styles } from "./USlider.styles.js";
@@ -25,7 +25,11 @@ export declare class USpinner extends UElement {
25
25
  */
26
26
  private readonly internals;
27
27
  connectedCallback(): void;
28
+ /** 이름으로 쓰는 보이는 글자(없으면 로케일의 «로딩 중»). */
29
+ private slotText;
28
30
  private nameFrom;
31
+ /** 글자가 없을 때의 기본 이름은 로케일 문장이다 — 새 로케일로 다시 적는다. */
32
+ protected localeChanged(): void;
29
33
  render(): import('lit-html').TemplateResult<1>;
30
34
  private handleSlotChange;
31
35
  }
@@ -1,9 +1,9 @@
1
+ import { Locale } from "../../utilities/Locale.js";
1
2
  import { UElement } from "../UElement.js";
2
3
  import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorateMetadata.js";
3
4
  import __decorate from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorate.js";
4
5
  import { styles } from "./USpinner.styles.js";
5
6
  import { attachProgressbar } from "../../utilities/progressAria.js";
6
- import { Locale } from "../../utilities/Locale.js";
7
7
  import { html } from "lit";
8
8
  import { customElement, property, state } from "lit/decorators.js";
9
9
  //#region src/components/spinner/USpinner.ts
@@ -12,6 +12,7 @@ var USpinner = class USpinner extends UElement {
12
12
  super(..._args);
13
13
  this.hasLabel = false;
14
14
  this.internals = attachProgressbar(this);
15
+ this.slotText = "";
15
16
  }
16
17
  static {
17
18
  this.styles = [super.styles, styles];
@@ -21,8 +22,14 @@ var USpinner = class USpinner extends UElement {
21
22
  this.nameFrom("");
22
23
  }
23
24
  nameFrom(text) {
25
+ this.slotText = text;
24
26
  if (this.internals) this.internals.ariaLabel = text || Locale.getValue("loading");
25
27
  }
28
+ /** 글자가 없을 때의 기본 이름은 로케일 문장이다 — 새 로케일로 다시 적는다. */
29
+ localeChanged() {
30
+ this.nameFrom(this.slotText);
31
+ super.localeChanged();
32
+ }
26
33
  render() {
27
34
  return html`
28
35
  <svg class="spinner" part="svg">
@@ -68,6 +68,8 @@ export declare class USplitPanel extends UElement {
68
68
  * 값은 **앞 패널(primary pane)의 몫**이다. 패널이 셋 이상이면 한 핸들은 이웃한 두 패널 사이만
69
69
  * 옮기므로 최대값은 100 이 아니라 그 두 패널의 몫의 합이다.
70
70
  */
71
+ /** 핸들 이름(«패널 크기 조절»)은 템플릿 밖에 적어 둔 로케일 문장이다 — 새 로케일로 다시 적는다. */
72
+ protected localeChanged(): void;
71
73
  private syncSplitterAria;
72
74
  /** 방향키 한 번이 옮기는 앞 패널의 몫(나머지 공간 기준 %). */
73
75
  private static readonly KEY_STEP;
@@ -1,8 +1,8 @@
1
+ import { Locale } from "../../utilities/Locale.js";
1
2
  import { UElement } from "../UElement.js";
2
3
  import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorateMetadata.js";
3
4
  import __decorate from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorate.js";
4
5
  import { arrayAttrConverter } from "../../utilities/converters.js";
5
- import { Locale } from "../../utilities/Locale.js";
6
6
  import { devWarnOnce } from "../../utilities/devWarning.js";
7
7
  import { styles } from "./USplitPanel.styles.js";
8
8
  import { html } from "lit";
@@ -287,6 +287,11 @@ var USplitPanel = class USplitPanel extends UElement {
287
287
  * 값은 **앞 패널(primary pane)의 몫**이다. 패널이 셋 이상이면 한 핸들은 이웃한 두 패널 사이만
288
288
  * 옮기므로 최대값은 100 이 아니라 그 두 패널의 몫의 합이다.
289
289
  */
290
+ /** 핸들 이름(«패널 크기 조절»)은 템플릿 밖에 적어 둔 로케일 문장이다 — 새 로케일로 다시 적는다. */
291
+ localeChanged() {
292
+ this.syncSplitterAria();
293
+ super.localeChanged();
294
+ }
290
295
  syncSplitterAria() {
291
296
  const root = this.renderRoot;
292
297
  if (!root) return;
@@ -1,7 +1,7 @@
1
+ import { Locale } from "../../utilities/Locale.js";
1
2
  import { UElement } from "../UElement.js";
2
3
  import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorateMetadata.js";
3
4
  import __decorate from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorate.js";
4
- import { Locale } from "../../utilities/Locale.js";
5
5
  import { styles } from "./USteps.styles.js";
6
6
  import { html, nothing } from "lit";
7
7
  import { customElement, property } from "lit/decorators.js";
@@ -1,7 +1,7 @@
1
+ import { Locale } from "../../utilities/Locale.js";
1
2
  import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorateMetadata.js";
2
3
  import __decorate from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorate.js";
3
4
  import { UFormControlElement } from "../UFormControlElement.js";
4
- import { Locale } from "../../utilities/Locale.js";
5
5
  import { styles } from "./USwitch.styles.js";
6
6
  import { html } from "lit";
7
7
  import { customElement, property, query } from "lit/decorators.js";
@@ -1,7 +1,7 @@
1
+ import { Locale } from "../../utilities/Locale.js";
1
2
  import { UElement } from "../UElement.js";
2
3
  import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorateMetadata.js";
3
4
  import __decorate from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorate.js";
4
- import { Locale } from "../../utilities/Locale.js";
5
5
  import "../button/UButton.js";
6
6
  import "../icon/UIcon.js";
7
7
  import { styles } from "./UTab.styles.js";
@@ -1,7 +1,7 @@
1
+ import { Locale } from "../../utilities/Locale.js";
1
2
  import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorateMetadata.js";
2
3
  import __decorate from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorate.js";
3
4
  import { UFormControlElement } from "../UFormControlElement.js";
4
- import { Locale } from "../../utilities/Locale.js";
5
5
  import "../field/UField.js";
6
6
  import { styles } from "./UTextarea.styles.js";
7
7
  import { html } from "lit";
package/dist/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { Locale } from "./utilities/Locale.js";
1
2
  import { UElement } from "./components/UElement.js";
2
3
  import { getParentElement, isCoarsePointer, isFocusCandidate, querySelectorAllWithin, querySelectorDeep, querySelectorWithin } from "./utilities/elements.js";
3
4
  import { UFloatingElement } from "./components/UFloatingElement.js";
@@ -6,7 +7,6 @@ import { isImeComposing } from "./utilities/keyboard.js";
6
7
  import { OverlayManager } from "./utilities/OverlayManager.js";
7
8
  import { arrayAttrConverter, booleanAttrConverter, dateAttrConverter, jsonAttrConverter, urlAttrConverter } from "./utilities/converters.js";
8
9
  import { UOverlayElement } from "./components/UOverlayElement.js";
9
- import { Locale } from "./utilities/Locale.js";
10
10
  import { USpinner } from "./components/spinner/USpinner.js";
11
11
  import { UButton } from "./components/button/UButton.js";
12
12
  import { IconCache, IconRegistry, getDefaultBaseUrl, setDefaultBaseUrl } from "./utilities/icons.js";
@@ -1,5 +1,5 @@
1
- import { isImeComposing } from "./keyboard.js";
2
1
  import { Locale } from "./Locale.js";
2
+ import { isImeComposing } from "./keyboard.js";
3
3
  import "../components/button/UButton.js";
4
4
  import { UDialog } from "../components/dialog/UDialog.js";
5
5
  import "../components/input/UInput.js";
@@ -12,7 +12,7 @@ export type SupportedLocale = 'en' | 'ko' | 'ja' | 'zh-CN' | 'zh-TW' | 'es' | 'f
12
12
  /** 내장 로케일은 자동완성되지만, 임의의 BCP47 태그도 그대로 받는다. */
13
13
  export type LocaleTag = SupportedLocale | (string & {});
14
14
  /** 라이브러리가 제공하는 chrome 문자열 키. 지금은 검증 메시지뿐이지만 이후 다른 UI 문구도 추가될 수 있다. */
15
- export type LocaleMessageKey = 'valueMissing' | 'badInput' | 'typeMismatch' | 'patternMismatch' | 'rangeUnderflow' | 'rangeOverflow' | 'stepMismatch' | 'tooShort' | 'tooLong' | 'increment' | 'decrement' | 'clear' | 'today' | 'time' | 'showPassword' | 'hidePassword' | 'previousSlide' | 'nextSlide' | 'goToSlide' | 'stopSlideRotation' | 'startSlideRotation' | 'chooseDate' | 'chooseDateRange' | 'yesterday' | 'last7Days' | 'last30Days' | 'thisWeek' | 'lastWeek' | 'thisMonth' | 'lastMonth' | 'thisYear' | 'quickRanges' | 'rangeStartChosen' | 'previousMonth' | 'nextMonth' | 'close' | 'copy' | 'copied' | 'chooseFile' | 'noFileChosen' | 'filesSelected' | 'resizePanels' | 'loading' | 'breadcrumb' | 'search' | 'alertError' | 'alertWarning' | 'alertSuccess' | 'alertInfo' | 'alertNotice' | 'alertMessage' | 'remove' | 'closeTab' | 'confirm' | 'cancel' | 'stepComplete' | 'stepOnHold' | 'apply' | 'dateUnavailable' | 'startTime' | 'endTime' | 'timeAm' | 'timePm';
15
+ 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' | 'thisWeek' | 'lastWeek' | 'thisMonth' | 'lastMonth' | 'thisYear' | 'quickRanges' | 'rangeStartChosen' | 'previousMonth' | 'nextMonth' | 'close' | 'copy' | 'copied' | 'chooseFile' | 'noFileChosen' | 'filesSelected' | 'resizePanels' | 'loading' | 'breadcrumb' | 'search' | 'alertError' | 'alertWarning' | 'alertSuccess' | 'alertInfo' | 'alertNotice' | 'alertMessage' | 'remove' | 'closeTab' | 'confirm' | 'cancel' | 'stepComplete' | 'stepOnHold' | 'apply' | 'dateUnavailable' | 'startTime' | 'endTime' | 'timeAm' | 'timePm';
16
16
  type LocaleTable = Record<LocaleMessageKey, string>;
17
17
  /**
18
18
  * 한 패키지(또는 앱 영역)의 문자열 묶음.
@@ -53,6 +53,17 @@ export declare class Locale {
53
53
  private constructor();
54
54
  /** 전역 활성 로케일을 지정합니다. */
55
55
  static set(locale: LocaleTag): void;
56
+ /**
57
+ * 로케일이 바뀔 때(활성 로케일 전환 · 표 등록) 부를 함수를 등록하고, **구독을 푸는 함수**를 돌려줍니다.
58
+ * `UElement` 계열은 연결된 동안 스스로 구독해 다시 그리므로, 이것은 그 밖의 코드 — 직접 만든 요소, 앱 상태 —
59
+ * 를 위한 것입니다. React 에서는 `useSyncExternalStore(Locale.subscribe, () => Locale.revision)`.
60
+ */
61
+ /**
62
+ * 로케일이 바뀔 때마다(구독자에게 알릴 때마다) 하나씩 느는 수 — «내가 마지막으로 본 뒤 바뀌었는가» 를 묻는 값.
63
+ * `get()` 은 표 등록으로 문장이 바뀌어도 그대로이므로, 스냅샷·캐시 키로는 이것을 쓴다.
64
+ */
65
+ static get revision(): number;
66
+ static subscribe(listener: () => void): () => void;
56
67
  /** 전역 활성 로케일을 반환합니다 (초기값은 `<html lang>` → 브라우저 언어 자동 감지, 실패 시 'en'). */
57
68
  static get(): LocaleTag;
58
69
  /**