@transcodes/ui-components 0.4.3 → 0.4.4

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 (112) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/controllers/animation.controller.d.ts +48 -0
  3. package/dist/controllers/animation.controller.d.ts.map +1 -0
  4. package/dist/controllers/animation.controller.js +32 -0
  5. package/dist/controllers/base.controller.d.ts +14 -0
  6. package/dist/controllers/base.controller.d.ts.map +1 -0
  7. package/dist/controllers/base.controller.js +8 -0
  8. package/dist/controllers/history.controller.d.ts +34 -0
  9. package/dist/controllers/history.controller.d.ts.map +1 -0
  10. package/dist/controllers/history.controller.js +26 -0
  11. package/dist/controllers/index.d.ts +9 -0
  12. package/dist/controllers/index.d.ts.map +1 -0
  13. package/dist/controllers/index.js +16 -0
  14. package/dist/controllers/loading.controller.d.ts +36 -0
  15. package/dist/controllers/loading.controller.d.ts.map +1 -0
  16. package/dist/controllers/loading.controller.js +27 -0
  17. package/dist/controllers/match-media.controller.d.ts +32 -0
  18. package/dist/controllers/match-media.controller.d.ts.map +1 -0
  19. package/dist/controllers/match-media.controller.js +20 -0
  20. package/dist/controllers/message-bus.controller.d.ts +45 -0
  21. package/dist/controllers/message-bus.controller.d.ts.map +1 -0
  22. package/dist/controllers/message-bus.controller.js +45 -0
  23. package/dist/controllers/storage.controller.d.ts +40 -0
  24. package/dist/controllers/storage.controller.d.ts.map +1 -0
  25. package/dist/controllers/storage.controller.js +40 -0
  26. package/dist/index.d.ts +5 -0
  27. package/dist/index.d.ts.map +1 -0
  28. package/dist/index.js +64 -0
  29. package/dist/primitives/index.d.ts +22 -0
  30. package/dist/primitives/index.d.ts.map +1 -0
  31. package/dist/primitives/index.js +44 -0
  32. package/dist/primitives/tc-box.d.ts +20 -0
  33. package/dist/primitives/tc-box.d.ts.map +1 -0
  34. package/dist/primitives/tc-box.js +38 -0
  35. package/dist/primitives/tc-button.d.ts +26 -0
  36. package/dist/primitives/tc-button.d.ts.map +1 -0
  37. package/dist/primitives/tc-button.js +168 -0
  38. package/dist/primitives/tc-callout.d.ts +24 -0
  39. package/dist/primitives/tc-callout.d.ts.map +1 -0
  40. package/dist/primitives/tc-callout.js +91 -0
  41. package/dist/primitives/tc-card.d.ts +21 -0
  42. package/dist/primitives/tc-card.d.ts.map +1 -0
  43. package/dist/primitives/tc-card.js +77 -0
  44. package/dist/primitives/tc-chip.d.ts +21 -0
  45. package/dist/primitives/tc-chip.d.ts.map +1 -0
  46. package/dist/primitives/tc-chip.js +90 -0
  47. package/dist/primitives/tc-container.d.ts +21 -0
  48. package/dist/primitives/tc-container.d.ts.map +1 -0
  49. package/dist/primitives/tc-container.js +64 -0
  50. package/dist/primitives/tc-divider.d.ts +22 -0
  51. package/dist/primitives/tc-divider.d.ts.map +1 -0
  52. package/dist/primitives/tc-divider.js +78 -0
  53. package/dist/primitives/tc-error-message.d.ts +25 -0
  54. package/dist/primitives/tc-error-message.d.ts.map +1 -0
  55. package/dist/primitives/tc-error-message.js +81 -0
  56. package/dist/primitives/tc-form-header.d.ts +26 -0
  57. package/dist/primitives/tc-form-header.d.ts.map +1 -0
  58. package/dist/primitives/tc-form-header.js +122 -0
  59. package/dist/primitives/tc-icon.d.ts +20 -0
  60. package/dist/primitives/tc-icon.d.ts.map +1 -0
  61. package/dist/primitives/tc-icon.js +95 -0
  62. package/dist/primitives/tc-input-with-chip.d.ts +40 -0
  63. package/dist/primitives/tc-input-with-chip.d.ts.map +1 -0
  64. package/dist/primitives/tc-input-with-chip.js +250 -0
  65. package/dist/primitives/tc-input.d.ts +46 -0
  66. package/dist/primitives/tc-input.d.ts.map +1 -0
  67. package/dist/primitives/tc-input.js +264 -0
  68. package/dist/primitives/tc-item-button.d.ts +29 -0
  69. package/dist/primitives/tc-item-button.d.ts.map +1 -0
  70. package/dist/primitives/tc-item-button.js +163 -0
  71. package/dist/primitives/tc-item.d.ts +24 -0
  72. package/dist/primitives/tc-item.d.ts.map +1 -0
  73. package/dist/primitives/tc-item.js +88 -0
  74. package/dist/primitives/tc-otp-input.d.ts +40 -0
  75. package/dist/primitives/tc-otp-input.d.ts.map +1 -0
  76. package/dist/primitives/tc-otp-input.js +236 -0
  77. package/dist/primitives/tc-page-decoration.d.ts +21 -0
  78. package/dist/primitives/tc-page-decoration.d.ts.map +1 -0
  79. package/dist/primitives/tc-page-decoration.js +130 -0
  80. package/dist/primitives/tc-section.d.ts +19 -0
  81. package/dist/primitives/tc-section.d.ts.map +1 -0
  82. package/dist/primitives/tc-section.js +47 -0
  83. package/dist/primitives/tc-spinner.d.ts +21 -0
  84. package/dist/primitives/tc-spinner.d.ts.map +1 -0
  85. package/dist/primitives/tc-spinner.js +90 -0
  86. package/dist/primitives/tc-symbol.d.ts +19 -0
  87. package/dist/primitives/tc-symbol.d.ts.map +1 -0
  88. package/dist/primitives/tc-symbol.js +54 -0
  89. package/dist/primitives/tc-text.d.ts +32 -0
  90. package/dist/primitives/tc-text.d.ts.map +1 -0
  91. package/dist/primitives/tc-text.js +145 -0
  92. package/dist/primitives/tc-toast.d.ts +36 -0
  93. package/dist/primitives/tc-toast.d.ts.map +1 -0
  94. package/dist/primitives/tc-toast.js +199 -0
  95. package/dist/screens/index.d.ts +4 -0
  96. package/dist/screens/index.d.ts.map +1 -0
  97. package/dist/screens/index.js +8 -0
  98. package/dist/screens/tc-error-screen.d.ts +34 -0
  99. package/dist/screens/tc-error-screen.d.ts.map +1 -0
  100. package/dist/screens/tc-error-screen.js +177 -0
  101. package/dist/screens/tc-loading-screen.d.ts +25 -0
  102. package/dist/screens/tc-loading-screen.d.ts.map +1 -0
  103. package/dist/screens/tc-loading-screen.js +85 -0
  104. package/dist/screens/tc-success-screen.d.ts +33 -0
  105. package/dist/screens/tc-success-screen.d.ts.map +1 -0
  106. package/dist/screens/tc-success-screen.js +200 -0
  107. package/dist/styles/shared.d.ts +20 -0
  108. package/dist/styles/shared.d.ts.map +1 -0
  109. package/dist/styles/shared.js +7 -0
  110. package/dist/types.d.ts +34 -0
  111. package/dist/types.d.ts.map +1 -0
  112. package/package.json +3 -2
