@iyulab/components 1.0.0 → 1.0.1

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,20 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.0.1 (2026-04-01)
4
+
5
+ ### Bug Fixes
6
+
7
+ - **`UIcon`**: Auto-apply `fill="currentColor"` only for fill-based icons; skip when `stroke="currentColor"` is set. Removed global `fill: currentColor` CSS rule.
8
+ - **`URadio`** / **`USelect`**: `options` field is now a `@state()` so UI re-renders when options change. `onChangeValue()` is now triggered on both `value` and `options` changes.
9
+ - **`UTextarea`**: Replaced `all: unset` with explicit CSS reset for better cross-browser compatibility. Height recalculation moved inside `requestAnimationFrame` to stabilize auto-resize.
10
+ - **`Dialog`**: Fixed `prompt()` input not capturing user text — switched to property binding (`.value`) and native `@input` event.
11
+
12
+ ### Dependencies
13
+
14
+ - **`@lit/react`**: Moved from `dependencies` to optional `peerDependencies`.
15
+
16
+ ---
17
+
3
18
  ## 1.0.0 (2026-04-01)
4
19
 
5
20
  ### Breaking Changes
@@ -42,6 +42,7 @@ var UIcon = class UIcon extends UElement {
42
42
  const svg = doc.documentElement;
43
43
  if (svg?.tagName.toLowerCase() !== "svg") return void 0;
44
44
  svg.setAttribute("part", "svg");
45
+ if (svg.getAttribute("stroke") !== "currentColor") svg.setAttribute("fill", "currentColor");
45
46
  return svg.outerHTML;
46
47
  } catch {
47
48
  return;
@@ -10,7 +10,6 @@ var styles = css`
10
10
  svg {
11
11
  width: 1em;
12
12
  height: 1em;
13
- fill: currentColor;
14
13
  }
15
14
  `;
16
15
  //#endregion
@@ -4,7 +4,7 @@ import { UFormControlElement } from "../UFormControlElement.js";
4
4
  import "../field/UField.js";
5
5
  import { UOption } from "../option/UOption.js";
6
6
  import { styles } from "./URadio.styles.js";
7
- import { customElement, property } from "lit/decorators.js";
7
+ import { customElement, property, state } from "lit/decorators.js";
8
8
  import { html } from "lit";
9
9
  //#region src/components/radio/URadio.ts
10
10
  var URadio = class URadio extends UFormControlElement {
@@ -76,7 +76,7 @@ var URadio = class URadio extends UFormControlElement {
76
76
  if (this.disabled) option.disabled = true;
77
77
  if (this.readonly) option.disabled = true;
78
78
  });
79
- if (changedProperties.has("value")) this.onChangeValue();
79
+ if (["value", "options"].some((k) => changedProperties.has(k))) this.onChangeValue();
80
80
  }
