@iyulab/components 0.1.0 → 0.1.2

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 (81) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/assets/icons/arrow-clockwise.svg.js +3 -7
  3. package/dist/assets/icons/arrow-down.svg.js +3 -6
  4. package/dist/assets/icons/arrow-up.svg.js +3 -6
  5. package/dist/assets/icons/ban.svg.js +3 -6
  6. package/dist/assets/icons/bell-fill.svg.js +3 -6
  7. package/dist/assets/icons/check-circle-fill.svg.js +3 -6
  8. package/dist/assets/icons/check-lg.svg.js +3 -6
  9. package/dist/assets/icons/chevron-down.svg.js +3 -6
  10. package/dist/assets/icons/chevron-left.svg.js +3 -6
  11. package/dist/assets/icons/chevron-right.svg.js +3 -6
  12. package/dist/assets/icons/chevron-up.svg.js +3 -6
  13. package/dist/assets/icons/copy.svg.js +3 -6
  14. package/dist/assets/icons/dash-lg.svg.js +3 -6
  15. package/dist/assets/icons/exclamation-circle-fill.svg.js +3 -6
  16. package/dist/assets/icons/exclamation-triangle-fill.svg.js +3 -6
  17. package/dist/assets/icons/eye-slash.svg.js +3 -8
  18. package/dist/assets/icons/eye.svg.js +3 -7
  19. package/dist/assets/icons/info-circle-fill.svg.js +3 -6
  20. package/dist/assets/icons/layout-sidebar.svg.js +3 -6
  21. package/dist/assets/icons/lightbulb-fill.svg.js +3 -6
  22. package/dist/assets/icons/lightbulb-off.svg.js +3 -6
  23. package/dist/assets/icons/lightbulb.svg.js +3 -6
  24. package/dist/assets/icons/mic-fill.svg.js +3 -7
  25. package/dist/assets/icons/mic-mute-fill.svg.js +3 -7
  26. package/dist/assets/icons/paperclip.svg.js +3 -6
  27. package/dist/assets/icons/pencil-square.svg.js +3 -7
  28. package/dist/assets/icons/plus-lg.svg.js +3 -6
  29. package/dist/assets/icons/search.svg.js +3 -6
  30. package/dist/assets/icons/speedometer.svg.js +3 -7
  31. package/dist/assets/icons/x-lg.svg.js +3 -6
  32. package/dist/assets/styles/dark.css.js +3 -4
  33. package/dist/assets/styles/light.css.js +3 -4
  34. package/dist/components/BaseElement.js +32 -22
  35. package/dist/components/BaseElement.styles.js +5 -5
  36. package/dist/components/alert/Alert.js +79 -51
  37. package/dist/components/alert/Alert.styles.js +5 -5
  38. package/dist/components/button/Button.js +29 -23
  39. package/dist/components/button/Button.styles.js +5 -5
  40. package/dist/components/context-menu/ContextMenu.js +123 -72
  41. package/dist/components/context-menu/ContextMenu.styles.js +5 -5
  42. package/dist/components/dialog/Dialog.js +73 -40
  43. package/dist/components/dialog/Dialog.styles.js +5 -5
  44. package/dist/components/form/Form.js +51 -32
  45. package/dist/components/form/Form.styles.js +5 -5
  46. package/dist/components/icon/Icon.js +53 -36
  47. package/dist/components/icon/Icon.styles.js +5 -5
  48. package/dist/components/icon-button/IconButton.js +44 -36
  49. package/dist/components/icon-button/IconButton.styles.js +5 -5
  50. package/dist/components/input/Input.js +161 -112
  51. package/dist/components/input/Input.styles.js +5 -5
  52. package/dist/components/menu/Menu.js +108 -58
  53. package/dist/components/menu/Menu.styles.js +5 -5
  54. package/dist/components/menu-item/MenuItem.js +67 -37
  55. package/dist/components/menu-item/MenuItem.styles.js +5 -5
  56. package/dist/components/panel/Panel.js +11 -10
  57. package/dist/components/panel/Panel.styles.js +5 -5
  58. package/dist/components/progress-ring/ProgressRing.js +70 -45
  59. package/dist/components/progress-ring/ProgressRing.styles.js +5 -5
  60. package/dist/components/spinner/Spinner.js +9 -9
  61. package/dist/components/spinner/Spinner.styles.js +5 -5
  62. package/dist/components/split-panel/SplitPanel.js +127 -66
  63. package/dist/components/split-panel/SplitPanel.styles.js +5 -5
  64. package/dist/components/split-panel/Splitter.js +29 -23
  65. package/dist/components/split-panel/Splitter.styles.js +5 -5
  66. package/dist/components/tooltip/Tooltip.js +115 -74
  67. package/dist/components/tooltip/Tooltip.styles.js +5 -5
  68. package/dist/index.js +18 -40
  69. package/dist/internals/attribute-converters.js +10 -8
  70. package/dist/internals/icons.js +41 -66
  71. package/dist/internals/node-helpers.js +16 -17
  72. package/dist/utilities/BrowserStorage.d.ts +43 -0
  73. package/dist/utilities/BrowserStorage.js +87 -0
  74. package/dist/utilities/decorators.js +19 -14
  75. package/dist/utilities/index.d.ts +1 -1
  76. package/dist/utilities/notifier.js +62 -20
  77. package/dist/utilities/theme.d.ts +38 -26
  78. package/dist/utilities/theme.js +110 -85
  79. package/package.json +2 -2
  80. package/dist/utilities/storage.d.ts +0 -60
  81. package/dist/utilities/storage.js +0 -120
