@iyulab/components 0.1.7 → 0.1.8

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 (275) hide show
  1. package/CHANGELOG.md +42 -18
  2. package/LICENSE +20 -20
  3. package/README.md +33 -33
  4. package/dist/assets/icons/arrow-clockwise.svg.js +1 -1
  5. package/dist/assets/icons/arrow-down.svg.js +1 -1
  6. package/dist/assets/icons/arrow-up.svg.js +1 -1
  7. package/dist/assets/icons/ban.svg.js +1 -1
  8. package/dist/assets/icons/bell-fill.svg.js +1 -1
  9. package/dist/assets/icons/check-circle-fill.svg.js +1 -1
  10. package/dist/assets/icons/check-lg.svg.js +1 -1
  11. package/dist/assets/icons/chevron-down.svg.js +1 -1
  12. package/dist/assets/icons/chevron-left.svg.js +1 -1
  13. package/dist/assets/icons/chevron-right.svg.js +1 -1
  14. package/dist/assets/icons/chevron-up.svg.js +1 -1
  15. package/dist/assets/icons/copy.svg.js +1 -1
  16. package/dist/assets/icons/dash-lg.svg.js +1 -1
  17. package/dist/assets/icons/exclamation-circle-fill.svg.js +1 -1
  18. package/dist/assets/icons/exclamation-triangle-fill.svg.js +1 -1
  19. package/dist/assets/icons/eye-slash.svg.js +1 -1
  20. package/dist/assets/icons/eye.svg.js +1 -1
  21. package/dist/assets/icons/info-circle-fill.svg.js +1 -1
  22. package/dist/assets/icons/layout-sidebar.svg.js +1 -1
  23. package/dist/assets/icons/lightbulb-fill.svg.js +1 -1
  24. package/dist/assets/icons/lightbulb-off.svg.js +1 -1
  25. package/dist/assets/icons/lightbulb.svg.js +1 -1
  26. package/dist/assets/icons/mic-fill.svg.js +1 -1
  27. package/dist/assets/icons/mic-mute-fill.svg.js +1 -1
  28. package/dist/assets/icons/paperclip.svg.js +1 -1
  29. package/dist/assets/icons/pencil-square.svg.js +1 -1
  30. package/dist/assets/icons/plus-lg.svg.js +1 -1
  31. package/dist/assets/icons/search.svg.js +1 -1
  32. package/dist/assets/icons/speedometer.svg.js +1 -1
  33. package/dist/assets/icons/x-lg.svg.js +1 -1
  34. package/dist/assets/styles/dark.css +129 -129
  35. package/dist/assets/styles/dark.css.js +1 -1
  36. package/dist/assets/styles/light.css +129 -129
  37. package/dist/assets/styles/light.css.js +1 -1
  38. package/dist/components/BaseElement.styles.js +1 -1
  39. package/dist/components/FloatingElement.d.ts +31 -19
  40. package/dist/components/FloatingElement.js +46 -34
  41. package/dist/components/FloatingElement.styles.js +5 -4
  42. package/dist/components/ModalElement.d.ts +70 -0
  43. package/dist/components/ModalElement.js +144 -0
  44. package/dist/components/ModalElement.styles.js +29 -0
  45. package/dist/components/alert/{Alert.d.ts → UAlert.component.d.ts} +1 -1
  46. package/dist/components/alert/{Alert.js → UAlert.component.js} +20 -18
  47. package/dist/components/alert/UAlert.d.ts +8 -0
  48. package/dist/components/alert/UAlert.js +5 -0
  49. package/dist/components/alert/{Alert.styles.js → UAlert.styles.js} +1 -3
  50. package/dist/components/button/{Button.d.ts → UButton.component.d.ts} +1 -1
  51. package/dist/components/button/{Button.js → UButton.component.js} +7 -7
  52. package/dist/components/button/UButton.d.ts +7 -0
  53. package/dist/components/button/UButton.js +5 -0
  54. package/dist/components/copy-button/{CopyButton.d.ts → UCopyButton.component.d.ts} +1 -1
  55. package/dist/components/copy-button/{CopyButton.js → UCopyButton.component.js} +10 -10
  56. package/dist/components/copy-button/UCopyButton.d.ts +7 -0
  57. package/dist/components/copy-button/UCopyButton.js +5 -0
  58. package/dist/components/dialog/UDialog.component.d.ts +15 -0
  59. package/dist/components/dialog/UDialog.component.js +65 -0
  60. package/dist/components/dialog/UDialog.d.ts +7 -0
  61. package/dist/components/dialog/UDialog.js +5 -0
  62. package/dist/components/dialog/{Dialog.styles.js → UDialog.styles.js} +14 -29
  63. package/dist/components/divider/{Divider.d.ts → UDivider.component.d.ts} +1 -1
  64. package/dist/components/divider/{Divider.js → UDivider.component.js} +6 -6
  65. package/dist/components/divider/UDivider.d.ts +7 -0
  66. package/dist/components/divider/UDivider.js +5 -0
  67. package/dist/components/drawer/UDrawer.component.d.ts +16 -0
  68. package/dist/components/drawer/UDrawer.component.js +59 -0
  69. package/dist/components/drawer/UDrawer.d.ts +8 -0
  70. package/dist/components/drawer/UDrawer.js +5 -0
  71. package/dist/components/drawer/UDrawer.styles.js +82 -0
  72. package/dist/components/form/{Form.d.ts → UForm.component.d.ts} +2 -2
  73. package/dist/components/form/{Form.js → UForm.component.js} +14 -12
  74. package/dist/components/form/UForm.d.ts +7 -0
  75. package/dist/components/form/UForm.js +5 -0
  76. package/dist/components/icon/{Icon.d.ts → UIcon.component.d.ts} +5 -4
  77. package/dist/components/icon/{Icon.js → UIcon.component.js} +9 -10
  78. package/dist/components/icon/UIcon.d.ts +8 -0
  79. package/dist/components/icon/UIcon.js +5 -0
  80. package/dist/components/icon-button/{IconButton.d.ts → UIconButton.component.d.ts} +3 -2
  81. package/dist/components/icon-button/{IconButton.js → UIconButton.component.js} +15 -15
  82. package/dist/components/icon-button/UIconButton.d.ts +7 -0
  83. package/dist/components/icon-button/UIconButton.js +5 -0
  84. package/dist/components/input/{Input.d.ts → UInput.component.d.ts} +14 -10
  85. package/dist/components/input/{Input.js → UInput.component.js} +71 -76
  86. package/dist/components/input/UInput.d.ts +7 -0
  87. package/dist/components/input/UInput.js +5 -0
  88. package/dist/components/input/{Input.styles.js → UInput.styles.js} +27 -24
  89. package/dist/components/menu/UMenu.component.d.ts +70 -0
  90. package/dist/components/menu/UMenu.component.js +327 -0
  91. package/dist/components/menu/UMenu.d.ts +8 -0
  92. package/dist/components/menu/UMenu.js +5 -0
  93. package/dist/components/menu/UMenu.styles.js +39 -0
  94. package/dist/components/menu-item/UMenuItem.component.d.ts +19 -0
  95. package/dist/components/menu-item/UMenuItem.component.js +96 -0
  96. package/dist/components/menu-item/UMenuItem.d.ts +7 -0
  97. package/dist/components/menu-item/UMenuItem.js +5 -0
  98. package/dist/components/menu-item/UMenuItem.styles.js +65 -0
  99. package/dist/components/progress-bar/{ProgressBar.d.ts → UProgressBar.component.d.ts} +1 -1
  100. package/dist/components/progress-bar/{ProgressBar.js → UProgressBar.component.js} +10 -10
  101. package/dist/components/progress-bar/UProgressBar.d.ts +7 -0
  102. package/dist/components/progress-bar/UProgressBar.js +5 -0
  103. package/dist/components/progress-ring/{ProgressRing.d.ts → UProgressRing.component.d.ts} +1 -1
  104. package/dist/components/progress-ring/{ProgressRing.js → UProgressRing.component.js} +9 -9
  105. package/dist/components/progress-ring/UProgressRing.d.ts +8 -0
  106. package/dist/components/progress-ring/UProgressRing.js +5 -0
  107. package/dist/components/skeleton/USkeleton.component.d.ts +22 -0
  108. package/dist/components/skeleton/USkeleton.component.js +58 -0
  109. package/dist/components/skeleton/USkeleton.d.ts +8 -0
  110. package/dist/components/skeleton/USkeleton.js +5 -0
  111. package/dist/components/skeleton/USkeleton.styles.js +74 -0
  112. package/dist/components/spinner/{Spinner.d.ts → USpinner.component.d.ts} +1 -1
  113. package/dist/components/spinner/{Spinner.js → USpinner.component.js} +3 -3
  114. package/dist/components/spinner/USpinner.d.ts +7 -0
  115. package/dist/components/spinner/USpinner.js +5 -0
  116. package/dist/components/split-panel/{SplitPanel.d.ts → USplitPanel.component.d.ts} +1 -1
  117. package/dist/components/split-panel/{SplitPanel.js → USplitPanel.component.js} +13 -13
  118. package/dist/components/split-panel/USplitPanel.d.ts +7 -0
  119. package/dist/components/split-panel/USplitPanel.js +5 -0
  120. package/dist/components/tooltip/{Tooltip.d.ts → UTooltip.component.d.ts} +6 -7
  121. package/dist/components/tooltip/{Tooltip.js → UTooltip.component.js} +12 -16
  122. package/dist/components/tooltip/UTooltip.d.ts +7 -0
  123. package/dist/components/tooltip/UTooltip.js +5 -0
  124. package/dist/components/tooltip/{Tooltip.styles.js → UTooltip.styles.js} +1 -0
  125. package/dist/components/tree/{Tree.d.ts → UTree.component.d.ts} +4 -4
  126. package/dist/components/tree/{Tree.js → UTree.component.js} +10 -10
  127. package/dist/components/tree/UTree.d.ts +7 -0
  128. package/dist/components/tree/UTree.js +5 -0
  129. package/dist/components/tree/UTree.styles.d.ts +1 -0
  130. package/dist/components/tree/{Tree.styles.js → UTree.styles.js} +0 -1
  131. package/dist/components/tree-item/{TreeItem.d.ts → UTreeItem.component.d.ts} +2 -2
  132. package/dist/components/tree-item/{TreeItem.js → UTreeItem.component.js} +15 -15
  133. package/dist/components/tree-item/UTreeItem.d.ts +7 -0
  134. package/dist/components/tree-item/UTreeItem.js +5 -0
  135. package/dist/index.d.ts +29 -2
  136. package/dist/index.js +40 -42
  137. package/dist/internals/attribute-converters.d.ts +5 -3
  138. package/dist/internals/node-helpers.d.ts +9 -9
  139. package/dist/internals/node-helpers.js +2 -2
  140. package/dist/utilities/icons.js +1 -4
  141. package/dist/utilities/notifier.d.ts +1 -1
  142. package/dist/utilities/notifier.js +3 -3
  143. package/package.json +60 -59
  144. package/dist/components/alert/index.d.ts +0 -7
  145. package/dist/components/alert/index.js +0 -5
  146. package/dist/components/button/index.d.ts +0 -7
  147. package/dist/components/button/index.js +0 -5
  148. package/dist/components/context-menu/ContextMenu.d.ts +0 -29
  149. package/dist/components/context-menu/ContextMenu.js +0 -148
  150. package/dist/components/context-menu/ContextMenu.styles.js +0 -15
  151. package/dist/components/context-menu/index.d.ts +0 -7
  152. package/dist/components/context-menu/index.js +0 -5
  153. package/dist/components/copy-button/index.d.ts +0 -7
  154. package/dist/components/copy-button/index.js +0 -5
  155. package/dist/components/dialog/Dialog.d.ts +0 -37
  156. package/dist/components/dialog/Dialog.js +0 -160
  157. package/dist/components/dialog/index.d.ts +0 -7
  158. package/dist/components/dialog/index.js +0 -5
  159. package/dist/components/divider/index.d.ts +0 -7
  160. package/dist/components/divider/index.js +0 -5
  161. package/dist/components/dropdown-menu/DropdownMenu.d.ts +0 -27
  162. package/dist/components/dropdown-menu/DropdownMenu.js +0 -135
  163. package/dist/components/dropdown-menu/DropdownMenu.styles.js +0 -15
  164. package/dist/components/dropdown-menu/index.d.ts +0 -7
  165. package/dist/components/dropdown-menu/index.js +0 -5
  166. package/dist/components/form/index.d.ts +0 -7
  167. package/dist/components/form/index.js +0 -5
  168. package/dist/components/icon/index.d.ts +0 -7
  169. package/dist/components/icon/index.js +0 -5
  170. package/dist/components/icon-button/index.d.ts +0 -7
  171. package/dist/components/icon-button/index.js +0 -5
  172. package/dist/components/index.d.ts +0 -20
  173. package/dist/components/input/index.d.ts +0 -7
  174. package/dist/components/input/index.js +0 -5
  175. package/dist/components/menu/Menu.d.ts +0 -25
  176. package/dist/components/menu/Menu.js +0 -168
  177. package/dist/components/menu/Menu.styles.js +0 -21
  178. package/dist/components/menu/index.d.ts +0 -7
  179. package/dist/components/menu/index.js +0 -5
  180. package/dist/components/menu-item/MenuItem.d.ts +0 -36
  181. package/dist/components/menu-item/MenuItem.js +0 -267
  182. package/dist/components/menu-item/MenuItem.styles.js +0 -70
  183. package/dist/components/menu-item/index.d.ts +0 -7
  184. package/dist/components/menu-item/index.js +0 -5
  185. package/dist/components/progress-bar/index.d.ts +0 -7
  186. package/dist/components/progress-bar/index.js +0 -5
  187. package/dist/components/progress-ring/index.d.ts +0 -7
  188. package/dist/components/progress-ring/index.js +0 -5
  189. package/dist/components/spinner/index.d.ts +0 -7
  190. package/dist/components/spinner/index.js +0 -5
  191. package/dist/components/split-panel/index.d.ts +0 -7
  192. package/dist/components/split-panel/index.js +0 -5
  193. package/dist/components/tooltip/index.d.ts +0 -7
  194. package/dist/components/tooltip/index.js +0 -5
  195. package/dist/components/tree/index.d.ts +0 -3
  196. package/dist/components/tree/index.js +0 -5
  197. package/dist/components/tree-item/index.d.ts +0 -3
  198. package/dist/components/tree-item/index.js +0 -5
  199. package/dist/events/index.d.ts +0 -6
  200. package/dist/integrations/react/UAlert.d.ts +0 -8
  201. package/dist/integrations/react/UAlert.js +0 -10
  202. package/dist/integrations/react/UButton.d.ts +0 -8
  203. package/dist/integrations/react/UButton.js +0 -10
  204. package/dist/integrations/react/UContextMenu.d.ts +0 -8
  205. package/dist/integrations/react/UContextMenu.js +0 -10
  206. package/dist/integrations/react/UCopyButton.d.ts +0 -8
  207. package/dist/integrations/react/UCopyButton.js +0 -10
  208. package/dist/integrations/react/UDialog.d.ts +0 -8
  209. package/dist/integrations/react/UDialog.js +0 -10
  210. package/dist/integrations/react/UDivider.d.ts +0 -8
  211. package/dist/integrations/react/UDivider.js +0 -10
  212. package/dist/integrations/react/UDropdownMenu.d.ts +0 -8
  213. package/dist/integrations/react/UDropdownMenu.js +0 -10
  214. package/dist/integrations/react/UForm.d.ts +0 -8
  215. package/dist/integrations/react/UForm.js +0 -10
  216. package/dist/integrations/react/UIcon.d.ts +0 -8
  217. package/dist/integrations/react/UIcon.js +0 -10
  218. package/dist/integrations/react/UIconButton.d.ts +0 -8
  219. package/dist/integrations/react/UIconButton.js +0 -10
  220. package/dist/integrations/react/UInput.d.ts +0 -8
  221. package/dist/integrations/react/UInput.js +0 -10
  222. package/dist/integrations/react/UMenu.d.ts +0 -8
  223. package/dist/integrations/react/UMenu.js +0 -10
  224. package/dist/integrations/react/UMenuItem.d.ts +0 -8
  225. package/dist/integrations/react/UMenuItem.js +0 -10
  226. package/dist/integrations/react/UProgressBar.d.ts +0 -8
  227. package/dist/integrations/react/UProgressBar.js +0 -10
  228. package/dist/integrations/react/UProgressRing.d.ts +0 -8
  229. package/dist/integrations/react/UProgressRing.js +0 -10
  230. package/dist/integrations/react/USpinner.d.ts +0 -8
  231. package/dist/integrations/react/USpinner.js +0 -10
  232. package/dist/integrations/react/USplitPanel.d.ts +0 -8
  233. package/dist/integrations/react/USplitPanel.js +0 -10
  234. package/dist/integrations/react/UTooltip.d.ts +0 -8
  235. package/dist/integrations/react/UTooltip.js +0 -10
  236. package/dist/integrations/react/UTree.d.ts +0 -8
  237. package/dist/integrations/react/UTree.js +0 -10
  238. package/dist/integrations/react/UTreeItem.d.ts +0 -8
  239. package/dist/integrations/react/UTreeItem.js +0 -10
  240. package/dist/integrations/react/index.d.ts +0 -27
  241. package/dist/integrations/react/index.js +0 -20
  242. package/dist/internals/index.d.ts +0 -3
  243. package/dist/utilities/decorators.js +0 -28
  244. package/dist/utilities/index.d.ts +0 -5
  245. /package/dist/components/{alert/Alert.styles.d.ts → ModalElement.styles.d.ts} +0 -0
  246. /package/dist/components/{button/Button.styles.d.ts → alert/UAlert.styles.d.ts} +0 -0
  247. /package/dist/components/{context-menu/ContextMenu.styles.d.ts → button/UButton.styles.d.ts} +0 -0
  248. /package/dist/components/button/{Button.styles.js → UButton.styles.js} +0 -0
  249. /package/dist/components/copy-button/{CopyButton.styles.d.ts → UCopyButton.styles.d.ts} +0 -0
  250. /package/dist/components/copy-button/{CopyButton.styles.js → UCopyButton.styles.js} +0 -0
  251. /package/dist/components/dialog/{Dialog.styles.d.ts → UDialog.styles.d.ts} +0 -0
  252. /package/dist/components/divider/{Divider.styles.d.ts → UDivider.styles.d.ts} +0 -0
  253. /package/dist/components/divider/{Divider.styles.js → UDivider.styles.js} +0 -0
  254. /package/dist/components/{dropdown-menu/DropdownMenu.styles.d.ts → drawer/UDrawer.styles.d.ts} +0 -0
  255. /package/dist/components/form/{Form.styles.d.ts → UForm.styles.d.ts} +0 -0
  256. /package/dist/components/form/{Form.styles.js → UForm.styles.js} +0 -0
  257. /package/dist/components/icon/{Icon.styles.d.ts → UIcon.styles.d.ts} +0 -0
  258. /package/dist/components/icon/{Icon.styles.js → UIcon.styles.js} +0 -0
  259. /package/dist/components/icon-button/{IconButton.styles.d.ts → UIconButton.styles.d.ts} +0 -0
  260. /package/dist/components/icon-button/{IconButton.styles.js → UIconButton.styles.js} +0 -0
  261. /package/dist/components/input/{Input.styles.d.ts → UInput.styles.d.ts} +0 -0
  262. /package/dist/components/menu/{Menu.styles.d.ts → UMenu.styles.d.ts} +0 -0
  263. /package/dist/components/menu-item/{MenuItem.styles.d.ts → UMenuItem.styles.d.ts} +0 -0
  264. /package/dist/components/progress-bar/{ProgressBar.styles.d.ts → UProgressBar.styles.d.ts} +0 -0
  265. /package/dist/components/progress-bar/{ProgressBar.styles.js → UProgressBar.styles.js} +0 -0
  266. /package/dist/components/progress-ring/{ProgressRing.styles.d.ts → UProgressRing.styles.d.ts} +0 -0
  267. /package/dist/components/progress-ring/{ProgressRing.styles.js → UProgressRing.styles.js} +0 -0
  268. /package/dist/components/{spinner/Spinner.styles.d.ts → skeleton/USkeleton.styles.d.ts} +0 -0
  269. /package/dist/components/{split-panel/SplitPanel.styles.d.ts → spinner/USpinner.styles.d.ts} +0 -0
  270. /package/dist/components/spinner/{Spinner.styles.js → USpinner.styles.js} +0 -0
  271. /package/dist/components/{tooltip/Tooltip.styles.d.ts → split-panel/USplitPanel.styles.d.ts} +0 -0
  272. /package/dist/components/split-panel/{SplitPanel.styles.js → USplitPanel.styles.js} +0 -0
  273. /package/dist/components/{tree-item/TreeItem.styles.d.ts → tooltip/UTooltip.styles.d.ts} +0 -0
  274. /package/dist/components/{tree/Tree.styles.d.ts → tree-item/UTreeItem.styles.d.ts} +0 -0
  275. /package/dist/components/tree-item/{TreeItem.styles.js → UTreeItem.styles.js} +0 -0
