@iyulab/components 2.12.1 → 2.13.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,14 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.13.0] - 2026-10-07
4
+
5
+ ### Changed
6
+
7
+ - **`size="sm"` and `size="lg"` follow the density** (`--u-density`) on `u-button`, `u-input`, `u-select`, `u-textarea`,
8
+ `u-date-picker` and `u-date-range-picker`: sm is 6/7 of it and lg 8/7. They were 12px and 16px whatever the density,
9
+ so a host that raised the density (a field or touch mode) enlarged the default controls and left the small ones
10
+ at 12px. At the default density (14px) nothing changes.
11
+
3
12
  ## [2.12.1] - 2026-10-07
4
13
 
5
14
  ### Fixed
@@ -143,15 +143,17 @@ var styles = css`
143
143
  * 그리고 아이콘 버튼의 계단(30/32/34)이 글자 버튼(32/37/42)과 기울기가 달라
144
144
  * size 를 올릴수록 어긋남이 커졌다.
145
145
  *
146
- * ⚠**size 미지정 기본값만 --u-density 를 읽는다(위 :host 블록) — sm/lg 는 리터럴로
147
- * 남긴다.** 밀도 스위치가 저자가 명시한 size=sm/lg 를 비례로 덮어써야 하는지는
148
- * 별도 제품 결정이라 이 스코프에 넣지 않았다(Pending Human Decision).
146
+ * sm·lg 도 --u-density 에 비례한다(× 6/7 · × 8/7 — 기본 밀도 14px 에서 12·16px). 종전에는 리터럴이라
147
+ * 밀도를 키운 화면(현장·터치 모드)에서 기본 크기만 커지고 작은 버튼은 12px 에 남았다. 명시한 size 는
148
+ * «단 안의 상대 위치» 를 고른 것이지 절대 크기를 고른 것이 아니다.
149
149
  */
150
150
  :host([size="sm"]) {
151
- font-size: 12px;
151
+ /* 밀도 단에 비례 — 기본 밀도 14px 에서 12px. */
152
+ font-size: calc(var(--u-density, 14px) * 6 / 7);
152
153
  }
153
154
  :host([size="lg"]) {
154
- font-size: 16px;
155
+ /* 밀도 단에 비례 — 기본 밀도 14px 에서 16px. */
156
+ font-size: calc(var(--u-density, 14px) * 8 / 7);
155
157
  }
156
158
 
157
159
  /* === States === */
@@ -62,7 +62,7 @@ export type { DateDisabledFn } from '../calendar/dates.js';
62
62
  */
63
63
  export declare class UDatePicker extends UFormControlElement<string> {
64
64
  static styles: import('lit').CSSResultGroup[];
65
- /** 크기 — 다른 필드·버튼과 같은 세 단(`sm` 12px · `md` = `--u-density`(14px) · `lg` 16px). */
65
+ /** 크기 — 다른 필드·버튼과 같은 세 단(`md` = `--u-density`(14px) · `sm` = 그 6/7(12px) · `lg` = 8/7(16px) — 밀도 단을 바꾸면 셋이 함께 움직인다). */
66
66
  size: FieldSize;
67
67
  /**
68
68
  * 칸이 담을 글자 수 — 지정하면 폭을 정하지 않은 칸(기본 `inline-block`)이 «N자 + 지우기·달력 버튼 + 패딩» 폭으로 그려지고,
@@ -46,10 +46,12 @@ var styles = css`
46
46
  font-size: var(--u-density, 14px);
47
47
  }
48
48
  :host([size="sm"]) {
49
- font-size: 12px;
49
+ /* 밀도 단에 비례 — 기본 밀도 14px 에서 12px. */
50
+ font-size: calc(var(--u-density, 14px) * 6 / 7);
50
51
  }
51
52
  :host([size="lg"]) {
52
- font-size: 16px;
53
+ /* 밀도 단에 비례 — 기본 밀도 14px 에서 16px. */
54
+ font-size: calc(var(--u-density, 14px) * 8 / 7);
53
55
  }
