@iyulab/components 0.1.11 → 0.2.1

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 (99) hide show
  1. package/CHANGELOG.md +113 -59
  2. package/LICENSE +20 -20
  3. package/README.md +283 -26
  4. package/dist/assets/icons/arrow-down.svg.js +1 -1
  5. package/dist/assets/icons/arrow-repeat.svg.js +3 -0
  6. package/dist/assets/icons/arrow-up.svg.js +1 -1
  7. package/dist/assets/icons/ban.svg.js +1 -1
  8. package/dist/assets/icons/bell-fill.svg.js +1 -1
  9. package/dist/assets/icons/box-arrow-up-right.svg.js +3 -0
  10. package/dist/assets/icons/check-circle-fill.svg.js +1 -1
  11. package/dist/assets/icons/check-lg.svg.js +1 -1
  12. package/dist/assets/icons/chevron-down.svg.js +1 -1
  13. package/dist/assets/icons/chevron-left.svg.js +1 -1
  14. package/dist/assets/icons/chevron-right.svg.js +1 -1
  15. package/dist/assets/icons/chevron-up.svg.js +1 -1
  16. package/dist/assets/icons/copy.svg.js +1 -1
  17. package/dist/assets/icons/dash-lg.svg.js +1 -1
  18. package/dist/assets/icons/exclamation-circle-fill.svg.js +1 -1
  19. package/dist/assets/icons/exclamation-triangle-fill.svg.js +1 -1
  20. package/dist/assets/icons/eye-slash.svg.js +1 -1
  21. package/dist/assets/icons/eye.svg.js +1 -1
  22. package/dist/assets/icons/file-earmark.svg.js +3 -0
  23. package/dist/assets/icons/flag.svg.js +3 -0
  24. package/dist/assets/icons/globe.svg.js +3 -0
  25. package/dist/assets/icons/hand-thumbs-down-fill.svg.js +3 -0
  26. package/dist/assets/icons/hand-thumbs-down.svg.js +3 -0
  27. package/dist/assets/icons/hand-thumbs-up-fill.svg.js +3 -0
  28. package/dist/assets/icons/hand-thumbs-up.svg.js +3 -0
  29. package/dist/assets/icons/info-circle-fill.svg.js +1 -1
  30. package/dist/assets/icons/layout-sidebar.svg.js +1 -1
  31. package/dist/assets/icons/lightbulb-fill.svg.js +1 -1
  32. package/dist/assets/icons/lightbulb-off.svg.js +1 -1
  33. package/dist/assets/icons/lightbulb.svg.js +1 -1
  34. package/dist/assets/icons/mic-fill.svg.js +1 -1
  35. package/dist/assets/icons/mic-mute-fill.svg.js +1 -1
  36. package/dist/assets/icons/paperclip.svg.js +1 -1
  37. package/dist/assets/icons/pencil-square.svg.js +1 -1
  38. package/dist/assets/icons/plus-lg.svg.js +1 -1
  39. package/dist/assets/icons/search.svg.js +1 -1
  40. package/dist/assets/icons/share.svg.js +3 -0
  41. package/dist/assets/icons/stop-circle.svg.js +3 -0
  42. package/dist/assets/icons/tools.svg.js +3 -0
  43. package/dist/assets/icons/x-lg.svg.js +1 -1
  44. package/dist/assets/styles/dark.css +129 -129
  45. package/dist/assets/styles/dark.css.js +1 -1
  46. package/dist/assets/styles/light.css +129 -129
  47. package/dist/assets/styles/light.css.js +1 -1
  48. package/dist/components/FloatingElement.d.ts +13 -5
  49. package/dist/components/FloatingElement.js +31 -14
  50. package/dist/components/button/UButton.component.d.ts +7 -0
  51. package/dist/components/button/UButton.component.js +20 -1
  52. package/dist/components/button/UButton.styles.js +51 -8
  53. package/dist/components/dialog/UDialog.component.d.ts +2 -0
  54. package/dist/components/dialog/UDialog.component.js +14 -9
  55. package/dist/components/drawer/UDrawer.component.d.ts +2 -0
  56. package/dist/components/drawer/UDrawer.component.js +14 -9
  57. package/dist/components/form/UForm.component.js +3 -3
  58. package/dist/components/icon/UIcon.component.d.ts +1 -4
  59. package/dist/components/icon/UIcon.component.js +2 -2
  60. package/dist/components/menu/UMenu.component.js +53 -41
  61. package/dist/components/menu-item/UMenuItem.component.d.ts +2 -2
  62. package/dist/components/menu-item/UMenuItem.component.js +1 -2
  63. package/dist/components/split-panel/USplitPanel.component.js +4 -4
  64. package/dist/components/tag/UTag.component.d.ts +23 -0
  65. package/dist/components/tag/UTag.component.js +72 -0
  66. package/dist/components/tag/UTag.d.ts +8 -0
  67. package/dist/components/tag/UTag.js +5 -0
  68. package/dist/components/tag/UTag.styles.js +83 -0
  69. package/dist/components/tooltip/UTooltip.component.d.ts +8 -0
  70. package/dist/components/tooltip/UTooltip.component.js +59 -17
  71. package/dist/components/tooltip/UTooltip.styles.js +15 -0
  72. package/dist/index.d.ts +4 -3
  73. package/dist/index.js +5 -4
  74. package/dist/react-components/UTag.d.ts +8 -0
  75. package/dist/react-components/UTag.js +10 -0
  76. package/dist/react-components/index.d.ts +1 -1
  77. package/dist/react-components/index.js +1 -1
  78. package/dist/utilities/{icons.d.ts → IconRegistry.d.ts} +20 -26
  79. package/dist/utilities/{icons.js → IconRegistry.js} +29 -20
  80. package/dist/utilities/{notifier.d.ts → Notifier.d.ts} +8 -13
  81. package/dist/utilities/{notifier.js → Notifier.js} +8 -10
  82. package/dist/utilities/{theme.d.ts → Theme.d.ts} +13 -18
  83. package/dist/utilities/{theme.js → Theme.js} +39 -35
  84. package/dist/{internals/attribute-converters.d.ts → utilities/converters.d.ts} +1 -1
  85. package/dist/{internals/attribute-converters.js → utilities/converters.js} +2 -2
  86. package/dist/{internals/node-helpers.js → utilities/elements.js} +6 -5
  87. package/package.json +60 -60
  88. package/dist/assets/icons/arrow-clockwise.svg.js +0 -3
  89. package/dist/assets/icons/speedometer.svg.js +0 -3
  90. package/dist/components/icon-button/UIconButton.component.d.ts +0 -20
  91. package/dist/components/icon-button/UIconButton.component.js +0 -59
  92. package/dist/components/icon-button/UIconButton.d.ts +0 -7
  93. package/dist/components/icon-button/UIconButton.js +0 -5
  94. package/dist/components/icon-button/UIconButton.styles.js +0 -54
  95. package/dist/internals/react-wrapper.d.ts +0 -21
  96. package/dist/react-components/UIconButton.d.ts +0 -8
  97. package/dist/react-components/UIconButton.js +0 -10
  98. /package/dist/components/{icon-button/UIconButton.styles.d.ts → tag/UTag.styles.d.ts} +0 -0
  99. /package/dist/{internals/node-helpers.d.ts → utilities/elements.d.ts} +0 -0
