@transcodes/ui-components 0.3.6 → 0.4.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 (72) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/README.md +8 -22
  3. package/dist/index.d.ts +1 -0
  4. package/dist/index.d.ts.map +1 -1
  5. package/dist/primitives/tc-box.d.ts +2 -1
  6. package/dist/primitives/tc-box.d.ts.map +1 -1
  7. package/dist/primitives/tc-button.d.ts +2 -1
  8. package/dist/primitives/tc-button.d.ts.map +1 -1
  9. package/dist/primitives/tc-callout.d.ts +2 -0
  10. package/dist/primitives/tc-callout.d.ts.map +1 -1
  11. package/dist/primitives/tc-callout.js +21 -17
  12. package/dist/primitives/tc-card.d.ts +2 -1
  13. package/dist/primitives/tc-card.d.ts.map +1 -1
  14. package/dist/primitives/tc-chip.d.ts +2 -0
  15. package/dist/primitives/tc-chip.d.ts.map +1 -1
  16. package/dist/primitives/tc-chip.js +22 -14
  17. package/dist/primitives/tc-container.d.ts +2 -1
  18. package/dist/primitives/tc-container.d.ts.map +1 -1
  19. package/dist/primitives/tc-divider.d.ts +2 -2
  20. package/dist/primitives/tc-divider.d.ts.map +1 -1
  21. package/dist/primitives/tc-divider.js +23 -22
  22. package/dist/primitives/tc-error-message.d.ts +2 -0
  23. package/dist/primitives/tc-error-message.d.ts.map +1 -1
  24. package/dist/primitives/tc-error-message.js +18 -15
  25. package/dist/primitives/tc-form-header.d.ts +2 -1
  26. package/dist/primitives/tc-form-header.d.ts.map +1 -1
  27. package/dist/primitives/tc-icon.d.ts +2 -2
  28. package/dist/primitives/tc-icon.d.ts.map +1 -1
  29. package/dist/primitives/tc-icon.js +61 -61
  30. package/dist/primitives/tc-input-with-chip.d.ts +2 -0
  31. package/dist/primitives/tc-input-with-chip.d.ts.map +1 -1
  32. package/dist/primitives/tc-input-with-chip.js +17 -13
  33. package/dist/primitives/tc-input.d.ts +2 -1
  34. package/dist/primitives/tc-input.d.ts.map +1 -1
  35. package/dist/primitives/tc-item-button.d.ts +2 -3
  36. package/dist/primitives/tc-item-button.d.ts.map +1 -1
  37. package/dist/primitives/tc-item-button.js +28 -34
  38. package/dist/primitives/tc-item.d.ts +2 -3
  39. package/dist/primitives/tc-item.d.ts.map +1 -1
  40. package/dist/primitives/tc-item.js +20 -26
  41. package/dist/primitives/tc-otp-input.d.ts +2 -0
  42. package/dist/primitives/tc-otp-input.d.ts.map +1 -1
  43. package/dist/primitives/tc-otp-input.js +11 -7
  44. package/dist/primitives/tc-page-decoration.d.ts +2 -0
  45. package/dist/primitives/tc-page-decoration.d.ts.map +1 -1
  46. package/dist/primitives/tc-page-decoration.js +24 -20
  47. package/dist/primitives/tc-section.d.ts +2 -2
  48. package/dist/primitives/tc-section.d.ts.map +1 -1
  49. package/dist/primitives/tc-section.js +20 -23
  50. package/dist/primitives/tc-spinner.d.ts +2 -1
  51. package/dist/primitives/tc-spinner.d.ts.map +1 -1
  52. package/dist/primitives/tc-spinner.js +25 -22
  53. package/dist/primitives/tc-symbol.d.ts +2 -3
  54. package/dist/primitives/tc-symbol.d.ts.map +1 -1
  55. package/dist/primitives/tc-symbol.js +24 -28
  56. package/dist/primitives/tc-text.d.ts +2 -1
  57. package/dist/primitives/tc-text.d.ts.map +1 -1
  58. package/dist/primitives/tc-toast.d.ts +2 -0
  59. package/dist/primitives/tc-toast.d.ts.map +1 -1
  60. package/dist/primitives/tc-toast.js +33 -23
  61. package/dist/screens/tc-error-screen.d.ts +2 -0
  62. package/dist/screens/tc-error-screen.d.ts.map +1 -1
  63. package/dist/screens/tc-error-screen.js +35 -31
  64. package/dist/screens/tc-loading-screen.d.ts +2 -0
  65. package/dist/screens/tc-loading-screen.d.ts.map +1 -1
  66. package/dist/screens/tc-loading-screen.js +19 -15
  67. package/dist/screens/tc-success-screen.d.ts +2 -0
  68. package/dist/screens/tc-success-screen.d.ts.map +1 -1
  69. package/dist/screens/tc-success-screen.js +25 -21
  70. package/dist/types.d.ts +34 -0
  71. package/dist/types.d.ts.map +1 -0
  72. package/package.json +2 -2
