@iyulab/modern-app 0.2.5 → 0.3.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 (36) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/README.md +18 -0
  3. package/dist/App.d.ts +9 -6
  4. package/dist/App.js +30 -28
  5. package/dist/components/SidebarButton.d.ts +4 -5
  6. package/dist/components/SidebarButton.js +12 -14
  7. package/dist/components/SidebarButton.styles.js +15 -18
  8. package/dist/components/SidebarGroup.d.ts +7 -6
  9. package/dist/components/SidebarGroup.js +45 -46
  10. package/dist/components/SidebarGroup.styles.js +39 -44
  11. package/dist/components/SidebarLink.d.ts +5 -10
  12. package/dist/components/SidebarLink.js +29 -39
  13. package/dist/components/SidebarLink.styles.js +9 -9
  14. package/dist/components/SidebarSection.d.ts +6 -7
  15. package/dist/components/SidebarSection.js +18 -22
  16. package/dist/components/SidebarSection.styles.js +9 -14
  17. package/dist/index.d.ts +2 -3
  18. package/dist/internals/ScreenObserver.d.ts +43 -0
  19. package/dist/internals/ScreenObserver.js +37 -0
  20. package/dist/internals/StyledElement.d.ts +24 -0
  21. package/dist/internals/{ExtendedBaseElement.js → StyledElement.js} +13 -14
  22. package/dist/layouts/SidebarLayout.d.ts +29 -21
  23. package/dist/layouts/SidebarLayout.js +143 -111
  24. package/dist/layouts/SidebarLayout.styles.js +82 -42
  25. package/dist/layouts/SidebarLayout.types.d.ts +14 -12
  26. package/dist/types/AppConfigs.d.ts +12 -7
  27. package/dist/types/AppOptions.d.ts +1 -1
  28. package/package.json +9 -11
  29. package/dist/components/SidebarLogo.d.ts +0 -33
  30. package/dist/components/SidebarLogo.js +0 -60
  31. package/dist/components/SidebarLogo.styles.d.ts +0 -1
  32. package/dist/components/SidebarLogo.styles.js +0 -57
  33. package/dist/internals/ExtendedBaseElement.d.ts +0 -22
  34. package/dist/internals/observables.d.ts +0 -7
  35. package/dist/internals/observables.js +0 -5
  36. package/dist/types/AppTypes.d.ts +0 -4
package/package.json CHANGED
@@ -1,11 +1,10 @@
1
1
  {
2
2
  "name": "@iyulab/modern-app",
3
- "description": "web-framework by iyulab based on react, lit-element",
4
- "version": "0.2.5",
3
+ "description": "web-framework by iyulab based on lit-element",
4
+ "version": "0.3.1",
5
5
  "keywords": [
6
6
  "iyulab",
7
7
  "web-framework",
8
- "react",
9
8
  "lit-element"
10
9
  ],
11
10
  "license": "MIT",
@@ -34,20 +33,19 @@
34
33
  }
35
34
  },
36
35
  "scripts": {
37
- "start": "vite",
36
+ "test": "vite",
38
37
  "build": "vite build"
39
38
  },
40
39
  "dependencies": {
41
- "@iyulab/components": "^0.1.11",
42
- "@iyulab/router": "^0.5.3",
43
- "lit": "^3.3.2",
44
- "mobx": "^6.15.0",
45
- "i18next": "^25.7.3"
40
+ "@iyulab/components": "^0.4.0",
41
+ "@iyulab/router": "^0.7.4",
42
+ "i18next": "^25.8.13",
43
+ "lit": "^3.3.2"
46
44
  },
47
45
  "devDependencies": {
48
- "@types/node": "^25.0.3",
46
+ "@types/node": "^25.3.2",
49
47
  "typescript": "^5.9.3",
50
- "vite": "^7.3.0",
48
+ "vite": "^7.3.1",
51
49
  "vite-plugin-dts": "^4.5.4"
52
50
  }
53
51
  }
