@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.
Files changed (186) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/LICENSE +21 -0
  3. package/README.md +33 -0
  4. package/dist/assets/icons/arrow-clockwise.svg.js +7 -0
  5. package/dist/assets/icons/arrow-down.svg.js +6 -0
  6. package/dist/assets/icons/arrow-up.svg.js +6 -0
  7. package/dist/assets/icons/ban.svg.js +6 -0
  8. package/dist/assets/icons/bell-fill.svg.js +6 -0
  9. package/dist/assets/icons/check-circle-fill.svg.js +6 -0
  10. package/dist/assets/icons/check-lg.svg.js +6 -0
  11. package/dist/assets/icons/chevron-down.svg.js +6 -0
  12. package/dist/assets/icons/chevron-left.svg.js +6 -0
  13. package/dist/assets/icons/chevron-right.svg.js +6 -0
  14. package/dist/assets/icons/chevron-up.svg.js +6 -0
  15. package/dist/assets/icons/copy.svg.js +6 -0
  16. package/dist/assets/icons/dash-lg.svg.js +6 -0
  17. package/dist/assets/icons/exclamation-circle-fill.svg.js +6 -0
  18. package/dist/assets/icons/exclamation-triangle-fill.svg.js +6 -0
  19. package/dist/assets/icons/eye-slash.svg.js +8 -0
  20. package/dist/assets/icons/eye.svg.js +7 -0
  21. package/dist/assets/icons/info-circle-fill.svg.js +6 -0
  22. package/dist/assets/icons/layout-sidebar.svg.js +6 -0
  23. package/dist/assets/icons/lightbulb-fill.svg.js +6 -0
  24. package/dist/assets/icons/lightbulb-off.svg.js +6 -0
  25. package/dist/assets/icons/lightbulb.svg.js +6 -0
  26. package/dist/assets/icons/mic-fill.svg.js +7 -0
  27. package/dist/assets/icons/mic-mute-fill.svg.js +7 -0
  28. package/dist/assets/icons/paperclip.svg.js +6 -0
  29. package/dist/assets/icons/pencil-square.svg.js +7 -0
  30. package/dist/assets/icons/plus-lg.svg.js +6 -0
  31. package/dist/assets/icons/search.svg.js +6 -0
  32. package/dist/assets/icons/speedometer.svg.js +7 -0
  33. package/dist/assets/icons/x-lg.svg.js +6 -0
  34. package/dist/assets/styles/dark.css +126 -0
  35. package/dist/assets/styles/dark.css.js +4 -0
  36. package/dist/assets/styles/light.css +127 -0
  37. package/dist/assets/styles/light.css.js +4 -0
  38. package/dist/components/BaseElement.d.ts +33 -0
  39. package/dist/components/BaseElement.js +49 -0
  40. package/dist/components/BaseElement.styles.d.ts +1 -0
  41. package/dist/components/BaseElement.styles.js +29 -0
  42. package/dist/components/alert/Alert.d.ts +36 -0
  43. package/dist/components/alert/Alert.js +107 -0
  44. package/dist/components/alert/Alert.styles.d.ts +1 -0
  45. package/dist/components/alert/Alert.styles.js +114 -0
  46. package/dist/components/alert/index.d.ts +7 -0
  47. package/dist/components/button/Button.d.ts +16 -0
  48. package/dist/components/button/Button.js +45 -0
  49. package/dist/components/button/Button.styles.d.ts +1 -0
  50. package/dist/components/button/Button.styles.js +89 -0
  51. package/dist/components/button/index.d.ts +7 -0
  52. package/dist/components/context-menu/ContextMenu.d.ts +48 -0
  53. package/dist/components/context-menu/ContextMenu.js +142 -0
  54. package/dist/components/context-menu/ContextMenu.styles.d.ts +1 -0
  55. package/dist/components/context-menu/ContextMenu.styles.js +40 -0
  56. package/dist/components/context-menu/index.d.ts +7 -0
  57. package/dist/components/copy-button/CopyButton.d.ts +15 -0
  58. package/dist/components/copy-button/CopyButton.styles.d.ts +1 -0
  59. package/dist/components/copy-button/index.d.ts +7 -0
  60. package/dist/components/dialog/Dialog.d.ts +30 -0
  61. package/dist/components/dialog/Dialog.js +66 -0
  62. package/dist/components/dialog/Dialog.styles.d.ts +1 -0
  63. package/dist/components/dialog/Dialog.styles.js +32 -0
  64. package/dist/components/dialog/index.d.ts +7 -0
  65. package/dist/components/form/Form.d.ts +22 -0
  66. package/dist/components/form/Form.js +53 -0
  67. package/dist/components/form/Form.styles.d.ts +1 -0
  68. package/dist/components/form/Form.styles.js +18 -0
  69. package/dist/components/form/index.d.ts +7 -0
  70. package/dist/components/icon/Icon.d.ts +35 -0
  71. package/dist/components/icon/Icon.js +63 -0
  72. package/dist/components/icon/Icon.styles.d.ts +1 -0
  73. package/dist/components/icon/Icon.styles.js +17 -0
  74. package/dist/components/icon/index.d.ts +7 -0
  75. package/dist/components/icon-button/IconButton.d.ts +19 -0
  76. package/dist/components/icon-button/IconButton.js +51 -0
  77. package/dist/components/icon-button/IconButton.styles.d.ts +1 -0
  78. package/dist/components/icon-button/IconButton.styles.js +69 -0
  79. package/dist/components/icon-button/index.d.ts +7 -0
  80. package/dist/components/index.d.ts +14 -0
  81. package/dist/components/input/Input.d.ts +73 -0
  82. package/dist/components/input/Input.js +193 -0
  83. package/dist/components/input/Input.styles.d.ts +1 -0
  84. package/dist/components/input/Input.styles.js +149 -0
  85. package/dist/components/input/index.d.ts +7 -0
  86. package/dist/components/menu/Menu.d.ts +36 -0
  87. package/dist/components/menu/Menu.js +103 -0
  88. package/dist/components/menu/Menu.styles.d.ts +1 -0
  89. package/dist/components/menu/Menu.styles.js +33 -0
  90. package/dist/components/menu/index.d.ts +7 -0
  91. package/dist/components/menu-item/MenuItem.d.ts +27 -0
  92. package/dist/components/menu-item/MenuItem.js +68 -0
  93. package/dist/components/menu-item/MenuItem.styles.d.ts +1 -0
  94. package/dist/components/menu-item/MenuItem.styles.js +64 -0
  95. package/dist/components/menu-item/index.d.ts +7 -0
  96. package/dist/components/panel/Panel.d.ts +10 -0
  97. package/dist/components/panel/Panel.js +20 -0
  98. package/dist/components/panel/Panel.styles.d.ts +1 -0
  99. package/dist/components/panel/Panel.styles.js +12 -0
  100. package/dist/components/panel/index.d.ts +7 -0
  101. package/dist/components/progress-ring/ProgressRing.d.ts +31 -0
  102. package/dist/components/progress-ring/ProgressRing.js +85 -0
  103. package/dist/components/progress-ring/ProgressRing.styles.d.ts +1 -0
  104. package/dist/components/progress-ring/ProgressRing.styles.js +53 -0
  105. package/dist/components/progress-ring/index.d.ts +7 -0
  106. package/dist/components/spinner/Spinner.d.ts +9 -0
  107. package/dist/components/spinner/Spinner.js +22 -0
  108. package/dist/components/spinner/Spinner.styles.d.ts +1 -0
  109. package/dist/components/spinner/Spinner.styles.js +57 -0
  110. package/dist/components/spinner/index.d.ts +7 -0
  111. package/dist/components/split-panel/SplitPanel.d.ts +26 -0
  112. package/dist/components/split-panel/SplitPanel.js +86 -0
  113. package/dist/components/split-panel/SplitPanel.styles.d.ts +1 -0
  114. package/dist/components/split-panel/SplitPanel.styles.js +19 -0
  115. package/dist/components/split-panel/SplitPanel.types.d.ts +2 -0
  116. package/dist/components/split-panel/Splitter.d.ts +17 -0
  117. package/dist/components/split-panel/Splitter.js +39 -0
  118. package/dist/components/split-panel/Splitter.styles.d.ts +1 -0
  119. package/dist/components/split-panel/Splitter.styles.js +45 -0
  120. package/dist/components/split-panel/index.d.ts +7 -0
  121. package/dist/components/tooltip/Tooltip.d.ts +44 -0
  122. package/dist/components/tooltip/Tooltip.js +130 -0
  123. package/dist/components/tooltip/Tooltip.styles.d.ts +1 -0
  124. package/dist/components/tooltip/Tooltip.styles.js +36 -0
  125. package/dist/components/tooltip/index.d.ts +7 -0
  126. package/dist/events/UChangeEvent.d.ts +6 -0
  127. package/dist/events/UHideEvent.d.ts +6 -0
  128. package/dist/events/UInputEvent.d.ts +6 -0
  129. package/dist/events/UResizeEvent.d.ts +6 -0
  130. package/dist/events/USelectEvent.d.ts +6 -0
  131. package/dist/events/UShowEvent.d.ts +6 -0
  132. package/dist/events/index.d.ts +6 -0
  133. package/dist/index.d.ts +2 -0
  134. package/dist/index.js +40 -0
  135. package/dist/integrations/react/UAlert.d.ts +8 -0
  136. package/dist/integrations/react/UAlert.js +10 -0
  137. package/dist/integrations/react/UButton.d.ts +8 -0
  138. package/dist/integrations/react/UButton.js +10 -0
  139. package/dist/integrations/react/UContextMenu.d.ts +8 -0
  140. package/dist/integrations/react/UContextMenu.js +10 -0
  141. package/dist/integrations/react/UCopyButton.d.ts +8 -0
  142. package/dist/integrations/react/UCopyButton.js +10 -0
  143. package/dist/integrations/react/UDialog.d.ts +8 -0
  144. package/dist/integrations/react/UDialog.js +10 -0
  145. package/dist/integrations/react/UForm.d.ts +8 -0
  146. package/dist/integrations/react/UForm.js +10 -0
  147. package/dist/integrations/react/UIcon.d.ts +8 -0
  148. package/dist/integrations/react/UIcon.js +10 -0
  149. package/dist/integrations/react/UIconButton.d.ts +8 -0
  150. package/dist/integrations/react/UIconButton.js +10 -0
  151. package/dist/integrations/react/UInput.d.ts +8 -0
  152. package/dist/integrations/react/UInput.js +10 -0
  153. package/dist/integrations/react/UMenu.d.ts +8 -0
  154. package/dist/integrations/react/UMenu.js +10 -0
  155. package/dist/integrations/react/UMenuItem.d.ts +8 -0
  156. package/dist/integrations/react/UMenuItem.js +10 -0
  157. package/dist/integrations/react/UPanel.d.ts +8 -0
  158. package/dist/integrations/react/UPanel.js +10 -0
  159. package/dist/integrations/react/UProgressRing.d.ts +8 -0
  160. package/dist/integrations/react/UProgressRing.js +10 -0
  161. package/dist/integrations/react/USpinner.d.ts +8 -0
  162. package/dist/integrations/react/USpinner.js +10 -0
  163. package/dist/integrations/react/USplitPanel.d.ts +8 -0
  164. package/dist/integrations/react/USplitPanel.js +10 -0
  165. package/dist/integrations/react/UTooltip.d.ts +8 -0
  166. package/dist/integrations/react/UTooltip.js +10 -0
  167. package/dist/integrations/react/index.d.ts +23 -0
  168. package/dist/integrations/react/index.js +16 -0
  169. package/dist/internals/attribute-converters.d.ts +10 -0
  170. package/dist/internals/attribute-converters.js +12 -0
  171. package/dist/internals/icons.d.ts +6 -0
  172. package/dist/internals/icons.js +67 -0
  173. package/dist/internals/index.d.ts +4 -0
  174. package/dist/internals/node-helpers.d.ts +12 -0
  175. package/dist/internals/node-helpers.js +21 -0
  176. package/dist/internals/react-wrapper.d.ts +21 -0
  177. package/dist/utilities/decorators.d.ts +28 -0
  178. package/dist/utilities/decorators.js +21 -0
  179. package/dist/utilities/index.d.ts +4 -0
  180. package/dist/utilities/notifier.d.ts +26 -0
  181. package/dist/utilities/notifier.js +29 -0
  182. package/dist/utilities/storage.d.ts +60 -0
  183. package/dist/utilities/storage.js +120 -0
  184. package/dist/utilities/theme.d.ts +54 -0
  185. package/dist/utilities/theme.js +108 -0
  186. package/package.json +58 -0
