@transcodes/ui-components 0.4.6 → 0.4.7
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
|
@@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.4.7] - 2026-01-13
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- **tc-text**: Shadow DOM 환경에서 `for` 속성이 정상 작동하도록 수정
|
|
13
|
+
- Shadow DOM의 label[for]는 Light DOM input을 참조할 수 없는 웹 표준 제약 해결
|
|
14
|
+
- JavaScript로 커스텀 구현: label 클릭 시 자동으로 target input에 포커스
|
|
15
|
+
- checkbox/radio는 자동 클릭도 지원하여 네이티브 HTML과 동일한 UX 제공
|
|
16
|
+
- 사용자 API는 변경 없음 (`<tc-text tag="label" for="id">` 그대로 사용)
|
|
17
|
+
|
|
8
18
|
## [0.4.6] - 2026-01-13
|
|
9
19
|
|
|
10
20
|
### Added
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tc-text.d.ts","sourceRoot":"","sources":["../../src/primitives/tc-text.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,UAAU,
|
|
1
|
+
{"version":3,"file":"tc-text.d.ts","sourceRoot":"","sources":["../../src/primitives/tc-text.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,UAAU,EAAE,MAAM,KAAK,CAAC;AAKtC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE3C,KAAK,OAAO,GACR,GAAG,GACH,MAAM,GACN,KAAK,GACL,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,OAAO,CAAC;AAEZ,KAAK,QAAQ,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,CAAC;AACpD,KAAK,UAAU,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;AAChD,KAAK,SAAS,GACV,SAAS,GACT,WAAW,GACX,UAAU,GACV,OAAO,GACP,QAAQ,GACR,SAAS,GACT,OAAO,GACP,SAAS,GACT,MAAM,CAAC;AAEX;;;;;;;GAOG;AACH,qBACa,MAAO,SAAQ,UAAU;IACR,GAAG,EAAE,OAAO,CAAO;IACnB,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,KAAK,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;IAC3B,EAAE,EAAE,OAAO,CAAM;IACjB,GAAG,SAAM;IAErC,OAAgB,MAAM,4BA2EpB;IAEF,OAAO,CAAC,aAAa;IAmBrB,OAAO,CAAC,aAAa;IAgBZ,YAAY;IAyBZ,MAAM;CA4BhB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,SAAS,EAAE,MAAM,CAAC;KACnB;CACF"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { css as
|
|
2
|
-
import { property as a, customElement as
|
|
3
|
-
import { styleMap as
|
|
4
|
-
import { unsafeStatic as
|
|
5
|
-
import { sharedStyles as
|
|
6
|
-
var
|
|
7
|
-
for (var
|
|
8
|
-
(l =
|
|
9
|
-
return n &&
|
|
1
|
+
import { css as p, LitElement as f } from "lit";
|
|
2
|
+
import { property as a, customElement as h } from "lit/decorators.js";
|
|
3
|
+
import { styleMap as x } from "lit/directives/style-map.js";
|
|
4
|
+
import { unsafeStatic as g, html as m } from "lit/static-html.js";
|
|
5
|
+
import { sharedStyles as y } from "../styles/shared.js";
|
|
6
|
+
var v = Object.defineProperty, u = Object.getOwnPropertyDescriptor, s = (r, t, i, n) => {
|
|
7
|
+
for (var o = n > 1 ? void 0 : n ? u(t, i) : t, c = r.length - 1, l; c >= 0; c--)
|
|
8
|
+
(l = r[c]) && (o = (n ? l(t, i, o) : l(o)) || o);
|
|
9
|
+
return n && o && v(t, i, o), o;
|
|
10
10
|
};
|
|
11
|
-
let
|
|
11
|
+
let e = class extends f {
|
|
12
12
|
constructor() {
|
|
13
13
|
super(...arguments), this.tag = "p", this.sx = {}, this.for = "";
|
|
14
14
|
}
|
|
@@ -29,8 +29,15 @@ let t = class extends x {
|
|
|
29
29
|
if (this.color && (this.color.startsWith("var(") || this.color.startsWith("#") || this.color.startsWith("rgb")))
|
|
30
30
|
return this.color;
|
|
31
31
|
}
|
|
32
|
+
firstUpdated() {
|
|
33
|
+
this.tag === "label" && this.for && this.addEventListener("click", (r) => {
|
|
34
|
+
r.preventDefault();
|
|
35
|
+
const t = document.getElementById(this.for);
|
|
36
|
+
t && (t.focus(), t instanceof HTMLInputElement && (t.type === "checkbox" || t.type === "radio") && t.click());
|
|
37
|
+
});
|
|
38
|
+
}
|
|
32
39
|
render() {
|
|
33
|
-
const
|
|
40
|
+
const r = g(this.tag), t = [
|
|
34
41
|
"text",
|
|
35
42
|
this.size ? `text--${this.size}` : "",
|
|
36
43
|
this.weight ? `text--w${this.weight}` : "",
|
|
@@ -39,21 +46,20 @@ let t = class extends x {
|
|
|
39
46
|
...i ? { color: i } : {},
|
|
40
47
|
...this.sx
|
|
41
48
|
};
|
|
42
|
-
return
|
|
43
|
-
<${
|
|
49
|
+
return m`
|
|
50
|
+
<${r}
|
|
44
51
|
part="text"
|
|
45
|
-
class=${
|
|
46
|
-
style=${
|
|
47
|
-
for=${this.tag === "label" && this.for ? this.for : p}
|
|
52
|
+
class=${t}
|
|
53
|
+
style=${x(n)}
|
|
48
54
|
>
|
|
49
55
|
<slot></slot>
|
|
50
|
-
</${
|
|
56
|
+
</${r}>
|
|
51
57
|
`;
|
|
52
58
|
}
|
|
53
59
|
};
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
60
|
+
e.styles = [
|
|
61
|
+
y,
|
|
62
|
+
p`
|
|
57
63
|
:host {
|
|
58
64
|
display: contents;
|
|
59
65
|
}
|
|
@@ -127,27 +133,27 @@ t.styles = [
|
|
|
127
133
|
}
|
|
128
134
|
`
|
|
129
135
|
];
|
|
130
|
-
|
|
136
|
+
s([
|
|
131
137
|
a({ type: String })
|
|
132
|
-
],
|
|
133
|
-
|
|
138
|
+
], e.prototype, "tag", 2);
|
|
139
|
+
s([
|
|
134
140
|
a({ type: String })
|
|
135
|
-
],
|
|
136
|
-
|
|
141
|
+
], e.prototype, "size", 2);
|
|
142
|
+
s([
|
|
137
143
|
a({ type: String })
|
|
138
|
-
],
|
|
139
|
-
|
|
144
|
+
], e.prototype, "weight", 2);
|
|
145
|
+
s([
|
|
140
146
|
a({ type: String })
|
|
141
|
-
],
|
|
142
|
-
|
|
147
|
+
], e.prototype, "color", 2);
|
|
148
|
+
s([
|
|
143
149
|
a({ type: Object })
|
|
144
|
-
],
|
|
145
|
-
|
|
150
|
+
], e.prototype, "sx", 2);
|
|
151
|
+
s([
|
|
146
152
|
a({ type: String })
|
|
147
|
-
],
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
],
|
|
153
|
+
], e.prototype, "for", 2);
|
|
154
|
+
e = s([
|
|
155
|
+
h("tc-text")
|
|
156
|
+
], e);
|
|
151
157
|
export {
|
|
152
|
-
|
|
158
|
+
e as TcText
|
|
153
159
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@transcodes/ui-components",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.7",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Lit 3.x component library with Reactive Controllers",
|
|
6
6
|
"keywords": [
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"lit": "^3.0.0"
|
|
76
76
|
},
|
|
77
77
|
"dependencies": {
|
|
78
|
-
"@transcodes/design-tokens": "^0.4.
|
|
78
|
+
"@transcodes/design-tokens": "^0.4.7"
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|
|
81
81
|
"@storybook/addon-a11y": "^10.1.9",
|