@@ -1,28 +1,29 @@
1
- import { css as m, LitElement as g, html as p } from "lit";
2
- import { property as l, customElement as h } from "lit/decorators.js";
3
- import { LoadingController as d } from "../controllers/loading.controller.js";
1
+ import { css as m, LitElement as g, html as l } from "lit";
2
+ import { property as c, customElement as h } from "lit/decorators.js";
3
+ import { styleMap as d } from "lit/directives/style-map.js";
4
+ import { LoadingController as y } from "../controllers/loading.controller.js";
4
5
  import "../primitives/tc-spinner.js";
5
6
  import "../primitives/tc-text.js";
6
7
  import "../primitives/tc-container.js";
7
- var f = Object.defineProperty, u = Object.getOwnPropertyDescriptor, c = (o, r, n, i) => {
8
- for (var e = i > 1 ? void 0 : i ? u(r, n) : r, s = o.length - 1, a; s >= 0; s--)
9
- (a = o[s]) && (e = (i ? a(r, n, e) : a(e)) || e);
8
+ var f = Object.defineProperty, x = Object.getOwnPropertyDescriptor, s = (p, r, n, i) => {
9
+ for (var e = i > 1 ? void 0 : i ? x(r, n) : r, a = p.length - 1, o; a >= 0; a--)
10
+ (o = p[a]) && (e = (i ? o(r, n, e) : o(e)) || e);
10
11
  return i && e && f(r, n, e), e;
11
12
  };
12
13
  let t = class extends g {
13
14
  constructor() {
14
- super(...arguments), this.message = "", this.spinnerSize = "md", this.loading = new d(this);
15
+ super(...arguments), this.message = "", this.spinnerSize = "md", this.sx = {}, this.loading = new y(this);
15
16
  }
16
17
  connectedCallback() {
17
18
  super.connectedCallback(), this.loading.start();
18
19
  }
19
20
  render() {
20
- return p`
21
- <div part="screen" class="screen">
21
+ return l`
22
+ <div part="screen" class="screen" style=${d(this.sx)}>
22
23
  <tc-container>
23
24
  <div part="content" class="content">
24
25
  <tc-spinner part="spinner" size=${this.spinnerSize}></tc-spinner>
25
- ${this.message ? p`
26
+ ${this.message ? l`
26
27
  <tc-text part="message" class="message" size="base" color="tertiary">
27
28
  ${this.message}
28
29
  </tc-text>
@@ -68,13 +69,16 @@ t.styles = m`
68
69
  max-width: 20rem;
69
70
  }
70
71
  `;
71
- c([
72
- l({ type: String })
72
+ s([
73
+ c({ type: String })
73
74
  ], t.prototype, "message", 2);
74
- c([
75
- l({ type: String, attribute: "spinner-size" })
75
+ s([
76
+ c({ type: String, attribute: "spinner-size" })
76
77
  ], t.prototype, "spinnerSize", 2);
77
- t = c([
78
+ s([
79
+ c({ type: Object })
80
+ ], t.prototype, "sx", 2);
81
+ t = s([
78
82
  h("tc-loading-screen")
79
83
  ], t);
80
84
  export {
@@ -1,4 +1,5 @@
1
1
  import { LitElement } from 'lit';
2
+ import { SxProps } from '../types.js';
2
3
  /**
3
4
  * A full-screen success state with animated checkmark and message.
4
5
  *
@@ -15,6 +16,7 @@ export declare class TcSuccessScreen extends LitElement {
15
16
  message: string;
16
17
  actionLabel: string;
17
18
  autoAnimate: boolean;
19
+ sx: SxProps;
18
20
  private isAnimated;
19
21
  private animation;
20
22
  static styles: import('lit').CSSResult;
@@ -1 +1 @@
1
- {"version":3,"file":"tc-success-screen.d.ts","sourceRoot":"","sources":["../../src/screens/tc-success-screen.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,UAAU,EAAE,MAAM,KAAK,CAAC;AAG5C,OAAO,0BAA0B,CAAC;AAClC,OAAO,0BAA0B,CAAC;AAClC,OAAO,4BAA4B,CAAC;AACpC,OAAO,+BAA+B,CAAC;AACvC,OAAO,6BAA6B,CAAC;AAErC;;;;;;;;;;GAUG;AACH,qBACa,eAAgB,SAAQ,UAAU;IACjB,KAAK,SAAc;IACnB,OAAO,SACS;IACW,WAAW,SAAM;IAChB,WAAW,UAAQ;IAElE,OAAO,CAAC,UAAU,CAAS;IAEpC,OAAO,CAAC,SAAS,CAGd;IAEH,OAAgB,MAAM,0BAoGpB;IAEO,iBAAiB;IASpB,aAAa;IAKnB,OAAO,CAAC,YAAY;IASX,MAAM;CA4ChB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,mBAAmB,EAAE,eAAe,CAAC;KACtC;CACF"}
1
+ {"version":3,"file":"tc-success-screen.d.ts","sourceRoot":"","sources":["../../src/screens/tc-success-screen.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,UAAU,EAAE,MAAM,KAAK,CAAC;AAI5C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,0BAA0B,CAAC;AAClC,OAAO,0BAA0B,CAAC;AAClC,OAAO,4BAA4B,CAAC;AACpC,OAAO,+BAA+B,CAAC;AACvC,OAAO,6BAA6B,CAAC;AAErC;;;;;;;;;;GAUG;AACH,qBACa,eAAgB,SAAQ,UAAU;IACjB,KAAK,SAAc;IACnB,OAAO,SACS;IACW,WAAW,SAAM;IAChB,WAAW,UAAQ;IAC/C,EAAE,EAAE,OAAO,CAAM;IAEpC,OAAO,CAAC,UAAU,CAAS;IAEpC,OAAO,CAAC,SAAS,CAGd;IAEH,OAAgB,MAAM,0BAoGpB;IAEO,iBAAiB;IASpB,aAAa;IAKnB,OAAO,CAAC,YAAY;IASX,MAAM;CA4ChB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,mBAAmB,EAAE,eAAe,CAAC;KACtC;CACF"}
@@ -1,19 +1,20 @@
1
1
  import { css as p, LitElement as d, html as m } from "lit";
2
- import { property as r, state as h, customElement as u } from "lit/decorators.js";
2
+ import { property as s, state as h, customElement as u } from "lit/decorators.js";
3
+ import { styleMap as y } from "lit/directives/style-map.js";
3
4
  import { AnimationController as f } from "../controllers/animation.controller.js";
4
5
  import "../primitives/tc-icon.js";
5
6
  import "../primitives/tc-text.js";
6
7
  import "../primitives/tc-button.js";
7
8
  import "../primitives/tc-container.js";
8
9
  import "../primitives/tc-section.js";
9
- var y = Object.defineProperty, g = Object.getOwnPropertyDescriptor, i = (a, s, o, n) => {
10
- for (var e = n > 1 ? void 0 : n ? g(s, o) : s, c = a.length - 1, l; c >= 0; c--)
11
- (l = a[c]) && (e = (n ? l(s, o, e) : l(e)) || e);
12
- return n && e && y(s, o, e), e;
10
+ var g = Object.defineProperty, v = Object.getOwnPropertyDescriptor, a = (i, n, o, r) => {
11
+ for (var e = r > 1 ? void 0 : r ? v(n, o) : n, c = i.length - 1, l; c >= 0; c--)
12
+ (l = i[c]) && (e = (r ? l(n, o, e) : l(e)) || e);
13
+ return r && e && g(n, o, e), e;
13
14
  };
14
15
  let t = class extends d {
15
16
  constructor() {
16
- super(...arguments), this.title = "Success!", this.message = "Your action was completed successfully.", this.actionLabel = "", this.autoAnimate = !0, this.isAnimated = !1, this.animation = new f(this, {
17
+ super(...arguments), this.title = "Success!", this.message = "Your action was completed successfully.", this.actionLabel = "", this.autoAnimate = !0, this.sx = {}, this.isAnimated = !1, this.animation = new f(this, {
17
18
  showDuration: 600,
18
19
  hideDuration: 300
19
20
  });
@@ -35,12 +36,12 @@ let t = class extends d {
35
36
  );
36
37
  }
37
38
  render() {
38
- const a = this.isAnimated ? "animated" : "";
39
+ const i = this.isAnimated ? "animated" : "";
39
40
  return m`
40
- <div part="screen" class="screen">
41
+ <div part="screen" class="screen" style=${y(this.sx)}>
41
42
  <tc-container>
42
43
  <div part="content" class="content">
43
- <div part="icon" class="icon-container ${a}">
44
+ <div part="icon" class="icon-container ${i}">
44
45
  <svg
45
46
  class="checkmark"
46
47
  viewBox="0 0 24 24"
@@ -53,7 +54,7 @@ let t = class extends d {
53
54
  <polyline points="20 6 9 17 4 12"></polyline>
54
55
  </svg>
55
56
  </div>
56
- <tc-section gap="var(--space-sm)" class="text-content ${a}">
57
+ <tc-section .sx=${{ gap: "var(--space-sm)" }} class="text-content ${i}">
57
58
  <tc-text part="title" tag="h1" size="xl" weight="600" class="title">
58
59
  ${this.title}
59
60
  </tc-text>
@@ -62,7 +63,7 @@ let t = class extends d {
62
63
  </tc-text>
63
64
  </tc-section>
64
65
  ${this.actionLabel ? m`
65
- <div part="action" class="action ${a}">
66
+ <div part="action" class="action ${i}">
66
67
  <tc-button variant="success" @tc-click=${this.handleAction}>
67
68
  ${this.actionLabel}
68
69
  </tc-button>
@@ -175,22 +176,25 @@ t.styles = p`
175
176
  transform: translateY(0);
176
177
  }
177
178
  `;
178
- i([
179
- r({ type: String })
179
+ a([
180
+ s({ type: String })
180
181
  ], t.prototype, "title", 2);
181
- i([
182
- r({ type: String })
182
+ a([
183
+ s({ type: String })
183
184
  ], t.prototype, "message", 2);
184
- i([
185
- r({ type: String, attribute: "action-label" })
185
+ a([
186
+ s({ type: String, attribute: "action-label" })
186
187
  ], t.prototype, "actionLabel", 2);
187
- i([
188
- r({ type: Boolean, attribute: "auto-animate" })
188
+ a([
189
+ s({ type: Boolean, attribute: "auto-animate" })
189
190
  ], t.prototype, "autoAnimate", 2);
190
- i([
191
+ a([
192
+ s({ type: Object })
193
+ ], t.prototype, "sx", 2);
194
+ a([
191
195
  h()
192
196
  ], t.prototype, "isAnimated", 2);
193
- t = i([
197
+ t = a([
194
198
  u("tc-success-screen")
195
199
  ], t);
196
200
  export {
@@ -0,0 +1,34 @@
1
+ /**
2
+ * 공통 타입 정의
3
+ * @packageDocumentation
4
+ */
5
+ /**
6
+ * 인라인 스타일 객체 타입
7
+ * Lit의 styleMap과 호환
8
+ *
9
+ * @example
10
+ * ```typescript
11
+ * <tc-button .sx=${{ padding: '1rem', fontSize: '1.25rem' }}>
12
+ * Large Button
13
+ * </tc-button>
14
+ * ```
15
+ */
16
+ export type SxProps = Record<string, string | number>;
17
+ /**
18
+ * 공통 크기 옵션
19
+ */
20
+ export type Size = 'sm' | 'md' | 'lg';
21
+ export type SizeWithAuto = Size | 'auto';
22
+ /**
23
+ * 시맨틱 변형 타입
24
+ */
25
+ export type SemanticVariant = 'info' | 'success' | 'warning' | 'error';
26
+ /**
27
+ * 버튼 변형 타입
28
+ */
29
+ export type ButtonVariant = 'primary' | 'secondary' | 'success';
30
+ /**
31
+ * 칩 변형 타입
32
+ */
33
+ export type ChipVariant = 'default' | 'success' | 'error' | 'info';
34
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;GAUG;AACH,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;AAEtD;;GAEG;AACH,MAAM,MAAM,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AACtC,MAAM,MAAM,YAAY,GAAG,IAAI,GAAG,MAAM,CAAC;AAEzC;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;AAEvE;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,CAAC;AAEhE;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@transcodes/ui-components",
3
- "version": "0.3.6",
3
+ "version": "0.4.0",
4
4
  "private": false,
5
5
  "description": "Lit 3.x component library with Reactive Controllers",
6
6
  "keywords": [
@@ -74,7 +74,7 @@
74
74
  "lit": "^3.0.0"
75
75
  },
76
76
  "dependencies": {
77
- "@transcodes/design-tokens": "^0.3.6"
77
+ "@transcodes/design-tokens": "^0.4.0"
78
78
  },
79
79
  "devDependencies": {
80
80
  "@storybook/addon-a11y": "^10.1.9",