@@ -1,33 +0,0 @@
1
- import { DirectiveResult } from 'lit/directive.js';
2
- import { BaseElement } from '@iyulab/components/dist/components/BaseElement.js';
3
- import { ExtendedBaseElement } from '../internals/ExtendedBaseElement.js';
4
- import { StyleMap } from '../types/AppTypes.js';
5
- type ElementParts = 'host' | 'container' | 'image' | 'icon' | 'label';
6
- /** 로고 설정 */
7
- export interface SidebarLogoConfig {
8
- type: 'image' | 'icon';
9
- image?: string;
10
- icon?: string;
11
- label?: string | DirectiveResult;
12
- styles?: StyleMap<ElementParts>;
13
- onClick?: (e: MouseEvent) => void;
14
- }
15
- /**
16
- * SidebarLogo 컴포넌트는 사이드바에 표시되는 로고를 나타냅니다.
17
- */
18
- export declare class SidebarLogo extends ExtendedBaseElement<ElementParts> {
19
- static styles: import('lit').CSSResultGroup[];
20
- static dependencies: Record<string, typeof BaseElement>;
21
- /** 콤팩트 모드 여부 */
22
- compact: boolean;
23
- /** 로고 타입 */
24
- type: 'image' | 'icon';
25
- /** 로고 이미지 URL */
26
- image?: string;
27
- /** 로고 아이콘 svg 이름 */
28
- icon?: string;
29
- /** 로고 아이콘 텍스트 */
30
- label?: string | DirectiveResult;
31
- render(): import('lit-html').TemplateResult<1>;
32
- }
33
- export {};
@@ -1,60 +0,0 @@
1
- import { nothing as m, html as s } from "lit";
2
- import { property as e } from "lit/decorators.js";
3
- import { UIcon as l } from "@iyulab/components/dist/components/icon/UIcon.component.js";
4
- import { ExtendedBaseElement as h } from "../internals/ExtendedBaseElement.js";
5
- import { styles as y } from "./SidebarLogo.styles.js";
6
- var d = Object.defineProperty, i = (r, n, a, g) => {
7
- for (var t = void 0, p = r.length - 1, c; p >= 0; p--)
8
- (c = r[p]) && (t = c(n, a, t) || t);
9
- return t && d(n, a, t), t;
10
- };
11
- class o extends h {
12
- constructor() {
13
- super(...arguments), this.compact = !1, this.type = "icon";
14
- }
15
- static {
16
- this.styles = [super.styles, y];
17
- }
18
- static {
19
- this.dependencies = {
20
- "u-icon": l
21
- };
22
- }
23
- render() {
24
- return s`
25
- <div class="container" part="container">
26
- ${this.type === "image" && this.image ? s`
27
- <img part="image"
28
- ?compact=${this.compact}
29
- src=${this.image}
30
- alt="App Logo"
31
- />` : this.type === "icon" && this.icon ? s`
32
- <u-icon part="icon"
33
- .name=${this.icon}
34
- ></u-icon>` : m}
35
- <span part="label"
36
- ?hidden=${this.compact || !this.label}>
37
- ${this.label}
38
- </span>
39
- </div>
40
- `;
41
- }
42
- }
43
- i([
44
- e({ type: Boolean })
45
- ], o.prototype, "compact");
46
- i([
47
- e({ type: String })
48
- ], o.prototype, "type");
49
- i([
50
- e({ type: String })
51
- ], o.prototype, "image");
52
- i([
53
- e({ type: String })
54
- ], o.prototype, "icon");
55
- i([
56
- e({ type: String })
57
- ], o.prototype, "label");
58
- export {
59
- o as SidebarLogo
60
- };
@@ -1 +0,0 @@
1
- export declare const styles: import('lit').CSSResult;
@@ -1,57 +0,0 @@
1
- import { css as o } from "lit";
2
- const e = o`
3
- :host {
4
- display: block;
5
- min-width: 0;
6
- font-size: 32px;
7
- color: var(--u-txt-color);
8
- user-select: none;
9
- cursor: pointer;
10
- transition: all 0.2s ease;
11
- }
12
- :host(:hover) {
13
- color: var(--u-txt-color-hover);
14
- }
15
- :host(:active) {
16
- color: var(--u-txt-color-active);
17
- }
18
-
19
- .container {
20
- display: flex;
21
- flex-direction: row;
22
- align-items: center;
23
- justify-content: flex-start;
24
- overflow: hidden;
25
- gap: 8px;
26
- }
27
-
28
- img {
29
- width: auto;
30
- height: 1em;
31
- object-fit: contain;
32
- flex-shrink: 0;
33
- }
34
- img[compact] {
35
- width: 1em;
36
- height: auto;
37
- }
38
-
39
- u-icon {
40
- font-size: 1em;
41
- color: inherit;
42
- flex-shrink: 0;
43
- }
44
-
45
- span {
46
- font-size: 0.75em;
47
- font-weight: 600;
48
- line-height: inherit;
49
- color: inherit;
50
- overflow: hidden;
51
- white-space: nowrap;
52
- text-overflow: ellipsis;
53
- }
54
- `;
55
- export {
56
- e as styles
57
- };
@@ -1,22 +0,0 @@
1
- import { PropertyValues } from 'lit';
2
- import { BaseElement } from '@iyulab/components/dist/components/BaseElement.js';
3
- import { StyleMap } from '../types/AppTypes';
4
- /**
5
- * ExtendedBaseElement - BaseElement를 확장한 클래스
6
- * - 부분별 스타일링 지원
7
- */
8
- export declare class ExtendedBaseElement<T extends string> extends BaseElement {
9
- static styles: import('lit').CSSResultGroup;
10
- static dependencies: Record<string, typeof BaseElement>;
11
- /** 부분별 스타일 구성 */
12
- styles?: StyleMap<T>;
13
- protected updated(changedProperties: PropertyValues): void;
14
- /**
15
- * 현재 스타일 구성을 각 파트에 적용, host 포함
16
- */
17
- private applyToParts;
18
- /**
19
- * 스타일 객체를 개별 프로퍼티 단위로 적용 (camelCase / kebab-case / custom props 처리)
20
- */
21
- private assignToObject;
22
- }
@@ -1,7 +0,0 @@
1
- import { IObservableValue } from 'mobx';
2
- /** 화면 크기 타입 */
3
- export type ScreenSize = 'small' | 'medium' | 'large';
4
- /**
5
- * 현재 화면 크기 상태
6
- */
7
- export declare const screen: IObservableValue<ScreenSize>;
@@ -1,5 +0,0 @@
1
- import { observable as e } from "mobx";
2
- const r = e.box("large");
3
- export {
4
- r as screen
5
- };
@@ -1,4 +0,0 @@
1
- /** 스타일 값 타입 */
2
- export type StyleValue = Record<string, string> | Partial<CSSStyleDeclaration>;
3
- /** 스타일 맵 타입 */
4
- export type StyleMap<T extends string> = Partial<Record<T, StyleValue>>;