@lawkit/ui 0.1.40 → 0.1.42

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.
@@ -21,6 +21,10 @@ export interface DateRangePickerProps extends Omit<HTMLAttributes<HTMLDivElement
21
21
  start: Date | null;
22
22
  end: Date | null;
23
23
  }) => void;
24
+ /** 최소 선택 가능 날짜 */
25
+ minDate?: Date;
26
+ /** 최대 선택 가능 날짜 */
27
+ maxDate?: Date;
24
28
  }
25
29
  /**
26
30
  * **DatePicker**
@@ -54,4 +58,4 @@ export declare function DatePicker({ value, onChange, showTime, minDate, maxDate
54
58
  * />
55
59
  * ```
56
60
  */
57
- export declare function DateRangePicker({ startDate, endDate, onChange, className, ...rest }: DateRangePickerProps): import("react/jsx-runtime").JSX.Element;
61
+ export declare function DateRangePicker({ startDate, endDate, onChange, minDate, maxDate, className, ...rest }: DateRangePickerProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ export declare const wrapper: string;
2
+ export declare const trigger: string;
3
+ export declare const calendarIcon: string;
4
+ export declare const popover: string;
@@ -0,0 +1,40 @@
1
+ import { HTMLAttributes } from 'react';
2
+ import { InputSize, InputState } from '../Input';
3
+ /** Date → "yyyy-MM-dd" (빈 값이면 "") */
4
+ export declare const formatYmd: (date: Date | null | undefined) => string;
5
+ export interface InputDatePickerProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange" | "defaultValue"> {
6
+ /** 선택된 날짜 */
7
+ value?: Date | null;
8
+ /** 날짜 변경 콜백 */
9
+ onChange?: (date: Date) => void;
10
+ /** placeholder (선택 전 표시) */
11
+ placeholder?: string;
12
+ /** 인풋 사이즈 */
13
+ inputSize?: InputSize;
14
+ /** 인풋 상태 (테두리 색 등) */
15
+ state?: InputState;
16
+ /** 비활성화 */
17
+ disabled?: boolean;
18
+ /** 최소 선택 가능 날짜 */
19
+ minDate?: Date;
20
+ /** 최대 선택 가능 날짜 */
21
+ maxDate?: Date;
22
+ }
23
+ /**
24
+ * **InputDatePicker** (프로토타입)
25
+ *
26
+ * Input 박스에 포커스하거나 캘린더 아이콘을 클릭하면 `DatePicker` 캘린더가
27
+ * 팝오버로 펼쳐지는 날짜 선택 컴포넌트.
28
+ *
29
+ * - 포커스 / 클릭 → 캘린더 열림
30
+ * - 날짜 선택 → 인풋에 `yyyy-MM-dd` 표시 후 닫힘
31
+ * - ESC / 바깥 클릭 → 닫힘
32
+ *
33
+ * > ⚠️ 아직 정식 export 컴포넌트가 아닌 Storybook 검토용 시안입니다.
34
+ *
35
+ * ```tsx
36
+ * const [date, setDate] = useState<Date | null>(null);
37
+ * <InputDatePicker value={date} onChange={setDate} />
38
+ * ```
39
+ */
40
+ export declare const InputDatePicker: ({ value, onChange, placeholder, inputSize, state, disabled, minDate, maxDate, className, ...rest }: InputDatePickerProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ export declare const wrapper: string;
2
+ export declare const rangeTrigger: string;
3
+ export declare const singleTrigger: string;
4
+ export declare const rangeInput: string;
5
+ export declare const singleInput: string;
6
+ export declare const rangeSeparator: string;
7
+ export declare const calendarIcon: string;
8
+ export declare const popover: string;
@@ -0,0 +1,48 @@
1
+ import { HTMLAttributes } from 'react';
2
+ import { InputSize, InputState } from '../Input';
3
+ export interface InputDateRangePickerProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange" | "defaultValue"> {
4
+ startDate?: Date | null;
5
+ endDate?: Date | null;
6
+ onChange?: (range: {
7
+ start: Date | null;
8
+ end: Date | null;
9
+ }) => void;
10
+ placeholder?: string;
11
+ inputSize?: InputSize;
12
+ state?: InputState;
13
+ disabled?: boolean;
14
+ minDate?: Date;
15
+ maxDate?: Date;
16
+ }
17
+ /**
18
+ * **InputDateRangePicker** (프로토타입)
19
+ *
20
+ * 하나의 Input에 `yyyy-MM-dd ~ yyyy-MM-dd` 형태로 범위를 표시하는 기본안입니다.
21
+ *
22
+ * - 포커스 / 클릭 → 캘린더 열림
23
+ * - 시작일/종료일 선택 → 하나의 인풋에 범위 문자열 표시
24
+ * - 종료일 선택 완료 시 닫힘
25
+ * - ESC / 바깥 클릭 → 닫힘
26
+ */
27
+ export declare const InputDateRangePicker: ({ startDate, endDate, onChange, placeholder, inputSize, state, disabled, minDate, maxDate, className, ...rest }: InputDateRangePickerProps) => import("react/jsx-runtime").JSX.Element;
28
+ export interface InputDateRangePickerSplitProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange" | "defaultValue"> {
29
+ startDate?: Date | null;
30
+ endDate?: Date | null;
31
+ onChange?: (range: {
32
+ start: Date | null;
33
+ end: Date | null;
34
+ }) => void;
35
+ startPlaceholder?: string;
36
+ endPlaceholder?: string;
37
+ inputSize?: InputSize;
38
+ state?: InputState;
39
+ disabled?: boolean;
40
+ minDate?: Date;
41
+ maxDate?: Date;
42
+ }
43
+ /**
44
+ * **InputDateRangePickerSplit** (프로토타입)
45
+ *
46
+ * Input 2개(시작일/종료일)로 범위를 보여주는 보조 variant입니다.
47
+ */
48
+ export declare const InputDateRangePickerSplit: ({ startDate, endDate, onChange, startPlaceholder, endPlaceholder, inputSize, state, disabled, minDate, maxDate, className, ...rest }: InputDateRangePickerSplitProps) => import("react/jsx-runtime").JSX.Element;
@@ -60,6 +60,10 @@ export { Radio, RadioGroup } from './components/Radio';
60
60
  export type { RadioProps, RadioSize, RadioVariant, RadioGroupProps, } from './components/Radio';
