@iyulab/chat-components 0.1.1 → 0.3.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 (115) hide show
  1. package/CHANGELOG.md +31 -1
  2. package/dist/components/blocks/UCodeBlock.component.d.ts +7 -8
  3. package/dist/components/blocks/UCodeBlock.component.js +32 -21
  4. package/dist/components/blocks/UCodeBlock.styles.js +7 -6
  5. package/dist/components/{json-viewer/UJsonViewer.component.d.ts → blocks/UJsonBlock.component.d.ts} +5 -4
  6. package/dist/components/{json-viewer/UJsonViewer.component.js → blocks/UJsonBlock.component.js} +20 -17
  7. package/dist/components/blocks/UJsonBlock.d.ts +7 -0
  8. package/dist/components/blocks/UJsonBlock.js +5 -0
  9. package/dist/components/blocks/UMarkedBlock.component.d.ts +30 -9
  10. package/dist/components/blocks/UMarkedBlock.component.js +75 -26
  11. package/dist/components/blocks/UMarkedBlock.styles.js +288 -949
  12. package/dist/components/blocks/URefBlock.component.d.ts +17 -0
  13. package/dist/components/blocks/URefBlock.component.js +74 -0
  14. package/dist/components/blocks/URefBlock.d.ts +7 -0
  15. package/dist/components/blocks/URefBlock.js +5 -0
  16. package/dist/components/blocks/URefBlock.styles.js +75 -0
  17. package/dist/components/blocks/UThinkBlock.component.d.ts +3 -8
  18. package/dist/components/blocks/UThinkBlock.component.js +28 -22
  19. package/dist/components/blocks/UThinkBlock.styles.js +35 -54
  20. package/dist/components/blocks/UToolBlock.component.d.ts +13 -9
  21. package/dist/components/blocks/UToolBlock.component.js +30 -76
  22. package/dist/components/blocks/UToolBlock.styles.js +21 -62
  23. package/dist/components/buttons/UAttachButton.component.d.ts +3 -5
  24. package/dist/components/buttons/UAttachButton.component.js +30 -19
  25. package/dist/components/buttons/UAttachButton.styles.js +5 -12
  26. package/dist/components/buttons/UCopyButton.component.d.ts +3 -8
  27. package/dist/components/buttons/UCopyButton.component.js +29 -53
  28. package/dist/components/buttons/UCopyButton.styles.js +8 -37
  29. package/dist/components/buttons/UReportButton.component.d.ts +9 -0
  30. package/dist/components/buttons/UReportButton.component.js +36 -0
  31. package/dist/components/buttons/UReportButton.d.ts +7 -0
  32. package/dist/components/buttons/UReportButton.js +5 -0
  33. package/dist/components/buttons/UReportButton.styles.js +14 -0
  34. package/dist/components/buttons/URetryButton.component.d.ts +11 -0
  35. package/dist/components/buttons/{USendButton.component.js → URetryButton.component.js} +21 -14
  36. package/dist/components/buttons/URetryButton.d.ts +7 -0
  37. package/dist/components/buttons/URetryButton.js +5 -0
  38. package/dist/components/buttons/URetryButton.styles.d.ts +1 -0
  39. package/dist/components/buttons/URetryButton.styles.js +26 -0
  40. package/dist/components/buttons/UShareButton.component.d.ts +9 -0
  41. package/dist/components/buttons/UShareButton.component.js +36 -0
  42. package/dist/components/buttons/UShareButton.d.ts +7 -0
  43. package/dist/components/buttons/UShareButton.js +5 -0
  44. package/dist/components/buttons/UShareButton.styles.d.ts +1 -0
  45. package/dist/components/buttons/UShareButton.styles.js +14 -0
  46. package/dist/components/buttons/UVoteButton.component.d.ts +15 -0
  47. package/dist/components/buttons/UVoteButton.component.js +70 -0
  48. package/dist/components/buttons/UVoteButton.d.ts +8 -0
  49. package/dist/components/buttons/UVoteButton.js +5 -0
  50. package/dist/components/buttons/UVoteButton.styles.d.ts +1 -0
  51. package/dist/components/buttons/UVoteButton.styles.js +19 -0
  52. package/dist/components/loaders/UDotLoader.component.d.ts +9 -0
  53. package/dist/components/loaders/UDotLoader.component.js +23 -0
  54. package/dist/components/loaders/UDotLoader.d.ts +7 -0
  55. package/dist/components/loaders/UDotLoader.js +5 -0
  56. package/dist/components/loaders/UDotLoader.styles.d.ts +1 -0
  57. package/dist/components/loaders/UDotLoader.styles.js +50 -0
  58. package/dist/components/message/UMessage.component.d.ts +12 -6
  59. package/dist/components/message/UMessage.component.js +45 -59
  60. package/dist/components/message/UMessage.d.ts +0 -1
  61. package/dist/components/message/UMessage.styles.js +30 -49
  62. package/dist/components/prompt/UPrompt.component.d.ts +25 -0
  63. package/dist/components/prompt/UPrompt.component.js +113 -0
  64. package/dist/components/prompt/UPrompt.d.ts +7 -0
  65. package/dist/components/prompt/UPrompt.js +5 -0
  66. package/dist/components/prompt/UPrompt.styles.d.ts +1 -0
  67. package/dist/components/prompt/UPrompt.styles.js +42 -0
  68. package/dist/components/references/URefCard.component.d.ts +24 -0
  69. package/dist/components/references/URefCard.component.js +105 -0
  70. package/dist/components/references/URefCard.d.ts +7 -0
  71. package/dist/components/references/URefCard.js +5 -0
  72. package/dist/components/references/URefCard.styles.d.ts +1 -0
  73. package/dist/components/references/URefCard.styles.js +103 -0
  74. package/dist/components/references/URefCardGroup.component.d.ts +25 -0
  75. package/dist/components/references/URefCardGroup.component.js +88 -0
  76. package/dist/components/references/URefCardGroup.d.ts +7 -0
  77. package/dist/components/references/URefCardGroup.js +5 -0
  78. package/dist/components/references/URefCardGroup.styles.d.ts +1 -0
  79. package/dist/components/references/URefCardGroup.styles.js +69 -0
  80. package/dist/components/references/URefTag.component.d.ts +13 -0
  81. package/dist/components/references/URefTag.component.js +54 -0
  82. package/dist/components/references/URefTag.d.ts +7 -0
  83. package/dist/components/references/URefTag.js +5 -0
  84. package/dist/components/references/URefTag.styles.d.ts +1 -0
  85. package/dist/components/references/URefTag.styles.js +51 -0
  86. package/dist/events/UCancelEvent.d.ts +6 -0
  87. package/dist/index.d.ts +16 -5
  88. package/dist/index.js +25 -9
  89. package/dist/types/BlockItem.d.ts +42 -0
  90. package/dist/types/JsonNode.d.ts +20 -0
  91. package/dist/types/References.d.ts +28 -0
  92. package/dist/utilities/converters.d.ts +9 -0
  93. package/dist/utilities/converters.js +19 -0
  94. package/package.json +10 -11
  95. package/dist/components/buttons/USendButton.component.d.ts +0 -13
  96. package/dist/components/buttons/USendButton.d.ts +0 -7
  97. package/dist/components/buttons/USendButton.js +0 -5
  98. package/dist/components/buttons/USendButton.styles.js +0 -23
  99. package/dist/components/buttons/UThinkButton.component.d.ts +0 -19
  100. package/dist/components/buttons/UThinkButton.component.js +0 -73
  101. package/dist/components/buttons/UThinkButton.d.ts +0 -7
  102. package/dist/components/buttons/UThinkButton.js +0 -5
  103. package/dist/components/buttons/UThinkButton.styles.js +0 -72
  104. package/dist/components/json-viewer/UJsonViewer.d.ts +0 -7
  105. package/dist/components/json-viewer/UJsonViewer.js +0 -5
  106. package/dist/components/json-viewer/UJsonViewer.lib.d.ts +0 -16
  107. package/dist/components/json-viewer/UJsonViewer.lib.js +0 -28
  108. package/dist/components/message/UMessage.types.d.ts +0 -21
  109. package/dist/events/UStopEvent.d.ts +0 -6
  110. package/dist/internals/date-helpers.d.ts +0 -8
  111. package/dist/internals/date-helpers.js +0 -27
  112. /package/dist/components/{buttons/USendButton.styles.d.ts → blocks/UJsonBlock.styles.d.ts} +0 -0
  113. /package/dist/components/{json-viewer/UJsonViewer.styles.js → blocks/UJsonBlock.styles.js} +0 -0
  114. /package/dist/components/{buttons/UThinkButton.styles.d.ts → blocks/URefBlock.styles.d.ts} +0 -0
  115. /package/dist/components/{json-viewer/UJsonViewer.styles.d.ts → buttons/UReportButton.styles.d.ts} +0 -0