@@ -2,7 +2,7 @@ import * as dark from '../assets/styles/dark.css.js';
2
2
  import * as light from '../assets/styles/light.css.js';
3
3
  import { BrowserStorage } from './BrowserStorage.js';
4
4
 
5
- const styleBundle = Object.entries(/* #__PURE__ */ Object.assign({"../assets/styles/dark.css": dark,"../assets/styles/light.css": light
5
+ const styleSheetBundle = Object.entries(/* #__PURE__ */ Object.assign({"../assets/styles/dark.css": dark,"../assets/styles/light.css": light
6
6
 
7
7
 
8
8
  })).map(([path, module]) => {
@@ -10,36 +10,31 @@ const styleBundle = Object.entries(/* #__PURE__ */ Object.assign({"../assets/sty
10
10
  return [name, module.default];
11
11
  }).filter(([name]) => name !== "");
12
12
  class Theme {
13
- constructor() {
13
+ static {
14
14
  this.STORAGE_THEME_KEY = "theme";
15
+ }
16
+ static {
15
17
  this.storage = null;
18
+ }
19
+ static {
16
20
  this._isInitialized = false;
21
+ }
22
+ static {
17
23
  this._isDebugMode = false;
18
- /** 시스템 테마 변경을 처리하는 메서드 */
19
- this.handleSystemThemeChanged = (_) => {
20
- if (document.documentElement.getAttribute("data-theme") === "system") {
21
- const isDark = window.matchMedia("(prefers-color-scheme: dark)").matches;
22
- document.documentElement.setAttribute("theme", isDark ? "dark" : "light");
23
- this.log("system theme changed, applied", isDark ? "dark" : "light");
24
- }
25
- };
26
24
  }
27
- static get instance() {
28
- if (!this._instance) {
29
- this._instance = new Theme();
30
- }
31
- return this._instance;
25
+ /** 개별 인스턴스 생성을 방지합니다. */
26
+ constructor() {
32
27
  }
33
- get isInitialized() {
28
+ static get isInitialized() {
34
29
  return this._isInitialized;
35
30
  }
36
- get isDebugMode() {
31
+ static get isDebugMode() {
37
32
  return this._isDebugMode;
38
33
  }
39
34
  /**
40
35
  * 테마 유틸리티를 초기화합니다.
41
36
  */
42
- async init(options) {
37
+ static async init(options) {
43
38
  this._isDebugMode = options?.debug || false;
44
39
  this.log("init called", { options });
45
40
  if (options?.store) {
@@ -52,7 +47,7 @@ class Theme {
52
47
  const useBuiltIn = options?.useBuiltIn ?? true;
53
48
  if (useBuiltIn) {
54
49
  this.log("Import enabled: loading styles via internal assets");
55
- for (let [name, module] of styleBundle) {
50
+ for (let [name, module] of styleSheetBundle) {
56
51
  const style = document.createElement("style");
57
52
  style.setAttribute("data-name", name);
58
53
  style.textContent = module;
@@ -68,24 +63,24 @@ class Theme {
68
63
  styleHead.forEach((el) => el.remove());
69
64
  this.log("Import disabled: removed internal styles from head");
70
65
  }
71
- let theme2 = options?.default ?? "system";
66
+ let theme = options?.default ?? "system";
72
67
  if (this.storage !== null) {
73
68
  const savedTheme = await this.storage.get(this.STORAGE_THEME_KEY);
74
69
  if (savedTheme) {
75
- theme2 = savedTheme;
76
- this.log("loaded theme from storage", theme2);
70
+ theme = savedTheme;
71
+ this.log("loaded theme from storage", theme);
77
72
  } else {
78
- this.log("no saved theme in storage, using default", theme2);
73
+ this.log("no saved theme in storage, using default", theme);
79
74
  }
80
75
  }
81
- this.set(theme2);
76
+ this.set(theme);
82
77
  this._isInitialized = true;
83
78
  this.log("theme initialized");
84
79
  }
85
80
  /**
86
81
  * 현재 문서에 적용된 테마를 가져옵니다.
87
82
  */
88
- get() {
83
+ static get() {
89
84
  const attr = document.documentElement.getAttribute("data-theme");
90
85
  switch (attr) {
91
86
  case "system":
@@ -101,40 +96,49 @@ class Theme {
101
96
  /**
102
97
  * 현재 문서에 적용할 테마를 설정합니다.
103
98
  */
104
- set(theme2) {
99
+ static set(theme) {
105
100
  try {
106
101
  const media = window.matchMedia("(prefers-color-scheme: dark)");
107
- if (theme2 === "system") {
102
+ if (theme === "system") {
108
103
  document.documentElement.setAttribute("data-theme", "system");
109
104
  media.addEventListener("change", this.handleSystemThemeChanged);
110
105
  this.handleSystemThemeChanged();
111
106
  this.log("system theme applied (data-theme=system)");
112
- } else if (theme2 === "dark") {
107
+ } else if (theme === "dark") {
113
108
  media.removeEventListener("change", this.handleSystemThemeChanged);
114
109
  document.documentElement.setAttribute("data-theme", "dark");
115
110
  document.documentElement.setAttribute("theme", "dark");
116
111
  this.log("dark theme applied (data-theme=dark, theme=dark)");
117
- } else if (theme2 === "light") {
112
+ } else if (theme === "light") {
118
113
  media.removeEventListener("change", this.handleSystemThemeChanged);
119
114
  document.documentElement.setAttribute("data-theme", "light");
120
115
  document.documentElement.setAttribute("theme", "light");
121
116
  this.log("light theme applied (data-theme=light, theme=light)");
122
117
  } else {
123
- throw new Error(`Invalid theme: ${theme2}. Use 'light', 'dark', or 'system'.`);
118
+ throw new Error(`Invalid theme: ${theme}. Use 'light', 'dark', or 'system'.`);
124
119
  }
125
120
  } catch (e) {
126
121
  this.log("Error applying theme:", e);
127
122
  }
128
123
  if (this.storage !== null) {
129
- this.storage.set(this.STORAGE_THEME_KEY, theme2);
130
- this.log("saved theme to storage", theme2);
124
+ this.storage.set(this.STORAGE_THEME_KEY, theme);
125
+ this.log("saved theme to storage", theme);
131
126
  }
132
127
  }
128
+ static {
129
+ /** 시스템 테마 변경을 처리하는 메서드 */
130
+ this.handleSystemThemeChanged = (_) => {
131
+ if (document.documentElement.getAttribute("data-theme") === "system") {
132
+ const isDark = window.matchMedia("(prefers-color-scheme: dark)").matches;
133
+ document.documentElement.setAttribute("theme", isDark ? "dark" : "light");
134
+ this.log("system theme changed, applied", isDark ? "dark" : "light");
135
+ }
136
+ };
137
+ }
133
138
  /** 디버그 모드시 로그 출력 함수 (인스턴스 스코프) */
134
- log(...args) {
139
+ static log(...args) {
135
140
  if (this._isDebugMode) console.log("[theme]", ...args);
136
141
  }
137
142
  }
138
- const theme = Theme.instance;
139
143
 
140
- export { Theme, theme };
144
+ export { Theme };
@@ -6,7 +6,7 @@
6
6
  * @param separator - 구분자 문자열 (default: `,`)
7
7
  * @returns lit 속성 컨버터 객체
8
8
  */
9
- export declare function arrayAttributeConverter<T>(parser: (value: string) => T, separator?: string): {
9
+ export declare function arrayAttrConverter<T>(parser: (value: string) => T, separator?: string): {
10
10
  fromAttribute: (value: string | null) => T[] | undefined;
11
11
  toAttribute: (value: T[] | undefined) => string | null;
12
12
  };
@@ -1,4 +1,4 @@
1
- function arrayAttributeConverter(parser, separator = ",") {
1
+ function arrayAttrConverter(parser, separator = ",") {
2
2
  return {
3
3
  fromAttribute: (value) => {
4
4
  if (!value) return void 0;
@@ -11,4 +11,4 @@ function arrayAttributeConverter(parser, separator = ",") {
11
11
  };
12
12
  }
13
13
 
14
- export { arrayAttributeConverter };
14
+ export { arrayAttrConverter };
@@ -6,14 +6,15 @@ function getParentElement(element) {
6
6
  return root instanceof Document ? root.documentElement : root instanceof ShadowRoot ? root.host : root instanceof HTMLElement ? root : void 0;
7
7
  }
8
8
  }
9
- function querySelectorWithin(element, selectors) {
10
- if (!selectors) return null;
9
+ function querySelectorAllWithin(element, selectors) {
10
+ if (!selectors) return [];
11
11
  const rootNode = element.getRootNode({ composed: false });
12
12
  if (rootNode instanceof ShadowRoot || rootNode instanceof Document) {
13
- return rootNode.querySelector(selectors);
13
+ const nodeList = rootNode.querySelectorAll(selectors);
14
+ return Array.from(nodeList);
14
15
  } else {
15
- return null;
16
+ return [];
16
17
  }
17
18
  }
18
19
 
19
- export { getParentElement, querySelectorWithin };
20
+ export { getParentElement, querySelectorAllWithin };
package/package.json CHANGED
@@ -1,60 +1,60 @@
1
- {
2
- "name": "@iyulab/components",
3
- "description": "web-components library based on lit-element made by iyulab",
4
- "version": "0.1.11",
5
- "keywords": [
6
- "iyulab",
7
- "components",
8
- "web-components",
9
- "lit",
10
- "lit-element"
11
- ],
12
- "license": "MIT",
13
- "author": "iyulab",
14
- "repository": {
15
- "type": "git",
16
- "url": "https://github.com/iyulab/node-components.git"
17
- },
18
- "files": [
19
- "dist",
20
- "LICENSE",
21
- "README.md",
22
- "CHANGELOG.md",
23
- "package.json"
24
- ],
25
- "type": "module",
26
- "types": "./dist/index.d.ts",
27
- "exports": {
28
- ".": {
29
- "types": "./dist/index.d.ts",
30
- "import": "./dist/index.js"
31
- },
32
- "./dist/*": {
33
- "types": "./dist/*.d.ts",
34
- "import": "./dist/*"
35
- }
36
- },
37
- "scripts": {
38
- "start": "vite --force",
39
- "build": "eslint && vite build"
40
- },
41
- "dependencies": {
42
- "@floating-ui/dom": "^1.7.4",
43
- "lit": "^3.3.2",
44
- "react": "^19.2.3",
45
- "reflect-metadata": "^0.2.2"
46
- },
47
- "devDependencies": {
48
- "@lit/react": "^1.0.8",
49
- "@eslint/js": "^9.39.2",
50
- "@types/node": "^25.0.3",
51
- "eslint": "^9.39.2",
52
- "eslint-plugin-lit": "^2.1.1",
53
- "globals": "^16.5.0",
54
- "typescript": "^5.9.3",
55
- "typescript-eslint": "^8.50.1",
56
- "vite": "^7.3.0",
57
- "vite-plugin-dts": "^4.5.4",
58
- "vite-plugin-static-copy": "^3.1.4"
59
- }
60
- }
1
+ {
2
+ "name": "@iyulab/components",
3
+ "description": "web-components library based on lit-element made by iyulab",
4
+ "version": "0.2.1",
5
+ "keywords": [
6
+ "iyulab",
7
+ "components",
8
+ "web-components",
9
+ "lit",
10
+ "lit-element"
11
+ ],
12
+ "license": "MIT",
13
+ "author": "iyulab",
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "https://github.com/iyulab/node-components.git"
17
+ },
18
+ "files": [
19
+ "dist",
20
+ "LICENSE",
21
+ "README.md",
22
+ "CHANGELOG.md",
23
+ "package.json"
24
+ ],
25
+ "type": "module",
26
+ "types": "./dist/index.d.ts",
27
+ "exports": {
28
+ ".": {
29
+ "types": "./src/index.d.ts",
30
+ "import": "./src/index.js"
31
+ },
32
+ "./dist/*": {
33
+ "types": "./src/*.d.ts",
34
+ "import": "./src/*"
35
+ }
36
+ },
37
+ "scripts": {
38
+ "test": "vite --force",
39
+ "build": "eslint && vite build"
40
+ },
41
+ "dependencies": {
42
+ "@floating-ui/dom": "^1.7.4",
43
+ "@lit/react": "^1.0.8",
44
+ "lit": "^3.3.2",
45
+ "react": "^19.2.3",
46
+ "reflect-metadata": "^0.2.2"
47
+ },
48
+ "devDependencies": {
49
+ "@eslint/js": "^9.39.2",
50
+ "@types/node": "^25.0.9",
51
+ "eslint": "^9.39.2",
52
+ "eslint-plugin-lit": "^2.1.1",
53
+ "globals": "^17.0.0",
54
+ "typescript": "^5.9.3",
55
+ "typescript-eslint": "^8.53.1",
56
+ "vite": "^7.3.1",
57
+ "vite-plugin-dts": "^4.5.4",
58
+ "vite-plugin-static-copy": "^3.1.5"
59
+ }
60
+ }
@@ -1,3 +0,0 @@
1
- const arrowClockwise = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\">\n <path fill-rule=\"evenodd\" d=\"M8 3a5 5 0 1 0 4.546 2.914.5.5 0 0 1 .908-.417A6 6 0 1 1 8 2z\"/>\n <path d=\"M8 4.466V.534a.25.25 0 0 1 .41-.192l2.36 1.966c.12.1.12.284 0 .384L8.41 4.658A.25.25 0 0 1 8 4.466\"/>\n</svg>";
2
-
3
- export { arrowClockwise as default };
@@ -1,3 +0,0 @@
1
- const speedometer = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\">\n <path d=\"M8 2a.5.5 0 0 1 .5.5V4a.5.5 0 0 1-1 0V2.5A.5.5 0 0 1 8 2M3.732 3.732a.5.5 0 0 1 .707 0l.915.914a.5.5 0 1 1-.708.708l-.914-.915a.5.5 0 0 1 0-.707M2 8a.5.5 0 0 1 .5-.5h1.586a.5.5 0 0 1 0 1H2.5A.5.5 0 0 1 2 8m9.5 0a.5.5 0 0 1 .5-.5h1.5a.5.5 0 0 1 0 1H12a.5.5 0 0 1-.5-.5m.754-4.246a.39.39 0 0 0-.527-.02L7.547 7.31A.91.91 0 1 0 8.85 8.569l3.434-4.297a.39.39 0 0 0-.029-.518z\"/>\n <path fill-rule=\"evenodd\" d=\"M6.664 15.889A8 8 0 1 1 9.336.11a8 8 0 0 1-2.672 15.78zm-4.665-4.283A11.95 11.95 0 0 1 8 10c2.186 0 4.236.585 6.001 1.606a7 7 0 1 0-12.002 0\"/>\n</svg>";
2
-
3
- export { speedometer as default };
@@ -1,20 +0,0 @@
1
- import { BaseElement } from '../BaseElement.js';
2
- import { IconLibrary } from '../icon/UIcon.component.js';
3
- /**
4
- * IconButton 컴포넌트는 아이콘만 표시하는 버튼입니다.
5
- */
6
- export declare class UIconButton extends BaseElement {
7
- static styles: import('lit').CSSResultGroup[];
8
- static dependencies: Record<string, typeof BaseElement>;
9
- /** 경계선이 없는 스타일을 적용합니다. */
10
- borderless: boolean;
11
- /** 버튼이 비활성화 상태인지 여부를 설정합니다. 비활성화된 버튼은 클릭할 수 없습니다. */
12
- disabled: boolean;
13
- /** 버튼이 로딩 상태인지 여부를 설정합니다. 로딩 중에는 버튼이 비활성화되고 스피너가 표시됩니다. */
14
- loading: boolean;
15
- /** 아이콘 라이브러리를 지정합니다. */
16
- lib: IconLibrary;
17
- /** 아이콘의 이름을 지정합니다. */
18
- name?: string;
19
- render(): import('lit-html').TemplateResult<1>;
20
- }
@@ -1,59 +0,0 @@
1
- import { html } from 'lit';
2
- import { property } from 'lit/decorators.js';
3
- import { BaseElement } from '../BaseElement.js';
4
- import { USpinner } from '../spinner/USpinner.component.js';
5
- import { UIcon } from '../icon/UIcon.component.js';
6
- import { styles } from './UIconButton.styles.js';
7
-
8
- var __defProp = Object.defineProperty;
9
- var __decorateClass = (decorators, target, key, kind) => {
10
- var result = void 0 ;
11
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
12
- if (decorator = decorators[i])
13
- result = (decorator(target, key, result) ) || result;
14
- if (result) __defProp(target, key, result);
15
- return result;
16
- };
17
- class UIconButton extends BaseElement {
18
- constructor() {
19
- super(...arguments);
20
- this.borderless = false;
21
- this.disabled = false;
22
- this.loading = false;
23
- this.lib = "default";
24
- }
25
- static {
26
- this.styles = [super.styles, styles];
27
- }
28
- static {
29
- this.dependencies = {
30
- "u-spinner": USpinner,
31
- "u-icon": UIcon
32
- };
33
- }
34
- render() {
35
- return html`
36
- <button part="base"
37
- ?disabled=${this.disabled || this.loading}>
38
- ${this.loading ? html`<u-spinner></u-spinner>` : html`<u-icon .lib=${this.lib} .name=${this.name}></u-icon>`}
39
- </button>
40
- `;
41
- }
42
- }
43
- __decorateClass([
44
- property({ type: Boolean, reflect: true })
45
- ], UIconButton.prototype, "borderless");
46
- __decorateClass([
47
- property({ type: Boolean, reflect: true })
48
- ], UIconButton.prototype, "disabled");
49
- __decorateClass([
50
- property({ type: Boolean, reflect: true })
51
- ], UIconButton.prototype, "loading");
52
- __decorateClass([
53
- property({ type: String })
54
- ], UIconButton.prototype, "lib");
55
- __decorateClass([
56
- property({ type: String })
57
- ], UIconButton.prototype, "name");
58
-
59
- export { UIconButton };
@@ -1,7 +0,0 @@
1
- import { UIconButton } from './UIconButton.component.js';
2
- declare global {
3
- interface HTMLElementTagNameMap {
4
- "u-icon-button": UIconButton;
5
- }
6
- }
7
- export { UIconButton };
@@ -1,5 +0,0 @@
1
- import { UIconButton } from './UIconButton.component.js';
2
-
3
- UIconButton.define("u-icon-button");
4
-
5
- export { UIconButton };
@@ -1,54 +0,0 @@
1
- import { css } from 'lit';
2
-
3
- const styles = css`
4
- :host {
5
- position: relative;
6
- display: inline-flex;
7
-
8
- font-size: 16px;
9
- padding: 0.5em;
10
- color: var(--u-icon-color);
11
- border: 1px solid var(--u-border-color);
12
- border-radius: 6px;
13
- background-color: var(--u-bg-color);
14
-
15
- transition: all 0.2s ease;
16
- user-select: none;
17
- cursor: pointer;
18
- }
19
- :host(:hover) {
20
- color: var(--u-icon-color-hover);
21
- background-color: var(--u-bg-color-hover);
22
- }
23
- :host(:active) {
24
- color: var(--u-icon-color-active);
25
- background-color: var(--u-bg-color-active);
26
- transform: translateY(1px);
27
- }
28
- :host([borderless]) {
29
- border: none;
30
- background-color: transparent;
31
- }
32
- :host([loading]),
33
- :host([disabled]) {
34
- color: var(--u-icon-color-disabled);
35
- pointer-events: none;
36
- }
37
-
38
- button {
39
- all: unset;
40
- display: inline-flex;
41
- }
42
- button:focus-visible {
43
- outline: 2px solid var(--u-blue-500, #3b82f6);
44
- outline-offset: 2px;
45
- }
46
-
47
- u-spinner,
48
- u-icon {
49
- color: inherit;
50
- font-size: inherit;
51
- }
52
- `;
53
-
54
- export { styles };
@@ -1,21 +0,0 @@
1
- type Constructor<T> = {
2
- new (): T;
3
- };
4
- type EventName<T extends Event = Event> = string & {
5
- __eventType: T;
6
- };
7
- type EventNames = Record<string, EventName | string>;
8
- interface Options<I extends HTMLElement, E extends EventNames = {}> {
9
- tagName: string;
10
- elementClass: Constructor<I>;
11
- events?: E;
12
- shadow?: 'open' | 'closed';
13
- properties?: Record<string, unknown>;
14
- }
15
- /**
16
- * Converts a Lit Element to a React Component.
17
- * @param option - The options for the conversion.
18
- * @returns The converted React Component.
19
- */
20
- export declare function convertReact<I extends HTMLElement, E extends EventNames = {}>(option: Options<I, E>): import('@lit/react').ReactWebComponent<I, E>;
21
- export {};
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- import { UIconButton } from '../components/icon-button/UIconButton';
3
-
4
- export declare const UIconButton: React.ForwardRefExoticComponent<
5
- Partial<UIconButton> & React.HTMLAttributes<UIconButton>
6
- >;
7
-
8
- export type UIconButtonProps = React.ComponentProps<typeof UIconButton>;
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- import { createComponent } from '@lit/react';
3
- import { UIconButton } from '../components/icon-button/UIconButton';
4
-
5
- export const UIconButton = createComponent({
6
- react: React,
7
- tagName: 'u-icon-button',
8
- elementClass: UIconButton,
9
- events: {}
10
- });