@@ -4,7 +4,7 @@ import { unsafeHTML } from 'lit/directives/unsafe-html.js';
4
4
  import { until } from 'lit/directives/until.js';
5
5
  import { BaseElement } from '../BaseElement.js';
6
6
  import { icons } from '../../utilities/icons.js';
7
- import { styles } from './Icon.styles.js';
7
+ import { styles } from './UIcon.styles.js';
8
8
 
9
9
  var __defProp = Object.defineProperty;
10
10
  var __decorateClass = (decorators, target, key, kind) => {
@@ -15,10 +15,10 @@ var __decorateClass = (decorators, target, key, kind) => {
15
15
  if (result) __defProp(target, key, result);
16
16
  return result;
17
17
  };
18
- class Icon extends BaseElement {
18
+ class UIcon extends BaseElement {
19
19
  constructor() {
20
20
  super(...arguments);
21
- this.library = "default";
21
+ this.lib = "default";
22
22
  }
23
23
  static {
24
24
  this.styles = [super.styles, styles];
@@ -27,9 +27,8 @@ class Icon extends BaseElement {
27
27
  this.dependencies = {};
28
28
  }
29
29
  render() {
30
- if (!this.name) return nothing;
31
- console.log(this.library, this.name, "icon render");
32
- return until(icons.resolve(this.library, this.name).then((html) => {
30
+ if (!this.lib || !this.name) return nothing;
31
+ return until(icons.resolve(this.lib, this.name).then((html) => {
33
32
  return this.validate(html) ? unsafeHTML(html) : nothing;
34
33
  }), nothing);
35
34
  }
@@ -49,10 +48,10 @@ class Icon extends BaseElement {
49
48
  }
50
49
  }
51
50
  __decorateClass([
52
- property({ type: String, attribute: "lib" })
53
- ], Icon.prototype, "library");
51
+ property({ type: String })
52
+ ], UIcon.prototype, "lib");
54
53
  __decorateClass([
55
54
  property({ type: String })
56
- ], Icon.prototype, "name");
55
+ ], UIcon.prototype, "name");
57
56
 
58
- export { Icon };
57
+ export { UIcon };
@@ -0,0 +1,8 @@
1
+ import { UIcon } from './UIcon.component.js';
2
+ declare global {
3
+ interface HTMLElementTagNameMap {
4
+ "u-icon": UIcon;
5
+ }
6
+ }
7
+ export { UIcon };
8
+ export type { IconLibrary } from './UIcon.component.js';
@@ -0,0 +1,5 @@
1
+ import { UIcon } from './UIcon.component.js';
2
+
3
+ UIcon.define("u-icon");
4
+
5
+ export { UIcon };
@@ -1,8 +1,9 @@
1
1
  import { BaseElement } from '../BaseElement.js';
2
+ import { IconLibrary } from '../icon/UIcon.component.js';
2
3
  /**
3
4
  * IconButton 컴포넌트는 아이콘만 표시하는 버튼입니다.
4
5
  */
5
- export declare class IconButton extends BaseElement {
6
+ export declare class UIconButton extends BaseElement {
6
7
  static styles: import('lit').CSSResultGroup[];
7
8
  static dependencies: Record<string, typeof BaseElement>;
8
9
  /** 경계선이 없는 스타일을 적용합니다. */
@@ -12,7 +13,7 @@ export declare class IconButton extends BaseElement {
12
13
  /** 버튼이 로딩 상태인지 여부를 설정합니다. 로딩 중에는 버튼이 비활성화되고 스피너가 표시됩니다. */
13
14
  loading: boolean;
14
15
  /** 아이콘 라이브러리를 지정합니다. */
15
- library: "internal" | "default" | (string & {});
16
+ lib: IconLibrary;
16
17
  /** 아이콘의 이름을 지정합니다. */
17
18
  name?: string;
18
19
  render(): import('lit-html').TemplateResult<1>;
@@ -1,9 +1,9 @@
1
1
  import { html } from 'lit';
2
2
  import { property } from 'lit/decorators.js';
3
3
  import { BaseElement } from '../BaseElement.js';
4
- import { Spinner } from '../spinner/Spinner.js';
5
- import { Icon } from '../icon/Icon.js';
6
- import { styles } from './IconButton.styles.js';
4
+ import { USpinner } from '../spinner/USpinner.component.js';
5
+ import { UIcon } from '../icon/UIcon.component.js';
6
+ import { styles } from './UIconButton.styles.js';
7
7
 
8
8
  var __defProp = Object.defineProperty;
9
9
  var __decorateClass = (decorators, target, key, kind) => {
@@ -14,46 +14,46 @@ var __decorateClass = (decorators, target, key, kind) => {
14
14
  if (result) __defProp(target, key, result);
15
15
  return result;
16
16
  };
17
- class IconButton extends BaseElement {
17
+ class UIconButton extends BaseElement {
18
18
  constructor() {
19
19
  super(...arguments);
20
20
  this.borderless = false;
21
21
  this.disabled = false;
22
22
  this.loading = false;
23
- this.library = "default";
23
+ this.lib = "default";
24
24
  }
25
25
  static {
26
26
  this.styles = [super.styles, styles];
27
27
  }
28
28
  static {
29
29
  this.dependencies = {
30
- "u-spinner": Spinner,
31
- "u-icon": Icon
30
+ "u-spinner": USpinner,
31
+ "u-icon": UIcon
32
32
  };
33
33
  }
34
34
  render() {
35
35
  return html`
36
36
  <button part="base"
37
37
  ?disabled=${this.disabled || this.loading}>
38
- ${this.loading ? html`<u-spinner></u-spinner>` : html`<u-icon .library=${this.library} .name=${this.name}></u-icon>`}
38
+ ${this.loading ? html`<u-spinner></u-spinner>` : html`<u-icon .lib=${this.lib} .name=${this.name}></u-icon>`}
39
39
  </button>
40
40
  `;
41
41
  }
42
42
  }
43
43
  __decorateClass([
44
44
  property({ type: Boolean, reflect: true })
45
- ], IconButton.prototype, "borderless");
45
+ ], UIconButton.prototype, "borderless");
46
46
  __decorateClass([
47
47
  property({ type: Boolean, reflect: true })
48
- ], IconButton.prototype, "disabled");
48
+ ], UIconButton.prototype, "disabled");
49
49
  __decorateClass([
50
50
  property({ type: Boolean, reflect: true })
51
- ], IconButton.prototype, "loading");
51
+ ], UIconButton.prototype, "loading");
52
52
  __decorateClass([
53
- property({ type: String, attribute: "lib" })
54
- ], IconButton.prototype, "library");
53
+ property({ type: String })
54
+ ], UIconButton.prototype, "lib");
55
55
  __decorateClass([
56
56
  property({ type: String })
57
- ], IconButton.prototype, "name");
57
+ ], UIconButton.prototype, "name");
58
58
 
