@vmscloud/moz-ui-components-core 0.1.48 → 0.1.50
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/chip/chip.core.d.ts +57 -0
- package/dist/components/chip/index.d.ts +6 -0
- package/dist/index.cjs +399 -372
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1285 -1186
- package/dist/index.js.map +1 -1
- package/dist/locale/types.d.ts +4 -0
- package/dist/styles/default/chip.css +224 -0
- package/dist/styles/default/index.css +152 -0
- package/package.json +1 -1
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Chip 코어 — 필터 토글 칩과 제거 가능 칩 (ITSM-2026-002636).
|
|
3
|
+
*
|
|
4
|
+
* 소비 앱(v-project)의 조회 조건 패널이 쓰는 두 역할을 한 컴포넌트로 받는다.
|
|
5
|
+
*
|
|
6
|
+
* - **토글 칩**(기본): `<button type="button" class="moz-chip" aria-pressed>`. 선택 여부는 소비자가
|
|
7
|
+
* `selected` 로 제어하고 코어는 `click` 만 emit 한다 — 필터 상태는 항상 소비자 store 가 쥐므로
|
|
8
|
+
* 내부 상태·model 을 두지 않는다. 키보드는 네이티브 버튼이 담당한다.
|
|
9
|
+
* - **제거 가능 칩**(`removable`): 적용된 조건처럼 "편집" 과 "제거" 가 다른 동작이라 토글이 아니다.
|
|
10
|
+
* 루트 `<span class="moz-chip removable">` 안에 라벨 `<button>`(`click`)과 제거 `<button aria-label>`
|
|
11
|
+
* (`remove`)을 둔다. 제거 아이콘은 코어 내장 SVG(tag-input 과 같은 `iconClose`), 접근명은
|
|
12
|
+
* `removeLabel` 이 없으면 로케일 `Chip.remove`.
|
|
13
|
+
*
|
|
14
|
+
* 색 어휘는 Badge/Radio segment 와 같다 — `tone` 6종 → `data-tone`, `appearance`(비선택 룩)
|
|
15
|
+
* outline|soft → `data-appearance`, 선택은 `.is-selected`. 어휘 밖 값은 기본값으로 정규화한다.
|
|
16
|
+
* 높이는 24px 하나(파운데이션 chip tier)이고 `size` 는 가로 패딩·글자만 바꾼다.
|
|
17
|
+
*/
|
|
18
|
+
export declare const CHIP_TONES: readonly ["accent", "neutral", "info", "success", "warning", "danger"];
|
|
19
|
+
export type ChipTone = (typeof CHIP_TONES)[number];
|
|
20
|
+
export declare const CHIP_APPEARANCES: readonly ["outline", "soft"];
|
|
21
|
+
export type ChipAppearance = (typeof CHIP_APPEARANCES)[number];
|
|
22
|
+
export declare const CHIP_SIZES: readonly ["sm", "md"];
|
|
23
|
+
export type ChipSize = (typeof CHIP_SIZES)[number];
|
|
24
|
+
export interface ChipProps {
|
|
25
|
+
/** 색 의미. 어휘 밖·미지정은 `accent` */
|
|
26
|
+
tone?: ChipTone;
|
|
27
|
+
/** 비선택 상태의 룩. 어휘 밖·미지정은 `outline` */
|
|
28
|
+
appearance?: ChipAppearance;
|
|
29
|
+
/** 가로 패딩·글자 tier (높이는 24px 고정). 어휘 밖·미지정은 `md` */
|
|
30
|
+
size?: ChipSize;
|
|
31
|
+
/** 토글 칩의 선택 상태(제어형). removable 이면 무시 */
|
|
32
|
+
selected?: boolean;
|
|
33
|
+
disabled?: boolean;
|
|
34
|
+
/** 라벨 버튼 + 제거 버튼 형태로 그린다 (토글 아님) */
|
|
35
|
+
removable?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* removable 의 라벨을 누를 수 있는가 (기본 `true`).
|
|
38
|
+
*
|
|
39
|
+
* `false` 면 라벨을 `<span>` 으로 그린다 — 편집 동작이 없는 **요약 칩**에서 누르면 아무 일도 없는
|
|
40
|
+
* 버튼이 탭 스톱을 차지하고 스크린리더가 "버튼" 으로 읽는 것을 막는다(ITSM-2026-002667).
|
|
41
|
+
*/
|
|
42
|
+
labelInteractive?: boolean;
|
|
43
|
+
/** 제거 버튼의 접근 이름. 없거나 빈 문자열이면 로케일 `Chip.remove` */
|
|
44
|
+
removeLabel?: string;
|
|
45
|
+
/** default slot 이 없을 때 그릴 텍스트 */
|
|
46
|
+
text?: string;
|
|
47
|
+
class?: unknown;
|
|
48
|
+
style?: unknown;
|
|
49
|
+
[attr: string]: unknown;
|
|
50
|
+
}
|
|
51
|
+
export interface ChipEmits {
|
|
52
|
+
/** 토글 칩 클릭 / removable 의 라벨 버튼 클릭 (disabled 면 나가지 않는다) */
|
|
53
|
+
click: [MouseEvent];
|
|
54
|
+
/** removable 의 제거 버튼 클릭 (disabled 면 나가지 않는다) */
|
|
55
|
+
remove: [MouseEvent];
|
|
56
|
+
}
|
|
57
|
+
export declare const createChip: import('../..').CoreFactory<ChipProps, ChipEmits, void>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { MozSpec } from '../../runtime/types';
|
|
2
|
+
import { ChipProps, ChipEmits } from './chip.core';
|
|
3
|
+
|
|
4
|
+
export { createChip, CHIP_TONES, CHIP_APPEARANCES, CHIP_SIZES } from './chip.core';
|
|
5
|
+
export type { ChipProps, ChipEmits, ChipTone, ChipAppearance, ChipSize } from './chip.core';
|
|
6
|
+
export declare const CHIP_SPEC: MozSpec<ChipProps, ChipEmits, void>;
|