@@ -0,0 +1,200 @@
1
+ import { css as p, LitElement as d, html as m } from "lit";
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";
4
+ import { AnimationController as f } from "../controllers/animation.controller.js";
5
+ import "../primitives/tc-icon.js";
6
+ import "../primitives/tc-text.js";
7
+ import "../primitives/tc-button.js";
8
+ import "../primitives/tc-container.js";
9
+ import "../primitives/tc-section.js";
10
+ var g = Object.defineProperty, v = Object.getOwnPropertyDescriptor, i = (a, n, o, r) => {
11
+ for (var e = r > 1 ? void 0 : r ? v(n, o) : n, c = a.length - 1, l; c >= 0; c--)
12
+ (l = a[c]) && (e = (r ? l(n, o, e) : l(e)) || e);
13
+ return r && e && g(n, o, e), e;
14
+ };
15
+ let t = class extends d {
16
+ constructor() {
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, {
18
+ showDuration: 600,
19
+ hideDuration: 300
20
+ });
21
+ }
22
+ connectedCallback() {
23
+ super.connectedCallback(), this.autoAnimate && requestAnimationFrame(() => {
24
+ this.playAnimation();
25
+ });
26
+ }
27
+ async playAnimation() {
28
+ await this.animation.show(), this.isAnimated = !0;
29
+ }
30
+ handleAction() {
31
+ this.dispatchEvent(
32
+ new CustomEvent("tc-action", {
33
+ bubbles: !0,
34
+ composed: !0
35
+ })
36
+ );
37
+ }
38
+ render() {
39
+ const a = this.isAnimated ? "animated" : "";
40
+ return m`
41
+ <div part="screen" class="screen" style=${y(this.sx)}>
42
+ <tc-container>
43
+ <div part="content" class="content">
44
+ <div part="icon" class="icon-container ${a}">
45
+ <svg
46
+ class="checkmark"
47
+ viewBox="0 0 24 24"
48
+ fill="none"
49
+ stroke="currentColor"
50
+ stroke-width="3"
51
+ stroke-linecap="round"
52
+ stroke-linejoin="round"
53
+ >
54
+ <polyline points="20 6 9 17 4 12"></polyline>
55
+ </svg>
56
+ </div>
57
+ <tc-section .sx=${{ gap: "var(--space-sm)" }} class="text-content ${a}">
58
+ <tc-text part="title" tag="h1" size="xl" weight="600" class="title">
59
+ ${this.title}
60
+ </tc-text>
61
+ <tc-text part="message" size="base" color="tertiary" class="message">
62
+ ${this.message}
63
+ </tc-text>
64
+ </tc-section>
65
+ ${this.actionLabel ? m`
66
+ <div part="action" class="action ${a}">
67
+ <tc-button variant="primary" @tc-click=${this.handleAction}>
68
+ ${this.actionLabel}
69
+ </tc-button>
70
+ </div>
71
+ ` : ""}
72
+ </div>
73
+ </tc-container>
74
+ </div>
75
+ `;
76
+ }
77
+ };
78
+ t.styles = p`
79
+ :host {
80
+ display: flex;
81
+ align-items: center;
82
+ justify-content: center;
83
+ width: 100%;
84
+ height: 100%;
85
+ min-height: inherit;
86
+ }
87
+
88
+ .screen {
89
+ display: flex;
90
+ align-items: center;
91
+ justify-content: center;
92
+ width: 100%;
93
+ height: 100%;
94
+ min-height: inherit;
95
+ padding: var(--space-lg);
96
+ box-sizing: border-box;
97
+ }
98
+
99
+ .content {
100
+ display: flex;
101
+ flex-direction: column;
102
+ align-items: center;
103
+ gap: var(--space-lg);
104
+ text-align: center;
105
+ max-width: 20rem;
106
+ }
107
+
108
+ .icon-container {
109
+ display: flex;
110
+ align-items: center;
111
+ justify-content: center;
112
+ padding: var(--space-md);
113
+ border-radius: var(--radius-full);
114
+ color: var(--accent-primary);
115
+ transform: scale(0);
116
+ opacity: 0;
117
+ transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
118
+ opacity 0.3s ease;
119
+ }
120
+
121
+ .icon-container.animated {
122
+ transform: scale(1);
123
+ opacity: 1;
124
+ }
125
+
126
+ .checkmark {
127
+ width: var(--size-icon-xl);
128
+ height: var(--size-icon-xl);
129
+ stroke-dasharray: 50;
130
+ stroke-dashoffset: 50;
131
+ }
132
+
133
+ .icon-container.animated .checkmark {
134
+ animation: draw-check 0.5s ease-out 0.3s forwards;
135
+ }
136
+
137
+ @keyframes draw-check {
138
+ to {
139
+ stroke-dashoffset: 0;
140
+ }
141
+ }
142
+
143
+ .title {
144
+ margin: 0;
145
+ }
146
+
147
+ .message {
148
+ color: var(--ink-medium);
149
+ }
150
+
151
+ .text-content {
152
+ opacity: 0;
153
+ transform: translateY(var(--offset-slide-up-md));
154
+ transition: opacity 0.4s ease, transform 0.4s ease;
155
+ transition-delay: 0.4s;
156
+ }
157
+
158
+ .text-content.animated {
159
+ opacity: 1;
160
+ transform: translateY(0);
161
+ }
162
+
163
+ .action {
164
+ width: 100%;
165
+ margin-top: var(--space-md);
166
+ opacity: 0;
167
+ transform: translateY(var(--offset-slide-up-md));
168
+ transition: opacity 0.4s ease, transform 0.4s ease;
169
+ transition-delay: 0.6s;
170
+ }
171
+
172
+ .action.animated {
173
+ opacity: 1;
174
+ transform: translateY(0);
175
+ }
176
+ `;
177
+ i([
178
+ s({ type: String })
179
+ ], t.prototype, "title", 2);
180
+ i([
181
+ s({ type: String })
182
+ ], t.prototype, "message", 2);
183
+ i([
184
+ s({ type: String, attribute: "action-label" })
185
+ ], t.prototype, "actionLabel", 2);
186
+ i([
187
+ s({ type: Boolean, attribute: "auto-animate" })
188
+ ], t.prototype, "autoAnimate", 2);
189
+ i([
190
+ s({ type: Object })
191
+ ], t.prototype, "sx", 2);
192
+ i([
193
+ h()
194
+ ], t.prototype, "isAnimated", 2);
195
+ t = i([
196
+ u("tc-success-screen")
197
+ ], t);
198
+ export {
199
+ t as TcSuccessScreen
200
+ };
@@ -0,0 +1,20 @@
1
+ import { CSSResult } from 'lit';
2
+ /**
3
+ * Design-tokens component styles as Lit CSSResult
4
+ * Use this in your component's static styles:
5
+ *
6
+ * @example
7
+ * ```ts
8
+ * import { sharedStyles } from '../styles/shared.js';
9
+ *
10
+ * @customElement('my-component')
11
+ * export class MyComponent extends LitElement {
12
+ * static override styles = [sharedStyles, css`
13
+ * // component-specific styles
14
+ * `];
15
+ * }
16
+ * ```
17
+ */
18
+ export declare const sharedStyles: CSSResult;
19
+ export default sharedStyles;
20
+ //# sourceMappingURL=shared.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/styles/shared.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,KAAK,SAAS,EAAa,MAAM,KAAK,CAAC;AAEhD;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,YAAY,EAAE,SAAsC,CAAC;AAElE,eAAe,YAAY,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { componentStyles as o } from "@transcodes/design-tokens/components";
2
+ import { unsafeCSS as t } from "lit";
3
+ const s = t(o);
4
+ export {
5
+ s as default,
6
+ s as sharedStyles
7
+ };
@@ -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.4.3",
3
+ "version": "0.4.4",
4
4
  "private": false,
5
5
  "description": "Lit 3.x component library with Reactive Controllers",
6
6
  "keywords": [
@@ -67,6 +67,7 @@
67
67
  "predev": "cd ../design-tokens && bun run build && cd ../ui-components && cp -r ../design-tokens/build .storybook/design-tokens",
68
68
  "clean": "rm -rf dist",
69
69
  "dev": "storybook dev -p 6006",
70
+ "prepublishOnly": "bun run clean && bun run build",
70
71
  "preview": "vite preview",
71
72
  "type-check": "tsc --noEmit"
72
73
  },
@@ -74,7 +75,7 @@
74
75
  "lit": "^3.0.0"
75
76
  },
76
77
  "dependencies": {
77
- "@transcodes/design-tokens": "^0.4.3"
78
+ "@transcodes/design-tokens": "^0.4.4"
78
79
  },
79
80
  "devDependencies": {
80
81
  "@storybook/addon-a11y": "^10.1.9",