@@ -1,120 +0,0 @@
1
- class h {
2
- constructor(o) {
3
- if (typeof window > "u" && typeof document > "u")
4
- throw new Error("BrowserStorage can only be used in a browser environment.");
5
- this.mode = o.type, this.prefix = o.prefix ? String(o.prefix) + ":" : "", this.mode === "cookie" ? this.cookieOpts = o : this.cookieOpts = null;
6
- }
7
- /** 키에 prefix를 붙인 실제 저장 키 */
8
- buildKey(o) {
9
- return `${this.prefix}${o}`;
10
- }
11
- /**
12
- * 값 저장
13
- * @param key 키
14
- * @param value 문자열 값 (문자열이 아닌 값은 JSON.stringify 권장)
15
- */
16
- set(o, e) {
17
- const i = this.buildKey(o);
18
- if (this.mode === "localStorage")
19
- try {
20
- window.localStorage.setItem(i, e);
21
- } catch {
22
- }
23
- else {
24
- const t = this.cookieOpts, a = encodeURIComponent(e);
25
- let r = `${i}=${a}; path=${t?.path ?? "/"}; SameSite=${t?.sameSite ?? "Lax"}`;
26
- t?.domain && (r += `; domain=${t.domain}`), t?.secure && (r += "; Secure");
27
- let s = "";
28
- if (t?.expires || (s = ""), t?.expires instanceof Date && (s = t?.expires.toUTCString()), typeof t?.expires == "number")
29
- if (t?.expires > 1e12)
30
- s = new Date(t?.expires).toUTCString();
31
- else {
32
- const c = /* @__PURE__ */ new Date();
33
- c.setDate(c.getDate() + Math.floor(t?.expires)), s = c.toUTCString();
34
- }
35
- const n = new Date(String(t?.expires));
36
- isNaN(n.getTime()) || (s = n.toUTCString()), s && (r += `; expires=${s}`), document.cookie = r;
37
- }
38
- }
39
- /**
40
- * 값 조회
41
- * @param key 키
42
- * @returns 값 (없으면 null)
43
- */
44
- get(o) {
45
- const e = this.buildKey(o);
46
- if (this.mode === "localStorage")
47
- try {
48
- return window.localStorage.getItem(e);
49
- } catch {
50
- return null;
51
- }
52
- else if (this.mode === "cookie") {
53
- const i = new RegExp("(?:^|; )" + e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&") + "=([^;]*)"), t = document.cookie.match(i);
54
- if (!t) return null;
55
- try {
56
- return decodeURIComponent(t[1]);
57
- } catch {
58
- return t[1];
59
- }
60
- } else
61
- throw new Error(`Unsupported storage mode: ${this.mode}`);
62
- }
63
- /**
64
- * 키 제거
65
- */
66
- remove(o) {
67
- const e = this.buildKey(o);
68
- if (this.mode === "localStorage")
69
- try {
70
- window.localStorage.removeItem(e);
71
- } catch {
72
- }
73
- else
74
- document.cookie = `${e}=; path=${this.cookieOpts?.path ?? "/"}; expires=Thu, 01 Jan 1970 00:00:00 GMT; SameSite=${this.cookieOpts?.sameSite ?? "Lax"}`;
75
- }
76
- /**
77
- * 현재 prefix 기준으로 모든 항목 제거 (주의: localStorage 전체 삭제 아님)
78
- */
79
- clear() {
80
- if (this.mode === "localStorage")
81
- try {
82
- const o = [];
83
- for (let e = 0; e < localStorage.length; e++) {
84
- const i = localStorage.key(e);
85
- i && i.startsWith(this.prefix) && o.push(i);
86
- }
87
- for (const e of o) localStorage.removeItem(e);
88
- } catch {
89
- }
90
- else {
91
- const o = document.cookie ? document.cookie.split("; ") : [];
92
- for (const e of o) {
93
- const [i] = e.split("=");
94
- i && i.startsWith(this.prefix) && (document.cookie = `${i}=; path=${this.cookieOpts?.path ?? "/"}; expires=Thu, 01 Jan 1970 00:00:00 GMT; SameSite=${this.cookieOpts?.sameSite ?? "Lax"}`);
95
- }
96
- }
97
- }
98
- /**
99
- * 모든 키 목록 반환 (prefix 적용된 실제 키들에서 접두사 제거한 상태)
100
- */
101
- keys() {
102
- const o = [];
103
- if (this.mode === "localStorage")
104
- for (let e = 0; e < localStorage.length; e++) {
105
- const i = localStorage.key(e);
106
- i && i.startsWith(this.prefix) && o.push(i.slice(this.prefix.length));
107
- }
108
- else {
109
- const e = document.cookie ? document.cookie.split("; ") : [];
110
- for (const i of e) {
111
- const [t] = i.split("=");
112
- t && t.startsWith(this.prefix) && o.push(t.slice(this.prefix.length));
113
- }
114
- }
115
- return o;
116
- }
117
- }
118
- export {
119
- h as BrowserStorage
120
- };