@loword/loword-design-system 0.7.2 → 0.7.4
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/README.md +21 -2
- package/dist/components/LDEditor/EditorBase.d.ts +5 -2
- package/dist/components/LDEditor/EditorBase.d.ts.map +1 -1
- package/dist/components/LDEditor/EditorBase.js +21 -13
- package/dist/components/LDEditor/LDEditor.d.ts +30 -1
- package/dist/components/LDEditor/LDEditor.d.ts.map +1 -1
- package/dist/components/LDEditor/LDEditor.js +184 -49
- package/dist/components/LDEditor/LDViewer.d.ts +7 -1
- package/dist/components/LDEditor/LDViewer.d.ts.map +1 -1
- package/dist/components/LDEditor/LDViewer.js +2 -2
- package/dist/components/LDEditor/extensions.d.ts +5 -0
- package/dist/components/LDEditor/extensions.d.ts.map +1 -1
- package/dist/components/LDEditor/extensions.js +109 -5
- package/dist/components/LDFileUpload/LDFileUpload.d.ts.map +1 -1
- package/dist/components/LDFileUpload/LDFileUpload.js +1 -1
- package/dist/components/LDPagination/PaginationBase.d.ts.map +1 -1
- package/dist/components/LDPagination/PaginationBase.js +7 -3
- package/dist/components/LDTeamHistory/TeamHistoryBase.d.ts.map +1 -1
- package/dist/components/LDTeamHistory/TeamHistoryBase.js +1 -1
- package/dist/index.css +75 -2
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- package/dist/utils/cn.d.ts +33 -0
- package/dist/utils/cn.d.ts.map +1 -1
- package/dist/utils/cn.js +55 -23
- package/package.json +2 -3
- package/src/styles/components/editor.css +94 -2
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import type { Extensions } from '@tiptap/react';
|
|
2
|
+
/**
|
|
3
|
+
* 이미지 너비(img의 width 속성). 숫자나 숫자 문자열(`671`, `'671'`, `'671px'`)은 고정(px), `'100%'`는 꽉 채움,
|
|
4
|
+
* null은 지정 없음(원본 크기, 컨테이너보다 크면 컨테이너 폭).
|
|
5
|
+
*/
|
|
6
|
+
export type EditorImageWidth = number | string | null;
|
|
2
7
|
export interface EditorExtensionOptions {
|
|
3
8
|
resizableImage?: boolean;
|
|
4
9
|
resizableTable?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extensions.d.ts","sourceRoot":"","sources":["../../../src/components/LDEditor/extensions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"extensions.d.ts","sourceRoot":"","sources":["../../../src/components/LDEditor/extensions.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAGhD;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;AAyJtD,MAAM,WAAW,sBAAsB;IACrC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,eAAO,MAAM,sBAAsB,GAAI,sCAGpC,sBAA2B,KAAG,UA0ChC,CAAC"}
|
|
@@ -1,9 +1,43 @@
|
|
|
1
|
-
import { mergeAttributes } from '@tiptap/core';
|
|
1
|
+
import { mergeAttributes, ResizableNodeView } from '@tiptap/core';
|
|
2
2
|
import Image from '@tiptap/extension-image';
|
|
3
3
|
import { TableKit } from '@tiptap/extension-table';
|
|
4
4
|
import TextAlign from '@tiptap/extension-text-align';
|
|
5
5
|
import { Color, FontSize, TextStyle } from '@tiptap/extension-text-style';
|
|
6
6
|
import StarterKit from '@tiptap/starter-kit';
|
|
7
|
+
// width 속성 값을 편집 화면 너비로 바꾼다. 브라우저가 img의 width 속성을 읽는 방식처럼 앞의 숫자만 보고
|
|
8
|
+
// 뒤가 %면 비율, 아니면 px이다('671'·671·'671px' → 671px, '100%' → 100%). 0 이하나 숫자가 아니면 지정 없음.
|
|
9
|
+
const toWidthStyle = (width) => {
|
|
10
|
+
const match = /^\s*(\d*\.?\d+)\s*(%?)/.exec(String(width ?? ''));
|
|
11
|
+
if (!match || !(Number(match[1]) > 0))
|
|
12
|
+
return undefined;
|
|
13
|
+
return `${Number(match[1])}${match[2] ? '%' : 'px'}`;
|
|
14
|
+
};
|
|
15
|
+
// 리사이즈로 끌어 컨테이너 폭에 이 값(px) 이내로 닿으면 꽉 채움으로 본다.
|
|
16
|
+
const FULL_WIDTH_TOLERANCE = 2;
|
|
17
|
+
/**
|
|
18
|
+
* 편집 화면 img에 노드 속성을 반영한다. 리사이즈 노드뷰는 만들 때만 속성을 읽고 이후 갱신에는
|
|
19
|
+
* DOM을 건드리지 않으므로, 정렬·너비가 바뀔 때마다 직접 맞춰 줘야 한다.
|
|
20
|
+
* 꽉 채움은 래퍼도 100%여야 한다 — 래퍼가 내용 폭(fit-content)이면 img의 100%가 순환해 원본 크기가 된다.
|
|
21
|
+
*/
|
|
22
|
+
const syncImage = (view, node) => {
|
|
23
|
+
const img = view.element;
|
|
24
|
+
const attrs = node.attrs;
|
|
25
|
+
if (attrs.src && img.getAttribute('src') !== attrs.src) {
|
|
26
|
+
img.setAttribute('src', attrs.src);
|
|
27
|
+
}
|
|
28
|
+
['alt', 'title'].forEach((name) => {
|
|
29
|
+
if (attrs[name])
|
|
30
|
+
img.setAttribute(name, attrs[name]);
|
|
31
|
+
else
|
|
32
|
+
img.removeAttribute(name);
|
|
33
|
+
});
|
|
34
|
+
img.style.textAlign = attrs.textAlign ?? '';
|
|
35
|
+
const width = toWidthStyle(attrs.width);
|
|
36
|
+
const percent = width?.endsWith('%');
|
|
37
|
+
view.wrapper.style.width = percent ? width : '';
|
|
38
|
+
img.style.width = percent ? '100%' : (width ?? '');
|
|
39
|
+
img.style.height = '';
|
|
40
|
+
};
|
|
7
41
|
/**
|
|
8
42
|
* 링크를 걸 수 있는 이미지. 링크(mark)는 텍스트에만 붙고 블록 이미지는 받지 못하므로
|
|
9
43
|
* 이미지 노드에 `href`를 두고 저장 시 `<a href><img></a>`로 감싼다.
|
|
@@ -13,6 +47,15 @@ const LinkableImage = Image.extend({
|
|
|
13
47
|
addAttributes() {
|
|
14
48
|
return {
|
|
15
49
|
...this.parent?.(),
|
|
50
|
+
// 넣기·리사이즈는 고정이면 px 정수, 꽉 채움이면 '100%'를 쓴다. 읽어 들인 값은 문자열 그대로 둬
|
|
51
|
+
// getJSON의 width가 기존과 같은 형태다(0·숫자가 아닌 값만 버린다). 기존 글의 px 너비는 고정으로 읽는다.
|
|
52
|
+
width: {
|
|
53
|
+
default: null,
|
|
54
|
+
parseHTML: (element) => {
|
|
55
|
+
const width = element.getAttribute('width');
|
|
56
|
+
return toWidthStyle(width) ? width : null;
|
|
57
|
+
},
|
|
58
|
+
},
|
|
16
59
|
href: {
|
|
17
60
|
default: null,
|
|
18
61
|
// 붙여넣기·불러오기 때 이미지를 감싼 <a>의 주소를 읽는다
|
|
@@ -22,6 +65,68 @@ const LinkableImage = Image.extend({
|
|
|
22
65
|
},
|
|
23
66
|
};
|
|
24
67
|
},
|
|
68
|
+
addNodeView() {
|
|
69
|
+
if (!this.options.resize || !this.options.resize.enabled)
|
|
70
|
+
return null;
|
|
71
|
+
if (typeof document === 'undefined')
|
|
72
|
+
return null;
|
|
73
|
+
const { directions, minWidth, minHeight, alwaysPreserveAspectRatio } = this.options.resize;
|
|
74
|
+
return ({ node, getPos, HTMLAttributes, editor }) => {
|
|
75
|
+
const el = document.createElement('img');
|
|
76
|
+
el.draggable = false;
|
|
77
|
+
Object.entries(mergeAttributes(this.options.HTMLAttributes, HTMLAttributes)).forEach(([key, value]) => {
|
|
78
|
+
// 너비·높이는 syncImage가 정한다(속성이 아니라 스타일로)
|
|
79
|
+
if (value != null && key !== 'width' && key !== 'height') {
|
|
80
|
+
el.setAttribute(key, value);
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
const view = new ResizableNodeView({
|
|
84
|
+
element: el,
|
|
85
|
+
editor,
|
|
86
|
+
node,
|
|
87
|
+
getPos,
|
|
88
|
+
// 끄는 동안 img가 px 너비로 바뀌므로 꽉 채움 래퍼를 풀어 핸들이 모서리에 붙게 한다
|
|
89
|
+
onResize: () => {
|
|
90
|
+
view.wrapper.style.width = '';
|
|
91
|
+
},
|
|
92
|
+
// 내용 폭에 닿으면 꽉 채움, 아니면 그 px(고정). 높이는 저장하지 않고 항상 비율을 따른다.
|
|
93
|
+
onCommit: (width) => {
|
|
94
|
+
const pos = getPos();
|
|
95
|
+
if (pos === undefined)
|
|
96
|
+
return;
|
|
97
|
+
const full = Math.abs(width - view.dom.clientWidth) <= FULL_WIDTH_TOLERANCE;
|
|
98
|
+
editor
|
|
99
|
+
.chain()
|
|
100
|
+
.setNodeSelection(pos)
|
|
101
|
+
.updateAttributes(this.name, {
|
|
102
|
+
width: full ? '100%' : Math.round(width),
|
|
103
|
+
height: null,
|
|
104
|
+
})
|
|
105
|
+
.run();
|
|
106
|
+
},
|
|
107
|
+
onUpdate: (updatedNode) => {
|
|
108
|
+
if (updatedNode.type !== node.type)
|
|
109
|
+
return false;
|
|
110
|
+
syncImage(view, updatedNode);
|
|
111
|
+
return true;
|
|
112
|
+
},
|
|
113
|
+
options: {
|
|
114
|
+
directions,
|
|
115
|
+
min: { width: minWidth, height: minHeight },
|
|
116
|
+
preserveAspectRatio: alwaysPreserveAspectRatio === true,
|
|
117
|
+
},
|
|
118
|
+
});
|
|
119
|
+
syncImage(view, node);
|
|
120
|
+
// 로드 전에는 숨겨 크기가 튀어 보이지 않게 한다. 깨진 이미지도 보이고 선택돼야 지울 수 있다.
|
|
121
|
+
view.dom.style.visibility = 'hidden';
|
|
122
|
+
view.dom.style.pointerEvents = 'none';
|
|
123
|
+
el.onload = el.onerror = () => {
|
|
124
|
+
view.dom.style.visibility = '';
|
|
125
|
+
view.dom.style.pointerEvents = '';
|
|
126
|
+
};
|
|
127
|
+
return view;
|
|
128
|
+
};
|
|
129
|
+
},
|
|
25
130
|
renderHTML({ node, HTMLAttributes }) {
|
|
26
131
|
const img = [
|
|
27
132
|
'img',
|
|
@@ -49,12 +154,11 @@ export const createEditorExtensions = ({ resizableImage = true, resizableTable =
|
|
|
49
154
|
link: {
|
|
50
155
|
openOnClick: false,
|
|
51
156
|
autolink: true,
|
|
52
|
-
HTMLAttributes: {
|
|
53
|
-
class: 'text-blue-500 underline cursor-pointer',
|
|
54
|
-
},
|
|
55
157
|
},
|
|
56
158
|
}),
|
|
57
|
-
|
|
159
|
+
// 글자 색·크기 mark가 링크 mark(priority 1000)보다 바깥이어야 한다. 링크가 바깥이면 밑줄이 링크 요소의
|
|
160
|
+
// 색으로 그려져 안쪽 글자 색을 따르지 못한다.
|
|
161
|
+
TextStyle.extend({ priority: 1001 }),
|
|
58
162
|
FontSize,
|
|
59
163
|
Color,
|
|
60
164
|
TextAlign.configure({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LDFileUpload.d.ts","sourceRoot":"","sources":["../../../src/components/LDFileUpload/LDFileUpload.tsx"],"names":[],"mappings":"AA8BA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,SAAS,EAGf,MAAM,OAAO,CAAC;AAEf,OAAiB,EAAE,KAAK,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAE9E,OAAuB,EAErB,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC5B,KAAK,iBAAiB,EAEvB,MAAM,0CAA0C,CAAC;AAuFlD,MAAM,WAAW,sBAAsB;IACrC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAID,MAAM,WAAW,qBAAsB,SAAQ,uBAAuB;IACpE,UAAU,CAAC,EAAE,sBAAsB,CAAC;CACrC;AAuBD,MAAM,WAAW,sBAAuB,SAAQ,IAAI,CAClD,aAAa,CAAC,QAAQ,CAAC,EACvB,MAAM,CACP;IACC,IAAI,CAAC,EAAE,SAAS,GAAG,YAAY,GAAG,OAAO,GA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;IACnD,OAAO,CAAC,EAAE,iBAAiB,CAAC;CAC7B;AA6FD,MAAM,WAAW,yBAAyB;IACxC,IAAI,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IAC3B,wDAAwD;IACxD,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA+UD,MAAM,WAAW,+BAA+B;IAC9C,4BAA4B;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4BAA4B;IAC5B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,+BAA+B;IAC/B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAoGD,MAAM,MAAM,4BAA4B,GAAG,cAAc,CAAC,oBAAoB,CAAC,CAAC;AA6BhF,MAAM,WAAW,iBACf,SACE,IAAI,CACF,qBAAqB,EACrB,UAAU,GAAG,YAAY,GAAG,cAAc,GAAG,MAAM,uBAAuB,CAC3E,EACD,uBAAuB;IACzB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,4BAA4B;IAC5B,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,kCAAkC;AAClC,QAAA,MAAM,YAAY;qFAMf,iBAAiB;0DA3mBjB,qBAAqB;iEAmCrB,sBAAsB;wDA+FtB,yBAAyB;iGAiWzB,+BAA+B;2CA2FY,4BAA4B;CA2DzE,CAAC;AAQF,eAAe,YAAY,CAAC"}
|
|
@@ -195,7 +195,7 @@ const LinkRow = ({ link, index, linkNumber, placeholder, labelPlaceholder, handl
|
|
|
195
195
|
}), children: [handle, _jsx(RenderIcon, { className: "size-5 shrink-0 text-lb500", children: _jsx(Link2, {}) }), _jsx(InputBase.Field, { value: link.label, placeholder: labelPlaceholder, "aria-label": `링크 ${linkNumber} 이름`, disabled: disabled, readOnly: readOnly, onChange: (event) => changeLink(index, { label: event.target.value }), className: linkFieldVariants({
|
|
196
196
|
disabled: !!disabled,
|
|
197
197
|
className: 'w-40 shrink-0',
|
|
198
|
-
}) }), _jsx("span", { "aria-hidden": true, className: "shrink-0 text-blue200", children: "|" }), _jsx(InputBase.Field, { type: "url", value: link.url, placeholder: placeholder, "aria-label": `링크 ${linkNumber} 주소`, disabled: disabled, readOnly: readOnly, onChange: (event) => changeLink(index, { url: event.target.value }), className: linkFieldVariants({ disabled: !!disabled }) }), _jsx(LDButton, { onClick: () => deleteLink(index), "aria-label": `링크 ${linkNumber} 삭제`, disabled: locked, variant: "ghost", leftIcon: _jsx(X, { className: "size-4.5" }), color: "neutral", className: cardDeleteVariants({ locked }) })] }));
|
|
198
|
+
}) }), _jsx("span", { "aria-hidden": true, className: "shrink-0 text-blue200", children: "|" }), _jsx(InputBase.Field, { type: "url", value: link.url, placeholder: placeholder, "aria-label": `링크 ${linkNumber} 주소`, disabled: disabled, readOnly: readOnly, onChange: (event) => changeLink(index, { url: event.target.value }), className: linkFieldVariants({ disabled: !!disabled }) }), _jsx(LDButton, { type: "button", onClick: () => deleteLink(index), "aria-label": `링크 ${linkNumber} 삭제`, disabled: locked, variant: "ghost", leftIcon: _jsx(X, { className: "size-4.5" }), color: "neutral", className: cardDeleteVariants({ locked }) })] }));
|
|
199
199
|
};
|
|
200
200
|
/**
|
|
201
201
|
* 드래그로 순서를 바꾸는 항목 래퍼.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaginationBase.d.ts","sourceRoot":"","sources":["../../../src/components/LDPagination/PaginationBase.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvD,OAAiB,EAAE,KAAK,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAyB3E,UAAU,aAAa;IACrB,QAAQ,EAAE,SAAS,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACtC;AAeD,UAAU,SAAU,SAAQ,cAAc,CAAC,WAAW,CAAC;IACrD,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAcD,UAAU,SAAS;IACjB,mCAAmC;IACnC,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;
|
|
1
|
+
{"version":3,"file":"PaginationBase.d.ts","sourceRoot":"","sources":["../../../src/components/LDPagination/PaginationBase.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvD,OAAiB,EAAE,KAAK,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAyB3E,UAAU,aAAa;IACrB,QAAQ,EAAE,SAAS,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACtC;AAeD,UAAU,SAAU,SAAQ,cAAc,CAAC,WAAW,CAAC;IACrD,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAcD,UAAU,SAAS;IACjB,mCAAmC;IACnC,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA+BD,UAAU,SAAS;IACjB,mCAAmC;IACnC,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA8BD,UAAU,SAAS;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,uCAAuC;IACvC,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA2BD,UAAU,SAAS;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,uCAAuC;IACvC,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA+BD,QAAA,MAAM,cAAc;qEAnKjB,aAAa;8CAYiC,SAAS;gCAkBX,SAAS;gCAmCT,SAAS;+CAmCS,SAAS;0DAwCvE,SAAS;CA8BX,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -16,14 +16,18 @@ const Root = ({ className, children, ...props }) => (_jsx("nav", { role: "naviga
|
|
|
16
16
|
const Prev = ({ size = '2xsmall', className }) => {
|
|
17
17
|
const { currentPage, onPageChange } = usePaginationContext();
|
|
18
18
|
const canPrevious = currentPage > 1;
|
|
19
|
-
return (_jsx(LDButton
|
|
19
|
+
return (_jsx(LDButton
|
|
20
|
+
// form 안에 있어도 페이지 이동이 submit으로 이어지지 않게 한다(button 기본 type은 submit)
|
|
21
|
+
, {
|
|
22
|
+
// form 안에 있어도 페이지 이동이 submit으로 이어지지 않게 한다(button 기본 type은 submit)
|
|
23
|
+
type: "button", variant: "outline", color: "neutral", size: size, shape: "capsule", leftIcon: _jsx(ChevronLeft, {}), compact: true, disabled: !canPrevious, onClick: () => onPageChange(currentPage - 1), "aria-label": "\uC774\uC804 \uD398\uC774\uC9C0", className: cn(canPrevious
|
|
20
24
|
? 'bg-neutral100 text-neutral400'
|
|
21
25
|
: 'bg-neutral50 text-neutral200', canPrevious && 'hover:bg-neutral200', className) }));
|
|
22
26
|
};
|
|
23
27
|
const Next = ({ size = '2xsmall', className }) => {
|
|
24
28
|
const { currentPage, totalPages, onPageChange } = usePaginationContext();
|
|
25
29
|
const canNext = currentPage < totalPages;
|
|
26
|
-
return (_jsx(LDButton, { variant: "outline", color: "neutral", size: size, shape: "capsule", leftIcon: _jsx(ChevronRight, {}), disabled: !canNext, compact: true, onClick: () => onPageChange(currentPage + 1), "aria-label": "\uB2E4\uC74C \uD398\uC774\uC9C0", className: cn(canNext
|
|
30
|
+
return (_jsx(LDButton, { type: "button", variant: "outline", color: "neutral", size: size, shape: "capsule", leftIcon: _jsx(ChevronRight, {}), disabled: !canNext, compact: true, onClick: () => onPageChange(currentPage + 1), "aria-label": "\uB2E4\uC74C \uD398\uC774\uC9C0", className: cn(canNext
|
|
27
31
|
? 'bg-neutral100 text-neutral400'
|
|
28
32
|
: 'bg-neutral50 text-neutral200', canNext && 'hover:bg-neutral200', className) }));
|
|
29
33
|
};
|
|
@@ -32,7 +36,7 @@ const List = ({ numbersToShow = 5, size = 'xsmall', className }) => {
|
|
|
32
36
|
const pages = calculatePaginationOptions(currentPage, totalPages, numbersToShow);
|
|
33
37
|
return (_jsx(_Fragment, { children: pages.map((page, idx) => (_jsx(Item, { page: page, isActive: currentPage === page, size: size, onClick: () => onPageChange(page), className: className }, `page_${page}_${idx}`))) }));
|
|
34
38
|
};
|
|
35
|
-
const Item = ({ page, isActive, size = 'xsmall', onClick, className, }) => (_jsx(LDButton, { variant: "ghost", shape: "capsule", color: isActive ? 'point' : 'neutral', size: size, compact: true, onClick: onClick, "aria-label": `${page} 페이지`, "aria-current": isActive ? 'page' : undefined, className: cn('regular outline-none', !isActive && 'text-neutral400', className), children: page }));
|
|
39
|
+
const Item = ({ page, isActive, size = 'xsmall', onClick, className, }) => (_jsx(LDButton, { type: "button", variant: "ghost", shape: "capsule", color: isActive ? 'point' : 'neutral', size: size, compact: true, onClick: onClick, "aria-label": `${page} 페이지`, "aria-current": isActive ? 'page' : undefined, className: cn('regular outline-none', !isActive && 'text-neutral400', className), children: page }));
|
|
36
40
|
// ── Export ──
|
|
37
41
|
const PaginationBase = {
|
|
38
42
|
Provider,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TeamHistoryBase.d.ts","sourceRoot":"","sources":["../../../src/components/LDTeamHistory/TeamHistoryBase.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,SAAS,EAQf,MAAM,OAAO,CAAC;AAgBf,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ACvB,gBAAgB,CAAC,EAAE,MAAM,CAAC;KAC3B;CAwBA,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -100,7 +100,7 @@ const Navigation = ({ classNames }) => {
|
|
|
100
100
|
}, [items.length]);
|
|
101
101
|
return (_jsx("nav", { ref: navRef, className: classNames?.root, children: items.map((item, idx) => {
|
|
102
102
|
const isActive = idx === index;
|
|
103
|
-
return (_jsxs("div", { className: "relative flex flex-col items-end", children: [_jsxs("button", { className: classNames?.item, "aria-current": isActive ? 'true' : undefined, onClick: () => moveToSection(idx), children: [_jsx("span", { "data-active": isActive, className: classNames?.label, children: item.target }), _jsx("span", { "data-active": isActive, className: classNames?.dot })] }), idx < items.length - 1 && (_jsx("span", { "data-active": idx + 1 === index, className: classNames?.line }))] }, `${item.target}_${idx}`));
|
|
103
|
+
return (_jsxs("div", { className: "relative flex flex-col items-end", children: [_jsxs("button", { type: "button", className: classNames?.item, "aria-current": isActive ? 'true' : undefined, onClick: () => moveToSection(idx), children: [_jsx("span", { "data-active": isActive, className: classNames?.label, children: item.target }), _jsx("span", { "data-active": isActive, className: classNames?.dot })] }), idx < items.length - 1 && (_jsx("span", { "data-active": idx + 1 === index, className: classNames?.line }))] }, `${item.target}_${idx}`));
|
|
104
104
|
}) }));
|
|
105
105
|
};
|
|
106
106
|
const Sections = ({ rootClassName, sectionClassName, }) => {
|
package/dist/index.css
CHANGED
|
@@ -607,6 +607,9 @@
|
|
|
607
607
|
max-width: 96rem;
|
|
608
608
|
}
|
|
609
609
|
}
|
|
610
|
+
.m-1 {
|
|
611
|
+
margin: calc(var(--spacing) * 1);
|
|
612
|
+
}
|
|
610
613
|
.m-auto {
|
|
611
614
|
margin: auto;
|
|
612
615
|
}
|
|
@@ -1275,6 +1278,9 @@
|
|
|
1275
1278
|
.ml-2 {
|
|
1276
1279
|
margin-left: calc(var(--spacing) * 2);
|
|
1277
1280
|
}
|
|
1281
|
+
.ml-\[17px\] {
|
|
1282
|
+
margin-left: 17px;
|
|
1283
|
+
}
|
|
1278
1284
|
.ml-auto {
|
|
1279
1285
|
margin-left: auto;
|
|
1280
1286
|
}
|
|
@@ -1679,6 +1685,9 @@
|
|
|
1679
1685
|
.min-h-25 {
|
|
1680
1686
|
min-height: calc(var(--spacing) * 25);
|
|
1681
1687
|
}
|
|
1688
|
+
.min-h-40 {
|
|
1689
|
+
min-height: calc(var(--spacing) * 40);
|
|
1690
|
+
}
|
|
1682
1691
|
.min-h-100 {
|
|
1683
1692
|
min-height: calc(var(--spacing) * 100);
|
|
1684
1693
|
}
|
|
@@ -1815,6 +1824,9 @@
|
|
|
1815
1824
|
.w-\[60px\] {
|
|
1816
1825
|
width: 60px;
|
|
1817
1826
|
}
|
|
1827
|
+
.w-\[calc\(100\%-34px\)\] {
|
|
1828
|
+
width: calc(100% - 34px);
|
|
1829
|
+
}
|
|
1818
1830
|
.w-auto {
|
|
1819
1831
|
width: auto;
|
|
1820
1832
|
}
|
|
@@ -1833,6 +1845,9 @@
|
|
|
1833
1845
|
.max-w-160 {
|
|
1834
1846
|
max-width: calc(var(--spacing) * 160);
|
|
1835
1847
|
}
|
|
1848
|
+
.max-w-180 {
|
|
1849
|
+
max-width: calc(var(--spacing) * 180);
|
|
1850
|
+
}
|
|
1836
1851
|
.max-w-200 {
|
|
1837
1852
|
max-width: calc(var(--spacing) * 200);
|
|
1838
1853
|
}
|
|
@@ -2019,6 +2034,9 @@
|
|
|
2019
2034
|
.resize {
|
|
2020
2035
|
resize: both;
|
|
2021
2036
|
}
|
|
2037
|
+
.resize-y {
|
|
2038
|
+
resize: vertical;
|
|
2039
|
+
}
|
|
2022
2040
|
.grid-cols-1 {
|
|
2023
2041
|
grid-template-columns: repeat(1, minmax(0, 1fr));
|
|
2024
2042
|
}
|
|
@@ -2417,6 +2435,9 @@
|
|
|
2417
2435
|
.border-neutral200 {
|
|
2418
2436
|
border-color: var(--color-neutral200);
|
|
2419
2437
|
}
|
|
2438
|
+
.border-neutral300 {
|
|
2439
|
+
border-color: var(--color-neutral300);
|
|
2440
|
+
}
|
|
2420
2441
|
.border-neutral700 {
|
|
2421
2442
|
border-color: var(--color-neutral700);
|
|
2422
2443
|
}
|
|
@@ -3186,6 +3207,9 @@
|
|
|
3186
3207
|
.text-orange500 {
|
|
3187
3208
|
color: var(--color-orange500);
|
|
3188
3209
|
}
|
|
3210
|
+
.text-red-500 {
|
|
3211
|
+
color: var(--color-red-500);
|
|
3212
|
+
}
|
|
3189
3213
|
.text-red200 {
|
|
3190
3214
|
color: var(--color-red200);
|
|
3191
3215
|
}
|
|
@@ -3496,6 +3520,9 @@
|
|
|
3496
3520
|
.\[outline-style\:solid\] {
|
|
3497
3521
|
outline-style: solid;
|
|
3498
3522
|
}
|
|
3523
|
+
.\[scrollbar-gutter\:stable\] {
|
|
3524
|
+
scrollbar-gutter: stable;
|
|
3525
|
+
}
|
|
3499
3526
|
.\[scrollbar-width\:none\] {
|
|
3500
3527
|
scrollbar-width: none;
|
|
3501
3528
|
}
|
|
@@ -5557,11 +5584,37 @@
|
|
|
5557
5584
|
padding: 0 !important;
|
|
5558
5585
|
line-height: calc(28 / 18) !important;
|
|
5559
5586
|
}
|
|
5587
|
+
.ld-editor-render .ProseMirror p:empty::before, .ProseMirror.ld-editor-render p:empty::before {
|
|
5588
|
+
content: '\200B';
|
|
5589
|
+
}
|
|
5590
|
+
.ld-editor-render .ProseMirror a, .ProseMirror.ld-editor-render a {
|
|
5591
|
+
color: inherit !important;
|
|
5592
|
+
text-decoration-color: currentcolor !important;
|
|
5593
|
+
}
|
|
5594
|
+
.ld-editor-render .ProseMirror :is(a, u), .ProseMirror.ld-editor-render :is(a, u) {
|
|
5595
|
+
text-underline-offset: 2px;
|
|
5596
|
+
}
|
|
5597
|
+
.ld-editor-render.prose, .ld-editor-render .prose {
|
|
5598
|
+
--tw-prose-body: var(--color-neutral900);
|
|
5599
|
+
letter-spacing: var(--tracking-display16);
|
|
5600
|
+
}
|
|
5560
5601
|
.prose h1, .prose h2, .prose h3 {
|
|
5561
|
-
margin-top:
|
|
5562
|
-
margin-bottom:
|
|
5602
|
+
margin-top: 1em !important;
|
|
5603
|
+
margin-bottom: 1em !important;
|
|
5563
5604
|
padding: 0 !important;
|
|
5564
5605
|
}
|
|
5606
|
+
.prose :is(h1, h2, h3):first-child {
|
|
5607
|
+
margin-top: 0 !important;
|
|
5608
|
+
}
|
|
5609
|
+
.prose h1 {
|
|
5610
|
+
line-height: calc(56 / 48) !important;
|
|
5611
|
+
}
|
|
5612
|
+
.prose h2 {
|
|
5613
|
+
line-height: calc(36 / 30) !important;
|
|
5614
|
+
}
|
|
5615
|
+
.prose h3 {
|
|
5616
|
+
line-height: calc(28 / 24) !important;
|
|
5617
|
+
}
|
|
5565
5618
|
.prose ul, .prose ol {
|
|
5566
5619
|
margin-top: 0 !important;
|
|
5567
5620
|
margin-bottom: 0.5rem !important;
|
|
@@ -5580,6 +5633,16 @@
|
|
|
5580
5633
|
margin-bottom: 0;
|
|
5581
5634
|
}
|
|
5582
5635
|
}
|
|
5636
|
+
@layer components {
|
|
5637
|
+
.ld-editor-render .ProseMirror, .ProseMirror.ld-editor-render {
|
|
5638
|
+
white-space: pre-wrap;
|
|
5639
|
+
white-space: break-spaces;
|
|
5640
|
+
}
|
|
5641
|
+
.ld-editor-render .ProseMirror:not([contenteditable='true']), .ProseMirror.ld-editor-render:not([contenteditable='true']) {
|
|
5642
|
+
overflow-y: auto;
|
|
5643
|
+
scrollbar-gutter: stable;
|
|
5644
|
+
}
|
|
5645
|
+
}
|
|
5583
5646
|
.ProseMirror img {
|
|
5584
5647
|
max-width: 100%;
|
|
5585
5648
|
height: auto !important;
|
|
@@ -5670,6 +5733,16 @@
|
|
|
5670
5733
|
}
|
|
5671
5734
|
.ProseMirror [data-resize-wrapper] {
|
|
5672
5735
|
width: fit-content;
|
|
5736
|
+
max-width: 100%;
|
|
5737
|
+
}
|
|
5738
|
+
.ProseMirror [data-resize-container] {
|
|
5739
|
+
justify-content: center;
|
|
5740
|
+
}
|
|
5741
|
+
.ProseMirror [data-resize-container]:has(img[style*='text-align: left']) {
|
|
5742
|
+
justify-content: flex-start;
|
|
5743
|
+
}
|
|
5744
|
+
.ProseMirror [data-resize-container]:has(img[style*='text-align: right']) {
|
|
5745
|
+
justify-content: flex-end;
|
|
5673
5746
|
}
|
|
5674
5747
|
.ProseMirror .tableWrapper {
|
|
5675
5748
|
overflow-x: auto;
|
package/dist/index.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ export { default as LDFormDateRangePicker } from './components/LDDateRangePicker
|
|
|
23
23
|
export { type LDDaumPostAddress, default as LDDaumPostButton, type LDDaumPostButtonProps, } from './components/LDDaumPostButton/LDDaumPostButton.js';
|
|
24
24
|
export { default as LDDivider, type LDDividerProps, } from './components/LDDivider/LDDivider.js';
|
|
25
25
|
export { type DrawerButton, default as LDDrawer, type LDDrawerBodyProps, type LDDrawerCloseProps, type LDDrawerContentProps, type LDDrawerDescriptionProps, type LDDrawerFooterProps, type LDDrawerHandleProps, type LDDrawerHeaderProps, type LDDrawerOverlayProps, type LDDrawerPanelProps, type LDDrawerProps, type LDDrawerRootProps, type LDDrawerTitleProps, type LDDrawerTriggerProps, } from './components/LDDrawer/LDDrawer.js';
|
|
26
|
-
export { default as LDEditor } from './components/LDEditor/LDEditor.js';
|
|
26
|
+
export { default as LDEditor, type LDEditorFontSize, } from './components/LDEditor/LDEditor.js';
|
|
27
27
|
export { default as LDViewer } from './components/LDEditor/LDViewer.js';
|
|
28
28
|
export { type EmptySize, default as LDEmpty, type LDEmptyProps, } from './components/LDEmpty/LDEmpty.js';
|
|
29
29
|
export { type FileUploadAttachment as LDFileUploadAttachment, type FileUploadOptions as LDFileUploadOptions, } from './components/LDFileUpload/FileUploadBase.js';
|
|
@@ -82,4 +82,5 @@ export { default as LDToggleButton, type LDToggleButtonProps, } from './componen
|
|
|
82
82
|
export { default as LDTooltip } from './components/LDTooltip/LDTooltip.js';
|
|
83
83
|
export { default as Show } from './components/Show/Show.js';
|
|
84
84
|
export { findActivePath } from './utils/utils.js';
|
|
85
|
+
export { createCn } from './utils/cn.js';
|
|
85
86
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,KAAK,iBAAiB,EACtB,OAAO,IAAI,WAAW,EACtB,KAAK,gBAAgB,GACtB,MAAM,sCAAsC,CAAC;AAG9C,OAAO,EACL,OAAO,IAAI,cAAc,EACzB,KAAK,2BAA2B,EAChC,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC7B,KAAK,8BAA8B,EACnC,KAAK,uBAAuB,EAC5B,KAAK,gCAAgC,EACrC,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,EACxB,KAAK,uBAAuB,GAC7B,MAAM,4CAA4C,CAAC;AAGpD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EACL,OAAO,IAAI,gBAAgB,EAC3B,KAAK,qBAAqB,GAC3B,MAAM,wCAAwC,CAAC;AAGhD,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAGlE,OAAO,EACL,OAAO,IAAI,YAAY,EACvB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,GACvB,MAAM,wCAAwC,CAAC;AAGhD,OAAO,EACL,OAAO,IAAI,QAAQ,EACnB,KAAK,aAAa,GACnB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,OAAO,IAAI,MAAM,EACjB,KAAK,WAAW,GACjB,MAAM,8BAA8B,CAAC;AAGtC,OAAO,EACL,KAAK,gBAAgB,EACrB,OAAO,IAAI,UAAU,EACrB,KAAK,eAAe,GACrB,MAAM,oCAAoC,CAAC;AAG5C,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAGxE,OAAO,EAA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AAM,4CAA4C,CAAC;AACzF,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,wCAAwC,CAAC;AAGjF,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAGtE,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,gDAAgD,CAAC;AAC/F,OAAO,EACL,OAAO,IAAI,cAAc,EACzB,KAAK,mBAAmB,GACzB,MAAM,4CAA4C,CAAC;AAGpD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAGxE,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAGzD,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAI/C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -43,7 +43,7 @@ export { default as LDDivider, } from './components/LDDivider/LDDivider.js';
|
|
|
43
43
|
// LDDrawer
|
|
44
44
|
export { default as LDDrawer, } from './components/LDDrawer/LDDrawer.js';
|
|
45
45
|
// LDEditor
|
|
46
|
-
export { default as LDEditor } from './components/LDEditor/LDEditor.js';
|
|
46
|
+
export { default as LDEditor, } from './components/LDEditor/LDEditor.js';
|
|
47
47
|
export { default as LDViewer } from './components/LDEditor/LDViewer.js';
|
|
48
48
|
// LDEmpty
|
|
49
49
|
export { default as LDEmpty, } from './components/LDEmpty/LDEmpty.js';
|
|
@@ -131,3 +131,6 @@ export { default as LDTooltip } from './components/LDTooltip/LDTooltip.js';
|
|
|
131
131
|
export { default as Show } from './components/Show/Show.js';
|
|
132
132
|
// 라우트 활성 판정 (LDLNB·LDBreadCrumb 내부와 동일한 로직)
|
|
133
133
|
export { findActivePath } from './utils/utils.js';
|
|
134
|
+
// LDS 토큰을 아는 cn 생성기. 소비처는 이걸로 자기 cn 을 만든다.
|
|
135
|
+
// 기본 cn 은 노출하지 않는다 — 소비처 자체 cn 과 이름이 겹쳐 자동 import 가 이쪽을 집으면 소비처 토큰이 조용히 빠진다.
|
|
136
|
+
export { createCn } from './utils/cn.js';
|
package/dist/utils/cn.d.ts
CHANGED
|
@@ -1,4 +1,37 @@
|
|
|
1
1
|
import { type ClassValue } from 'clsx';
|
|
2
|
+
import { type ConfigExtension, type DefaultClassGroupIds, type DefaultThemeGroupIds } from 'tailwind-merge';
|
|
3
|
+
/**
|
|
4
|
+
* LDS 설정이 미리 등록된 `cn()` 을 만듭니다. 소비처가 자체 토큰을 tailwind-merge 에 알릴 때 씁니다.
|
|
5
|
+
*
|
|
6
|
+
* LDS 커스텀 토큰(display·font-weight·spacing·icon-size·숫자 radius)은 이미 등록돼 있습니다.
|
|
7
|
+
* 넘긴 `extension` 은 LDS 설정 **뒤에** 적용되므로, `extend` 는 LDS 값에 추가되고
|
|
8
|
+
* `override` 는 LDS 가 등록한 것까지 교체합니다.
|
|
9
|
+
*
|
|
10
|
+
* 호출마다 독립된 tailwind-merge 인스턴스(설정·LRU 캐시)가 생깁니다. 모듈 스코프에서
|
|
11
|
+
* 한 번만 만들어 재사용하세요.
|
|
12
|
+
*
|
|
13
|
+
* 소비처 커스텀 class group id 는 타입 인자로 넘깁니다. LDS 의 `'icon-size'` 는 타입 인자 없이
|
|
14
|
+
* `conflictingClassGroups` 에서 참조할 수 있습니다.
|
|
15
|
+
*
|
|
16
|
+
* 설정 형식은 tailwind-merge 의 `ConfigExtension` 입니다.
|
|
17
|
+
* https://github.com/dcastil/tailwind-merge/blob/main/docs/configuration.md
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* // 소비처 lib/cn.ts — 모듈 스코프에서 한 번만 만든다
|
|
21
|
+
* import { createCn } from '@loword/loword-design-system';
|
|
22
|
+
*
|
|
23
|
+
* export const cn = createCn<'elevation'>({
|
|
24
|
+
* extend: {
|
|
25
|
+
* // 자체 타이포 토큰 text-caption 을 font-size 로 인식시킨다(미등록 시 text-color 로 오인돼 text-red-500 을 지움)
|
|
26
|
+
* theme: { text: ['caption', 'body1'] },
|
|
27
|
+
* // 자체 유틸 elevation-* 를 새 그룹으로 등록하고 shadow-* 와 상충시킨다
|
|
28
|
+
* classGroups: { elevation: [{ elevation: ['1', '2', '3'] }] },
|
|
29
|
+
* conflictingClassGroups: { elevation: ['shadow'] },
|
|
30
|
+
* },
|
|
31
|
+
* });
|
|
32
|
+
*/
|
|
33
|
+
export declare const createCn: <AdditionalClassGroupIds extends string = never, AdditionalThemeGroupIds extends string = never>(extension?: ConfigExtension<DefaultClassGroupIds | "icon-size" | AdditionalClassGroupIds, DefaultThemeGroupIds | AdditionalThemeGroupIds>) => (...inputs: ClassValue[]) => string;
|
|
34
|
+
/** LDS 토큰을 아는 clsx + tailwind-merge 병합. */
|
|
2
35
|
declare const cn: (...inputs: ClassValue[]) => string;
|
|
3
36
|
export default cn;
|
|
4
37
|
//# sourceMappingURL=cn.d.ts.map
|
package/dist/utils/cn.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cn.d.ts","sourceRoot":"","sources":["../../src/utils/cn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAQ,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"cn.d.ts","sourceRoot":"","sources":["../../src/utils/cn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAQ,MAAM,MAAM,CAAC;AAC7C,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EAI1B,MAAM,gBAAgB,CAAC;AAqDxB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,eAAO,MAAM,QAAQ,GACnB,uBAAuB,SAAS,MAAM,GAAG,KAAK,EAC9C,uBAAuB,SAAS,MAAM,GAAG,KAAK,EAE9C,YAAW,eAAe,CACxB,oBAAoB,GAAG,WAAW,GAAG,uBAAuB,EAC5D,oBAAoB,GAAG,uBAAuB,CAC1C,MA0BE,GAAG,QAAQ,UAAU,EAAE,WAChC,CAAC;AAEF,2CAA2C;AAC3C,QAAA,MAAM,EAAE,cAJa,UAAU,EAAE,WAIZ,CAAC;AAEtB,eAAe,EAAE,CAAC"}
|
package/dist/utils/cn.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { clsx } from 'clsx';
|
|
2
|
-
import { extendTailwindMerge, validators } from 'tailwind-merge';
|
|
2
|
+
import { extendTailwindMerge, mergeConfigs, validators, } from 'tailwind-merge';
|
|
3
3
|
// 커스텀 타이포 유틸을 twMerge 그룹에 등록해, 프리셋과 className이 상충하면
|
|
4
4
|
// 뒤(className)가 이기게 함. (typography.css의 @utility 목록과 반드시 일치시킬 것)
|
|
5
5
|
const DISPLAY_SIZES = [
|
|
@@ -45,28 +45,60 @@ const SPACING = [
|
|
|
45
45
|
// icon.css의 @utility icon-*. width/height를 함께 잡으므로 w/h/size와도 상충한다.
|
|
46
46
|
// (icon.css의 @utility 목록과 반드시 일치시킬 것)
|
|
47
47
|
const ICON_SIZES = ['2xs', 'xs', 'sm', 'md', 'lg', 'xl'].map((s) => `icon-${s}`);
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
48
|
+
/**
|
|
49
|
+
* LDS 설정이 미리 등록된 `cn()` 을 만듭니다. 소비처가 자체 토큰을 tailwind-merge 에 알릴 때 씁니다.
|
|
50
|
+
*
|
|
51
|
+
* LDS 커스텀 토큰(display·font-weight·spacing·icon-size·숫자 radius)은 이미 등록돼 있습니다.
|
|
52
|
+
* 넘긴 `extension` 은 LDS 설정 **뒤에** 적용되므로, `extend` 는 LDS 값에 추가되고
|
|
53
|
+
* `override` 는 LDS 가 등록한 것까지 교체합니다.
|
|
54
|
+
*
|
|
55
|
+
* 호출마다 독립된 tailwind-merge 인스턴스(설정·LRU 캐시)가 생깁니다. 모듈 스코프에서
|
|
56
|
+
* 한 번만 만들어 재사용하세요.
|
|
57
|
+
*
|
|
58
|
+
* 소비처 커스텀 class group id 는 타입 인자로 넘깁니다. LDS 의 `'icon-size'` 는 타입 인자 없이
|
|
59
|
+
* `conflictingClassGroups` 에서 참조할 수 있습니다.
|
|
60
|
+
*
|
|
61
|
+
* 설정 형식은 tailwind-merge 의 `ConfigExtension` 입니다.
|
|
62
|
+
* https://github.com/dcastil/tailwind-merge/blob/main/docs/configuration.md
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* // 소비처 lib/cn.ts — 모듈 스코프에서 한 번만 만든다
|
|
66
|
+
* import { createCn } from '@loword/loword-design-system';
|
|
67
|
+
*
|
|
68
|
+
* export const cn = createCn<'elevation'>({
|
|
69
|
+
* extend: {
|
|
70
|
+
* // 자체 타이포 토큰 text-caption 을 font-size 로 인식시킨다(미등록 시 text-color 로 오인돼 text-red-500 을 지움)
|
|
71
|
+
* theme: { text: ['caption', 'body1'] },
|
|
72
|
+
* // 자체 유틸 elevation-* 를 새 그룹으로 등록하고 shadow-* 와 상충시킨다
|
|
73
|
+
* classGroups: { elevation: [{ elevation: ['1', '2', '3'] }] },
|
|
74
|
+
* conflictingClassGroups: { elevation: ['shadow'] },
|
|
75
|
+
* },
|
|
76
|
+
* });
|
|
77
|
+
*/
|
|
78
|
+
export const createCn = (extension = {}) => {
|
|
79
|
+
const twMerge = extendTailwindMerge({
|
|
80
|
+
extend: {
|
|
81
|
+
theme: {
|
|
82
|
+
spacing: SPACING,
|
|
83
|
+
// 소비처가 `--radius-8` 처럼 숫자 이름으로 정의한 rounded-* 를 radius 로 인식시켜,
|
|
84
|
+
// 프리셋의 rounded-[5px] 와 상충하면 className 이 이기게 함. (기본 설정은 sm·lg 같은 이름만 앎)
|
|
85
|
+
radius: [validators.isNumber],
|
|
86
|
+
},
|
|
87
|
+
classGroups: {
|
|
88
|
+
'font-size': DISPLAY_SIZES,
|
|
89
|
+
'font-weight': FONT_WEIGHTS,
|
|
90
|
+
'icon-size': ICON_SIZES,
|
|
91
|
+
},
|
|
92
|
+
conflictingClassGroups: {
|
|
93
|
+
'icon-size': ['w', 'h', 'size'],
|
|
94
|
+
w: ['icon-size'],
|
|
95
|
+
h: ['icon-size'],
|
|
96
|
+
size: ['icon-size'],
|
|
97
|
+
},
|
|
55
98
|
},
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
'font-weight': FONT_WEIGHTS,
|
|
59
|
-
'icon-size': ICON_SIZES,
|
|
60
|
-
},
|
|
61
|
-
conflictingClassGroups: {
|
|
62
|
-
'icon-size': ['w', 'h', 'size'],
|
|
63
|
-
w: ['icon-size'],
|
|
64
|
-
h: ['icon-size'],
|
|
65
|
-
size: ['icon-size'],
|
|
66
|
-
},
|
|
67
|
-
},
|
|
68
|
-
});
|
|
69
|
-
const cn = (...inputs) => {
|
|
70
|
-
return twMerge(clsx(inputs));
|
|
99
|
+
}, (config) => mergeConfigs(config, extension));
|
|
100
|
+
return (...inputs) => twMerge(clsx(inputs));
|
|
71
101
|
};
|
|
102
|
+
/** LDS 토큰을 아는 clsx + tailwind-merge 병합. */
|
|
103
|
+
const cn = createCn();
|
|
72
104
|
export default cn;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loword/loword-design-system",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.4",
|
|
4
4
|
"description": "로워드 디자인 시스템 컴포넌트 패키지(Tailwind v4)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -241,7 +241,6 @@
|
|
|
241
241
|
"eslint-plugin-simple-import-sort": "^14.0.0",
|
|
242
242
|
"eslint-plugin-storybook": "10.5.7",
|
|
243
243
|
"globals": "^16.3.0",
|
|
244
|
-
"lint-staged": "^17.3.0",
|
|
245
244
|
"next": "15.5.18",
|
|
246
245
|
"playwright": "latest",
|
|
247
246
|
"prettier": "^3.9.6",
|
|
@@ -282,7 +281,7 @@
|
|
|
282
281
|
"dev:styles": "tailwindcss -i ./src/styles.css -o ./dist/index.css --watch",
|
|
283
282
|
"lint": "eslint --fix src .storybook --max-warnings 0",
|
|
284
283
|
"lint:ci": "eslint src .storybook --max-warnings 0",
|
|
285
|
-
"prettier": "prettier --write
|
|
284
|
+
"prettier": "prettier --write . --log-level warn",
|
|
286
285
|
"test": "vitest run",
|
|
287
286
|
"test:watch": "vitest",
|
|
288
287
|
"test:coverage": "pnpm run test:coverage:utils && pnpm run test:coverage:components",
|