@sonamu-kit/react-components 0.4.6 → 0.4.8
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/ui/calendar.js +12 -6
- package/dist/components/ui/calendar.js.map +1 -1
- package/dist/components/ui/carousel.js +12 -16
- package/dist/components/ui/carousel.js.map +1 -1
- package/dist/components/ui/common-modal.d.ts +6 -6
- package/dist/components/ui/common-modal.js.map +1 -1
- package/dist/components/ui/file-input.js +131 -130
- package/dist/components/ui/file-input.js.map +1 -1
- package/dist/components/ui/input.js +21 -20
- package/dist/components/ui/input.js.map +1 -1
- package/dist/components/ui/month-picker-multiple.js +31 -19
- package/dist/components/ui/month-picker-multiple.js.map +1 -1
- package/dist/components/ui/pagination.js +18 -17
- package/dist/components/ui/pagination.js.map +1 -1
- package/dist/components/ui/select/enum-select.js +4 -2
- package/dist/components/ui/select/enum-select.js.map +1 -1
- package/dist/components/ui/select/id-async-select.d.ts +32 -14
- package/dist/components/ui/select/id-async-select.js +185 -144
- package/dist/components/ui/select/id-async-select.js.map +1 -1
- package/dist/components/ui/select/select.js +199 -158
- package/dist/components/ui/select/select.js.map +1 -1
- package/dist/components/ui/sidebar.d.ts +2 -1
- package/dist/components/ui/sidebar.js +54 -45
- package/dist/components/ui/sidebar.js.map +1 -1
- package/dist/components/ui/sonamu-filter/constants.d.ts +27 -3
- package/dist/components/ui/sonamu-filter/constants.js.map +1 -1
- package/dist/components/ui/sonamu-filter/rule-row-input.js +18 -15
- package/dist/components/ui/sonamu-filter/rule-row-input.js.map +1 -1
- package/dist/components/ui/sonamu-filter/sonamu-filter-modal.js +34 -37
- package/dist/components/ui/sonamu-filter/sonamu-filter-modal.js.map +1 -1
- package/dist/components/ui/sonamu-filter/sonamu-filter-popover.js +17 -12
- package/dist/components/ui/sonamu-filter/sonamu-filter-popover.js.map +1 -1
- package/dist/components/ui/sonamu-filter/types.d.ts +14 -9
- package/dist/components/ui/sonamu-filter/utils.d.ts +9 -7
- package/dist/components/ui/sonamu-filter/utils.js +39 -20
- package/dist/components/ui/sonamu-filter/utils.js.map +1 -1
- package/dist/components/ui/sonamu-filter/value-input.js +65 -50
- package/dist/components/ui/sonamu-filter/value-input.js.map +1 -1
- package/dist/contexts/sonamu-context.js +34 -10
- package/dist/contexts/sonamu-context.js.map +1 -1
- package/dist/demo/components/FormDebugPanel.d.ts +1 -1
- package/dist/hooks/use-toast.d.ts +1 -1
- package/dist/hooks/use-toast.js.map +1 -1
- package/dist/lib/base-helpers.d.ts +1 -1
- package/dist/lib/base-helpers.js +17 -16
- package/dist/lib/base-helpers.js.map +1 -1
- package/dist/lib/caster.d.ts +3 -2
- package/dist/lib/caster.js +37 -19
- package/dist/lib/caster.js.map +1 -1
- package/dist/lib/form-helpers.js +38 -35
- package/dist/lib/form-helpers.js.map +1 -1
- package/dist/lib/list-helpers.d.ts +2 -2
- package/dist/lib/list-helpers.js +33 -36
- package/dist/lib/list-helpers.js.map +1 -1
- package/dist/lib/use-mobile.js +5 -7
- package/dist/lib/use-mobile.js.map +1 -1
- package/dist/lib/utils.d.ts +0 -14
- package/dist/lib/utils.js +24 -14
- package/dist/lib/utils.js.map +1 -1
- package/dist/styles/globals.css +38 -106
- package/package.json +2 -2
package/dist/lib/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","names":[],"sources":["../../src/lib/utils.ts"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { type ClassValue } from \"clsx\";\nimport {
|
|
1
|
+
{"version":3,"file":"utils.js","names":[],"sources":["../../src/lib/utils.ts"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { type ClassValue } from \"clsx\";\nimport { useMemo, useSyncExternalStore } from \"react\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\n/**\n * 값을 배열로 정규화합니다.\n * 이미 배열이면 그대로 반환하고, 단일 값이면 배열로 감싸서 반환합니다.\n *\n * @param value - 정규화할 값 (단일 값 또는 배열)\n * @returns 배열로 정규화된 값 (undefined면 undefined 반환)\n *\n * @example\n * normalizeToArray(50) // [50]\n * normalizeToArray([20, 80]) // [20, 80]\n * normalizeToArray(undefined) // undefined\n */\nexport function normalizeToArray<T>(value: T | T[] | undefined): T[] | undefined {\n return value === undefined ? undefined : Array.isArray(value) ? value : [value];\n}\n\n/**\n * useObjectUrls 훅\n *\n * 로컬 File 객체 배열을 받아서 브라우저 메모리 기반 미리보기용 Object URL을 생성하고,\n * 컴포넌트가 언마운트되거나 파일이 변경될 때 자동으로 메모리를 해제합니다.\n *\n * **동작 방식**:\n * 1. File 배열을 받아서 각 파일마다 `URL.createObjectURL()`로 임시 URL 생성\n * 2. 생성된 URL은 `blob:http://...` 형태로, 브라우저 메모리를 직접 참조\n * 3. 컴포넌트 언마운트나 파일 변경 시 cleanup 함수가 `URL.revokeObjectURL()`로 메모리 해제\n *\n * @param files - 미리보기할 File 객체 배열\n * @returns 생성된 Object URL 문자열 배열\n */\nconst EMPTY_OBJECT_URLS: string[] = [];\n\nclass ObjectUrlStore {\n private urls = EMPTY_OBJECT_URLS;\n\n constructor(private readonly files: File[]) {}\n\n getSnapshot = () => this.urls;\n\n subscribe = (onStoreChange: () => void) => {\n const created = this.files.map((file) => URL.createObjectURL(file));\n this.urls = created;\n onStoreChange();\n\n return () => {\n for (const url of created) {\n URL.revokeObjectURL(url);\n }\n if (this.urls === created) {\n this.urls = EMPTY_OBJECT_URLS;\n }\n };\n };\n}\n\nexport function useObjectUrls(files: File[]): string[] {\n const store = useMemo(() => new ObjectUrlStore(files), [files]);\n\n return useSyncExternalStore(store.subscribe, store.getSnapshot, () => EMPTY_OBJECT_URLS);\n}\n"],"mappings":";;;;AAKA,SAAgB,EAAG,GAAG,GAAsB;CAC1C,OAAO,EAAQ,EAAK,CAAM,CAAC;AAC7B;AAcA,SAAgB,EAAoB,GAA6C;CAC/E,OAAO,MAAU,KAAA,IAAY,KAAA,IAAY,MAAM,QAAQ,CAAK,IAAI,IAAQ,CAAC,CAAK;AAChF;AAgBA,IAAM,IAA8B,CAAC,GAE/B,IAAN,MAAqB;CAGU;CAF7B,OAAe;CAEf,YAAY,GAAgC;EAAf,KAAA,QAAA;CAAgB;CAE7C,oBAAoB,KAAK;CAEzB,aAAa,MAA8B;EACzC,IAAM,IAAU,KAAK,MAAM,KAAK,MAAS,IAAI,gBAAgB,CAAI,CAAC;EAIlE,OAHA,KAAK,OAAO,GACZ,EAAc,SAED;GACX,KAAK,IAAM,KAAO,GAChB,IAAI,gBAAgB,CAAG;GAEzB,AAAI,KAAK,SAAS,MAChB,KAAK,OAAO;EAEhB;CACF;AACF;AAEA,SAAgB,EAAc,GAAyB;CACrD,IAAM,IAAQ,QAAc,IAAI,EAAe,CAAK,GAAG,CAAC,CAAK,CAAC;CAE9D,OAAO,EAAqB,EAAM,WAAW,EAAM,mBAAmB,CAAiB;AACzF"}
|
package/dist/styles/globals.css
CHANGED
|
@@ -300,120 +300,52 @@
|
|
|
300
300
|
}
|
|
301
301
|
|
|
302
302
|
/**
|
|
303
|
-
* Base typography.
|
|
303
|
+
* Base typography.
|
|
304
|
+
*
|
|
305
|
+
* Tailwind v4는 CSS를 theme < base < components < utilities 레이어 순서로 적용한다.
|
|
306
|
+
* 요소 자신에 붙은 text-*, font-*, leading-* 유틸리티는 항상 base 위에 오므로
|
|
307
|
+
* 여기서는 조건 없이 태그 기본값만 정한다.
|
|
308
|
+
*
|
|
309
|
+
* :has()로 조상의 클래스를 검사하는 조건은 두지 않는다. Firefox는 :has()가 포함된
|
|
310
|
+
* 전역 셀렉터를 DOM 변경마다 모든 조상에 대해 재평가하므로, 수백 행이 갱신되는
|
|
311
|
+
* 화면에서 수십 초의 멈춤이 발생한다(SON-540).
|
|
312
|
+
*
|
|
313
|
+
* 부모의 유틸리티가 상속되도록 헤딩 외에는 크기와 행간을 정하지 않는다.
|
|
314
|
+
* font-family는 body 상속과 Preflight(button, input의 font: inherit)로 충분하다.
|
|
304
315
|
*/
|
|
305
316
|
@layer base {
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
h3 {
|
|
334
|
-
font-family:
|
|
335
|
-
"Pretendard",
|
|
336
|
-
-apple-system,
|
|
337
|
-
BlinkMacSystemFont,
|
|
338
|
-
system-ui,
|
|
339
|
-
Roboto,
|
|
340
|
-
sans-serif;
|
|
341
|
-
font-size: var(--text-lg);
|
|
342
|
-
font-weight: var(--font-weight-medium);
|
|
343
|
-
line-height: 1.5;
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
h4 {
|
|
347
|
-
font-family:
|
|
348
|
-
"Pretendard",
|
|
349
|
-
-apple-system,
|
|
350
|
-
BlinkMacSystemFont,
|
|
351
|
-
system-ui,
|
|
352
|
-
Roboto,
|
|
353
|
-
sans-serif;
|
|
354
|
-
font-size: var(--text-base);
|
|
355
|
-
font-weight: var(--font-weight-medium);
|
|
356
|
-
line-height: 1.5;
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
p {
|
|
360
|
-
font-family:
|
|
361
|
-
"Pretendard",
|
|
362
|
-
-apple-system,
|
|
363
|
-
BlinkMacSystemFont,
|
|
364
|
-
system-ui,
|
|
365
|
-
Roboto,
|
|
366
|
-
sans-serif;
|
|
367
|
-
font-size: var(--text-base);
|
|
368
|
-
font-weight: var(--font-weight-normal);
|
|
369
|
-
line-height: 1.5;
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
label {
|
|
373
|
-
font-family:
|
|
374
|
-
"Pretendard",
|
|
375
|
-
-apple-system,
|
|
376
|
-
BlinkMacSystemFont,
|
|
377
|
-
system-ui,
|
|
378
|
-
Roboto,
|
|
379
|
-
sans-serif;
|
|
380
|
-
font-size: var(--text-sm);
|
|
381
|
-
font-weight: var(--font-weight-normal);
|
|
382
|
-
line-height: 1.5;
|
|
383
|
-
}
|
|
384
|
-
|
|
385
|
-
button {
|
|
386
|
-
font-family:
|
|
387
|
-
"Pretendard",
|
|
388
|
-
-apple-system,
|
|
389
|
-
BlinkMacSystemFont,
|
|
390
|
-
system-ui,
|
|
391
|
-
Roboto,
|
|
392
|
-
sans-serif;
|
|
393
|
-
font-size: var(--text-base);
|
|
394
|
-
font-weight: var(--font-weight-medium);
|
|
395
|
-
line-height: 1.5;
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
input {
|
|
399
|
-
font-family:
|
|
400
|
-
"Pretendard",
|
|
401
|
-
-apple-system,
|
|
402
|
-
BlinkMacSystemFont,
|
|
403
|
-
system-ui,
|
|
404
|
-
Roboto,
|
|
405
|
-
sans-serif;
|
|
406
|
-
font-size: var(--text-base);
|
|
407
|
-
font-weight: var(--font-weight-normal);
|
|
408
|
-
line-height: 1.5;
|
|
409
|
-
}
|
|
317
|
+
h1 {
|
|
318
|
+
font-size: var(--text-2xl);
|
|
319
|
+
font-weight: var(--font-weight-medium);
|
|
320
|
+
line-height: 1.5;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
h2 {
|
|
324
|
+
font-size: var(--text-xl);
|
|
325
|
+
font-weight: var(--font-weight-medium);
|
|
326
|
+
line-height: 1.5;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
h3 {
|
|
330
|
+
font-size: var(--text-lg);
|
|
331
|
+
font-weight: var(--font-weight-medium);
|
|
332
|
+
line-height: 1.5;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
h4 {
|
|
336
|
+
font-size: var(--text-base);
|
|
337
|
+
font-weight: var(--font-weight-medium);
|
|
338
|
+
line-height: 1.5;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
button {
|
|
342
|
+
font-weight: var(--font-weight-medium);
|
|
410
343
|
}
|
|
411
344
|
}
|
|
412
345
|
|
|
413
346
|
html {
|
|
414
347
|
font-size: var(--font-size);
|
|
415
348
|
}
|
|
416
|
-
|
|
417
349
|
/* Custom Scrollbar Styles */
|
|
418
350
|
::-webkit-scrollbar {
|
|
419
351
|
width: 8px;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sonamu-kit/react-components",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.8",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "CartaNova <dev@cartanova.ai>",
|
|
6
6
|
"repository": {
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
"postcss": "^8.4.49",
|
|
115
115
|
"storybook": "^10.2.19",
|
|
116
116
|
"tailwindcss": "^4.0.0",
|
|
117
|
-
"typescript": "
|
|
117
|
+
"typescript": "7.1.0-dev.20260831.1",
|
|
118
118
|
"unplugin-icons": "0.20.2",
|
|
119
119
|
"vite": "8.0.16",
|
|
120
120
|
"vite-plugin-dts": "5.0.2",
|