@vmscloud/moz-ui-components-core 0.1.50 → 0.1.52
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/dist/components/callout/callout.core.d.ts +57 -0
- package/dist/components/callout/icons.d.ts +25 -0
- package/dist/components/callout/index.d.ts +6 -0
- package/dist/index.cjs +361 -260
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1770 -1610
- package/dist/index.js.map +1 -1
- package/dist/locale/types.d.ts +4 -0
- package/dist/styles/default/callout.css +175 -0
- package/dist/styles/default/index.css +103 -0
- package/package.json +1 -1
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Callout 코어 — 문서 흐름 안의 안내·경고 블록 (ITSM-2026-002670).
|
|
3
|
+
*
|
|
4
|
+
* Toast 는 떠 있는 알림이고 EmptyState 는 빈 상태다. 이건 **본문 안에 놓여 계속 보이는 안내**로,
|
|
5
|
+
* 소비 앱(v-project)의 `Alert`(93파일)·`InfoBox`(13파일)가 각자 그리던 블록을 대신한다.
|
|
6
|
+
*
|
|
7
|
+
* 구조: `<div class="moz-callout" data-tone>` 안에 아이콘·본문·(선택) 닫기 버튼.
|
|
8
|
+
* - 아이콘은 tone 별 내장 20px SVG. `icon` slot 을 주면 그것을, `hideIcon` 이면 영역 자체를 뺀다.
|
|
9
|
+
* - 본문은 `.moz-callout-body` 안에 선택적 `.moz-callout-title`(`title` prop 또는 **`heading` slot** —
|
|
10
|
+
* slot 우선. slot 이름을 `title` 로 두지 않는 이유는 아래 `title` prop 주석 참고)과 default slot
|
|
11
|
+
* (없으면 `text` prop).
|
|
12
|
+
* - `dismissible` 이면 `.moz-callout-close` 버튼이 붙고 클릭이 `dismiss` 를 emit 한다. 접근명은
|
|
13
|
+
* 로케일 `Callout.dismiss`(소비자가 `dismissLabel` 로 덮을 수 있다).
|
|
14
|
+
*
|
|
15
|
+
* **role 은 기본이 없다.** 문서 흐름 안내에 `role="alert"` 를 상시로 주면 스크린리더가 페이지를
|
|
16
|
+
* 열 때마다 읽는다. 상태 변화로 나타나는 안내만 `live` 를 켜고, 그때 tone 에 따라 alert/status 로
|
|
17
|
+
* 갈린다(Toast 의 error→alert/assertive, 그 밖 status/polite 규칙과 같다).
|
|
18
|
+
*/
|
|
19
|
+
export declare const CALLOUT_TONES: readonly ["info", "success", "warning", "danger", "neutral", "accent"];
|
|
20
|
+
export type CalloutTone = (typeof CALLOUT_TONES)[number];
|
|
21
|
+
export interface CalloutProps {
|
|
22
|
+
/** 색 의미. 어휘 밖·미지정은 `info` */
|
|
23
|
+
tone?: CalloutTone;
|
|
24
|
+
/**
|
|
25
|
+
* 제목 텍스트. 요소가 필요하면 `heading` slot 을 쓴다(그쪽이 이긴다).
|
|
26
|
+
*
|
|
27
|
+
* slot 이름을 `title` 로 두지 않는 이유: React 브릿지는 정적 slot 이름을 **같은 이름의 prop** 으로
|
|
28
|
+
* 읽어(`createMozComponent`) prop 과 slot 이 한 이름을 다툰다. Toast 가 `message` prop + `heading`
|
|
29
|
+
* slot 으로 이름을 나눈 것과 같은 규칙이다(ITSM-2026-002321 선례).
|
|
30
|
+
*/
|
|
31
|
+
title?: string;
|
|
32
|
+
/** default slot 이 없을 때 그릴 본문 텍스트 */
|
|
33
|
+
text?: string;
|
|
34
|
+
/** 닫기 버튼을 붙인다 (클릭 → `dismiss`) */
|
|
35
|
+
dismissible?: boolean;
|
|
36
|
+
/** 닫기 버튼의 접근 이름. 없거나 빈 문자열이면 로케일 `Callout.dismiss` */
|
|
37
|
+
dismissLabel?: string;
|
|
38
|
+
/** 아이콘 영역을 그리지 않는다 */
|
|
39
|
+
hideIcon?: boolean;
|
|
40
|
+
/** 밀도 축소 (패딩 16 → 12px) */
|
|
41
|
+
compact?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* 상태 변화로 나타나는 안내 — 보조기술에 알린다.
|
|
44
|
+
*
|
|
45
|
+
* 기본(false)은 role 없음. true 면 tone danger|warning 은 `role="alert"`·`aria-live="assertive"`,
|
|
46
|
+
* 그 밖은 `role="status"`·`aria-live="polite"` 이고 둘 다 `aria-atomic="true"`.
|
|
47
|
+
*/
|
|
48
|
+
live?: boolean;
|
|
49
|
+
class?: unknown;
|
|
50
|
+
style?: unknown;
|
|
51
|
+
[attr: string]: unknown;
|
|
52
|
+
}
|
|
53
|
+
export interface CalloutEmits {
|
|
54
|
+
/** 닫기 버튼 클릭 */
|
|
55
|
+
dismiss: [MouseEvent];
|
|
56
|
+
}
|
|
57
|
+
export declare const createCallout: import('../..').CoreFactory<CalloutProps, CalloutEmits, void>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { TemplateResult } from 'lit-html';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Callout 아이콘 — 안내 블록용 20px 세트 (ITSM-2026-002670).
|
|
5
|
+
*
|
|
6
|
+
* Toast 아이콘(30px·흰색 채움 전제)은 떠 있는 카드용이라 문서 흐름 안 안내 블록에 맞지 않는다.
|
|
7
|
+
* 여기서는 `currentColor` 만 쓴다 — 색은 `.moz-callout-icon` 이 tone 으로 정한다.
|
|
8
|
+
*
|
|
9
|
+
* ⚠️ 아이콘마다 `<svg>` 전체를 **한 템플릿 안에** 쓴다(저장소의 다른 icons.ts 와 같은 형태).
|
|
10
|
+
* 공통 래퍼를 만들어 `html`<path …/>`` 조각을 넘기면 그 조각이 HTML 로 파싱돼 이름만 `path` 인
|
|
11
|
+
* XHTML 요소가 되고, 요소·`d`·색은 정상인데 geometry 가 0×0 이라 화면에 아무것도 안 그려진다
|
|
12
|
+
* (ITSM-2026-002688 실측). 계약 테스트 `components/svgTemplateNamespace.test.ts` 가 이 형태를 막는다.
|
|
13
|
+
*/
|
|
14
|
+
/** ⓘ 정보 */
|
|
15
|
+
export declare const iconCalloutInfo: () => TemplateResult;
|
|
16
|
+
/** ✓ 성공 */
|
|
17
|
+
export declare const iconCalloutSuccess: () => TemplateResult;
|
|
18
|
+
/** △ 경고 */
|
|
19
|
+
export declare const iconCalloutWarning: () => TemplateResult;
|
|
20
|
+
/** ✕ 위험 */
|
|
21
|
+
export declare const iconCalloutDanger: () => TemplateResult;
|
|
22
|
+
/** • 중립 */
|
|
23
|
+
export declare const iconCalloutNeutral: () => TemplateResult;
|
|
24
|
+
/** 닫기 — 룩은 소비자 클래스가 정하므로 currentColor 만 쓴다(Toast 와 같은 형태). */
|
|
25
|
+
export declare const iconCalloutClose: () => TemplateResult;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { MozSpec } from '../../runtime/types';
|
|
2
|
+
import { CalloutProps, CalloutEmits } from './callout.core';
|
|
3
|
+
|
|
4
|
+
export { createCallout, CALLOUT_TONES } from './callout.core';
|
|
5
|
+
export type { CalloutProps, CalloutEmits, CalloutTone } from './callout.core';
|
|
6
|
+
export declare const CALLOUT_SPEC: MozSpec<CalloutProps, CalloutEmits, void>;
|