61
61
  export { DatePicker, DateRangePicker } from './components/DatePicker';
62
62
  export type { DatePickerProps, DateRangePickerProps, } from './components/DatePicker';
63
+ export { InputDatePicker, formatYmd as formatInputDateYmd, } from './components/InputDatePicker';
64
+ export type { InputDatePickerProps } from './components/InputDatePicker';
65
+ export { InputDateRangePicker, InputDateRangePickerSplit, } from './components/InputDateRangePicker';
66
+ export type { InputDateRangePickerProps, InputDateRangePickerSplitProps, } from './components/InputDateRangePicker';
63
67
  export { FileUploadArea, FileThumbnail, FileItem, FileAttachBadge, } from './components/FileUpload';
64
68
  export type { FileUploadAreaProps, FileThumbnailProps, FileItemProps, FileAttachBadgeProps, ThumbnailLayout, ThumbnailSize, } from './components/FileUpload';
65
69
  export { NumberInput } from './components/NumberInput';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lawkit/ui",
3
- "version": "0.1.40",
3
+ "version": "0.1.42",
4
4
  "type": "module",
5
5
  "description": "LDS Design System — React component library with design tokens",
6
6
  "main": "./dist/index.js",
@@ -18,7 +18,9 @@
18
18
  ],
19
19
  "files": [
20
20
  "dist",
21
- "README.md"
21
+ "README.md",
22
+ "CLAUDE.md",
23
+ "scripts"
22
24
  ],
23
25
  "publishConfig": {
24
26
  "access": "public"
@@ -69,6 +71,8 @@
69
71
  "build": "vite build",
70
72
  "lint": "echo \"No lint configured yet\"",
71
73
  "check": "tsc --noEmit",
72
- "test": "vitest run --config vitest.config.ts"
74
+ "test": "vitest run --config vitest.config.ts",
75
+ "docs": "node ../../scripts/generate-component-docs.mjs",
76
+ "postinstall": "node scripts/postinstall.js"
73
77
  }
74
78
  }