81
81
  render() {
82
82
  return html`
@@ -146,6 +146,7 @@ __decorate([property({
146
146
  type: String,
147
147
  reflect: true
148
148
  }), __decorateMetadata("design:type", Object)], URadio.prototype, "orientation", void 0);
149
+ __decorate([state(), __decorateMetadata("design:type", Array)], URadio.prototype, "options", void 0);
149
150
  URadio = __decorate([customElement("u-radio")], URadio);
150
151
  //#endregion
151
152
  export { URadio };
@@ -7,7 +7,7 @@ import "../field/UField.js";
7
7
  import { UOption } from "../option/UOption.js";
8
8
  import { UPopover } from "../popover/UPopover.js";
9
9
  import { styles } from "./USelect.styles.js";
10
- import { customElement, property, query } from "lit/decorators.js";
10
+ import { customElement, property, query, state } from "lit/decorators.js";
11
11
  import { html } from "lit";
12
12
  //#region src/components/select/USelect.ts
13
13
  var _ref, _ref2;
@@ -133,7 +133,7 @@ var USelect = class USelect extends UFormControlElement {
133
133
  }
134
134
  updated(changedProperties) {
135
135
  super.updated(changedProperties);
136
- if (changedProperties.has("value")) this.onChangeValue();
136
+ if (["value", "options"].some((k) => changedProperties.has(k))) this.onChangeValue();
137
137
  }
138
138
  render() {
139
139
  return html`
@@ -310,6 +310,7 @@ __decorate([property({
310
310
  __decorate([property({ type: String }), __decorateMetadata("design:type", String)], USelect.prototype, "placeholder", void 0);
311
311
  __decorate([query(".container", true), __decorateMetadata("design:type", typeof (_ref = typeof HTMLElement !== "undefined" && HTMLElement) === "function" ? _ref : Object)], USelect.prototype, "containerEl", void 0);
312
312
  __decorate([query("u-popover", true), __decorateMetadata("design:type", typeof (_ref2 = typeof UPopover !== "undefined" && UPopover) === "function" ? _ref2 : Object)], USelect.prototype, "popoverEl", void 0);
313
+ __decorate([state(), __decorateMetadata("design:type", Array)], USelect.prototype, "options", void 0);
313
314
  USelect = __decorate([customElement("u-select")], USelect);
314
315
  //#endregion
315
316
  export { USelect };
@@ -49,7 +49,7 @@ export declare class UTextarea extends UFormControlElement<string> {
49
49
  /** placeholder 텍스트 */
50
50
  placeholder?: string;
51
51
  textareaEl?: HTMLTextAreaElement;
52
- protected updated(changedProperties: PropertyValues): void;
52
+ protected updated(changedProperties: PropertyValues): Promise<void>;
53
53
  render(): import('lit-html').TemplateResult<1>;
54
54
  validate(): boolean;
55
55
  reset(): void;
@@ -34,8 +34,9 @@ var UTextarea = class UTextarea extends UFormControlElement {
34
34
  static {
35
35
  this.styles = [super.styles, styles];
36
36
  }
37
- updated(changedProperties) {
37
+ async updated(changedProperties) {
38
38
  super.updated(changedProperties);
39
+ await this.updateComplete;
39
40
  if (this.resize === "auto" && [
40
41
  "value",
41
42
  "minRows",
@@ -102,10 +103,12 @@ var UTextarea = class UTextarea extends UFormControlElement {
102
103
  const minHeight = this.minRows ? lineHeight * this.minRows + extra : lineHeight + extra;
103
104
  const maxHeight = this.maxRows ? lineHeight * this.maxRows + extra : Infinity;
104
105
  textarea.style.height = "auto";
105
- const scrollHeight = textarea.scrollHeight;
106
- const newHeight = Math.min(Math.max(scrollHeight, minHeight), maxHeight);
107
- textarea.style.height = `${newHeight}px`;
108
- textarea.style.overflowY = scrollHeight > maxHeight ? "auto" : "hidden";
106
+ requestAnimationFrame(() => {
107
+ const scrollHeight = textarea.scrollHeight;
108
+ const newHeight = Math.min(Math.max(scrollHeight, minHeight), maxHeight);
109
+ textarea.style.height = `${newHeight}px`;
110
+ textarea.style.overflowY = scrollHeight > maxHeight ? "auto" : "hidden";
111
+ });
109
112
  }
110
113
  };
111
114
  __decorate([property({
@@ -101,7 +101,14 @@ var styles = css`
101
101
 
102
102
  /* ===== Textarea 요소 ===== */
103
103
  textarea {
104
- all: unset;
104
+ display: block;
105
+ border: none;
106
+ background: none;
107
+ outline: none;
108
+ padding: 0;
109
+ margin: 0;
110
+ color: inherit;
111
+ font: inherit;
105
112
  flex: 1;
106
113
  min-width: 0;
107
114
  font-size: 1em;
@@ -52,8 +52,8 @@ var Dialog = class {
52
52
  <u-input
53
53
  type=${options?.type || "text"}
54
54
  placeholder=${options?.placeholder || ""}
55
- value=${inputValue}
56
- @u-input=${(e) => {
55
+ .value=${inputValue}
56
+ @input=${(e) => {
57
57
  inputValue = e.target.value || "";
58
58
  }}
59
59
  @keydown=${(e) => {
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": "1.0.0",
4
+ "version": "1.0.1",
5
5
  "keywords": [
6
6
  "iyulab",
7
7
  "components",
@@ -45,14 +45,17 @@
45
45
  },
46
46
  "dependencies": {
47
47
  "@floating-ui/dom": "^1.7.6",
48
- "@lit/react": "^1.0.8",
49
48
  "focus-trap": "^8.0.1",
50
49
  "lit": "^3.3.2"
51
50
  },
52
51
  "peerDependencies": {
52
+ "@lit/react": ">=1.0.8",
53
53
  "react": ">=18.0.0"
54
54
  },
55
55
  "peerDependenciesMeta": {
56
+ "@lit/react": {
57
+ "optional": true
58
+ },
56
59
  "react": {
57
60
  "optional": true
58
61
  }
@@ -4,7 +4,7 @@ description: Web component library built on Lit. Covers all u-* custom elements
4
4
  license: MIT
5
5
  metadata:
6
6
  author: iyulab
7
- version: "1.0.0"
7
+ version: "1.0.1"
8
8
  ---
9
9
 
10
10
  # @iyulab/components