@@ -2,42 +2,37 @@ import { css } from 'lit';
2
2
 
3
3
  const styles = css`
4
4
  :host {
5
- display: block;
5
+ display: flex;
6
+ flex-direction: column;
6
7
  width: 100%;
7
- height: auto;
8
+ font-size: 14px;
8
9
  border: 1px solid var(--u-border-color);
9
10
  border-radius: 8px;
10
- font-size: 14px;
11
- }
12
-
13
- .container {
14
- width: 100%;
15
- display: flex;
16
- flex-direction: column;
17
11
  }
18
12
 
19
13
  .header {
20
14
  width: 100%;
15
+ padding: 8px;
16
+ border-radius: inherit;
21
17
  display: flex;
22
18
  flex-direction: row;
23
19
  align-items: center;
24
20
  justify-content: space-between;
25
21
  gap: 8px;
26
- padding: 8px;
27
22
  cursor: pointer;
28
23
  user-select: none;
29
24
  }
30
- .header u-icon[name="eye"] {
31
- font-size: 16px;
32
- color: var(--u-blue-500);
25
+ .header:hover {
26
+ background: linear-gradient(var(--u-neutral-100), transparent);
33
27
  }
34
- .header u-icon[name="check-lg"] {
35
- color: var(--u-green-500);
28
+ .header:active {
29
+ background: linear-gradient(var(--u-neutral-200), transparent);
36
30
  }
37
- .header u-icon[name="x-lg"] {
38
- color: var(--u-red-500);
31
+
32
+ .header u-icon[name="tools"] {
33
+ color: var(--u-blue-800);
39
34
  }
40
- .header .display {
35
+ .header .title {
41
36
  flex: 1;
42
37
  font-size: inherit;
43
38
  font-weight: 600;
@@ -49,58 +44,22 @@ const styles = css`
49
44
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
50
45
  width: 100%;