54
56
  `;
55
57
  //#endregion
@@ -76,7 +76,7 @@ export type { DateRangePreset, DateRangePresetName, DateRangePresetOption } from
76
76
  */
77
77
  export declare class UDateRangePicker extends UFormControlElement<string> {
78
78
  static styles: import('lit').CSSResultGroup[];
79
- /** 크기 — 다른 필드·버튼과 같은 세 단(`sm` 12px · `md` = `--u-density`(14px) · `lg` 16px). */
79
+ /** 크기 — 다른 필드·버튼과 같은 세 단(`md` = `--u-density`(14px) · `sm` = 그 6/7(12px) · `lg` = 8/7(16px) — 밀도 단을 바꾸면 셋이 함께 움직인다). */
80
80
  size: FieldSize;
81
81
  /**
82
82
  * 칸이 담을 글자 수 — 지정하면 폭을 정하지 않은 칸(기본 `inline-block`)이 «N자 + 지우기·달력 버튼 + 패딩» 폭으로 그려지고,
@@ -106,10 +106,12 @@ var styles = css`
106
106
  font-size: var(--u-density, 14px);
107
107
  }
108
108
  :host([size="sm"]) {
109
- font-size: 12px;
109
+ /* 밀도 단에 비례 — 기본 밀도 14px 에서 12px. */
110
+ font-size: calc(var(--u-density, 14px) * 6 / 7);
110
111
  }
111
112
  :host([size="lg"]) {
112
- font-size: 16px;
113
+ /* 밀도 단에 비례 — 기본 밀도 14px 에서 16px. */
114
+ font-size: calc(var(--u-density, 14px) * 8 / 7);
113
115
  }
114
116
  `;
115
117
  //#endregion
@@ -84,7 +84,7 @@ export declare class UInput extends UFormControlElement<string> {
84
84
  /** 자동 완성 기능 설정 */
85
85
  autocomplete?: AutoFill;
86
86
  /**
87
- * 크기 — 버튼의 `size` 와 같은 세 단(`sm` 12px · `md` 기본 = `--u-density`(14px) · `lg` 16px).
87
+ * 크기 — 버튼의 `size` 와 같은 세 단(`md` 기본 = `--u-density`(14px) · `sm` = 그 6/7(12px) · `lg` = 8/7(16px) — 밀도 단을 바꾸면 셋이 함께 움직인다).
88
88
  * 상자 높이는 글자 크기에서 파생된다(1.5em 줄 + 필드 상자 여백 × 2 + 테두리) — 같은 `size` 의 버튼과
89
89
  * 한 줄에 서도록. 테마는 필드 상자 토큰(`--u-field-padding-block`)으로 단마다 높이를 다듬는다.
90
90
  */
@@ -241,10 +241,12 @@ var styles = css`
241
241
  font-size: var(--u-density, 14px);
242
242
  }
243
243
  :host([size="sm"]) {
244
- font-size: 12px;
244
+ /* 밀도 단에 비례 — 기본 밀도 14px 에서 12px. */
245
+ font-size: calc(var(--u-density, 14px) * 6 / 7);
245
246
  }
246
247
  :host([size="lg"]) {
247
- font-size: 16px;
248
+ /* 밀도 단에 비례 — 기본 밀도 14px 에서 16px. */
249
+ font-size: calc(var(--u-density, 14px) * 8 / 7);
248
250
  }
249
251
  `;
250
252
  //#endregion
@@ -45,7 +45,7 @@ export declare class USelect extends UFormControlElement<string | string[]> {
45
45
  /** 외형 정도 */
46
46
  appearance: FieldAppearance;
47
47
  /**
48
- * 크기 — 버튼의 `size` 와 같은 세 단(`sm` 12px · `md` 기본 = `--u-density`(14px) · `lg` 16px).
48
+ * 크기 — 버튼의 `size` 와 같은 세 단(`md` 기본 = `--u-density`(14px) · `sm` = 그 6/7(12px) · `lg` = 8/7(16px) — 밀도 단을 바꾸면 셋이 함께 움직인다).
49
49
  * 상자 높이는 글자 크기에서 파생된다(1.5em 줄 + 필드 상자 여백 × 2 + 테두리) — 같은 `size` 의 버튼과
50
50
  * 한 줄에 서도록. 테마는 필드 상자 토큰(`--u-field-padding-block`)으로 단마다 높이를 다듬는다.
51
51
  */
@@ -262,10 +262,12 @@ var styles = css`
262
262
  font-size: var(--u-density, 14px);