59
- export { IconButton };
59
+ export { UIconButton };
@@ -0,0 +1,7 @@
1
+ import { UIconButton } from './UIconButton.component.js';
2
+ declare global {
3
+ interface HTMLElementTagNameMap {
4
+ "u-icon-button": UIconButton;
5
+ }
6
+ }
7
+ export { UIconButton };
@@ -0,0 +1,5 @@
1
+ import { UIconButton } from './UIconButton.component.js';
2
+
3
+ UIconButton.define("u-icon-button");
4
+
5
+ export { UIconButton };
@@ -1,17 +1,21 @@
1
1
  import { PropertyValues } from 'lit';
2
2
  import { BaseElement } from '../BaseElement.js';
3
- /** 지원하는 input 타입 */
3
+ /**
4
+ * Supported input types for Input component
5
+ *
6
+ * - Excludes: checkbox, radio, range, color, file, hidden, image, reset, submit, button
7
+ */
4
8
  type InputType = ('text' | 'password' | 'email' | 'tel' | 'url' | 'search' | 'number' | 'date' | 'time' | 'datetime-local' | 'month' | 'week');
5
9
  /**
6
10
  * Input 컴포넌트는 사용자 입력을 받는 텍스트 입력 필드입니다.
7
11
  * prefix, suffix 슬롯과 라벨, 도움말, 유효성 검사 등의 기능을 제공합니다.
8
12
  */