@@ -0,0 +1,69 @@
1
+ import { css as o } from "lit";
2
+ const e = o`
3
+ :host {
4
+ position: relative;
5
+ display: inline-flex;
6
+
7
+ font-size: 16px;
8
+ color: var(--u-icon-color);
9
+ padding: 0.5em;
10
+ background-color: var(--u-bg-color);
11
+ border: 1px solid var(--u-border-color);
12
+ border-radius: 6px;
13
+
14
+ transition: all 0.2s ease;
15
+ user-select: none;
16
+ cursor: pointer;
17
+ }
18
+ :host([borderless]) {
19
+ border: none;
20
+ background-color: transparent;
21
+ }
22
+ :host([borderless]:hover) {
23
+ border: none;
24
+ background-color: transparent;
25
+ }
26
+ :host([borderless]:active) {
27
+ border: none;
28
+ background-color: transparent;
29
+ }
30
+ :host([loading]),
31
+ :host([disabled]) {
32
+ pointer-events: none;
33
+ }
34
+ :host([disabled]) {
35
+ opacity: 0.6;
36
+ color: var(--u-icon-color-disabled);
37
+ }
38
+ :host(:hover) {
39
+ color: var(--u-icon-color-hover);
40
+ background-color: var(--u-bg-color-hover);
41
+ border-color: var(--u-border-color-strong);
42
+ }
43
+ :host(:active) {
44
+ color: var(--u-icon-color-active);
45
+ background-color: var(--u-bg-color-active);
46
+ transform: translateY(1px);
47
+ }
48
+
49
+ button {
50
+ all: unset;
51
+ display: inline-flex;
52
+ align-items: center;
53
+ justify-content: center;
54
+ }
55
+ button:focus-visible {
56
+ outline: 2px solid var(--u-blue-500, #3b82f6);
57
+ outline-offset: 2px;
58
+ border-radius: inherit;
59
+ }
60
+
61
+ u-icon,
62
+ u-spinner {
63
+ font-size: inherit;
64
+ color: inherit;
65
+ }
66
+ `;
67
+ export {
68
+ e as styles
69
+ };
@@ -0,0 +1,7 @@
1
+ import { IconButton } from './IconButton.js';
2
+ declare global {
3
+ interface HTMLElementTagNameMap {
4
+ "u-icon-button": IconButton;
5
+ }
6
+ }
7
+ export { IconButton };
@@ -0,0 +1,14 @@
1
+ export * from './alert';
2
+ export * from './button';
3
+ export * from './context-menu';
4
+ export * from './dialog';
5
+ export * from './form';
6
+ export * from './icon';
7
+ export * from './icon-button';
8
+ export * from './input';
9
+ export * from './menu';
10
+ export * from './panel';
11
+ export * from './progress-ring';
12
+ export * from './spinner';
13
+ export * from './split-panel';
14
+ export * from './tooltip';
@@ -0,0 +1,73 @@
1
+ import { PropertyValues } from 'lit';
2
+ import { BaseElement } from '../BaseElement.js';
3
+ /**
4
+ * Input ์ปดํฌ๋„ŒํŠธ๋Š” ์‚ฌ์šฉ์ž ์ž…๋ ฅ์„ ๋ฐ›๋Š” ํ…์ŠคํŠธ ์ž…๋ ฅ ํ•„๋“œ์ž…๋‹ˆ๋‹ค.
5
+ * prefix, suffix ์Šฌ๋กฏ๊ณผ ๋ผ๋ฒจ, ๋„์›€๋ง, ์œ ํšจ์„ฑ ๊ฒ€์‚ฌ ๋“ฑ์˜ ๊ธฐ๋Šฅ์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค.
6
+ */
7
+ export declare class Input extends BaseElement {
8
+ static styles: import('lit').CSSResultGroup[];
9
+ static dependencies: Record<string, typeof BaseElement>;
10
+ input: HTMLInputElement;
11
+ /** password type์ธ ๊ฒฝ์šฐ ๋น„๋ฐ€๋ฒˆํ˜ธ ํ‘œ์‹œ/์ˆจ๊น€ ์ƒํƒœ */
12
+ showPassword: boolean;
13
+ /** ์œ ํšจ์„ฑ ๊ฒ€์‚ฌ ์‹คํŒจ ์—ฌ๋ถ€ */
14
+ isInvalid: boolean;
15
+ /** ํ˜„์žฌ ํ‘œ์‹œํ•  ์œ ํšจ์„ฑ ๊ฒ€์‚ฌ ๋ฉ”์‹œ์ง€ */
16
+ currentValidationMessage: string;
17
+ /** input ์š”์†Œ์˜ type ์†์„ฑ */
18
+ type: 'text' | 'email' | 'password' | 'search' | 'tel' | 'url' | 'number';
19
+ /** ํ•„์ˆ˜ ์ž…๋ ฅ ์—ฌ๋ถ€ */
20
+ required: boolean;
21
+ /** ๋น„ํ™œ์„ฑํ™” ์—ฌ๋ถ€ */
22
+ disabled: boolean;
23
+ /** ํด๋ฆฌ์–ด ๋ฒ„ํŠผ ํ‘œ์‹œ ์—ฌ๋ถ€ */
24
+ clearable: boolean;
25
+ /** ์ฝ๊ธฐ ์ „์šฉ ์—ฌ๋ถ€ */
26
+ readonly: boolean;
27
+ /** input ์š”์†Œ์˜ name ์†์„ฑ */
28
+ name?: string;
29
+ /** ๋ผ๋ฒจ ํ…์ŠคํŠธ */
30
+ label?: string;
31
+ /** ๋ผ๋ฒจ ๋„์›€๋ง (ํˆดํŒ) */
32
+ labelhelp?: string;
33
+ /** placeholder ํ…์ŠคํŠธ */
34
+ placeholder?: string;
35
+ /** ์ปดํฌ๋„ŒํŠธ ํ•˜๋‹จ ์„ค๋ช… ํ…์ŠคํŠธ */
36
+ description?: string;
37
+ /** ์ตœ์†Œ ๊ธธ์ด */
38
+ minlength?: number;
39
+ /** ์ตœ๋Œ€ ๊ธธ์ด */
40
+ maxlength?: number;
41
+ /** ๋งž์ถค๋ฒ• ๊ฒ€์‚ฌ ์—ฌ๋ถ€ */
42
+ spellcheck: boolean;
43
+ /** autocomplete ์†์„ฑ */
44
+ autocomplete?: string;
45
+ /** ์ž…๋ ฅ๊ฐ’ */
46
+ value: string;
47
+ /** ์œ ํšจ์„ฑ ๊ฒ€์‚ฌ ํŒจํ„ด (์ •๊ทœ์‹) */
48
+ pattern?: string;
49
+ /** ์œ ํšจ์„ฑ ๊ฒ€์‚ฌ ์‹คํŒจ ์‹œ ํ‘œ์‹œํ•  ๋ฉ”์‹œ์ง€ */
50
+ validationMessage?: string;
51
+ protected updated(changedProperties: PropertyValues): void;
52
+ render(): import('lit-html').TemplateResult<1>;
53
+ /** ๋ผ๋ฒจ ์˜์—ญ์„ ๋ Œ๋”๋งํ•ฉ๋‹ˆ๋‹ค. */
54
+ private renderHeader;
55
+ /** ์œ ํšจ์„ฑ ๊ฒ€์‚ฌ๋ฅผ ์ˆ˜ํ–‰ํ•ฉ๋‹ˆ๋‹ค. */
56
+ validate(): boolean;
57
+ /** ์ž…๋ ฅ๊ฐ’์„ ์ดˆ๊ธฐํ™”ํ•ฉ๋‹ˆ๋‹ค. */
58
+ clear(): void;
59
+ /** ์ž…๋ ฅ ํ•„๋“œ์— ํฌ์ปค์Šค๋ฅผ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค. */
60
+ focus(): void;
61
+ /** ์ž…๋ ฅ ํ•„๋“œ์˜ ํฌ์ปค์Šค๋ฅผ ํ•ด์ œํ•ฉ๋‹ˆ๋‹ค. */
62
+ blur(): void;
63
+ /** input ์ด๋ฒคํŠธ ํ•ธ๋“ค๋Ÿฌ */
64
+ private handleInput;
65
+ /** change ์ด๋ฒคํŠธ ํ•ธ๋“ค๋Ÿฌ */
66
+ private handleChange;
67
+ /** blur ์ด๋ฒคํŠธ ํ•ธ๋“ค๋Ÿฌ */
68
+ private handleBlur;
69
+ /** ํด๋ฆฌ์–ด ๋ฒ„ํŠผ ํด๋ฆญ ํ•ธ๋“ค๋Ÿฌ */
70
+ private handleClear;
71
+ /** ๋น„๋ฐ€๋ฒˆํ˜ธ ํ‘œ์‹œ/์ˆจ๊น€ ํ† ๊ธ€ ํ•ธ๋“ค๋Ÿฌ */
72
+ private handlePasswordToggle;
73
+ }
@@ -0,0 +1,193 @@
1
+ import { html as o, nothing as u } from "lit";
2
+ import { query as c, state as p, property as s } from "lit/decorators.js";
3
+ import { ifDefined as r } from "lit/directives/if-defined.js";
4
+ import { live as y } from "lit/directives/live.js";
5
+ import { BaseElement as v } from "../BaseElement.js";
6
+ import { Icon as f } from "../icon/Icon.js";
7
+ import { Tooltip as g } from "../tooltip/Tooltip.js";
8
+ import { styles as m } from "./Input.styles.js";
9
+ var $ = Object.defineProperty, t = (n, i, a, b) => {
10
+ for (var l = void 0, h = n.length - 1, d; h >= 0; h--)
11
+ (d = n[h]) && (l = d(i, a, l) || l);
12
+ return l && $(i, a, l), l;
13
+ };
14
+ class e extends v {
15
+ constructor() {
16
+ super(...arguments), this.showPassword = !1, this.isInvalid = !1, this.currentValidationMessage = "", this.type = "text", this.required = !1, this.disabled = !1, this.clearable = !1, this.readonly = !1, this.spellcheck = !1, this.value = "", this.handleInput = (i) => {
17
+ const a = i.target;
18
+ this.value = a.value, this.isInvalid && (this.isInvalid = !1, this.currentValidationMessage = ""), this.emit("u-input", { value: this.value });
19
+ }, this.handleChange = (i) => {
20
+ const a = i.target;
21
+ this.value = a.value, this.emit("u-change", { value: this.value });
22
+ }, this.handleBlur = () => {
23
+ this.validate();
24
+ }, this.handleClear = (i) => {
25
+ i.stopPropagation(), this.clear();
26
+ }, this.handlePasswordToggle = (i) => {
27
+ i.stopPropagation(), this.showPassword = !this.showPassword, this.focus();
28
+ };
29
+ }
30
+ static {
31
+ this.styles = [super.styles, m];
32
+ }
33
+ static {
34
+ this.dependencies = {
35
+ "u-icon": f,
36
+ "u-tooltip": g
37
+ };
38
+ }
39
+ updated(i) {
40
+ super.updated(i), i.has("value") && this.input && this.input.value !== this.value && (this.input.value = this.value);
41
+ }
42
+ render() {
43
+ return o`
44
+ ${this.renderHeader()}
45
+
46
+ <div class="container"
47
+ ?invalid=${this.isInvalid}
48
+ ?disabled=${this.disabled}
49
+ ?readonly=${this.readonly}>
50
+ <slot name="prefix" class="prefix"></slot>
51
+
52
+ <input part="input"
53
+ type=${this.type === "password" && this.showPassword ? "text" : this.type}
54
+ name=${r(this.name)}
55
+ ?required=${this.required}
56
+ ?disabled=${this.disabled}
57
+ ?readonly=${this.readonly}
58
+ placeholder=${r(this.placeholder)}
59
+ minlength=${r(this.minlength)}
60
+ maxlength=${r(this.maxlength)}
61
+ spellcheck=${this.spellcheck}
62
+ autocomplete=${r(this.autocomplete)}
63
+ pattern=${r(this.pattern)}
64
+ .value=${y(this.value)}
65
+ @input=${this.handleInput}
66
+ @change=${this.handleChange}
67
+ @blur=${this.handleBlur}
68
+ />
69
+
70
+ <slot name="suffix" class="suffix"></slot>
71
+
72
+ <div class="tools">
73
+ <u-icon class="tool" name=${this.showPassword ? "eye-slash" : "eye"}
74
+ ?hidden=${this.type !== "password" || this.disabled || this.readonly}
75
+ @click=${this.handlePasswordToggle}
76
+ ></u-icon>
77
+ <u-icon class="tool" name="x-lg"
78
+ ?hidden=${!this.clearable || !this.value || this.disabled || this.readonly}
79
+ @click=${this.handleClear}
80
+ ></u-icon>
81
+ </div>
82
+ </div>
83
+
84
+ <div class="validation-error" role="alert" ?hidden=${!this.currentValidationMessage}>
85
+ ${this.currentValidationMessage}
86
+ </div>
87
+
88
+ <div class="description" ?hidden=${!this.description}>
89
+ ${this.description}
90
+ </div>
91
+ `;
92
+ }
93
+ /** ๋ผ๋ฒจ ์˜์—ญ์„ ๋ Œ๋”๋งํ•ฉ๋‹ˆ๋‹ค. */
94
+ renderHeader() {
95
+ return this.label ? o`
96
+ <div class="header">
97
+ <label class="label" @click=${this.focus}>
98
+ ${this.label}
99
+ ${this.required ? o`<span class="required-mark">*</span>` : ""}
100
+ </label>
101
+
102
+ ${this.labelhelp ? o`
103
+ <u-icon class="help-icon" name="info-circle-fill"></u-icon>
104
+ <u-tooltip trigger-selectors=".help-icon" placement="right-end">${this.labelhelp}</u-tooltip>
105
+ ` : u}
106
+ </div>
107
+ ` : u;
108
+ }
109
+ /** ์œ ํšจ์„ฑ ๊ฒ€์‚ฌ๋ฅผ ์ˆ˜ํ–‰ํ•ฉ๋‹ˆ๋‹ค. */
110
+ validate() {
111
+ if (!this.input) return !0;
112
+ const i = this.input.checkValidity();
113
+ return this.isInvalid = !i, i ? this.currentValidationMessage = "" : this.currentValidationMessage = this.validationMessage || this.input.validationMessage, i;
114
+ }
115
+ /** ์ž…๋ ฅ๊ฐ’์„ ์ดˆ๊ธฐํ™”ํ•ฉ๋‹ˆ๋‹ค. */
116
+ clear() {
117
+ this.value = "", this.isInvalid = !1, this.currentValidationMessage = "", this.focus(), this.emit("u-clear");
118
+ }
119
+ /** ์ž…๋ ฅ ํ•„๋“œ์— ํฌ์ปค์Šค๋ฅผ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค. */
120
+ focus() {
121
+ this.input?.focus();
122
+ }
123
+ /** ์ž…๋ ฅ ํ•„๋“œ์˜ ํฌ์ปค์Šค๋ฅผ ํ•ด์ œํ•ฉ๋‹ˆ๋‹ค. */
124
+ blur() {
125
+ this.input?.blur();
126
+ }
127
+ }
128
+ t([
129
+ c("input")
130
+ ], e.prototype, "input");
131
+ t([
132
+ p()
133
+ ], e.prototype, "showPassword");
134
+ t([
135
+ p()
136
+ ], e.prototype, "isInvalid");
137
+ t([
138
+ p()
139
+ ], e.prototype, "currentValidationMessage");
140
+ t([
141
+ s({ type: String, reflect: !0 })
142
+ ], e.prototype, "type");
143
+ t([
144
+ s({ type: Boolean, reflect: !0 })
145
+ ], e.prototype, "required");
146
+ t([
147
+ s({ type: Boolean, reflect: !0 })
148
+ ], e.prototype, "disabled");
149
+ t([
150
+ s({ type: Boolean, reflect: !0 })
151
+ ], e.prototype, "clearable");
152
+ t([
153
+ s({ type: Boolean, reflect: !0 })
154
+ ], e.prototype, "readonly");
155
+ t([
156
+ s({ type: String })
157
+ ], e.prototype, "name");
158
+ t([
159
+ s({ type: String })
160
+ ], e.prototype, "label");
161
+ t([
162
+ s({ type: String })
163
+ ], e.prototype, "labelhelp");
164
+ t([
165
+ s({ type: String })
166
+ ], e.prototype, "placeholder");
167
+ t([
168
+ s({ type: String })
169
+ ], e.prototype, "description");
170
+ t([
171
+ s({ type: Number })
172
+ ], e.prototype, "minlength");
173
+ t([
174
+ s({ type: Number })
175
+ ], e.prototype, "maxlength");
176
+ t([
177
+ s({ type: Boolean })
178
+ ], e.prototype, "spellcheck");
179
+ t([
180
+ s({ type: String })
181
+ ], e.prototype, "autocomplete");
182
+ t([
183
+ s({ type: String })
184
+ ], e.prototype, "value");
185
+ t([
186
+ s({ type: String })
187
+ ], e.prototype, "pattern");
188
+ t([
189
+ s({ type: String })
190
+ ], e.prototype, "validationMessage");
191
+ export {
192
+ e as Input
193
+ };
@@ -0,0 +1 @@
1
+ export declare const styles: import('lit').CSSResult;
@@ -0,0 +1,149 @@
1
+ import { css as o } from "lit";
2
+ const r = o`
3
+ :host {
4
+ display: inline-block;
5
+ font-size: inherit;
6
+ }
7
+ :host([disabled]) {
8
+ opacity: 0.5;
9
+ }
10
+
11
+ /* ํ—ค๋” ์˜์—ญ */
12
+ .header {
13
+ display: flex;
14
+ align-items: center;
15
+ gap: 0.375em;
16
+ margin-bottom: 0.5em;
17
+ }
18
+ .header .label {
19
+ font-size: 0.8em;
20
+ font-weight: 500;
21
+ line-height: 1;
22
+ color: var(--u-text-color);
23
+ user-select: none;
24
+ cursor: pointer;
25
+ }
26
+ .header .required-mark {
27
+ color: var(--u-red-600);
28
+ margin-left: 0.25em;
29
+ }
30
+ .header .help-icon {
31
+ font-size: 0.8em;
32
+ cursor: help;
33
+ }
34
+
35
+ /* ์ž…๋ ฅ ๋ž˜ํผ */
36
+ .container {
37
+ display: flex;
38
+ align-items: center;
39
+ gap: 0.5em;
40
+ padding: 0.5em 0.75em;
41
+ background-color: var(--u-bg-color);
42
+ border: 1px solid var(--u-input-border-color);
43
+ border-radius: 0.375em;
44
+ transition: border-color 0.2s ease, box-shadow 0.2s ease;
45
+ }
46
+ .container[invalid] {
47
+ border-color: var(--u-red-600);
48
+ }
49
+ .container[invalid]:focus-within {
50
+ box-shadow: 0 0 0 0.125em rgba(244, 67, 54, 0.1);
51
+ }
52
+ .container[disabled] {
53
+ background-color: var(--u-bg-color-disabled);
54
+ border-color: var(--u-border-color-weak);
55
+ cursor: not-allowed;
56
+ }
57
+ .container[readonly] {
58
+ background-color: var(--u-neutral-50);
59
+ border-color: var(--u-border-color-weak);
60
+ }
61
+ .container:hover:not(([disabled])):not(([readonly])) {
62
+ border-color: var(--u-input-border-hover);
63
+ }
64
+ .container:focus-within:not(([disabled])):not(([readonly])) {
65
+ border-color: var(--u-input-border-focus);
66
+ box-shadow: 0 0 0 0.125em rgba(33, 150, 243, 0.1);
67
+ outline: none;
68
+ }
69
+
70
+ /* ์ž…๋ ฅ ํ•„๋“œ */
71
+ input {
72
+ flex: 1;
73
+ min-width: 0;
74
+ border: none;
75
+ background: transparent;
76
+ outline: none;
77
+ font-family: inherit;
78
+ font-size: 1em;
79
+ line-height: 1.5;
80
+ color: var(--u-text-color);
81
+ padding: 0;
82
+ }
83
+ input::placeholder {
84
+ color: var(--u-text-color-disabled);
85
+ }
86
+ input:disabled {
87
+ cursor: not-allowed;
88
+ color: var(--u-text-color-disabled);
89
+ }
90
+ input:read-only {
91
+ cursor: default;
92
+ }
93
+
94
+ /* Prefix & Suffix ์Šฌ๋กฏ */
95
+ ::slotted([slot="prefix"]),
96
+ ::slotted([slot="suffix"]) {
97
+ display: contents;
98
+ }
99
+
100
+ /* Tools ์˜์—ญ (clear, password toggle ๋“ฑ) */
101
+ .tools {
102
+ display: flex;
103
+ flex-direction: row;
104
+ align-items: center;
105
+ gap: 0.375em;
106
+ }
107
+ .tool {
108
+ font-size: 1.125em;
109
+ color: var(--u-icon-color);
110
+ transition: color 0.2s ease;
111
+ cursor: pointer;
112
+ }
113
+ .tool:hover {
114
+ color: var(--u-icon-color-hover);
115
+ }
116
+ .tool:active {
117
+ color: var(--u-icon-color-active);
118
+ }
119
+
120
+ /* ์œ ํšจ์„ฑ ๊ฒ€์‚ฌ ์—๋Ÿฌ ๋ฉ”์‹œ์ง€ */
121
+ .validation-error {
122
+ margin-top: 0.375em;
123
+ font-size: 0.8125em;
124
+ color: var(--u-red-600);
125
+ line-height: 1.4;
126
+ }
127
+
128
+ /* ์„ค๋ช… ํ…์ŠคํŠธ */
129
+ .description {
130
+ margin-top: 0.375em;
131
+ font-size: 0.8125em;
132
+ color: var(--u-soft-text-color);
133
+ line-height: 1.4;
134
+ }
135
+
136
+ /* Number input ๊ธฐ๋ณธ ์Šคํƒ€์ผ ์ œ๊ฑฐ (๋ธŒ๋ผ์šฐ์ € ๊ฐ„ ์ผ๊ด€์„ฑ ์œ„ํ•ด) */
137
+ input[type="number"] {
138
+ -moz-appearance: textfield;
139
+ }
140
+ /* Number input ์Šคํ”ผ๋„ˆ ์ œ๊ฑฐ ์˜ต์…˜ (์„ ํƒ์ ) */
141
+ input[type="number"]::-webkit-inner-spin-button,
142
+ input[type="number"]::-webkit-outer-spin-button {
143
+ -webkit-appearance: none;
144
+ margin: 0;
145
+ }
146
+ `;
147
+ export {
148
+ r as styles
149
+ };
@@ -0,0 +1,7 @@
1
+ import { Input } from './Input.js';
2
+ declare global {
3
+ interface HTMLElementTagNameMap {
4
+ "u-input": Input;
5
+ }
6
+ }
7
+ export { Input };
@@ -0,0 +1,36 @@
1
+ import { PropertyValues } from 'lit';
2
+ import { BaseElement } from '../BaseElement.js';
3
+ /**
4
+ * Menu ์ปดํฌ๋„ŒํŠธ๋Š” ์ผ๋ฐ˜์ ์ธ ๋ฉ”๋‰ด ์ปจํ…Œ์ด๋„ˆ์ž…๋‹ˆ๋‹ค.
5
+ * MenuItem ์ปดํฌ๋„ŒํŠธ๋ฅผ ์ž์‹์œผ๋กœ ํฌํ•จํ•˜์—ฌ ๋ฉ”๋‰ด๋ฅผ ๊ตฌ์„ฑํ•ฉ๋‹ˆ๋‹ค.
6
+ */
7
+ export declare class Menu extends BaseElement {
8
+ static styles: import('lit').CSSResultGroup[];
9
+ static dependencies: Record<string, typeof BaseElement>;
10
+ /** ์Šฌ๋กฏ์— ํ• ๋‹น๋œ ๋ฉ”๋‰ด ํ•ญ๋ชฉ๋“ค์„ ๊ฐ€์ ธ์˜ต๋‹ˆ๋‹ค. */
11
+ private items;
12
+ /** ๋ฉ”๋‰ด๊ฐ€ ์—ด๋ ค์žˆ๋Š”์ง€ ์—ฌ๋ถ€์ž…๋‹ˆ๋‹ค. */
13
+ open: boolean;
14
+ /** ๋ฉ”๋‰ด ํ•ญ๋ชฉ ์ค‘ ํ•˜๋‚˜๋งŒ ์„ ํƒํ•  ์ˆ˜ ์žˆ๋Š”์ง€ ์—ฌ๋ถ€์ž…๋‹ˆ๋‹ค. */
15
+ selectable: boolean;
16
+ /** ํ˜„์žฌ ์„ ํƒ๋œ ๋ฉ”๋‰ด ํ•ญ๋ชฉ์˜ ๊ฐ’์ž…๋‹ˆ๋‹ค. */
17
+ value: string;
18
+ connectedCallback(): void;
19
+ disconnectedCallback(): void;
20
+ protected updated(changedProperties: PropertyValues): void;
21
+ render(): import('lit-html').TemplateResult<1>;
22
+ /** ๋ฉ”๋‰ด๋ฅผ ํ‘œ์‹œํ•ฉ๋‹ˆ๋‹ค. */
23
+ show: () => Promise<void>;
24
+ /** ๋ฉ”๋‰ด๋ฅผ ์ˆจ๊น๋‹ˆ๋‹ค. */
25
+ hide: () => Promise<void>;
26
+ /** open ์ƒํƒœ๊ฐ€ ๋ณ€๊ฒฝ๋  ๋•Œ ํ˜ธ์ถœ๋ฉ๋‹ˆ๋‹ค. */
27
+ private updateOpenState;
28
+ /** ์„ ํƒ ์ƒํƒœ๋ฅผ ์—…๋ฐ์ดํŠธํ•ฉ๋‹ˆ๋‹ค. */
29
+ private updateSelection;
30
+ /** ์Šฌ๋กฏ ๋ณ€๊ฒฝ ์ด๋ฒคํŠธ๋ฅผ ์ฒ˜๋ฆฌํ•ฉ๋‹ˆ๋‹ค. */
31
+ private handleSlotChange;
32
+ /** ๋ฉ”๋‰ด ํ•ญ๋ชฉ ์„ ํƒ ์ด๋ฒคํŠธ๋ฅผ ์ฒ˜๋ฆฌํ•ฉ๋‹ˆ๋‹ค. */
33
+ private handleSelect;
34
+ /** ํ‚ค๋ณด๋“œ ๋„ค๋น„๊ฒŒ์ด์…˜์„ ์ฒ˜๋ฆฌํ•ฉ๋‹ˆ๋‹ค. */
35
+ private handleKeydown;
36
+ }
@@ -0,0 +1,103 @@
1
+ import { html as c } from "lit";
2
+ import { queryAssignedElements as u, property as o } from "lit/decorators.js";
3
+ import { BaseElement as d } from "../BaseElement.js";
4
+ import { MenuItem as p } from "../menu-item/MenuItem.js";
5
+ import { styles as m } from "./Menu.styles.js";
6
+ var f = Object.defineProperty, i = (r, e, t, n) => {
7
+ for (var s = void 0, a = r.length - 1, h; a >= 0; a--)
8
+ (h = r[a]) && (s = h(e, t, s) || s);
9
+ return s && f(e, t, s), s;
10
+ };
11
+ class l extends d {
12
+ constructor() {
13
+ super(...arguments), this.open = !1, this.selectable = !1, this.value = "", this.show = async () => {
14
+ await this.updateComplete, requestAnimationFrame(() => {
15
+ this.open = !0;
16
+ });
17
+ }, this.hide = async () => {
18
+ await this.updateComplete, requestAnimationFrame(() => {
19
+ this.open = !1;
20
+ });
21
+ }, this.handleSlotChange = () => {
22
+ this.selectable && this.value && this.updateSelection();
23
+ }, this.handleSelect = (e) => {
24
+ const t = e, n = e.target;
25
+ this.selectable && n && (this.value = n.value || t.detail?.value || "", this.updateSelection());
26
+ }, this.handleKeydown = (e) => {
27
+ const t = this.items.filter((a) => !a.disabled);
28
+ if (t.length === 0) return;
29
+ const n = t.findIndex((a) => a === e.target);
30
+ let s = n;
31
+ switch (e.key) {
32
+ case "ArrowDown":
33
+ e.preventDefault(), s = (n + 1) % t.length, t[s].focus();
34
+ break;
35
+ case "ArrowUp":
36
+ e.preventDefault(), s = n - 1 < 0 ? t.length - 1 : n - 1, t[s].focus();
37
+ break;
38
+ case "Home":
39
+ e.preventDefault(), t[0].focus();
40
+ break;
41
+ case "End":
42
+ e.preventDefault(), t[t.length - 1].focus();
43
+ break;
44
+ case "Enter":
45
+ case " ":
46
+ e.preventDefault(), n >= 0 && t[n].click();
47
+ break;
48
+ case "Escape":
49
+ e.preventDefault(), this.hide();
50
+ break;
51
+ }
52
+ };
53
+ }
54
+ static {
55
+ this.styles = [super.styles, m];
56
+ }
57
+ static {
58
+ this.dependencies = {
59
+ "u-menu-item": p
60
+ };
61
+ }
62
+ connectedCallback() {
63
+ super.connectedCallback(), this.setAttribute("role", "menu"), this.addEventListener("u-select", this.handleSelect), this.addEventListener("keydown", this.handleKeydown);
64
+ }
65
+ disconnectedCallback() {
66
+ this.removeEventListener("u-select", this.handleSelect), this.removeEventListener("keydown", this.handleKeydown), super.disconnectedCallback();
67
+ }
68
+ updated(e) {
69
+ super.updated(e), e.has("value") && this.selectable && this.updateSelection(), e.has("open") && this.updateOpenState(this.open);
70
+ }
71
+ render() {
72
+ return c`
73
+ <div class="container">
74
+ <slot @slotchange=${this.handleSlotChange}></slot>
75
+ </div>
76
+ `;
77
+ }
78
+ /** open ์ƒํƒœ๊ฐ€ ๋ณ€๊ฒฝ๋  ๋•Œ ํ˜ธ์ถœ๋ฉ๋‹ˆ๋‹ค. */
79
+ updateOpenState(e) {
80
+ e ? this.emit("u-show") : this.emit("u-hide");
81
+ }
82
+ /** ์„ ํƒ ์ƒํƒœ๋ฅผ ์—…๋ฐ์ดํŠธํ•ฉ๋‹ˆ๋‹ค. */
83
+ updateSelection() {
84
+ this.items.forEach((e) => {
85
+ e.selected = e.value === this.value;
86
+ });
87
+ }
88
+ }
89
+ i([
90
+ u({ selector: "u-menu-item" })
91
+ ], l.prototype, "items");
92
+ i([
93
+ o({ type: Boolean, reflect: !0 })
94
+ ], l.prototype, "open");
95
+ i([
96
+ o({ type: Boolean })
97
+ ], l.prototype, "selectable");
98
+ i([
99
+ o({ type: String })
100
+ ], l.prototype, "value");
101
+ export {
102
+ l as Menu
103
+ };
@@ -0,0 +1 @@
1
+ export declare const styles: import('lit').CSSResult;
@@ -0,0 +1,33 @@
1
+ import { css as o } from "lit";
2
+ const t = o`
3
+ :host {
4
+ display: block;
5
+ width: max-content;
6
+ min-width: 180px;
7
+
8
+ opacity: 0;
9
+ transform: scale(0.95);
10
+ transform-origin: top left;
11
+ transition: opacity 0.2s ease, transform 0.2s ease;
12
+ pointer-events: none;
13
+ }
14
+ :host([open]) {
15
+ opacity: 1;
16
+ transform: scale(1);
17
+ pointer-events: auto;
18
+ }
19
+
20
+ .container {
21
+ display: flex;
22
+ flex-direction: column;
23
+ gap: 2px;
24
+ padding: 4px;
25
+ border: 1px solid var(--u-border-color, #ddd);
26
+ border-radius: 8px;
27
+ background-color: var(--u-bg-color, #fff);
28
+ overflow: auto;
29
+ }
30
+ `;
31
+ export {
32
+ t as styles
33
+ };