263
263
  }
264
264
  :host([size="sm"]) {
265
- font-size: 12px;
265
+ /* 밀도 단에 비례 — 기본 밀도 14px 에서 12px. */
266
+ font-size: calc(var(--u-density, 14px) * 6 / 7);
266
267
  }
267
268
  :host([size="lg"]) {
268
- font-size: 16px;
269
+ /* 밀도 단에 비례 — 기본 밀도 14px 에서 16px. */
270
+ font-size: calc(var(--u-density, 14px) * 8 / 7);
269
271
  }
270
272
  `;
271
273
  //#endregion
@@ -24,7 +24,7 @@ export declare class UTextarea extends UFormControlElement<string> {
24
24
  /** 외형 정도 */
25
25
  appearance: FieldAppearance;
26
26
  /**
27
- * 크기 — 버튼의 `size` 와 같은 세 단(`sm` 12px · `md` 기본 = `--u-density`(14px) · `lg` 16px).
27
+ * 크기 — 버튼의 `size` 와 같은 세 단(`md` 기본 = `--u-density`(14px) · `sm` = 그 6/7(12px) · `lg` = 8/7(16px) — 밀도 단을 바꾸면 셋이 함께 움직인다).
28
28
  * 상자 높이는 글자 크기에서 파생된다(1.5em 줄 + 필드 상자 여백 × 2 + 테두리) — 같은 `size` 의 버튼과
29
29
  * 한 줄에 서도록. 테마는 필드 상자 토큰(`--u-field-padding-block`)으로 단마다 높이를 다듬는다.
30
30
  */
@@ -176,10 +176,12 @@ var styles = css`
176
176
  font-size: var(--u-density, 14px);
177
177
  }
178
178
  :host([size="sm"]) {
179
- font-size: 12px;
179
+ /* 밀도 단에 비례 — 기본 밀도 14px 에서 12px. */
180
+ font-size: calc(var(--u-density, 14px) * 6 / 7);
180
181
  }
181
182
  :host([size="lg"]) {
182
- font-size: 16px;
183
+ /* 밀도 단에 비례 — 기본 밀도 14px 에서 16px. */
184
+ font-size: calc(var(--u-density, 14px) * 8 / 7);
183
185
  }
184
186
  `;
185
187
  //#endregion
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.12.1",
4
+ "version": "2.13.0",
5
5
  "keywords": [
6
6
  "iyulab",
7
7
  "components",
@@ -47,7 +47,7 @@ Versatile button with multiple appearances. Renders as an `<a>` element when `hr
47
47
  |----------|------|---------|---------|-------------|
48
48
  | `appearance` | `'solid'\|'soft'\|'outlined'\|'plain'\|'link'` | `'solid'` | ✓ | How much chrome: `solid` filled with the colour · `soft` tint, no outline · `outlined` · `plain` no chrome · `link` |
49
49
  | `color` | `'neutral'\|'primary'\|'info'\|'success'\|'warning'\|'danger'\|'blue'\|'green'\|'red'\|'orange'\|'teal'\|'cyan'\|'purple'\|'pink'` | — | ✓ | Color, independent of `appearance`. Unset paints like `primary` (the brand colour) without adding the attribute; `neutral` is an achromatic (grey) button (see notes below). |
50
- | `size` | `'sm'\|'md'\|'lg'` | `'md'` | ✓ | Button size (12px/14px/16px font-size; padding, spinner, and icon slots scale proportionally). |
50
+ | `size` | `'sm'\|'md'\|'lg'` | `'md'` | ✓ | Button size (font-size `--u-density` × 6/7 · × 1 · × 8/7 — 12/14/16px at the default density; padding, spinner, and icon slots scale proportionally). |
51
51
  | `rounded` | `boolean` | `false` | ✓ | Pill-shaped border radius |