51
46
  max-height: 260px;
47
+ padding: 8px;
52
48
  overflow: auto;
53
- scrollbar-width: thin;
54
- scrollbar-color: var(--u-scrollbar-color) transparent;
55
- }
56
- .body .viewer {
57
- width: 100%;
58
- display: flex;
59
- flex-direction: row;
60
- align-items: flex-start;
61
- gap: 8px;
62
- padding: 4px 8px;
63
- }
64
- .body .viewer:not(:last-child) {
65
- border-bottom: 1px dashed var(--u-border-color);
66
49
  }
67
- .body .viewer .label {
68
- display: flex;
69
- align-items: center;
70
- justify-content: center;
71
- font-size: inherit;
72
- font-weight: 400;
73
- width: 1.5em;
74
- height: 1.5em;
75
- }
76
- .body .viewer u-json-viewer {
77
- width: calc(100% - 1.5em);
50
+ .body u-json-viewer {
78
51
  font-size: inherit;
79
52
  font-family: inherit;
80
53
  line-height: 1.5;
81
54
  }
82
-
83
- .footer {
84
- display: flex;
85
- flex-direction: row;
86
- align-items: center;
87
- justify-content: flex-end;
88
- gap: 8px;
89
- padding: 4px 12px;
55
+ .body u-icon[name="chevron-down"] {
56
+ align-self: center;
57
+ font-size: 16px;
58
+ color: var(--u-neutral-600, #4b5563);
90
59
  }
91
- .footer u-button {
60
+ .body .output-view {
92
61
  display: flex;
93
- flex-direction: row;
94
- align-items: center;
95
- gap: 4px;
96
- padding: 6px 8px;
97
- font-size: 12px;
98
- }
99
- .footer u-icon[name="check-lg"] {
100
- color: var(--u-green-500);
101
- }
102
- .footer u-icon[name="x-lg"] {
103
- color: var(--u-red-500);
62
+ flex-direction: column;
104
63
  }
105
64
  `;
106
65
 
@@ -5,20 +5,18 @@ import { BaseElement } from '@iyulab/components/dist/components/BaseElement.js';
5
5
  export declare class UAttachButton extends BaseElement {
6
6
  static styles: import('lit').CSSResultGroup[];
7
7
  static dependencies: Record<string, typeof BaseElement>;
8
- input: HTMLInputElement;
8
+ input?: HTMLInputElement;
9
9
  /** 첨부 파일 유형 제한, 컴마로 구분된 MIME 타입 문자열 (예: "image/*,application/pdf") */
10
10
  accept?: string;
11
11
  /** 다중 파일 선택 가능 여부 */
12
12
  multiple: boolean;
13
- connectedCallback(): void;
14
- disconnectedCallback(): void;
15
13
  render(): import('lit-html').TemplateResult<1>;
16
14
  /**
17
15
  * 버튼 클릭 핸들러
18
16
  */
19
- private openFileExplorer;
17
+ private handleButtonClick;
20
18
  /**
21
19
  * 파일 선택 이벤트 핸들러
22
20
  */
23
- private handleFileSelected;
21
+ private handleInputChange;
24
22
  }
@@ -2,6 +2,8 @@ import { html } from 'lit';
2
2
  import { query, property } from 'lit/decorators.js';
3
3
  import { BaseElement } from '@iyulab/components/dist/components/BaseElement.js';
4
4
  import { UIcon } from '@iyulab/components/dist/components/icon/UIcon.component.js';
5
+ import { UButton } from '@iyulab/components/dist/components/button/UButton.component.js';
6
+ import { UTooltip } from '@iyulab/components/dist/components/tooltip/UTooltip.component.js';
5
7
  import { styles } from './UAttachButton.styles.js';
6
8
 
7
9
  var __defProp = Object.defineProperty;
@@ -20,18 +22,22 @@ class UAttachButton extends BaseElement {
20
22
  /**
21
23
  * 버튼 클릭 핸들러
22
24
  */
23
- this.openFileExplorer = () => {
25
+ this.handleButtonClick = () => {
24
26
  if (!this.input) return;
25
27
  this.input.click();
26
28
  };
27
29
  /**
28
30
  * 파일 선택 이벤트 핸들러
29
31
  */
30
- this.handleFileSelected = (e) => {
32
+ this.handleInputChange = (e) => {
33
+ e.preventDefault();
34
+ e.stopPropagation();
31
35
  const target = e.target;
32
36
  const files = target.files;
33
37
  if (!files || files.length === 0) return;
34
- this.emit("select-files", files);
38
+ this.emit("u-change", {
39
+ files: Array.from(files)
40
+ });
35
41
  target.value = "";
36
42
  };
37
43
  }
@@ -40,27 +46,32 @@ class UAttachButton extends BaseElement {
40
46
  }
41
47
  static {
42
48
  this.dependencies = {
43
- "u-icon": UIcon
49
+ "u-icon": UIcon,
50
+ "u-button": UButton,
51
+ "u-tooltip": UTooltip
44
52
  };
45
53
  }
46
- connectedCallback() {
47
- super.connectedCallback();
48
- this.addEventListener("click", this.openFileExplorer);
49
- }
50
- disconnectedCallback() {
51
- this.removeEventListener("click", this.openFileExplorer);
52
- super.disconnectedCallback();
53
- }
54
54
  render() {
55
55
  return html`
56
- <u-icon
57
- lib="internal"
58
- name="paperclip"
59
- ></u-icon>
60
- <input type="file"
56
+ <u-button part="base"
57
+ variant="borderless"
58
+ @click=${this.handleButtonClick}>
59
+ <u-icon part="icon"
60
+ lib="internal"
61
+ name="paperclip"
62
+ ></u-icon>
63
+ </u-button>
64
+
65
+ <u-tooltip for="u-button" placement="bottom" distance="8">
66
+ <slot></slot>
67
+ </u-tooltip>
68
+
69
+ <input
70
+ hidden
71
+ type="file"
61
72
  ?multiple=${this.multiple}
62
- .accept=${this.accept || ""}
63
- @change=${this.handleFileSelected}
73
+ .accept=${this.accept || "*"}
74
+ @change=${this.handleInputChange}
64
75
  />
65
76
  `;
66
77
  }
@@ -1,20 +1,13 @@
1
1
  import { css } from 'lit';
2
2
 
3
3
  const styles = css`
4
- :host {
5
- position: relative;
6
- display: inline-flex;
7
- padding: 8px;
8
- font-size: 16px;
9
- border-radius: 8px;
10
- cursor: pointer;
11
- }
12
- :host(:hover) {
13
- background-color: var(--u-neutral-100, #f3f4f6);
4
+ :host(:empty) u-tooltip {
5
+ display: none;
14
6
  }
15
7
 
16
- input[type="file"] {
17
- display: none;
8
+ u-button {
9
+ color: var(--u-txt-color-weak);
10
+ font-size: 16px;
18
11
  }
19
12
  `;
20
13
 
@@ -1,4 +1,3 @@
1
- import { nothing } from 'lit';
2
1
  import { BaseElement } from '@iyulab/components/dist/components/BaseElement.js';
3
2
  /**
4
3
  * 클릭 시 클립보드에 텍스트를 복사하는 버튼입니다. 복사 상태를 표시하기 위해 아이콘이 변경됩니다.
@@ -6,17 +5,13 @@ import { BaseElement } from '@iyulab/components/dist/components/BaseElement.js';
6
5
  export declare class UCopyButton extends BaseElement {
7
6
  static styles: import('lit').CSSResultGroup[];
8
7
  static dependencies: Record<string, typeof BaseElement>;
9
- /** 버튼의 모드를 설정합니다. 기본은 'symbol'입니다. */
10
- mode: 'badge' | 'symbol';
11
8
  /** 클립보드 복사 상태를 나타내는 플래그입니다. */
12
9
  isCopied: boolean;
13
- /** 복사할 텍스트를 설정합니다. */
14
- value?: string;
15
10
  /** 클립보드 복사 후 재사용 대기 시간 (ms) */
16
11
  delay: number;
17
- connectedCallback(): void;
18
- disconnectedCallback(): void;
19
- render(): import('lit-html').TemplateResult<1> | typeof nothing;
12
+ /** 복사할 텍스트를 설정합니다. */
13
+ value?: string;
14
+ render(): import('lit-html').TemplateResult<1>;
20
15
  /**
21
16
  * 클립보드에 텍스트를 복사하는 메서드입니다.
22
17
  * 복사 후 재사용 대기 시간이 설정되어 있으면, 일정 시간 후에 복사 가능 상태로 되돌립니다.
@@ -1,7 +1,8 @@
1
- import { html, nothing } from 'lit';
2
- import { property } from 'lit/decorators.js';
1
+ import { html } from 'lit';
2
+ import { state, property } from 'lit/decorators.js';
3
3
  import { BaseElement } from '@iyulab/components/dist/components/BaseElement.js';
4
4
  import { UIcon } from '@iyulab/components/dist/components/icon/UIcon.component.js';
5
+ import { UButton } from '@iyulab/components/dist/components/button/UButton.component.js';
5
6
  import { UTooltip } from '@iyulab/components/dist/components/tooltip/UTooltip.component.js';
6
7
  import { styles } from './UCopyButton.styles.js';
7
8
 
@@ -17,7 +18,6 @@ var __decorateClass = (decorators, target, key, kind) => {
17
18
  class UCopyButton extends BaseElement {
18
19
  constructor() {
19
20
  super(...arguments);
20
- this.mode = "symbol";
21
21
  this.isCopied = false;
22
22
  this.delay = 1e3;
23
23
  /**
@@ -27,30 +27,16 @@ class UCopyButton extends BaseElement {
27
27
  this.copyToClipboard = async () => {
28
28
  if (!this.value) return;
29
29
  if (this.isCopied) return;
30
- if (navigator.clipboard) {
31
- await navigator.clipboard.writeText(this.value);
32
- } else {
33
- const area = document.createElement("textarea");
34
- area.style.position = "fixed";
35
- area.style.opacity = "0";
36
- area.style.pointerEvents = "none";
37
- area.value = this.value;
38
- document.body.appendChild(area);
39
- area.focus();
40
- area.select();
41
- try {
42
- document.execCommand("copy");
43
- } catch (err) {
44
- console.error("Failed to copy: ", err);
45
- } finally {
46
- document.body.removeChild(area);
47
- }
48
- }
49
- if (this.delay > 0) {
30
+ try {
31
+ await window.navigator.clipboard.writeText(this.value);
32
+ if (this.delay <= 0) return;
50
33
  this.isCopied = true;
51
34
  setTimeout(() => {
52
35
  this.isCopied = false;
53
36
  }, this.delay);
37
+ } catch (error) {
38
+ console.error("Failed to copy text to clipboard:", error);
39
+ this.isCopied = false;
54
40
  }
55
41
  };
56
42
  }
@@ -60,46 +46,36 @@ class UCopyButton extends BaseElement {
60
46
  static {
61
47
  this.dependencies = {
62
48
  "u-icon": UIcon,
49
+ "u-button": UButton,
63
50
  "u-tooltip": UTooltip
64
51
  };
65
52
  }
66
- connectedCallback() {
67
- super.connectedCallback();
68
- this.addEventListener("click", this.copyToClipboard);
69
- }
70
- disconnectedCallback() {
71
- this.removeEventListener("click", this.copyToClipboard);
72
- super.disconnectedCallback();
73
- }
74
53
  render() {
75
- if (this.mode === "badge") {
76
- return html`
77
- <u-icon lib="internal" name=${this.isCopied ? "check-lg" : "copy"}></u-icon>
78
- <span class="display">${this.isCopied ? "Copied!" : "Copy"}</span>
79
- `;
80
- } else if (this.mode === "symbol") {
81
- return html`
82
- <u-icon lib="internal" name=${this.isCopied ? "check-lg" : "copy"}></u-icon>
83
- <u-tooltip for="u-icon" distance="6">
84
- ${this.isCopied ? "Copied!" : "Copy"}
85
- </u-tooltip>
86
- `;
87
- } else {
88
- return nothing;
89
- }
54
+ return html`
55
+ <u-button part="base"
56
+ variant="borderless"
57
+ ?disabled=${this.isCopied}
58
+ @click=${this.copyToClipboard}>
59
+ <u-icon part="icon"
60
+ lib="internal"
61
+ name=${this.isCopied ? "check-lg" : "copy"}
62
+ ></u-icon>
63
+ </u-button>
64
+
65
+ <u-tooltip for="u-button" placement="bottom" distance="8">
66
+ <slot></slot>
67
+ </u-tooltip>
68
+ `;
90
69
  }
91
70
  }
92
71
  __decorateClass([
93
- property({ type: String, reflect: true })
94
- ], UCopyButton.prototype, "mode");
95
- __decorateClass([
96
- property({ type: Boolean, reflect: true })
72
+ state()
97
73
  ], UCopyButton.prototype, "isCopied");
98
- __decorateClass([
99
- property({ type: String })
100
- ], UCopyButton.prototype, "value");
101
74
  __decorateClass([
102
75
  property({ type: Number })
103
76
  ], UCopyButton.prototype, "delay");
77
+ __decorateClass([
78
+ property({ type: String })
79
+ ], UCopyButton.prototype, "value");
104
80
 
105
81
  export { UCopyButton };
@@ -1,46 +1,17 @@
1
1
  import { css } from 'lit';
2
2
 
3
3
  const styles = css`
4
- :host {
5
- position: relative;
6
- padding: 8px;
7
- border-radius: 8px;
8
- font-size: inherit;
9
- color: inherit;
10
- background-color: transparent;
11
- cursor: pointer;
4
+ :host(:empty) u-tooltip {
5
+ display: none;
12
6
  }
13
- :host(:hover) {
14
- background-color: var(--u-neutral-100, #f3f4f6);
15
- }
16
- :host([isCopied]) {
17
- pointer-events: none;
18
- background-color: transparent;
19
- }
20
- :host([mode="symbol"]) {
21
- display: inline-flex;
22
- }
23
- :host([mode="badge"]) {
24
- display: flex;
25
- flex-direction: row;
26
- align-items: center;
27
- gap: 6px;
28
- }
29
-
30
- u-icon {
31
- font-size: inherit;
32
- }
33
- u-icon[name="copy"] {
34
- color: inherit;
35
- }
36
- u-icon[name="check"] {
37
- color: var(--u-green-500);
7
+
8
+ u-button {
9
+ color: var(--u-txt-color-weak);
10
+ font-size: 16px;
38
11
  }
39
12
 
40
- .display {
41
- font-size: inherit;
42
- color: inherit;
43
- line-height: 1;
13
+ u-icon[name="check-lg"] {
14
+ color: var(--u-green-500);
44
15
  }
45
16
  `;
46
17
 
@@ -0,0 +1,9 @@
1
+ import { BaseElement } from '@iyulab/components/dist/components/BaseElement.js';
2
+ /**
3
+ * 메시지 신고 버튼 컴포넌트입니다.
4
+ */
5
+ export declare class UReportButton extends BaseElement {
6
+ static styles: import('lit').CSSResultGroup[];
7
+ static dependencies: Record<string, typeof BaseElement>;
8
+ render(): import('lit-html').TemplateResult<1>;
9
+ }
@@ -0,0 +1,36 @@
1
+ import { html } from 'lit';
2
+ import { BaseElement } from '@iyulab/components/dist/components/BaseElement.js';
3
+ import { UIcon } from '@iyulab/components/dist/components/icon/UIcon.component.js';
4
+ import { UButton } from '@iyulab/components/dist/components/button/UButton.component.js';
5
+ import { UTooltip } from '@iyulab/components/dist/components/tooltip/UTooltip.component.js';
6
+ import { styles } from './UReportButton.styles.js';
7
+
8
+ class UReportButton extends BaseElement {
9
+ static {
10
+ this.styles = [super.styles, styles];
11
+ }
12
+ static {
13
+ this.dependencies = {
14
+ "u-icon": UIcon,
15
+ "u-button": UButton,
16
+ "u-tooltip": UTooltip
17
+ };
18
+ }
19
+ render() {
20
+ return html`
21
+ <u-button part="base"
22
+ variant="borderless">
23
+ <u-icon part="icon"
24
+ lib="internal"
25
+ name="flag"
26
+ ></u-icon>
27
+ </u-button>
28
+
29
+ <u-tooltip for="u-button" placement="bottom" distance="8">
30
+ <slot></slot>
31
+ </u-tooltip>
32
+ `;
33
+ }
34
+ }
35
+
36
+ export { UReportButton };
@@ -0,0 +1,7 @@
1
+ import { UReportButton } from './UReportButton.component.js';
2
+ declare global {
3
+ interface HTMLElementTagNameMap {
4
+ 'u-report-button': UReportButton;
5
+ }
6
+ }
7
+ export { UReportButton };
@@ -0,0 +1,5 @@
1
+ import { UReportButton } from './UReportButton.component.js';
2
+
3
+ UReportButton.define("u-report-button");
4
+
5
+ export { UReportButton };
@@ -0,0 +1,14 @@
1
+ import { css } from 'lit';
2
+
3
+ const styles = css`
4
+ :host(:empty) u-tooltip {
5
+ display: none;
6
+ }
7
+
8
+ u-button {
9
+ color: var(--u-txt-color-weak);
10
+ font-size: 16px;
11
+ }
12
+ `;
13
+
14
+ export { styles };
@@ -0,0 +1,11 @@
1
+ import { BaseElement } from '@iyulab/components/dist/components/BaseElement.js';
2
+ /**
3
+ * 메시지 재시도 버튼 컴포넌트입니다.
4
+ */
5
+ export declare class URetryButton extends BaseElement {
6
+ static styles: import('lit').CSSResultGroup[];
7
+ static dependencies: Record<string, typeof BaseElement>;
8
+ /** 재생성 중인지 여부 */
9
+ loading: boolean;
10
+ render(): import('lit-html').TemplateResult<1>;
11
+ }
@@ -2,7 +2,9 @@ import { html } from 'lit';
2
2
  import { property } from 'lit/decorators.js';
3
3
  import { BaseElement } from '@iyulab/components/dist/components/BaseElement.js';
4
4
  import { UIcon } from '@iyulab/components/dist/components/icon/UIcon.component.js';
5
- import { styles } from './USendButton.styles.js';
5
+ import { UButton } from '@iyulab/components/dist/components/button/UButton.component.js';
6
+ import { UTooltip } from '@iyulab/components/dist/components/tooltip/UTooltip.component.js';
7
+ import { styles } from './URetryButton.styles.js';
6
8
 
7
9
  var __defProp = Object.defineProperty;
8
10
  var __decorateClass = (decorators, target, key, kind) => {
@@ -13,34 +15,39 @@ var __decorateClass = (decorators, target, key, kind) => {
13
15
  if (result) __defProp(target, key, result);
14
16
  return result;
15
17
  };
16
- class USendButton extends BaseElement {
18
+ class URetryButton extends BaseElement {
17
19
  constructor() {
18
20
  super(...arguments);
19
- this.mode = "send";
20
- this.disabled = false;
21
+ this.loading = false;
21
22
  }
22
23
  static {
23
24
  this.styles = [super.styles, styles];
24
25
  }
25
26
  static {
26
27
  this.dependencies = {
27
- "u-icon": UIcon
28
+ "u-icon": UIcon,
29
+ "u-button": UButton,
30
+ "u-tooltip": UTooltip
28
31
  };
29
32
  }
30
33
  render() {
31
34
  return html`
32
- <u-icon
33
- lib="internal"
34
- name=${this.mode === "send" ? "arrow-up" : this.mode === "stop" ? "ban" : this.mode === "retry" ? "arrow-clockwise" : ""}
35
- ></u-icon>
35
+ <u-button part="base"
36
+ variant="borderless">
37
+ <u-icon part="icon"
38
+ lib="internal"
39
+ name="arrow-repeat"
40
+ ></u-icon>
41
+ </u-button>
42
+
43
+ <u-tooltip for="u-button" placement="bottom" distance="8">
44
+ <slot></slot>
45
+ </u-tooltip>
36
46
  `;
37
47
  }
38
48
  }
39
- __decorateClass([
40
- property({ type: String })
41
- ], USendButton.prototype, "mode");
42
49
  __decorateClass([
43
50
  property({ type: Boolean, reflect: true })
44
- ], USendButton.prototype, "disabled");
51
+ ], URetryButton.prototype, "loading");
45
52
 
46
- export { USendButton };
53
+ export { URetryButton };
@@ -0,0 +1,7 @@
1
+ import { URetryButton } from './URetryButton.component.js';
2
+ declare global {
3
+ interface HTMLElementTagNameMap {
4
+ 'u-retry-button': URetryButton;
5
+ }
6
+ }
7
+ export { URetryButton };
@@ -0,0 +1,5 @@
1
+ import { URetryButton } from './URetryButton.component.js';
2
+
3
+ URetryButton.define("u-retry-button");
4
+
5
+ export { URetryButton };
@@ -0,0 +1 @@
1
+ export declare const styles: import('lit').CSSResult;
@@ -0,0 +1,26 @@
1
+ import { css } from 'lit';
2
+
3
+ const styles = css`
4
+ :host(:empty) u-tooltip {
5
+ display: none;
6
+ }
7
+ :host([loading]) u-icon {
8
+ animation: spin 1s linear infinite;
9
+ }
10
+
11
+ u-button {
12
+ color: var(--u-txt-color-weak);
13
+ font-size: 16px;
14
+ }
15
+
16
+ @keyframes spin {
17
+ from {
18
+ transform: rotate(0deg);
19
+ }
20
+ to {
21
+ transform: rotate(360deg);
22
+ }
23
+ }
24
+ `;
25
+
26
+ export { styles };
@@ -0,0 +1,9 @@
1
+ import { BaseElement } from '@iyulab/components/dist/components/BaseElement.js';
2
+ /**
3
+ * 메시지 공유하기 버튼 컴포넌트입니다.
4
+ */
5
+ export declare class UShareButton extends BaseElement {
6
+ static styles: import('lit').CSSResultGroup[];
7
+ static dependencies: Record<string, typeof BaseElement>;
8
+ render(): import('lit-html').TemplateResult<1>;
9
+ }