9
- export declare class Input extends BaseElement {
13
+ export declare class UInput extends BaseElement {
10
14
  static styles: import('lit').CSSResultGroup[];
11
15
  static dependencies: Record<string, typeof BaseElement>;
12
16
  inputEl: HTMLInputElement;
13
- /** 유효성 검사 실패 여부 */
14
- isInvalid: boolean;
17
+ /** 유효성 여부 */
18
+ isValid: boolean;
15
19
  /** 현재 표시할 유효성 검사 메시지 */
16
20
  currentValidationMessage: string;
17
21
  /** password type인 경우 비밀번호 표시/숨김 상태 */
@@ -31,7 +35,7 @@ export declare class Input extends BaseElement {
31
35
  /** 라벨 텍스트 */
32
36
  label?: string;
33
37
  /** 라벨 도움말 (툴팁) */
34
- labelhelp?: string;
38
+ help?: string;
35
39
  /** placeholder 텍스트 */
36
40
  placeholder?: string;
37
41
  /** 컴포넌트 하단 설명 텍스트 */
@@ -52,14 +56,14 @@ export declare class Input extends BaseElement {
52
56
  validationMessage?: string;
53
57
  protected updated(changedProperties: PropertyValues): void;
54
58
  render(): import('lit-html').TemplateResult<1>;
55
- /** 유효성 검사를 수행합니다. */
56
- validate(): boolean;
57
- /** 입력값을 초기화합니다. */
58
- clear(): void;
59
59
  /** 입력 필드에 포커스를 설정합니다. */
60
60
  focus(): void;
61
61
  /** 입력 필드의 포커스를 해제합니다. */
62
62
  blur(): void;
63
+ /** 입력값을 초기화합니다. */
64
+ clear(): void;
65
+ /** 유효성 검사를 수행합니다. */
66
+ validate(): boolean;
63
67
  /** input 이벤트 핸들러 */
64
68
  private handleInput;
65
69
  /** change 이벤트 핸들러 */
@@ -69,6 +73,6 @@ export declare class Input extends BaseElement {
69
73
  /** 비밀번호 표시/숨김 토글 핸들러 */
70
74
  private handlePasswordTogglerClick;
71
75
  /** 클리어 버튼 클릭 핸들러 */
72
- private handleClearBtnClick;
76
+ private handleClearButtonClick;
73
77
  }
74
78
  export {};
@@ -1,11 +1,11 @@
1
- import { nothing, html } from 'lit';
1
+ import { html } from 'lit';
2
2
  import { query, state, property } from 'lit/decorators.js';
3
3
  import { ifDefined } from 'lit/directives/if-defined.js';
4
4
  import { live } from 'lit/directives/live.js';
5
5
  import { BaseElement } from '../BaseElement.js';
6
- import { Icon } from '../icon/Icon.js';
7
- import { Tooltip } from '../tooltip/Tooltip.js';
8
- import { styles } from './Input.styles.js';
6
+ import { UIcon } from '../icon/UIcon.component.js';
7
+ import { UTooltip } from '../tooltip/UTooltip.component.js';
8
+ import { styles } from './UInput.styles.js';
9
9
 
10
10
  var __defProp = Object.defineProperty;
11
11
  var __decorateClass = (decorators, target, key, kind) => {
@@ -16,10 +16,10 @@ var __decorateClass = (decorators, target, key, kind) => {
16
16
  if (result) __defProp(target, key, result);
17
17
  return result;
18
18
  };
19
- class Input extends BaseElement {
19
+ class UInput extends BaseElement {
20
20
  constructor() {
21
21
  super(...arguments);
22
- this.isInvalid = false;
22
+ this.isValid = true;
23
23
  this.currentValidationMessage = "";
24
24
  this.showPassword = false;
25
25
  this.type = "text";
@@ -33,10 +33,6 @@ class Input extends BaseElement {
33
33
  this.handleInput = (e) => {
34
34
  const input = e.target;
35
35
  this.value = input.value;
36
- if (this.isInvalid) {
37
- this.isInvalid = false;
38
- this.currentValidationMessage = "";
39
- }
40
36
  this.emit("u-input", { value: this.value });
41
37
  };
42
38
  /** change 이벤트 핸들러 */
@@ -46,7 +42,7 @@ class Input extends BaseElement {
46
42
  this.emit("u-change", { value: this.value });
47
43
  };
48
44
  /** blur 이벤트 핸들러 */
49
- this.handleInputBlur = () => {
45
+ this.handleInputBlur = (_) => {
50
46
  this.validate();
51
47
  };
52
48
  /** 비밀번호 표시/숨김 토글 핸들러 */
@@ -57,7 +53,7 @@ class Input extends BaseElement {
57
53
  this.focus();
58
54
  };
59
55
  /** 클리어 버튼 클릭 핸들러 */
60
- this.handleClearBtnClick = (e) => {
56
+ this.handleClearButtonClick = (e) => {
61
57
  e.preventDefault();
62
58
  e.stopPropagation();
63
59
  this.clear();
@@ -68,8 +64,8 @@ class Input extends BaseElement {
68
64
  }
69
65
  static {
70
66
  this.dependencies = {
71
- "u-icon": Icon,
72
- "u-tooltip": Tooltip
67
+ "u-icon": UIcon,
68
+ "u-tooltip": UTooltip
73
69
  };
74
70
  }
75
71
  updated(changedProperties) {
@@ -83,21 +79,22 @@ class Input extends BaseElement {
83
79
  render() {
84
80
  return html`
85
81
  <div class="header" ?hidden=${!this.label}>
86
- ${this.required ? html`<span class="required-mark">*</span>` : nothing}
82
+ <span class="required" ?hidden=${!this.required}>*</span>
87
83
 
88
84
  <label class="label" @click=${this.focus}>
89
85
  ${this.label}
90
86
  </label>
91
87
 
92
- ${this.labelhelp ? html`
93
- <u-icon class="help-icon" lib="internal" name="info-circle-fill"></u-icon>
94
- <u-tooltip class="help-tooltip" trigger-selectors=".help-icon" placement="right-end">
95
- ${this.labelhelp}
96
- </u-tooltip>` : nothing}
88
+ <div class="helper" ?hidden=${!this.help}>
89
+ <u-icon lib="internal" name="info-circle-fill"></u-icon>
90
+ <u-tooltip distance="6" placement="right-end">
91
+ ${this.help}
92
+ </u-tooltip>
93
+ </div>
97
94
  </div>
98
95
 
99
96
  <div class="container"
100
- ?invalid=${this.isInvalid}
97
+ ?invalid=${!this.isValid}
101
98
  ?disabled=${this.disabled}
102
99
  ?readonly=${this.readonly}>
103
100
 
@@ -123,20 +120,18 @@ class Input extends BaseElement {
123
120
 
124
121
  <slot name="suffix"></slot>
125
122
 
126
- <div class="suffix-items">
127
- <u-icon
128
- lib="internal"
129
- name=${this.showPassword ? "eye-slash" : "eye"}
130
- ?hidden=${this.type !== "password" || this.disabled || this.readonly}
131
- @click=${this.handlePasswordTogglerClick}
132
- ></u-icon>
133
- <u-icon
134
- lib="internal"
135
- name="x-lg"
136
- ?hidden=${!this.clearable || !this.value || this.disabled || this.readonly}
137
- @click=${this.handleClearBtnClick}
138
- ></u-icon>
139
- </div>
123
+ <u-icon class="suffix icon" tabindex="0"
124
+ ?hidden=${this.type !== "password" || this.disabled || this.readonly}
125
+ lib="internal"
126
+ name=${this.showPassword ? "eye-slash" : "eye"}
127
+ @click=${this.handlePasswordTogglerClick}
128
+ ></u-icon>
129
+ <u-icon class="suffix icon" tabindex="0"
130
+ ?hidden=${!this.clearable || this.disabled || this.readonly}
131
+ lib="internal"
132
+ name="x-lg"
133
+ @click=${this.handleClearButtonClick}
134
+ ></u-icon>
140
135
  </div>
141
136
 
142
137
  <div class="validation-message" ?hidden=${!this.currentValidationMessage}>
@@ -148,25 +143,6 @@ class Input extends BaseElement {
148
143
  </div>
149
144
  `;
150
145
  }
151
- /** 유효성 검사를 수행합니다. */
152
- validate() {
153
- if (!this.inputEl) return true;
154
- const isValid = this.inputEl.checkValidity();
155
- this.isInvalid = !isValid;
156
- if (!isValid) {
157
- this.currentValidationMessage = this.validationMessage || this.inputEl.validationMessage;
158
- } else {
159
- this.currentValidationMessage = "";
160
- }
161
- return isValid;
162
- }
163
- /** 입력값을 초기화합니다. */
164
- clear() {
165
- this.value = "";
166
- this.isInvalid = false;
167
- this.currentValidationMessage = "";
168
- this.focus();
169
- }
170
146
  /** 입력 필드에 포커스를 설정합니다. */
171
147
  focus() {
172
148
  this.inputEl?.focus();
@@ -175,69 +151,88 @@ class Input extends BaseElement {
175
151
  blur() {
176
152
  this.inputEl?.blur();
177
153
  }
154
+ /** 입력값을 초기화합니다. */
155
+ clear() {
156
+ this.value = "";
157
+ this.isValid = true;
158
+ this.currentValidationMessage = "";
159
+ this.focus();
160
+ }
161
+ /** 유효성 검사를 수행합니다. */
162
+ validate() {
163
+ if (!this.inputEl) return true;
164
+ const validity = this.inputEl.validity;
165
+ this.isValid = validity.valid;
166
+ if (this.isValid) {
167
+ this.currentValidationMessage = "";
168
+ } else {
169
+ this.currentValidationMessage = validity.patternMismatch ? this.validationMessage || this.inputEl.validationMessage : this.inputEl.validationMessage;
170
+ }
171
+ return this.isValid;
172
+ }
178
173
  }
179
174
  __decorateClass([
180
175
  query("input")
181
- ], Input.prototype, "inputEl");
176
+ ], UInput.prototype, "inputEl");
182
177
  __decorateClass([
183
178
  state()
184
- ], Input.prototype, "isInvalid");
179
+ ], UInput.prototype, "isValid");
185
180
  __decorateClass([
186
181
  state()
187
- ], Input.prototype, "currentValidationMessage");
182
+ ], UInput.prototype, "currentValidationMessage");
188
183
  __decorateClass([
189
184
  state()
190
- ], Input.prototype, "showPassword");
185
+ ], UInput.prototype, "showPassword");
191
186
  __decorateClass([
192
187
  property({ type: String, reflect: true })
193
- ], Input.prototype, "type");
188
+ ], UInput.prototype, "type");
194
189
  __decorateClass([
195
190
  property({ type: Boolean, reflect: true })
196
- ], Input.prototype, "required");
191
+ ], UInput.prototype, "required");
197
192
  __decorateClass([
198
193
  property({ type: Boolean, reflect: true })
199
- ], Input.prototype, "readonly");
194
+ ], UInput.prototype, "readonly");
200
195
  __decorateClass([
201
196
  property({ type: Boolean, reflect: true })
202
- ], Input.prototype, "disabled");
197
+ ], UInput.prototype, "disabled");
203
198
  __decorateClass([
204
199
  property({ type: Boolean, reflect: true })
205
- ], Input.prototype, "clearable");
200
+ ], UInput.prototype, "clearable");
206
201
  __decorateClass([
207
202
  property({ type: String })
208
- ], Input.prototype, "name");
203
+ ], UInput.prototype, "name");
209
204
  __decorateClass([
210
205
  property({ type: String })
211
- ], Input.prototype, "label");
206
+ ], UInput.prototype, "label");
212
207
  __decorateClass([
213
208
  property({ type: String })
214
- ], Input.prototype, "labelhelp");
209
+ ], UInput.prototype, "help");
215
210
  __decorateClass([
216
211
  property({ type: String })
217
- ], Input.prototype, "placeholder");
212
+ ], UInput.prototype, "placeholder");
218
213
  __decorateClass([
219
214
  property({ type: String })
220
- ], Input.prototype, "description");
215
+ ], UInput.prototype, "description");
221
216
  __decorateClass([
222
217
  property({ type: Number })
223
- ], Input.prototype, "minlength");
218
+ ], UInput.prototype, "minlength");
224
219
  __decorateClass([
225
220
  property({ type: Number })
226
- ], Input.prototype, "maxlength");
221
+ ], UInput.prototype, "maxlength");
227
222
  __decorateClass([
228
223
  property({ type: Boolean })
229
- ], Input.prototype, "spellcheck");
224
+ ], UInput.prototype, "spellcheck");
230
225
  __decorateClass([
231
226
  property({ type: String })
232
- ], Input.prototype, "autocomplete");
227
+ ], UInput.prototype, "autocomplete");
233
228
  __decorateClass([
234
229
  property({ type: String })
235
- ], Input.prototype, "value");
230
+ ], UInput.prototype, "value");
236
231
  __decorateClass([
237
232
  property({ type: String })
238
- ], Input.prototype, "pattern");
233
+ ], UInput.prototype, "pattern");
239
234
  __decorateClass([
240
235
  property({ type: String })
241
- ], Input.prototype, "validationMessage");
236
+ ], UInput.prototype, "validationMessage");
242
237
 