52
52
  | `disabled` | `boolean` | `false` | ✓ | Disable the button |
53
53
  | `loading` | `boolean` | `false` | ✓ | Show loading spinner; disables interaction |
@@ -81,7 +81,7 @@ starts from the value. Typing in the text box still commits on Enter or leaving
81
81
  | `value` | `string` | — | — | Selected date (ISO `YYYY-MM-DD`), or full ISO-8601 datetime in `mode="datetime"` |
82
82
  | `min` | `string` | — | — | Minimum selectable date (ISO `YYYY-MM-DD`, date-only in both modes) |
83
83
  | `max` | `string` | — | — | Maximum selectable date (ISO `YYYY-MM-DD`, date-only in both modes) |
84
- | `size` | `'sm'\|'md'\|'lg'` | `'md'` | ✓ | Field size, like a button's: 12px · `--u-density` (14px) · 16px. A field and a button of the same size share a height |
84
+ | `size` | `'sm'\|'md'\|'lg'` | `'md'` | ✓ | Field size, like a button's: `--u-density` (14px) for md, 6/7 of it for sm (12px) and 8/7 for lg (16px) — change the density and all three follow. A field and a button of the same size share a height |
85
85
  | `chars` | `number` | — | ✓ | Characters the field holds. An unsized field draws at N characters + its clear and calendar buttons + padding; a sized one uses it as the text floor, so a narrower box overflows. Give the length of the `format` pattern for a box that fits it exactly. Same axis as `u-input`'s `chars`. N characters are measured as drawn — tabular figures and letter spacing count, which CSS `ch` leaves out |
86
86
  | `clearable` | `boolean` | `false` | ✓ | Show clear button |
87
87
  | `isDateDisabled` | `(date: string) => boolean` | — | — | App rule for days that cannot be chosen (ISO in, `true` = disabled). Property only; see «Disabled days» |
