@transcodes/ui-components 0.4.5 → 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,25 @@ 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
|
+
|
|
18
|
+
## [0.4.6] - 2026-01-13
|
|
19
|
+
|
|
20
|
+
### Added
|
|
21
|
+
|
|
22
|
+
- **tc-text**: `for` 속성 지원 추가 (label 접근성 개선)
|
|
23
|
+
- `tag="label"`일 때 `for` 속성으로 form control과 연결 가능
|
|
24
|
+
- 스크린 리더 및 키보드 네비게이션 접근성 향상
|
|
25
|
+
- Storybook `LabelWithFor` 스토리 추가
|
|
26
|
+
|
|
8
27
|
## [0.4.5] - 2025-12-23
|
|
9
28
|
|
|
10
29
|
### Fixed
|
|
@@ -18,9 +18,11 @@ export declare class TcText extends LitElement {
|
|
|
18
18
|
weight?: TextWeight;
|
|
19
19
|
color?: TextColor | string;
|
|
20
20
|
sx: SxProps;
|
|
21
|
+
for: string;
|
|
21
22
|
static styles: import('lit').CSSResult[];
|
|
22
23
|
private getColorClass;
|
|
23
24
|
private getColorStyle;
|
|
25
|
+
firstUpdated(): void;
|
|
24
26
|
render(): import('lit').TemplateResult;
|
|
25
27
|
}
|
|
26
28
|
declare global {
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
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,16 +1,16 @@
|
|
|
1
|
-
import { css as
|
|
2
|
-
import { property as a, customElement as
|
|
3
|
-
import { styleMap as
|
|
4
|
-
import { unsafeStatic as
|
|
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
5
|
import { sharedStyles as y } from "../styles/shared.js";
|
|
6
|
-
var v = Object.defineProperty, u = Object.getOwnPropertyDescriptor,
|
|
7
|
-
for (var
|
|
8
|
-
(l = r[c]) && (
|
|
9
|
-
return
|
|
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
|
-
super(...arguments), this.tag = "p", this.sx = {};
|
|
13
|
+
super(...arguments), this.tag = "p", this.sx = {}, this.for = "";
|
|
14
14
|
}
|
|
15
15
|
getColorClass() {
|
|
16
16
|
return this.color && {
|
|
@@ -29,26 +29,37 @@ let t = class extends p {
|
|
|
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 r =
|
|
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}` : "",
|
|
37
44
|
this.getColorClass()
|
|
38
|
-
].filter(Boolean).join(" "),
|
|
39
|
-
...
|
|
45
|
+
].filter(Boolean).join(" "), i = this.getColorStyle(), n = {
|
|
46
|
+
...i ? { color: i } : {},
|
|
40
47
|
...this.sx
|
|
41
48
|
};
|
|
42
49
|
return m`
|
|
43
|
-
<${r}
|
|
50
|
+
<${r}
|
|
51
|
+
part="text"
|
|
52
|
+
class=${t}
|
|
53
|
+
style=${x(n)}
|
|
54
|
+
>
|
|
44
55
|
<slot></slot>
|
|
45
56
|
</${r}>
|
|
46
57
|
`;
|
|
47
58
|
}
|
|
48
59
|
};
|
|
49
|
-
|
|
60
|
+
e.styles = [
|
|
50
61
|
y,
|
|
51
|
-
|
|
62
|
+
p`
|
|
52
63
|
:host {
|
|
53
64
|
display: contents;
|
|
54
65
|
}
|
|
@@ -122,24 +133,27 @@ t.styles = [
|
|
|
122
133
|
}
|
|
123
134
|
`
|
|
124
135
|
];
|
|
125
|
-
|
|
136
|
+
s([
|
|
126
137
|
a({ type: String })
|
|
127
|
-
],
|
|
128
|
-
|
|
138
|
+
], e.prototype, "tag", 2);
|
|
139
|
+
s([
|
|
129
140
|
a({ type: String })
|
|
130
|
-
],
|
|
131
|
-
|
|
141
|
+
], e.prototype, "size", 2);
|
|
142
|
+
s([
|
|
132
143
|
a({ type: String })
|
|
133
|
-
],
|
|
134
|
-
|
|
144
|
+
], e.prototype, "weight", 2);
|
|
145
|
+
s([
|
|
135
146
|
a({ type: String })
|
|
136
|
-
],
|
|
137
|
-
|
|
147
|
+
], e.prototype, "color", 2);
|
|
148
|
+
s([
|
|
138
149
|
a({ type: Object })
|
|
139
|
-
],
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
],
|
|
150
|
+
], e.prototype, "sx", 2);
|
|
151
|
+
s([
|
|
152
|
+
a({ type: String })
|
|
153
|
+
], e.prototype, "for", 2);
|
|
154
|
+
e = s([
|
|
155
|
+
h("tc-text")
|
|
156
|
+
], e);
|
|
143
157
|
export {
|
|
144
|
-
|
|
158
|
+
e as TcText
|
|
145
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",
|