@iyulab/components 0.1.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.
- package/CHANGELOG.md +4 -0
- package/LICENSE +21 -0
- package/README.md +33 -0
- package/dist/assets/icons/arrow-clockwise.svg.js +7 -0
- package/dist/assets/icons/arrow-down.svg.js +6 -0
- package/dist/assets/icons/arrow-up.svg.js +6 -0
- package/dist/assets/icons/ban.svg.js +6 -0
- package/dist/assets/icons/bell-fill.svg.js +6 -0
- package/dist/assets/icons/check-circle-fill.svg.js +6 -0
- package/dist/assets/icons/check-lg.svg.js +6 -0
- package/dist/assets/icons/chevron-down.svg.js +6 -0
- package/dist/assets/icons/chevron-left.svg.js +6 -0
- package/dist/assets/icons/chevron-right.svg.js +6 -0
- package/dist/assets/icons/chevron-up.svg.js +6 -0
- package/dist/assets/icons/copy.svg.js +6 -0
- package/dist/assets/icons/dash-lg.svg.js +6 -0
- package/dist/assets/icons/exclamation-circle-fill.svg.js +6 -0
- package/dist/assets/icons/exclamation-triangle-fill.svg.js +6 -0
- package/dist/assets/icons/eye-slash.svg.js +8 -0
- package/dist/assets/icons/eye.svg.js +7 -0
- package/dist/assets/icons/info-circle-fill.svg.js +6 -0
- package/dist/assets/icons/layout-sidebar.svg.js +6 -0
- package/dist/assets/icons/lightbulb-fill.svg.js +6 -0
- package/dist/assets/icons/lightbulb-off.svg.js +6 -0
- package/dist/assets/icons/lightbulb.svg.js +6 -0
- package/dist/assets/icons/mic-fill.svg.js +7 -0
- package/dist/assets/icons/mic-mute-fill.svg.js +7 -0
- package/dist/assets/icons/paperclip.svg.js +6 -0
- package/dist/assets/icons/pencil-square.svg.js +7 -0
- package/dist/assets/icons/plus-lg.svg.js +6 -0
- package/dist/assets/icons/search.svg.js +6 -0
- package/dist/assets/icons/speedometer.svg.js +7 -0
- package/dist/assets/icons/x-lg.svg.js +6 -0
- package/dist/assets/styles/dark.css +126 -0
- package/dist/assets/styles/dark.css.js +4 -0
- package/dist/assets/styles/light.css +127 -0
- package/dist/assets/styles/light.css.js +4 -0
- package/dist/components/BaseElement.d.ts +33 -0
- package/dist/components/BaseElement.js +49 -0
- package/dist/components/BaseElement.styles.d.ts +1 -0
- package/dist/components/BaseElement.styles.js +29 -0
- package/dist/components/alert/Alert.d.ts +36 -0
- package/dist/components/alert/Alert.js +107 -0
- package/dist/components/alert/Alert.styles.d.ts +1 -0
- package/dist/components/alert/Alert.styles.js +114 -0
- package/dist/components/alert/index.d.ts +7 -0
- package/dist/components/button/Button.d.ts +16 -0
- package/dist/components/button/Button.js +45 -0
- package/dist/components/button/Button.styles.d.ts +1 -0
- package/dist/components/button/Button.styles.js +89 -0
- package/dist/components/button/index.d.ts +7 -0
- package/dist/components/context-menu/ContextMenu.d.ts +48 -0
- package/dist/components/context-menu/ContextMenu.js +142 -0
- package/dist/components/context-menu/ContextMenu.styles.d.ts +1 -0
- package/dist/components/context-menu/ContextMenu.styles.js +40 -0
- package/dist/components/context-menu/index.d.ts +7 -0
- package/dist/components/copy-button/CopyButton.d.ts +15 -0
- package/dist/components/copy-button/CopyButton.styles.d.ts +1 -0
- package/dist/components/copy-button/index.d.ts +7 -0
- package/dist/components/dialog/Dialog.d.ts +30 -0
- package/dist/components/dialog/Dialog.js +66 -0
- package/dist/components/dialog/Dialog.styles.d.ts +1 -0
- package/dist/components/dialog/Dialog.styles.js +32 -0
- package/dist/components/dialog/index.d.ts +7 -0
- package/dist/components/form/Form.d.ts +22 -0
- package/dist/components/form/Form.js +53 -0
- package/dist/components/form/Form.styles.d.ts +1 -0
- package/dist/components/form/Form.styles.js +18 -0
- package/dist/components/form/index.d.ts +7 -0
- package/dist/components/icon/Icon.d.ts +35 -0
- package/dist/components/icon/Icon.js +63 -0
- package/dist/components/icon/Icon.styles.d.ts +1 -0
- package/dist/components/icon/Icon.styles.js +17 -0
- package/dist/components/icon/index.d.ts +7 -0
- package/dist/components/icon-button/IconButton.d.ts +19 -0
- package/dist/components/icon-button/IconButton.js +51 -0
- package/dist/components/icon-button/IconButton.styles.d.ts +1 -0
- package/dist/components/icon-button/IconButton.styles.js +69 -0
- package/dist/components/icon-button/index.d.ts +7 -0
- package/dist/components/index.d.ts +14 -0
- package/dist/components/input/Input.d.ts +73 -0
- package/dist/components/input/Input.js +193 -0
- package/dist/components/input/Input.styles.d.ts +1 -0
- package/dist/components/input/Input.styles.js +149 -0
- package/dist/components/input/index.d.ts +7 -0
- package/dist/components/menu/Menu.d.ts +36 -0
- package/dist/components/menu/Menu.js +103 -0
- package/dist/components/menu/Menu.styles.d.ts +1 -0
- package/dist/components/menu/Menu.styles.js +33 -0
- package/dist/components/menu/index.d.ts +7 -0
- package/dist/components/menu-item/MenuItem.d.ts +27 -0
- package/dist/components/menu-item/MenuItem.js +68 -0
- package/dist/components/menu-item/MenuItem.styles.d.ts +1 -0
- package/dist/components/menu-item/MenuItem.styles.js +64 -0
- package/dist/components/menu-item/index.d.ts +7 -0
- package/dist/components/panel/Panel.d.ts +10 -0
- package/dist/components/panel/Panel.js +20 -0
- package/dist/components/panel/Panel.styles.d.ts +1 -0
- package/dist/components/panel/Panel.styles.js +12 -0
- package/dist/components/panel/index.d.ts +7 -0
- package/dist/components/progress-ring/ProgressRing.d.ts +31 -0
- package/dist/components/progress-ring/ProgressRing.js +85 -0
- package/dist/components/progress-ring/ProgressRing.styles.d.ts +1 -0
- package/dist/components/progress-ring/ProgressRing.styles.js +53 -0
- package/dist/components/progress-ring/index.d.ts +7 -0
- package/dist/components/spinner/Spinner.d.ts +9 -0
- package/dist/components/spinner/Spinner.js +22 -0
- package/dist/components/spinner/Spinner.styles.d.ts +1 -0
- package/dist/components/spinner/Spinner.styles.js +57 -0
- package/dist/components/spinner/index.d.ts +7 -0
- package/dist/components/split-panel/SplitPanel.d.ts +26 -0
- package/dist/components/split-panel/SplitPanel.js +86 -0
- package/dist/components/split-panel/SplitPanel.styles.d.ts +1 -0
- package/dist/components/split-panel/SplitPanel.styles.js +19 -0
- package/dist/components/split-panel/SplitPanel.types.d.ts +2 -0
- package/dist/components/split-panel/Splitter.d.ts +17 -0
- package/dist/components/split-panel/Splitter.js +39 -0
- package/dist/components/split-panel/Splitter.styles.d.ts +1 -0
- package/dist/components/split-panel/Splitter.styles.js +45 -0
- package/dist/components/split-panel/index.d.ts +7 -0
- package/dist/components/tooltip/Tooltip.d.ts +44 -0
- package/dist/components/tooltip/Tooltip.js +130 -0
- package/dist/components/tooltip/Tooltip.styles.d.ts +1 -0
- package/dist/components/tooltip/Tooltip.styles.js +36 -0
- package/dist/components/tooltip/index.d.ts +7 -0
- package/dist/events/UChangeEvent.d.ts +6 -0
- package/dist/events/UHideEvent.d.ts +6 -0
- package/dist/events/UInputEvent.d.ts +6 -0
- package/dist/events/UResizeEvent.d.ts +6 -0
- package/dist/events/USelectEvent.d.ts +6 -0
- package/dist/events/UShowEvent.d.ts +6 -0
- package/dist/events/index.d.ts +6 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +40 -0
- package/dist/integrations/react/UAlert.d.ts +8 -0
- package/dist/integrations/react/UAlert.js +10 -0
- package/dist/integrations/react/UButton.d.ts +8 -0
- package/dist/integrations/react/UButton.js +10 -0
- package/dist/integrations/react/UContextMenu.d.ts +8 -0
- package/dist/integrations/react/UContextMenu.js +10 -0
- package/dist/integrations/react/UCopyButton.d.ts +8 -0
- package/dist/integrations/react/UCopyButton.js +10 -0
- package/dist/integrations/react/UDialog.d.ts +8 -0
- package/dist/integrations/react/UDialog.js +10 -0
- package/dist/integrations/react/UForm.d.ts +8 -0
- package/dist/integrations/react/UForm.js +10 -0
- package/dist/integrations/react/UIcon.d.ts +8 -0
- package/dist/integrations/react/UIcon.js +10 -0
- package/dist/integrations/react/UIconButton.d.ts +8 -0
- package/dist/integrations/react/UIconButton.js +10 -0
- package/dist/integrations/react/UInput.d.ts +8 -0
- package/dist/integrations/react/UInput.js +10 -0
- package/dist/integrations/react/UMenu.d.ts +8 -0
- package/dist/integrations/react/UMenu.js +10 -0
- package/dist/integrations/react/UMenuItem.d.ts +8 -0
- package/dist/integrations/react/UMenuItem.js +10 -0
- package/dist/integrations/react/UPanel.d.ts +8 -0
- package/dist/integrations/react/UPanel.js +10 -0
- package/dist/integrations/react/UProgressRing.d.ts +8 -0
- package/dist/integrations/react/UProgressRing.js +10 -0
- package/dist/integrations/react/USpinner.d.ts +8 -0
- package/dist/integrations/react/USpinner.js +10 -0
- package/dist/integrations/react/USplitPanel.d.ts +8 -0
- package/dist/integrations/react/USplitPanel.js +10 -0
- package/dist/integrations/react/UTooltip.d.ts +8 -0
- package/dist/integrations/react/UTooltip.js +10 -0
- package/dist/integrations/react/index.d.ts +23 -0
- package/dist/integrations/react/index.js +16 -0
- package/dist/internals/attribute-converters.d.ts +10 -0
- package/dist/internals/attribute-converters.js +12 -0
- package/dist/internals/icons.d.ts +6 -0
- package/dist/internals/icons.js +67 -0
- package/dist/internals/index.d.ts +4 -0
- package/dist/internals/node-helpers.d.ts +12 -0
- package/dist/internals/node-helpers.js +21 -0
- package/dist/internals/react-wrapper.d.ts +21 -0
- package/dist/utilities/decorators.d.ts +28 -0
- package/dist/utilities/decorators.js +21 -0
- package/dist/utilities/index.d.ts +4 -0
- package/dist/utilities/notifier.d.ts +26 -0
- package/dist/utilities/notifier.js +29 -0
- package/dist/utilities/storage.d.ts +60 -0
- package/dist/utilities/storage.js +120 -0
- package/dist/utilities/theme.d.ts +54 -0
- package/dist/utilities/theme.js +108 -0
- package/package.json +58 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { LitElement as c } from "lit";
|
|
2
|
+
import { styles as i } from "./BaseElement.styles.js";
|
|
3
|
+
class a extends c {
|
|
4
|
+
static {
|
|
5
|
+
this.styles = i;
|
|
6
|
+
}
|
|
7
|
+
static {
|
|
8
|
+
this.dependencies = {};
|
|
9
|
+
}
|
|
10
|
+
constructor() {
|
|
11
|
+
super(), Object.entries(this.constructor.dependencies).forEach(([e, t]) => {
|
|
12
|
+
t.define(e);
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* 커스텀 엘리먼트를 정의합니다.
|
|
17
|
+
* 이미 정의된 엘리먼트는 다시 정의하지 않습니다.
|
|
18
|
+
* @param name - 커스텀 엘리먼트의 이름
|
|
19
|
+
* @param options - 엘리먼트 정의 옵션
|
|
20
|
+
*/
|
|
21
|
+
static define(e, t = {}) {
|
|
22
|
+
if (!customElements.get(e))
|
|
23
|
+
try {
|
|
24
|
+
customElements.define(e, this, t);
|
|
25
|
+
} catch (s) {
|
|
26
|
+
console.warn(`Failed to register component "${e}":`, s);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* 커스텀 이벤트를 디스패치합니다.
|
|
31
|
+
* @param name - 이벤트 이름
|
|
32
|
+
* @param value - 이벤트의 detail에 포함될 데이터
|
|
33
|
+
* @param options - 추가 이벤트 옵션 (예: bubbles, composed 등)
|
|
34
|
+
* @returns 이벤트가 성공적으로 디스패치되었는지 여부
|
|
35
|
+
*/
|
|
36
|
+
emit(e, t, s) {
|
|
37
|
+
const n = new CustomEvent(e, {
|
|
38
|
+
bubbles: !0,
|
|
39
|
+
composed: !0,
|
|
40
|
+
cancelable: !1,
|
|
41
|
+
detail: t,
|
|
42
|
+
...s
|
|
43
|
+
});
|
|
44
|
+
return this.dispatchEvent(n);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
export {
|
|
48
|
+
a as BaseElement
|
|
49
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const styles: import('lit').CSSResult;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { css as r } from "lit";
|
|
2
|
+
const t = r`
|
|
3
|
+
:host {
|
|
4
|
+
box-sizing: border-box;
|
|
5
|
+
overflow-wrap: anywhere;
|
|
6
|
+
color: var(--u-text-color, inherit);
|
|
7
|
+
font-family: var(--u-font-base, inherit);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
:host *,
|
|
11
|
+
:host *::before,
|
|
12
|
+
:host *::after {
|
|
13
|
+
box-sizing: inherit;
|
|
14
|
+
overflow-wrap: inherit;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
[hidden] {
|
|
18
|
+
display: none !important;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.scrollable {
|
|
22
|
+
scrollbar-width: thin;
|
|
23
|
+
scrollbar-color: var(--u-scrollbar-color) var(--u-scrollbar-track-color);
|
|
24
|
+
scrollbar-gutter: stable;
|
|
25
|
+
}
|
|
26
|
+
`;
|
|
27
|
+
export {
|
|
28
|
+
t as styles
|
|
29
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { PropertyValues } from 'lit';
|
|
2
|
+
import { BaseElement } from '../BaseElement.js';
|
|
3
|
+
export type AlertType = "error" | "warning" | "info" | "success" | "notice";
|
|
4
|
+
/**
|
|
5
|
+
* 사용자에게 메시지를 표시하는 Alert 컴포넌트입니다.
|
|
6
|
+
* 자동 닫힘 타이머, 접기/펼치기 기능 등을 제공합니다.
|
|
7
|
+
*/
|
|
8
|
+
export declare class Alert extends BaseElement {
|
|
9
|
+
static styles: import('lit').CSSResultGroup[];
|
|
10
|
+
static dependencies: Record<string, typeof BaseElement>;
|
|
11
|
+
private timeoutId?;
|
|
12
|
+
/** 표시 여부 */
|
|
13
|
+
open: boolean;
|
|
14
|
+
/** 상태 (warning, error, info, success, notice) */
|
|
15
|
+
type: AlertType;
|
|
16
|
+
/** 타이틀 라벨 */
|
|
17
|
+
label?: string;
|
|
18
|
+
/** 본문 내용 */
|
|
19
|
+
content?: string;
|
|
20
|
+
/** 본문 최소 행 수 */
|
|
21
|
+
minRows: number;
|
|
22
|
+
/** 본문 최대 행 수 */
|
|
23
|
+
maxRows: number;
|
|
24
|
+
/** 자동 닫힘 타이머 (밀리초 단위, 0일 경우 자동 닫힘 없음) */
|
|
25
|
+
duration: number;
|
|
26
|
+
protected updated(changedProperties: PropertyValues): void;
|
|
27
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
28
|
+
/** Alert를 표시합니다. */
|
|
29
|
+
show(): Promise<void>;
|
|
30
|
+
/** Alert를 숨깁니다. */
|
|
31
|
+
hide(): Promise<void>;
|
|
32
|
+
/** Alert 타입에 따른 아이콘 이름을 반환합니다. */
|
|
33
|
+
private getIcon;
|
|
34
|
+
/** open 속성 변경에 따른 상태 업데이트를 처리합니다. */
|
|
35
|
+
private updateOpenState;
|
|
36
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { html as p } from "lit";
|
|
2
|
+
import { property as e } from "lit/decorators.js";
|
|
3
|
+
import { BaseElement as c } from "../BaseElement.js";
|
|
4
|
+
import { Icon as h } from "../icon/Icon.js";
|
|
5
|
+
import { styles as m } from "./Alert.styles.js";
|
|
6
|
+
var u = Object.defineProperty, i = (r, t, a, d) => {
|
|
7
|
+
for (var o = void 0, n = r.length - 1, l; n >= 0; n--)
|
|
8
|
+
(l = r[n]) && (o = l(t, a, o) || o);
|
|
9
|
+
return o && u(t, a, o), o;
|
|
10
|
+
};
|
|
11
|
+
class s extends c {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments), this.open = !1, this.type = "info", this.minRows = 1, this.maxRows = 3, this.duration = 0;
|
|
14
|
+
}
|
|
15
|
+
static {
|
|
16
|
+
this.styles = [super.styles, m];
|
|
17
|
+
}
|
|
18
|
+
static {
|
|
19
|
+
this.dependencies = {
|
|
20
|
+
"u-icon": h
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
updated(t) {
|
|
24
|
+
super.updated(t), t.has("minRows") && this.minRows < this.maxRows && this.minRows > 0 && this.style.setProperty("--min-content-rows", `${this.minRows}`), t.has("maxRows") && this.maxRows > this.minRows && this.maxRows > 0 && this.style.setProperty("--max-content-rows", `${this.maxRows}`), t.has("open") && this.updateOpenState(this.open);
|
|
25
|
+
}
|
|
26
|
+
render() {
|
|
27
|
+
return p`
|
|
28
|
+
<div class="container">
|
|
29
|
+
<div class="header">
|
|
30
|
+
<u-icon class="icon"
|
|
31
|
+
name=${this.getIcon(this.type)}
|
|
32
|
+
></u-icon>
|
|
33
|
+
<div class="title">
|
|
34
|
+
${this.label || this.type.toUpperCase()}
|
|
35
|
+
</div>
|
|
36
|
+
<u-icon class="close-btn"
|
|
37
|
+
name="x-lg"
|
|
38
|
+
@click=${this.hide}
|
|
39
|
+
></u-icon>
|
|
40
|
+
</div>
|
|
41
|
+
<div class="content scrollable">
|
|
42
|
+
${this.content || p`<slot></slot>`}
|
|
43
|
+
</div>
|
|
44
|
+
<div class="footer"></div>
|
|
45
|
+
</div>
|
|
46
|
+
`;
|
|
47
|
+
}
|
|
48
|
+
/** Alert를 표시합니다. */
|
|
49
|
+
async show() {
|
|
50
|
+
await this.updateComplete, requestAnimationFrame(() => {
|
|
51
|
+
this.open = !0;
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
/** Alert를 숨깁니다. */
|
|
55
|
+
async hide() {
|
|
56
|
+
await this.updateComplete, requestAnimationFrame(() => {
|
|
57
|
+
this.open = !1;
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
/** Alert 타입에 따른 아이콘 이름을 반환합니다. */
|
|
61
|
+
getIcon(t) {
|
|
62
|
+
switch (t) {
|
|
63
|
+
case "error":
|
|
64
|
+
return "exclamation-circle-fill";
|
|
65
|
+
case "warning":
|
|
66
|
+
return "exclamation-triangle-fill";
|
|
67
|
+
case "info":
|
|
68
|
+
return "info-circle-fill";
|
|
69
|
+
case "success":
|
|
70
|
+
return "check-circle-fill";
|
|
71
|
+
case "notice":
|
|
72
|
+
return "bell-fill";
|
|
73
|
+
default:
|
|
74
|
+
return "bell-fill";
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
/** open 속성 변경에 따른 상태 업데이트를 처리합니다. */
|
|
78
|
+
updateOpenState(t) {
|
|
79
|
+
t ? (this.duration && this.duration > 0 && (this.timeoutId = window.setTimeout(() => {
|
|
80
|
+
this.hide();
|
|
81
|
+
}, this.duration)), this.emit("u-show")) : (clearTimeout(this.timeoutId), this.emit("u-hide"));
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
i([
|
|
85
|
+
e({ type: Boolean, reflect: !0 })
|
|
86
|
+
], s.prototype, "open");
|
|
87
|
+
i([
|
|
88
|
+
e({ type: String, reflect: !0 })
|
|
89
|
+
], s.prototype, "type");
|
|
90
|
+
i([
|
|
91
|
+
e({ type: String })
|
|
92
|
+
], s.prototype, "label");
|
|
93
|
+
i([
|
|
94
|
+
e({ type: String })
|
|
95
|
+
], s.prototype, "content");
|
|
96
|
+
i([
|
|
97
|
+
e({ type: Number })
|
|
98
|
+
], s.prototype, "minRows");
|
|
99
|
+
i([
|
|
100
|
+
e({ type: Number })
|
|
101
|
+
], s.prototype, "maxRows");
|
|
102
|
+
i([
|
|
103
|
+
e({ type: Number })
|
|
104
|
+
], s.prototype, "duration");
|
|
105
|
+
export {
|
|
106
|
+
s as Alert
|
|
107
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const styles: import('lit').CSSResult;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { css as r } from "lit";
|
|
2
|
+
const e = r`
|
|
3
|
+
:host {
|
|
4
|
+
display: block;
|
|
5
|
+
min-width: 300px;
|
|
6
|
+
max-width: 500px;
|
|
7
|
+
|
|
8
|
+
background-color: var(--alert-bg-color);
|
|
9
|
+
border: 1px solid var(--alert-border-color);
|
|
10
|
+
border-radius: 8px;
|
|
11
|
+
box-shadow: 0 4px 12px var(--u-shadow-medium), 0 2px 4px var(--u-shadow-weak);
|
|
12
|
+
|
|
13
|
+
opacity: 0;
|
|
14
|
+
transform: scale(0.8);
|
|
15
|
+
transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
|
|
16
|
+
pointer-events: none;
|
|
17
|
+
|
|
18
|
+
--min-content-rows: 1;
|
|
19
|
+
--max-content-rows: 3;
|
|
20
|
+
|
|
21
|
+
--alert-icon-color: var(--u-neutral-700);
|
|
22
|
+
--alert-bg-color: var(--u-neutral-100);
|
|
23
|
+
--alert-border-color: var(--u-neutral-300);
|
|
24
|
+
}
|
|
25
|
+
:host([open]) {
|
|
26
|
+
opacity: 1;
|
|
27
|
+
transform: scale(1);
|
|
28
|
+
pointer-events: auto;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
:host([type="error"]) {
|
|
32
|
+
--alert-icon-color: var(--u-red-700);
|
|
33
|
+
--alert-bg-color: var(--u-red-0);
|
|
34
|
+
--alert-border-color: var(--u-red-100);
|
|
35
|
+
}
|
|
36
|
+
:host([type="warning"]) {
|
|
37
|
+
--alert-icon-color: var(--u-yellow-700);
|
|
38
|
+
--alert-bg-color: var(--u-yellow-0);
|
|
39
|
+
--alert-border-color: var(--u-yellow-100);
|
|
40
|
+
}
|
|
41
|
+
:host([type="info"]) {
|
|
42
|
+
--alert-icon-color: var(--u-blue-700);
|
|
43
|
+
--alert-bg-color: var(--u-blue-0);
|
|
44
|
+
--alert-border-color: var(--u-blue-100);
|
|
45
|
+
}
|
|
46
|
+
:host([type="success"]) {
|
|
47
|
+
--alert-icon-color: var(--u-green-700);
|
|
48
|
+
--alert-bg-color: var(--u-green-0);
|
|
49
|
+
--alert-border-color: var(--u-green-100);
|
|
50
|
+
}
|
|
51
|
+
:host([type="notice"]) {
|
|
52
|
+
--alert-icon-color: var(--u-neutral-700);
|
|
53
|
+
--alert-bg-color: var(--u-neutral-100);
|
|
54
|
+
--alert-border-color: var(--u-neutral-300);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.container {
|
|
58
|
+
display: flex;
|
|
59
|
+
flex-direction: column;
|
|
60
|
+
padding: 8px 12px 8px 12px;
|
|
61
|
+
overflow: hidden;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.header {
|
|
65
|
+
width: 100%;
|
|
66
|
+
display: flex;
|
|
67
|
+
flex-direction: row;
|
|
68
|
+
align-items: center;
|
|
69
|
+
gap: 12px;
|
|
70
|
+
margin-bottom: 4px;
|
|
71
|
+
user-select: none;
|
|
72
|
+
}
|
|
73
|
+
.header .icon {
|
|
74
|
+
flex-shrink: 0;
|
|
75
|
+
font-size: 20px;
|
|
76
|
+
color: var(--alert-icon-color);
|
|
77
|
+
filter: drop-shadow(0 1px 2px var(--u-shadow-weak));
|
|
78
|
+
}
|
|
79
|
+
.header .title {
|
|
80
|
+
flex: 1;
|
|
81
|
+
font-size: 16px;
|
|
82
|
+
font-weight: 600;
|
|
83
|
+
line-height: 1.4;
|
|
84
|
+
}
|
|
85
|
+
.header .close-btn {
|
|
86
|
+
flex-shrink: 0;
|
|
87
|
+
font-size: 18px;
|
|
88
|
+
cursor: pointer;
|
|
89
|
+
}
|
|
90
|
+
.header .close-btn:hover {
|
|
91
|
+
color: var(--u-icon-color-hover);
|
|
92
|
+
}
|
|
93
|
+
.header .close-btn:active {
|
|
94
|
+
color: var(--u-icon-color-active);
|
|
95
|
+
transform: scale(0.9);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.content {
|
|
99
|
+
font-size: 14px;
|
|
100
|
+
font-weight: 400;
|
|
101
|
+
color: var(--u-soft-text-color);
|
|
102
|
+
line-height: 1.6;
|
|
103
|
+
min-height: calc(1.6em * var(--min-content-rows));
|
|
104
|
+
max-height: calc(1.6em * var(--max-content-rows));
|
|
105
|
+
overflow-y: auto;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.footer {
|
|
109
|
+
display: none;
|
|
110
|
+
}
|
|
111
|
+
`;
|
|
112
|
+
export {
|
|
113
|
+
e as styles
|
|
114
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BaseElement } from '../BaseElement.js';
|
|
2
|
+
/**
|
|
3
|
+
* Button 컴포넌트는 클릭 가능한 버튼을 나타내며, 로딩 상태와 툴팁 기능을 지원합니다.
|
|
4
|
+
* @slot - 버튼 내부에 표시할 콘텐츠를 삽입합니다.
|
|
5
|
+
* @slot prefix - 버튼의 접두사로 표시할 콘텐츠를 삽입합니다.
|
|
6
|
+
* @slot suffix - 버튼의 접미사로 표시할 콘텐츠를 삽입합니다.
|
|
7
|
+
*/
|
|
8
|
+
export declare class Button extends BaseElement {
|
|
9
|
+
static styles: import('lit').CSSResultGroup[];
|
|
10
|
+
static dependencies: Record<string, typeof BaseElement>;
|
|
11
|
+
/** 버튼이 비활성화 상태인지 여부를 설정합니다. 비활성화된 버튼은 클릭할 수 없습니다. */
|
|
12
|
+
disabled: boolean;
|
|
13
|
+
/** 버튼이 로딩 상태인지 여부를 설정합니다. 로딩 중에는 버튼이 비활성화되고 스피너가 표시됩니다. */
|
|
14
|
+
loading: boolean;
|
|
15
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { html as p } from "lit";
|
|
2
|
+
import { property as n } from "lit/decorators.js";
|
|
3
|
+
import { BaseElement as d } from "../BaseElement.js";
|
|
4
|
+
import { Spinner as f } from "../spinner/Spinner.js";
|
|
5
|
+
import { styles as u } from "./Button.styles.js";
|
|
6
|
+
var m = Object.defineProperty, l = (t, r, o, h) => {
|
|
7
|
+
for (var e = void 0, s = t.length - 1, i; s >= 0; s--)
|
|
8
|
+
(i = t[s]) && (e = i(r, o, e) || e);
|
|
9
|
+
return e && m(r, o, e), e;
|
|
10
|
+
};
|
|
11
|
+
class a extends d {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments), this.disabled = !1, this.loading = !1;
|
|
14
|
+
}
|
|
15
|
+
static {
|
|
16
|
+
this.styles = [super.styles, u];
|
|
17
|
+
}
|
|
18
|
+
static {
|
|
19
|
+
this.dependencies = {
|
|
20
|
+
"u-spinner": f
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
render() {
|
|
24
|
+
return p`
|
|
25
|
+
<button part="base" ?disabled=${this.disabled || this.loading}>
|
|
26
|
+
<slot name="prefix"></slot>
|
|
27
|
+
<slot></slot>
|
|
28
|
+
<slot name="suffix"></slot>
|
|
29
|
+
</button>
|
|
30
|
+
|
|
31
|
+
<div class="overlay" ?hidden=${!this.loading}>
|
|
32
|
+
<u-spinner></u-spinner>
|
|
33
|
+
</div>
|
|
34
|
+
`;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
l([
|
|
38
|
+
n({ type: Boolean, reflect: !0 })
|
|
39
|
+
], a.prototype, "disabled");
|
|
40
|
+
l([
|
|
41
|
+
n({ type: Boolean, reflect: !0 })
|
|
42
|
+
], a.prototype, "loading");
|
|
43
|
+
export {
|
|
44
|
+
a as Button
|
|
45
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const styles: import('lit').CSSResult;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { css as o } from "lit";
|
|
2
|
+
const t = o`
|
|
3
|
+
:host {
|
|
4
|
+
position: relative;
|
|
5
|
+
display: inline-flex;
|
|
6
|
+
|
|
7
|
+
font-size: 14px;
|
|
8
|
+
font-weight: 500;
|
|
9
|
+
line-height: 1.5;
|
|
10
|
+
padding: 0.5em 1em;
|
|
11
|
+
background-color: var(--u-bg-color);
|
|
12
|
+
border: 1px solid var(--u-border-color);
|
|
13
|
+
border-radius: 6px;
|
|
14
|
+
|
|
15
|
+
transition: all 0.2s ease;
|
|
16
|
+
user-select: none;
|
|
17
|
+
cursor: pointer;
|
|
18
|
+
}
|
|
19
|
+
:host([loading]),
|
|
20
|
+
:host([disabled]) {
|
|
21
|
+
pointer-events: none;
|
|
22
|
+
}
|
|
23
|
+
:host([disabled]) {
|
|
24
|
+
color: var(--u-text-color-disabled);
|
|
25
|
+
}
|
|
26
|
+
:host(:hover) {
|
|
27
|
+
color: var(--u-text-color-hover);
|
|
28
|
+
background-color: var(--u-bg-color-hover);
|
|
29
|
+
border-color: var(--u-border-color-strong);
|
|
30
|
+
}
|
|
31
|
+
:host(:active) {
|
|
32
|
+
color: var(--u-text-color-active);
|
|
33
|
+
background-color: var(--u-bg-color-active);
|
|
34
|
+
transform: translateY(1px);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
button {
|
|
38
|
+
all: unset;
|
|
39
|
+
width: 100%;
|
|
40
|
+
display: inline-flex;
|
|
41
|
+
flex-direction: row;
|
|
42
|
+
align-items: center;
|
|
43
|
+
justify-content: center;
|
|
44
|
+
}
|
|
45
|
+
button:focus-visible {
|
|
46
|
+
outline: 2px solid var(--u-blue-500, #3b82f6);
|
|
47
|
+
outline-offset: 2px;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
slot {
|
|
51
|
+
flex: 1 1 auto;
|
|
52
|
+
min-width: 0;
|
|
53
|
+
display: inline-flex;
|
|
54
|
+
align-items: center;
|
|
55
|
+
justify-content: center;
|
|
56
|
+
}
|
|
57
|
+
slot[name="prefix"],
|
|
58
|
+
slot[name="suffix"] {
|
|
59
|
+
flex: 0 0 auto;
|
|
60
|
+
}
|
|
61
|
+
/* 슬롯에 내용이 있을 때만 gap 적용 */
|
|
62
|
+
slot[name="prefix"]:not(:empty) {
|
|
63
|
+
margin-right: 0.5em;
|
|
64
|
+
}
|
|
65
|
+
slot[name="suffix"]:not(:empty) {
|
|
66
|
+
margin-left: 0.5em;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.overlay {
|
|
70
|
+
position: absolute;
|
|
71
|
+
z-index: 100;
|
|
72
|
+
top: 0;
|
|
73
|
+
left: 0;
|
|
74
|
+
right: 0;
|
|
75
|
+
bottom: 0;
|
|
76
|
+
|
|
77
|
+
display: flex;
|
|
78
|
+
align-items: center;
|
|
79
|
+
justify-content: center;
|
|
80
|
+
|
|
81
|
+
padding: inherit;
|
|
82
|
+
font-size: inherit;
|
|
83
|
+
border-radius: inherit;
|
|
84
|
+
background-color: inherit;
|
|
85
|
+
}
|
|
86
|
+
`;
|
|
87
|
+
export {
|
|
88
|
+
t as styles
|
|
89
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { PropertyValues } from 'lit';
|
|
2
|
+
import { Placement } from '@floating-ui/dom';
|
|
3
|
+
import { BaseElement } from '../BaseElement.js';
|
|
4
|
+
/**
|
|
5
|
+
* ContextMenu 컴포넌트는 마우스 오른쪽 버튼 클릭으로 표시되는 컨텍스트 메뉴입니다.
|
|
6
|
+
* MenuItem 컴포넌트를 자식으로 포함하여 메뉴를 구성합니다.
|
|
7
|
+
*/
|
|
8
|
+
export declare class ContextMenu extends BaseElement {
|
|
9
|
+
static styles: import('lit').CSSResultGroup[];
|
|
10
|
+
static dependencies: Record<string, typeof BaseElement>;
|
|
11
|
+
/** 마우스 클릭 위치 */
|
|
12
|
+
private mouseX;
|
|
13
|
+
private mouseY;
|
|
14
|
+
/** 컨텍스트 메뉴가 연결될 대상 엘리먼트입니다. 지정하지 않으면 부모 엘리먼트가 대상이 됩니다. */
|
|
15
|
+
trigger?: HTMLElement;
|
|
16
|
+
/** 현재 메뉴가 열려있는지 여부입니다. */
|
|
17
|
+
open: boolean;
|
|
18
|
+
/** 'fixed' 위치에서 포지션을 계산할지 여부를 설정합니다. 기본값은 true입니다. */
|
|
19
|
+
hoist: boolean;
|
|
20
|
+
/** 메뉴가 나타날 위치를 설정합니다. */
|
|
21
|
+
placement?: Placement;
|
|
22
|
+
/** 메뉴의 위치에서 마우스 포인터까지의 거리를 픽셀단위로 설정합니다. 기본값은 2입니다. */
|
|
23
|
+
distance: number;
|
|
24
|
+
connectedCallback(): void;
|
|
25
|
+
disconnectedCallback(): void;
|
|
26
|
+
protected updated(changedProperties: PropertyValues): void;
|
|
27
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
28
|
+
/** 컨텍스트 메뉴를 표시합니다. */
|
|
29
|
+
show: (x?: number, y?: number) => Promise<void>;
|
|
30
|
+
/** 컨텍스트 메뉴를 숨깁니다. */
|
|
31
|
+
hide: () => Promise<void>;
|
|
32
|
+
/**
|
|
33
|
+
* 메뉴가 나타날 위치에 따라 transform-origin 값을 반환합니다.
|
|
34
|
+
*/
|
|
35
|
+
private getTransformOrigin;
|
|
36
|
+
/** 대상 엘리먼트에 컨텍스트 메뉴 이벤트를 바인딩 합니다. */
|
|
37
|
+
private attachTrigger;
|
|
38
|
+
/** 대상 엘리먼트에 바인딩된 컨텍스트 메뉴 이벤트를 제거합니다. */
|
|
39
|
+
private detachTrigger;
|
|
40
|
+
/** 컨텍스트 메뉴 이벤트를 처리합니다. */
|
|
41
|
+
private handleContextMenu;
|
|
42
|
+
/** 문서 클릭 이벤트를 처리합니다. */
|
|
43
|
+
private handleDocumentClick;
|
|
44
|
+
/** 문서 컨텍스트 메뉴 이벤트를 처리합니다. */
|
|
45
|
+
private handleDocumentContextMenu;
|
|
46
|
+
/** 슬롯 변경 이벤트를 처리합니다. */
|
|
47
|
+
private handleSlotChange;
|
|
48
|
+
}
|