@@ -137,7 +137,7 @@ picker.addEventListener('change', () => {
137
137
  | `end` | `string` (read-only) | — | — | End of the range (ISO day, or date-time in `mode="datetime"`), `undefined` without a complete range |
138
138
  | `min` | `string` | — | — | Earliest selectable day (ISO `YYYY-MM-DD`), inclusive |
139
139
  | `max` | `string` | — | — | Latest selectable day (ISO `YYYY-MM-DD`), inclusive |
140
- | `size` | `'sm'\|'md'\|'lg'` | `'md'` | ✓ | Field size, like a button's: 12px · `--u-density` (14px) · 16px. A field and a button of the same size share a height |
140
+ | `size` | `'sm'\|'md'\|'lg'` | `'md'` | ✓ | Field size, like a button's: `--u-density` (14px) for md, 6/7 of it for sm (12px) and 8/7 for lg (16px) — change the density and all three follow. A field and a button of the same size share a height |
141
141
  | `chars` | `number` | — | ✓ | Characters the field holds — both dates and the separator (`a – b`). An unsized field draws at N characters + its clear and calendar buttons + padding; a sized one uses it as the text floor, so a narrower box overflows. Same axis as `u-input`'s `chars`. N characters are measured as drawn — tabular figures and letter spacing count, which CSS `ch` leaves out |
142
142
  | `clearable` | `boolean` | `false` | ✓ | Show clear button |
143
143
  | `isDateDisabled` | `(date: string) => boolean` | — | — | App rule for days that cannot start or end a range (ISO in, `true` = disabled). Property only; see «Disabled days» |
@@ -55,7 +55,7 @@ the library does not infer one from field meaning.
55
55
  | Property | Type | Default | Reflect | Description |
56
56
  |----------|------|---------|---------|-------------|
57
57
  | `appearance` | `'outlined'\|'soft'\|'underlined'\|'plain'` | `'outlined'` | ✓ | How much chrome: `outlined` · `soft` tinted face · `underlined` bottom line only · `plain` no chrome |
58
- | `size` | `'sm'\|'md'\|'lg'` | `'md'` | ✓ | Field size, like a button's: 12px · `--u-density` (14px) · 16px. A field and a button of the same size share a height |
58
+ | `size` | `'sm'\|'md'\|'lg'` | `'md'` | ✓ | Field size, like a button's: `--u-density` (14px) for md, 6/7 of it for sm (12px) and 8/7 for lg (16px) — change the density and all three follow. A field and a button of the same size share a height |
59
59
  | `type` | `'text'\|'password'\|'email'\|'tel'\|'url'\|'search'\|'number'\|'date'\|'time'`… | `'text'` | — | Input type |
60
60
  | `chars` | `number` | — | ✓ | Characters the field holds. An unsized field draws at N characters + its suffix icons + padding; a sized one (`width`, `block`) uses it as the text floor, so a narrower box overflows. Not `size` — that is the sm/md/lg scale. N characters are measured as drawn — tabular figures and letter spacing count, which CSS `ch` leaves out |
61
61
  | `placeholder` | `string` | — | — | Placeholder text |
@@ -38,7 +38,7 @@ Dropdown select with single or multiple selection, search, and clear support. Fo
38
38
  |----------|------|---------|---------|-------------|
39
39
  | `value` | `string \| string[]` | — | — | Selected value(s) |
40
40
  | `appearance` | `'outlined'\|'soft'\|'underlined'\|'plain'` | `'outlined'` | ✓ | How much chrome: `outlined` · `soft` tinted face · `underlined` bottom line only · `plain` no chrome |
41
- | `size` | `'sm'\|'md'\|'lg'` | `'md'` | ✓ | Field size, like a button's: 12px · `--u-density` (14px) · 16px. A field and a button of the same size share a height |
41
+ | `size` | `'sm'\|'md'\|'lg'` | `'md'` | ✓ | Field size, like a button's: `--u-density` (14px) for md, 6/7 of it for sm (12px) and 8/7 for lg (16px) — change the density and all three follow. A field and a button of the same size share a height |
42
42
  | `chars` | `number` | — | ✓ | Characters the field holds. An unsized field draws at N characters + its clear button and arrow + padding, so it no longer widens and narrows with the chosen option (a longer one ends in an ellipsis); a sized one (`--u-select-width`, `block`) uses it as the text floor, so a narrower box overflows. Same axis as `u-input`'s `chars`. N characters are measured as drawn — tabular figures and letter spacing count, which CSS `ch` leaves out |
43
43
  | `multiple` | `boolean` | `false` | ✓ | Allow multiple selections |
44
44
  | `searchable` | `boolean` | `false` | ✓ | Filter options by text |
@@ -24,7 +24,7 @@ Multi-line text input with auto-resize and optional character counter. Form-asso
24
24
  |----------|------|---------|---------|-------------|
25
25
  | `value` | `string` | — | — | Current text value |
26
26
  | `appearance` | `'outlined'\|'soft'\|'underlined'\|'plain'` | `'outlined'` | ✓ | How much chrome: `outlined` · `soft` tinted face · `underlined` bottom line only · `plain` no chrome |
27
- | `size` | `'sm'\|'md'\|'lg'` | `'md'` | ✓ | Field size, like a button's: 12px · `--u-density` (14px) · 16px. A field and a button of the same size share a height |
27
+ | `size` | `'sm'\|'md'\|'lg'` | `'md'` | ✓ | Field size, like a button's: `--u-density` (14px) for md, 6/7 of it for sm (12px) and 8/7 for lg (16px) — change the density and all three follow. A field and a button of the same size share a height |
28
28
  | `resize` | `'none'\|'vertical'\|'horizontal'\|'both'\|'auto'` | `'auto'` | ✓ | Resize behavior |
29
29
  | `minRows` | `number` | — | — | Minimum visible rows |
30
30
  | `maxRows` | `number` | — | — | Maximum rows (auto-resize cap) |