243
- export { Input };
238
+ export { UInput };
@@ -0,0 +1,7 @@
1
+ import { UInput } from './UInput.component.js';
2
+ declare global {
3
+ interface HTMLElementTagNameMap {
4
+ "u-input": UInput;
5
+ }
6
+ }
7
+ export { UInput };
@@ -0,0 +1,5 @@
1
+ import { UInput } from './UInput.component.js';
2
+
3
+ UInput.define("u-input");
4
+
5
+ export { UInput };
@@ -16,26 +16,26 @@ const styles = css`
16
16
  .header {
17
17
  display: flex;
18
18
  flex-direction: row;
19
+ justify-content: flex-start;
19
20
  align-items: center;
20
21
  margin-bottom: 0.5em;
22
+ font-size: 0.8em;
21
23
  user-select: none;
22
24
  }
25
+ .header .required {
26
+ color: var(--u-red-600);
27
+ margin-right: 0.25em;
28
+ }
23
29
  .header .label {
24
- font-size: 0.8em;
25
30
  font-weight: 500;
26
- line-height: 1.2;
31
+ line-height: 1.25;
27
32
  cursor: pointer;
28
33
  }
29
- .header .required-mark {
30
- color: var(--u-red-600);
31
- margin-right: 0.25em;
32
- }
33
- .header .help-icon {
34
- font-size: 0.8em;
34
+ .header .helper u-icon {
35
35
  margin-left: 0.5em;
36
36
  cursor: help;
37
37
  }
38
- .header .help-tooltip {
38
+ .header .helper u-tooltip {
39
39
  font-size: 0.6em;
40
40
  }
41
41
 
@@ -49,23 +49,24 @@ const styles = css`
49
49
  border-radius: 0.25em;