@@ -0,0 +1,82 @@
1
+ import { existsSync, readFileSync, writeFileSync } from 'fs';
2
+ import { join } from 'path';
3
+
4
+ // 자기 자신 패키지 빌드 시에는 실행하지 않음
5
+ if (process.env.npm_package_name === '@lawkit/ui') process.exit(0);
6
+
7
+ // 소비 프로젝트 루트 (npm install 실행 위치)
8
+ const projectRoot = process.cwd();
9
+
10
+ const CLAUDE_MD_REF_LINE = '@node_modules/@lawkit/ui/CLAUDE.md';
11
+ const CURSOR_RULES_DIR = '.cursor/rules';
12
+ const CURSOR_RULES_FILE = '.cursor/rules/lds.mdc';
13
+ const COPILOT_INSTRUCTIONS_FILE = '.github/copilot-instructions.md';
14
+ const COPILOT_MARKER = '<!-- @lawkit/ui -->';
15
+
16
+ const CURSOR_MDC_CONTENT = `---
17
+ description: @lawkit/ui 컴포넌트 사용 규칙
18
+ globs: "**/*.tsx,**/*.ts"
19
+ alwaysApply: false
20
+ ---
21
+
22
+ @lawkit/ui 컴포넌트를 사용할 때는 node_modules/@lawkit/ui/CLAUDE.md 파일을 참고하세요.
23
+ 컴포넌트별 import 방법과 템플릿 코드가 정리되어 있습니다.
24
+ `;
25
+
26
+ const COPILOT_APPEND_CONTENT = `
27
+ <!-- @lawkit/ui -->
28
+ ## @lawkit/ui 컴포넌트
29
+ 컴포넌트 사용법은\`node_modules/@lawkit/ui/CLAUDE.md\` 를 참고하세요.
30
+ `;
31
+
32
+ let anyActionTaken = false;
33
+
34
+ try {
35
+ // 1. CLAUDE.md 처리 — 파일 끝에 추가 (기존 구조 보존)
36
+ const claudeMdPath = join(projectRoot, 'CLAUDE.md');
37
+ if (existsSync(claudeMdPath)) {
38
+ const content = readFileSync(claudeMdPath, 'utf-8');
39
+ if (!content.includes(CLAUDE_MD_REF_LINE)) {
40
+ const updated = content.trimEnd() + '\n' + CLAUDE_MD_REF_LINE + '\n';
41
+ writeFileSync(claudeMdPath, updated, 'utf-8');
42
+ console.log('[@lawkit/ui] CLAUDE.md 참조 추가됨');
43
+ } else {
44
+ console.log('[@lawkit/ui] CLAUDE.md 참조 이미 존재 — skip');
45
+ }
46
+ anyActionTaken = true;
47
+ }
48
+
49
+ // 2. .cursor/rules/ 디렉토리 처리
50
+ const cursorRulesDirPath = join(projectRoot, CURSOR_RULES_DIR);
51
+ if (existsSync(cursorRulesDirPath)) {
52
+ const ldsMdcPath = join(projectRoot, CURSOR_RULES_FILE);
53
+ if (!existsSync(ldsMdcPath)) {
54
+ writeFileSync(ldsMdcPath, CURSOR_MDC_CONTENT, 'utf-8');
55
+ console.log('[@lawkit/ui] .cursor/rules/lds.mdc 생성됨');
56
+ } else {
57
+ console.log('[@lawkit/ui] .cursor/rules/lds.mdc 이미 존재 — skip');
58
+ }
59
+ anyActionTaken = true;
60
+ }
61
+
62
+ // 3. .github/copilot-instructions.md 처리
63
+ const copilotInstructionsPath = join(projectRoot, COPILOT_INSTRUCTIONS_FILE);
64
+ if (existsSync(copilotInstructionsPath)) {
65
+ const content = readFileSync(copilotInstructionsPath, 'utf-8');
66
+ if (!content.includes(COPILOT_MARKER)) {
67
+ const updated = content.trimEnd() + COPILOT_APPEND_CONTENT;
68
+ writeFileSync(copilotInstructionsPath, updated, 'utf-8');
69
+ console.log('[@lawkit/ui] copilot-instructions.md 참조 추가됨');
70
+ } else {
71
+ console.log('[@lawkit/ui] copilot-instructions.md 참조 이미 존재 — skip');
72
+ }
73
+ anyActionTaken = true;
74
+ }
75
+
76
+ if (!anyActionTaken) {
77
+ console.log('[@lawkit/ui] AI 설정 파일을 찾지 못했습니다. 필요 시 수동으로 추가하세요.');
78
+ }
79
+ } catch (err) {
80
+ // postinstall 실패가 npm install 전체를 막지 않도록 경고만 출력
81
+ console.warn('[@lawkit/ui] AI 설정 파일 업데이트 중 오류 발생 (무시됨):', err.message);
82
+ }