50
50
  background-color: var(--u-input-bg-color);
51
51
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
52
+ overflow: hidden;
52
53
  }
53
54
  .container[readonly],
54
55
  .container[disabled] {
55
56
  border-color: var(--u-border-color-weak);
56
57
  background-color: var(--u-bg-color-disabled);
57
58
  }
58
- .container:hover:not([readonly]):not([disabled]) {
59
+ .container:not([readonly]):not([disabled]):hover {
59
60
  box-shadow:
60
61
  0 0 0 1px var(--u-input-border-color-hover),
61
62
  0 0 0 3px rgba(59, 130, 246, 0.12);
62
63
  }
63
- .container:focus-within:not([readonly]):not([disabled]) {
64
+ .container:not([readonly]):not([disabled]):focus-within {
64
65
  box-shadow:
65
66
  0 0 0 1px var(--u-input-border-color-focus),
66
67
  0 0 0 3px rgba(59, 130, 246, 0.22);
67
68
  }
68
- .container[invalid]:not([readonly]):not([disabled]) {
69
+ .container:not([readonly]):not([disabled])[invalid] {
69
70
  box-shadow:
70
71
  0 0 0 1px var(--u-input-border-color-invalid),
71
72
  0 0 0 3px rgba(220, 38, 38, 0.12);
@@ -73,9 +74,9 @@ const styles = css`
73
74
 
74
75
  /* 입력 필드 */
75
76
  input {
76
- flex: 1 1 auto;
77
- min-width: 0;
78
77
  all: unset;
78
+ flex: 1 0 auto;
79
+ min-width: 0;
79
80
  font-size: 1em;
80
81
  line-height: 1.5;
81
82
  }
@@ -97,26 +98,28 @@ const styles = css`
97
98
  margin-left: 0.5em;
98
99
  }
99
100
 
100
- /* 영역 (clear, password toggle 등) */
101
- .suffix-items {
102
- display: flex;
103
- flex-direction: row;
104
- align-items: center;
105
- }
106
- .suffix-items u-icon {
101
+ /* 아이콘 영역 (clear, password toggle 등) */
102
+ .icon {
107
103
  color: var(--u-icon-color);
108
104
  font-size: 1em;
109
- margin-left: 0.5em;
110
105
  transition: color 0.2s ease;
111
106
  cursor: pointer;
112
107
  }
113
- .suffix-items u-icon:hover {
108
+ .icon:hover {
114
109
  color: var(--u-icon-color-hover);
115
110
  }
116
- .suffix-items u-icon:active {
111
+ .icon:active {
117
112
  color: var(--u-icon-color-active);
118
113
  }
119
114
 
115
+ /* 접두/접미 아이콘 간격 */
116
+ .icon.prefix {
117
+ margin-right: 0.5em;
118
+ }
119
+ .icon.suffix {
120
+ margin-left: 0.5em;
121
+ }
122
+
120
123
  /* 유효성 검사 에러 메시지 */
121
124
  .validation-message {
122
125
  margin-top: 0.5em;