@bestow-ui/react 0.11.0 → 1.0.0
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 +31 -14
- package/dist/chunk-PFEZ3D2H.js +212 -0
- package/dist/chunk-PFEZ3D2H.js.map +1 -0
- package/dist/client.js +3112 -0
- package/dist/client.js.map +1 -0
- package/dist/index.cjs +1254 -718
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +218 -112
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +278 -87
- package/dist/index.d.ts +278 -87
- package/dist/index.js +2 -2981
- package/dist/shared.js +246 -0
- package/dist/shared.js.map +1 -0
- package/package.json +14 -8
- package/dist/index.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _bestow_ui_tokens from '@bestow-ui/tokens';
|
|
2
2
|
import { space } from '@bestow-ui/tokens';
|
|
3
3
|
import * as react from 'react';
|
|
4
|
-
import { HTMLAttributes, CSSProperties, ComponentPropsWithoutRef,
|
|
4
|
+
import { ReactNode, HTMLAttributes, CSSProperties, ComponentPropsWithoutRef, InputHTMLAttributes, ElementType, ButtonHTMLAttributes, AnchorHTMLAttributes, ReactElement, TdHTMLAttributes, ThHTMLAttributes, TextareaHTMLAttributes } from 'react';
|
|
5
5
|
import * as RadixAccordion from '@radix-ui/react-accordion';
|
|
6
6
|
import * as Dialog from '@radix-ui/react-dialog';
|
|
7
7
|
import * as RadixMenu from '@radix-ui/react-dropdown-menu';
|
|
@@ -250,7 +250,8 @@ declare function contrastRatio(a: string, b: string): number;
|
|
|
250
250
|
type IntentName = 'primary' | 'neutral' | 'danger' | 'success' | 'warning';
|
|
251
251
|
/**
|
|
252
252
|
* 대표색 하나로 intent(primary 등)의 라이트·다크 색 세트를 만든다. 결과는 createTheme 에 넘긴다.
|
|
253
|
-
* - solid 는 넘긴 색을 그대로 쓴다 (다크모드에서 너무 어두우면 조금 밝힌다).
|
|
253
|
+
* - solid 는 넘긴 색을 그대로 쓴다 (다크모드에서 너무 어두우면 조금 밝힌다). 단 흰 글자·짙은 글자 모두
|
|
254
|
+
* 대비 4.5:1 이 안 나오는 중간 밝기 색이면 4.5 가 나올 만큼만 밝기를 옮긴다.
|
|
254
255
|
* - text 와 contrast(solid 위 글자색)는 WCAG AA 대비 4.5:1 을 만족하도록 계산한다.
|
|
255
256
|
* - intent 가 'primary' 면 포커스 링 색(border.focus)도 함께 바꾼다.
|
|
256
257
|
*
|
|
@@ -258,50 +259,142 @@ type IntentName = 'primary' | 'neutral' | 'danger' | 'success' | 'warning';
|
|
|
258
259
|
*/
|
|
259
260
|
declare function createIntentColors(intent: IntentName, color: string): ThemeInput;
|
|
260
261
|
|
|
261
|
-
interface ThemeProviderProps extends HTMLAttributes<HTMLDivElement> {
|
|
262
|
-
/** 라이트/다크 모드. 생략하면 바깥 ThemeProvider 의 모드를 이어받는다 (최상위는 light). */
|
|
263
|
-
theme?: ThemeName;
|
|
264
|
-
/**
|
|
265
|
-
* createTheme 으로 만든 브랜드 테마. 모드를 바꿔도 유지되고, 중첩된 ThemeProvider 는 바깥 값을 이어받는다
|
|
266
|
-
* (안쪽에서 준 값이 우선).
|
|
267
|
-
*/
|
|
268
|
-
overrides?: BestowTheme;
|
|
269
|
-
}
|
|
270
|
-
declare const ThemeProvider: react.ForwardRefExoticComponent<ThemeProviderProps & react.RefAttributes<HTMLDivElement>>;
|
|
271
|
-
/** 현재 적용 중인 모드(light/dark)를 반환한다. */
|
|
272
|
-
declare function useTheme(): ThemeName;
|
|
273
262
|
/**
|
|
274
|
-
*
|
|
275
|
-
*
|
|
263
|
+
* 컴포넌트의 기본 문구. 모두 생략할 수 있고, 생략하면 각 컴포넌트의 한국어 기본값을 쓴다.
|
|
264
|
+
* 우선순위: 컴포넌트에 직접 준 prop > LocaleProvider 의 messages > 한국어 기본값.
|
|
276
265
|
*
|
|
277
|
-
*
|
|
266
|
+
* 한국어 기본값을 하나의 객체로 모으지 않고 각 컴포넌트에 두는 이유: 그 객체를 import 하면 Button 하나만 써도
|
|
267
|
+
* 모든 문구가 번들에 딸려 온다(Button → Spinner). 이 파일에는 타입과 Provider 만 둔다.
|
|
278
268
|
*/
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
269
|
+
interface BestowMessages {
|
|
270
|
+
/** 닫기 버튼 (Modal, Drawer, Popover, Toast, Alert) — "닫기" */
|
|
271
|
+
close: string;
|
|
272
|
+
/** Spinner — "로딩 중" */
|
|
273
|
+
loading: string;
|
|
274
|
+
/** Toast 영역 — "알림" */
|
|
275
|
+
notifications: string;
|
|
276
|
+
/** Breadcrumb — "이동 경로" */
|
|
277
|
+
breadcrumb: string;
|
|
278
|
+
/** Pagination — "페이지 탐색", "이전 페이지", "다음 페이지", "3 페이지" */
|
|
279
|
+
pagination: string;
|
|
280
|
+
paginationPrevious: string;
|
|
281
|
+
paginationNext: string;
|
|
282
|
+
paginationPage: (page: number) => string;
|
|
283
|
+
/** Link external — "(새 창)" */
|
|
284
|
+
newWindow: string;
|
|
285
|
+
/** Combobox — "결과가 없어요", "목록 열기" */
|
|
286
|
+
noResults: string;
|
|
287
|
+
openList: string;
|
|
288
|
+
/** Slider 범위 손잡이 — "최소", "최대" */
|
|
289
|
+
rangeStart: string;
|
|
290
|
+
rangeEnd: string;
|
|
291
|
+
/** AgreementGroup — "전체 동의", "필수", "선택", "보기", "접기" */
|
|
292
|
+
agreeAll: string;
|
|
293
|
+
required: string;
|
|
294
|
+
optional: string;
|
|
295
|
+
show: string;
|
|
296
|
+
hide: string;
|
|
297
|
+
/** VerificationCodeInput — "인증번호", "6자리 숫자를 입력하세요.", "재전송", "인증 시간이 지났어요. 재전송해 주세요." */
|
|
298
|
+
verificationCode: string;
|
|
299
|
+
verificationCodeHint: (length: number, type: 'numeric' | 'alphanumeric') => string;
|
|
300
|
+
resend: string;
|
|
301
|
+
verificationExpired: string;
|
|
302
|
+
/** PhoneNumberInput — "휴대폰 번호" */
|
|
303
|
+
phoneNumber: string;
|
|
304
|
+
/** BusinessNumberInput — "사업자등록번호" 와 검증 문구 */
|
|
305
|
+
businessNumber: string;
|
|
306
|
+
businessNumberInvalid: string;
|
|
307
|
+
businessNumberIncomplete: string;
|
|
308
|
+
/** AmountInput — "금액", "원" */
|
|
309
|
+
amount: string;
|
|
310
|
+
currencyUnit: string;
|
|
311
|
+
/** AddressInput */
|
|
312
|
+
address: string;
|
|
313
|
+
addressSearch: string;
|
|
314
|
+
addressSearchDescription: string;
|
|
315
|
+
postalCode: string;
|
|
316
|
+
baseAddress: string;
|
|
317
|
+
baseAddressPlaceholder: string;
|
|
318
|
+
detailAddress: string;
|
|
319
|
+
detailAddressPlaceholder: string;
|
|
320
|
+
addressLoading: string;
|
|
321
|
+
addressLoadError: string;
|
|
322
|
+
/** Calendar */
|
|
323
|
+
previousMonth: string;
|
|
324
|
+
nextMonth: string;
|
|
325
|
+
/** 달 제목 — month 는 1~12 */
|
|
326
|
+
monthTitle: (year: number, month: number) => string;
|
|
327
|
+
/** 요일 머리글 (일요일부터 7개) */
|
|
328
|
+
weekdaysShort: readonly string[];
|
|
329
|
+
/** 요일 전체 이름 (일요일부터 7개) */
|
|
330
|
+
weekdaysLong: readonly string[];
|
|
331
|
+
/** 날짜 버튼 이름 — 화면에 보이는 날짜 숫자로 시작해야 한다 (WCAG 2.5.3) */
|
|
332
|
+
dayLabel: (date: Date, weekdayLong: string) => string;
|
|
333
|
+
holiday: string;
|
|
334
|
+
today: string;
|
|
335
|
+
/** DatePicker */
|
|
336
|
+
date: string;
|
|
337
|
+
openCalendar: string;
|
|
338
|
+
calendar: string;
|
|
339
|
+
dateInvalid: string;
|
|
340
|
+
dateUnavailable: string;
|
|
341
|
+
dateIncomplete: string;
|
|
342
|
+
}
|
|
343
|
+
type Messages = Partial<BestowMessages>;
|
|
344
|
+
interface LocaleProviderProps {
|
|
345
|
+
/** 바꿀 문구. 일부만 넘기면 나머지는 바깥 LocaleProvider 또는 한국어 기본값을 쓴다 */
|
|
346
|
+
messages: Messages;
|
|
347
|
+
children?: ReactNode;
|
|
348
|
+
}
|
|
283
349
|
/**
|
|
284
|
-
*
|
|
350
|
+
* 컴포넌트 기본 문구를 한곳에서 바꾼다 (다국어 대응 등). 중첩하면 바깥 값을 이어받고 안쪽이 우선한다.
|
|
351
|
+
* @example <LocaleProvider messages={en}>…</LocaleProvider>
|
|
352
|
+
* @example <LocaleProvider messages={{ close: '창 닫기' }}>…</LocaleProvider>
|
|
285
353
|
*/
|
|
286
|
-
declare function
|
|
354
|
+
declare function LocaleProvider({ messages, children }: LocaleProviderProps): react.JSX.Element;
|
|
355
|
+
/** LocaleProvider 로 바꾼 문구 (없으면 빈 객체 — 각 컴포넌트가 한국어 기본값을 쓴다) */
|
|
356
|
+
declare function useMessages(): Messages;
|
|
287
357
|
|
|
288
358
|
/**
|
|
289
|
-
*
|
|
290
|
-
*
|
|
359
|
+
* 영어 문구. `<LocaleProvider messages={en}>` 로 쓴다. 따로 import 할 때만 번들에 들어간다.
|
|
360
|
+
* 한국 서비스 전용 부품(사업자등록번호 등)의 문구도 영어로 바뀌지만 서식(하이픈 위치 등)은 그대로다.
|
|
291
361
|
*/
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
362
|
+
declare const en: BestowMessages;
|
|
363
|
+
|
|
364
|
+
/**
|
|
365
|
+
* 숫자만 있는 전화번호에 하이픈을 넣는다. 입력 중인 값도 자연스럽게 나눈다.
|
|
366
|
+
* @example formatPhoneNumber('01012345678') // '010-1234-5678'
|
|
367
|
+
* @example formatPhoneNumber('021234567') // '02-123-4567'
|
|
368
|
+
* @example formatPhoneNumber('15881234') // '1588-1234'
|
|
369
|
+
*/
|
|
370
|
+
declare function formatPhoneNumber(input: string): string;
|
|
371
|
+
/**
|
|
372
|
+
* 사업자등록번호(10자리)에 하이픈을 넣는다.
|
|
373
|
+
* @example formatBusinessNumber('1234567890') // '123-45-67890'
|
|
374
|
+
*/
|
|
375
|
+
declare function formatBusinessNumber(input: string): string;
|
|
376
|
+
/**
|
|
377
|
+
* 사업자등록번호 검증 공식(가중치 1,3,7,1,3,7,1,3,5)으로 확인한다. 실제로 등록된 번호인지는 국세청 조회가 필요하다.
|
|
378
|
+
* @example isValidBusinessNumber('124-81-00998') // true
|
|
379
|
+
*/
|
|
380
|
+
declare function isValidBusinessNumber(input: string): boolean;
|
|
381
|
+
/**
|
|
382
|
+
* 금액을 만·억·조 단위로 읽기 쉽게 쓴다.
|
|
383
|
+
* @example formatKoreanAmount(125000) // '12만 5,000원'
|
|
384
|
+
* @example formatKoreanAmount(150000000) // '1억 5,000만원'
|
|
385
|
+
* @example formatKoreanAmount(0) // '0원'
|
|
386
|
+
*/
|
|
387
|
+
declare function formatKoreanAmount(amount: number, unit?: string): string;
|
|
388
|
+
|
|
389
|
+
/** Date → 'YYYY-MM-DD' (로컬 기준) */
|
|
390
|
+
declare function toISODate(date: Date): string;
|
|
391
|
+
/** 'YYYY-MM-DD' → Date (로컬 자정). 형식이 틀리거나 없는 날짜(2월 30일 등)면 null */
|
|
392
|
+
declare function parseISODate(value: string | null | undefined): Date | null;
|
|
393
|
+
/**
|
|
394
|
+
* 한국어 날짜. 스크린리더용 날짜 이름 등에 쓴다.
|
|
395
|
+
* @example formatKoreanDate(new Date(2026, 9, 15)) // '2026년 10월 15일 목요일'
|
|
396
|
+
*/
|
|
397
|
+
declare function formatKoreanDate(date: Date, withWeekday?: boolean): string;
|
|
305
398
|
|
|
306
399
|
/** 주소 검색 결과 */
|
|
307
400
|
interface AddressSearchResult {
|
|
@@ -335,6 +428,59 @@ declare function composeExtraAddress(data: Pick<KakaoPostcodeData, 'userSelected
|
|
|
335
428
|
*/
|
|
336
429
|
declare const kakaoPostcodeProvider: AddressProvider;
|
|
337
430
|
|
|
431
|
+
interface AgreementItem {
|
|
432
|
+
value: string;
|
|
433
|
+
/** 약관 이름 (예: "서비스 이용약관 동의") */
|
|
434
|
+
label: ReactNode;
|
|
435
|
+
/** 필수 동의 여부. 이름 앞에 "필수"/"선택" 이 붙는다 */
|
|
436
|
+
required?: boolean;
|
|
437
|
+
/** 펼쳐서 보여 줄 약관 내용. 있으면 "보기" 버튼이 생긴다 */
|
|
438
|
+
content?: ReactNode;
|
|
439
|
+
}
|
|
440
|
+
/** 필수 항목에 모두 동의했는지 */
|
|
441
|
+
declare function hasAllRequiredAgreements(items: AgreementItem[], value: string[]): boolean;
|
|
442
|
+
|
|
443
|
+
interface ThemeProviderProps extends HTMLAttributes<HTMLDivElement> {
|
|
444
|
+
/** 라이트/다크 모드. 생략하면 바깥 ThemeProvider 의 모드를 이어받는다 (최상위는 light). */
|
|
445
|
+
theme?: ThemeName;
|
|
446
|
+
/**
|
|
447
|
+
* createTheme 으로 만든 브랜드 테마. 모드를 바꿔도 유지되고, 중첩된 ThemeProvider 는 바깥 값을 이어받는다
|
|
448
|
+
* (안쪽에서 준 값이 우선).
|
|
449
|
+
*/
|
|
450
|
+
overrides?: BestowTheme;
|
|
451
|
+
}
|
|
452
|
+
declare const ThemeProvider: react.ForwardRefExoticComponent<ThemeProviderProps & react.RefAttributes<HTMLDivElement>>;
|
|
453
|
+
/** 현재 적용 중인 모드(light/dark)를 반환한다. */
|
|
454
|
+
declare function useTheme(): ThemeName;
|
|
455
|
+
/**
|
|
456
|
+
* Portal 로 ThemeProvider 바깥(body)에 렌더링되는 요소에 펼쳐 넣을 props.
|
|
457
|
+
* 현재 모드의 CSS 변수, 브랜드 오버라이드, 기본 글꼴을 다시 적용한다.
|
|
458
|
+
*
|
|
459
|
+
* @example const portal = usePortalProps(); <Content className={cx(portal.className, styles.content)} style={portal.style} />
|
|
460
|
+
*/
|
|
461
|
+
declare function usePortalProps(): {
|
|
462
|
+
className: string;
|
|
463
|
+
style?: CSSProperties;
|
|
464
|
+
};
|
|
465
|
+
|
|
466
|
+
/**
|
|
467
|
+
* `type="single"`: 한 번에 하나만 열린다 (`value: string`). `collapsible` 이면 열린 항목을 다시 눌러 닫을 수 있다.
|
|
468
|
+
* `type="multiple"`: 여러 개를 함께 열 수 있다 (`value: string[]`).
|
|
469
|
+
*/
|
|
470
|
+
type AccordionProps = ComponentPropsWithoutRef<typeof RadixAccordion.Root>;
|
|
471
|
+
declare const Accordion: react.ForwardRefExoticComponent<AccordionProps & react.RefAttributes<HTMLDivElement>>;
|
|
472
|
+
interface AccordionItemProps extends Omit<ComponentPropsWithoutRef<typeof RadixAccordion.Item>, 'title'> {
|
|
473
|
+
/** 항목 값. Accordion 의 value 와 비교한다 */
|
|
474
|
+
value: string;
|
|
475
|
+
/** 항목 제목 (펼침 버튼의 이름) */
|
|
476
|
+
title: ReactNode;
|
|
477
|
+
/** 제목을 감싸는 heading 수준. 페이지의 heading 구조에 맞춘다 (기본 3) */
|
|
478
|
+
headingLevel?: 2 | 3 | 4 | 5 | 6;
|
|
479
|
+
/** 펼쳤을 때 보이는 내용 */
|
|
480
|
+
children?: ReactNode;
|
|
481
|
+
}
|
|
482
|
+
declare const AccordionItem: react.ForwardRefExoticComponent<AccordionItemProps & react.RefAttributes<HTMLDivElement>>;
|
|
483
|
+
|
|
338
484
|
interface AddressValue {
|
|
339
485
|
/** 우편번호 */
|
|
340
486
|
zonecode: string;
|
|
@@ -376,15 +522,6 @@ interface AddressInputProps {
|
|
|
376
522
|
*/
|
|
377
523
|
declare const AddressInput: react.ForwardRefExoticComponent<AddressInputProps & react.RefAttributes<HTMLFieldSetElement>>;
|
|
378
524
|
|
|
379
|
-
interface AgreementItem {
|
|
380
|
-
value: string;
|
|
381
|
-
/** 약관 이름 (예: "서비스 이용약관 동의") */
|
|
382
|
-
label: ReactNode;
|
|
383
|
-
/** 필수 동의 여부. 이름 앞에 "필수"/"선택" 이 붙는다 */
|
|
384
|
-
required?: boolean;
|
|
385
|
-
/** 펼쳐서 보여 줄 약관 내용. 있으면 "보기" 버튼이 생긴다 */
|
|
386
|
-
content?: ReactNode;
|
|
387
|
-
}
|
|
388
525
|
interface AgreementGroupProps {
|
|
389
526
|
items: AgreementItem[];
|
|
390
527
|
/** 동의한 항목의 value 목록 (제어 모드) */
|
|
@@ -411,8 +548,6 @@ interface AgreementGroupProps {
|
|
|
411
548
|
name?: string;
|
|
412
549
|
className?: string;
|
|
413
550
|
}
|
|
414
|
-
/** 필수 항목에 모두 동의했는지 */
|
|
415
|
-
declare function hasAllRequiredAgreements(items: AgreementItem[], value: string[]): boolean;
|
|
416
551
|
/**
|
|
417
552
|
* 약관 동의 묶음. "전체 동의" 와 개별 항목이 서로 맞춰지고(일부만 동의하면 전체 동의는 부분 선택 상태),
|
|
418
553
|
* 항목마다 필수·선택 표시와 약관 내용 펼쳐 보기를 지원한다.
|
|
@@ -586,6 +721,40 @@ interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'col
|
|
|
586
721
|
}
|
|
587
722
|
declare const Button: react.ForwardRefExoticComponent<ButtonProps & react.RefAttributes<HTMLButtonElement>>;
|
|
588
723
|
|
|
724
|
+
interface CalendarProps {
|
|
725
|
+
/** 선택된 날짜 'YYYY-MM-DD' (제어 모드) */
|
|
726
|
+
value?: string;
|
|
727
|
+
/** 처음 선택된 날짜 (비제어 모드) */
|
|
728
|
+
defaultValue?: string;
|
|
729
|
+
/** 날짜를 고를 때 호출된다 */
|
|
730
|
+
onValueChange?: (value: string) => void;
|
|
731
|
+
/** 고를 수 있는 가장 이른 날짜 'YYYY-MM-DD' */
|
|
732
|
+
min?: string;
|
|
733
|
+
/** 고를 수 있는 가장 늦은 날짜 'YYYY-MM-DD' */
|
|
734
|
+
max?: string;
|
|
735
|
+
/** 고를 수 없는 날짜 (예: 주말 제외) */
|
|
736
|
+
isDateDisabled?: (date: Date) => boolean;
|
|
737
|
+
/** 공휴일. 일요일처럼 빨갛게 표시하고 스크린리더에 "공휴일" 을 덧붙인다 */
|
|
738
|
+
isHoliday?: (date: Date) => boolean;
|
|
739
|
+
/**
|
|
740
|
+
* 오늘 날짜 'YYYY-MM-DD'. 기본은 브라우저의 오늘 — 테스트·스크린샷에서 고정할 때 쓴다.
|
|
741
|
+
* 서버 렌더링에서는 서버와 브라우저의 날짜(시간대)가 다를 수 있어, 없으면 hydration 이 끝난 뒤에 정한다
|
|
742
|
+
* (선택된 날짜도 없으면 그 전까지 날짜 칸을 비워 둔다).
|
|
743
|
+
*/
|
|
744
|
+
today?: string;
|
|
745
|
+
/** 처음 그릴 때 날짜(선택된 날짜, 없으면 오늘)로 포커스를 옮긴다 — 팝업 안에서 쓸 때 */
|
|
746
|
+
initialFocus?: boolean;
|
|
747
|
+
/** 이전·다음 달 버튼 이름 */
|
|
748
|
+
prevMonthLabel?: string;
|
|
749
|
+
nextMonthLabel?: string;
|
|
750
|
+
className?: string;
|
|
751
|
+
}
|
|
752
|
+
/**
|
|
753
|
+
* 달력 (WAI-ARIA grid). 일요일부터 시작하고 일요일·공휴일은 빨강, 토요일은 파랑으로 표시한다.
|
|
754
|
+
* 키보드: ←→ 하루, ↑↓ 일주일, Home/End 주의 처음·끝, PageUp/PageDown 한 달(Shift 와 함께 1년), Enter/Space 선택.
|
|
755
|
+
*/
|
|
756
|
+
declare const Calendar: react.ForwardRefExoticComponent<CalendarProps & react.RefAttributes<HTMLDivElement>>;
|
|
757
|
+
|
|
589
758
|
interface CardProps extends HTMLAttributes<HTMLElement> {
|
|
590
759
|
/** 시각적 스타일. outline 은 테두리, elevated 는 그림자(다크 모드는 가장자리 ring 포함), soft 는 옅은 배경 */
|
|
591
760
|
variant?: 'outline' | 'elevated' | 'soft';
|
|
@@ -613,6 +782,8 @@ interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'siz
|
|
|
613
782
|
indeterminate?: boolean;
|
|
614
783
|
/** 에러 상태 */
|
|
615
784
|
invalid?: boolean;
|
|
785
|
+
/** 체크 상태가 바뀌면 호출된다 (Switch 와 같은 이름). 기본 `onChange` 도 그대로 쓸 수 있다 */
|
|
786
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
616
787
|
}
|
|
617
788
|
declare const Checkbox: react.ForwardRefExoticComponent<CheckboxProps & react.RefAttributes<HTMLInputElement>>;
|
|
618
789
|
|
|
@@ -661,6 +832,47 @@ interface ComboboxProps {
|
|
|
661
832
|
*/
|
|
662
833
|
declare const Combobox: react.ForwardRefExoticComponent<ComboboxProps & react.RefAttributes<HTMLInputElement>>;
|
|
663
834
|
|
|
835
|
+
interface DatePickerProps {
|
|
836
|
+
/** 날짜 'YYYY-MM-DD' (제어 모드). 비어 있으면 '' */
|
|
837
|
+
value?: string;
|
|
838
|
+
/** 처음 날짜 (비제어 모드) */
|
|
839
|
+
defaultValue?: string;
|
|
840
|
+
/** 올바른 날짜를 다 입력하거나 달력에서 고르면 'YYYY-MM-DD', 지우거나 잘못되면 '' 로 호출된다 */
|
|
841
|
+
onValueChange?: (value: string) => void;
|
|
842
|
+
/** 고를 수 있는 가장 이른·늦은 날짜 'YYYY-MM-DD' */
|
|
843
|
+
min?: string;
|
|
844
|
+
max?: string;
|
|
845
|
+
/** 고를 수 없는 날짜 */
|
|
846
|
+
isDateDisabled?: (date: Date) => boolean;
|
|
847
|
+
/** 공휴일 (달력에 빨갛게 표시) */
|
|
848
|
+
isHoliday?: (date: Date) => boolean;
|
|
849
|
+
/** 오늘 날짜 'YYYY-MM-DD' (테스트·스크린샷 고정용) */
|
|
850
|
+
today?: string;
|
|
851
|
+
label?: ReactNode;
|
|
852
|
+
/** 아래 도움말. error 일 때는 에러 메시지로 표시된다 */
|
|
853
|
+
helperText?: ReactNode;
|
|
854
|
+
error?: boolean;
|
|
855
|
+
required?: boolean;
|
|
856
|
+
disabled?: boolean;
|
|
857
|
+
fullWidth?: boolean;
|
|
858
|
+
placeholder?: string;
|
|
859
|
+
/** 달력 버튼·달력 창 이름 */
|
|
860
|
+
calendarLabel?: string;
|
|
861
|
+
/** 자동 검증 문구 */
|
|
862
|
+
invalidText?: string;
|
|
863
|
+
unavailableText?: string;
|
|
864
|
+
incompleteText?: string;
|
|
865
|
+
/** form 제출 시 이름 ('YYYY-MM-DD' 가 제출된다) */
|
|
866
|
+
name?: string;
|
|
867
|
+
id?: string;
|
|
868
|
+
className?: string;
|
|
869
|
+
}
|
|
870
|
+
/**
|
|
871
|
+
* 날짜 입력. `YYYY-MM-DD` 로 직접 입력하거나(숫자만 쳐도 하이픈이 들어간다) 달력 버튼으로 고른다.
|
|
872
|
+
* 달력은 일요일부터 시작하고, 열면 선택된 날짜(없으면 오늘)로 포커스가 간다. 값은 시간대 문제가 없는 'YYYY-MM-DD' 문자열이다.
|
|
873
|
+
*/
|
|
874
|
+
declare const DatePicker: react.ForwardRefExoticComponent<DatePickerProps & react.RefAttributes<HTMLInputElement>>;
|
|
875
|
+
|
|
664
876
|
interface DividerProps extends HTMLAttributes<HTMLDivElement> {
|
|
665
877
|
/** 방향. vertical 은 flex 행 안에서 부모 높이를 채운다 */
|
|
666
878
|
orientation?: 'horizontal' | 'vertical';
|
|
@@ -734,7 +946,7 @@ interface DropdownMenuItemProps extends Omit<ComponentPropsWithoutRef<typeof Rad
|
|
|
734
946
|
/** 오른쪽에 표시할 단축키 (예: "⌘K"). 표시용이라 항목 이름에는 포함되지 않는다 */
|
|
735
947
|
shortcut?: string;
|
|
736
948
|
/** danger 는 삭제처럼 되돌리기 어려운 동작 */
|
|
737
|
-
color?: '
|
|
949
|
+
color?: 'neutral' | 'danger';
|
|
738
950
|
}
|
|
739
951
|
declare const DropdownMenuItem: react.ForwardRefExoticComponent<DropdownMenuItemProps & react.RefAttributes<HTMLDivElement>>;
|
|
740
952
|
type DropdownMenuLabelProps = ComponentPropsWithoutRef<typeof RadixMenu.Label>;
|
|
@@ -827,7 +1039,8 @@ declare function Modal({ open, defaultOpen, onOpenChange, trigger, title, descri
|
|
|
827
1039
|
*/
|
|
828
1040
|
declare const ModalClose: react.ForwardRefExoticComponent<Dialog.DialogCloseProps & react.RefAttributes<HTMLButtonElement>>;
|
|
829
1041
|
|
|
830
|
-
|
|
1042
|
+
/** getItemLabel 이 이름을 만드는 버튼 종류 */
|
|
1043
|
+
type PaginationItemType = 'previous' | 'next' | 'page';
|
|
831
1044
|
interface PaginationProps extends Omit<HTMLAttributes<HTMLElement>, 'onChange'> {
|
|
832
1045
|
/** 전체 페이지 수. 1 미만이면 아무것도 렌더링하지 않는다 */
|
|
833
1046
|
totalPages: number;
|
|
@@ -844,7 +1057,7 @@ interface PaginationProps extends Omit<HTMLAttributes<HTMLElement>, 'onChange'>
|
|
|
844
1057
|
/** 크기 */
|
|
845
1058
|
size?: 'sm' | 'md';
|
|
846
1059
|
/** 버튼의 스크린리더용 이름 (다국어 대응). 기본: "이전 페이지", "다음 페이지", "3 페이지" */
|
|
847
|
-
getItemLabel?: (type:
|
|
1060
|
+
getItemLabel?: (type: PaginationItemType, page: number) => string;
|
|
848
1061
|
}
|
|
849
1062
|
declare const Pagination: react.ForwardRefExoticComponent<PaginationProps & react.RefAttributes<HTMLElement>>;
|
|
850
1063
|
|
|
@@ -891,8 +1104,10 @@ interface PopoverProps {
|
|
|
891
1104
|
className?: string;
|
|
892
1105
|
/** 팝오버 style (너비 지정 등) */
|
|
893
1106
|
style?: CSSProperties;
|
|
1107
|
+
/** 열릴 때 포커스 처리. 기본은 내용의 첫 요소로 간다 — `event.preventDefault()` 후 원하는 요소에 focus() 할 수 있다 */
|
|
1108
|
+
onOpenAutoFocus?: (event: Event) => void;
|
|
894
1109
|
}
|
|
895
|
-
declare function Popover({ content, children, title, 'aria-label': ariaLabel, showClose, showArrow, side, align, open, defaultOpen, onOpenChange, modal, className, style, }: PopoverProps): react.JSX.Element;
|
|
1110
|
+
declare function Popover({ content, children, title, 'aria-label': ariaLabel, showClose, showArrow, side, align, open, defaultOpen, onOpenChange, modal, className, style, onOpenAutoFocus, }: PopoverProps): react.JSX.Element;
|
|
896
1111
|
/**
|
|
897
1112
|
* 팝오버 내용 안에서 누르면 팝오버를 닫는 요소.
|
|
898
1113
|
* @example <PopoverClose asChild><Button>확인</Button></PopoverClose>
|
|
@@ -1056,8 +1271,8 @@ declare const Slider: react.ForwardRefExoticComponent<SliderProps & react.RefAtt
|
|
|
1056
1271
|
interface SpinnerProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'color'> {
|
|
1057
1272
|
/** 크기 (sm 16px, md 20px, lg 28px) */
|
|
1058
1273
|
size?: 'sm' | 'md' | 'lg';
|
|
1059
|
-
/** 색상. `
|
|
1060
|
-
color?: '
|
|
1274
|
+
/** 색상. `inherit`(기본)는 부모 글자색을 그대로 쓴다 */
|
|
1275
|
+
color?: 'inherit' | 'primary' | 'neutral' | 'danger';
|
|
1061
1276
|
/**
|
|
1062
1277
|
* 스크린리더가 읽을 텍스트 (기본 "로딩 중").
|
|
1063
1278
|
* 빈 문자열이면 장식용으로 보고 `aria-hidden` 처리한다 — 버튼처럼 바깥 요소가 이미 상태를 알릴 때 쓴다.
|
|
@@ -1137,10 +1352,10 @@ interface TableRowProps extends HTMLAttributes<HTMLTableRowElement> {
|
|
|
1137
1352
|
selected?: boolean;
|
|
1138
1353
|
}
|
|
1139
1354
|
declare const TableRow: react.ForwardRefExoticComponent<TableRowProps & react.RefAttributes<HTMLTableRowElement>>;
|
|
1140
|
-
type
|
|
1355
|
+
type TableAlign = 'left' | 'center' | 'right';
|
|
1141
1356
|
interface TableHeadProps extends Omit<ThHTMLAttributes<HTMLTableCellElement>, 'align'> {
|
|
1142
1357
|
/** 정렬 */
|
|
1143
|
-
align?:
|
|
1358
|
+
align?: TableAlign;
|
|
1144
1359
|
/**
|
|
1145
1360
|
* 이 열의 정렬 상태. onSort 와 함께 주면 머리 셀이 정렬 버튼이 되고 `aria-sort` 를 붙인다.
|
|
1146
1361
|
* 정렬되지 않은 열은 'none'.
|
|
@@ -1152,7 +1367,7 @@ interface TableHeadProps extends Omit<ThHTMLAttributes<HTMLTableCellElement>, 'a
|
|
|
1152
1367
|
declare const TableHead: react.ForwardRefExoticComponent<TableHeadProps & react.RefAttributes<HTMLTableCellElement>>;
|
|
1153
1368
|
interface TableCellProps extends Omit<TdHTMLAttributes<HTMLTableCellElement>, 'align'> {
|
|
1154
1369
|
/** 정렬 (숫자는 right 권장) */
|
|
1155
|
-
align?:
|
|
1370
|
+
align?: TableAlign;
|
|
1156
1371
|
}
|
|
1157
1372
|
declare const TableCell: react.ForwardRefExoticComponent<TableCellProps & react.RefAttributes<HTMLTableCellElement>>;
|
|
1158
1373
|
|
|
@@ -1208,13 +1423,14 @@ interface TextareaProps extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>
|
|
|
1208
1423
|
}
|
|
1209
1424
|
declare const Textarea: react.ForwardRefExoticComponent<TextareaProps & react.RefAttributes<HTMLTextAreaElement>>;
|
|
1210
1425
|
|
|
1426
|
+
type ToastColor = 'primary' | 'neutral' | 'danger' | 'success' | 'warning';
|
|
1211
1427
|
interface ToastOptions {
|
|
1212
1428
|
/** 제목 */
|
|
1213
1429
|
title: ReactNode;
|
|
1214
1430
|
/** 설명 */
|
|
1215
1431
|
description?: ReactNode;
|
|
1216
|
-
/** 의미 색상 */
|
|
1217
|
-
|
|
1432
|
+
/** 의미 색상 (기본 neutral) — Alert·Badge 의 `color` 와 같은 이름 */
|
|
1433
|
+
color?: ToastColor;
|
|
1218
1434
|
/** 자동으로 닫히기까지 시간(ms). Infinity 면 자동으로 닫히지 않는다 */
|
|
1219
1435
|
duration?: number;
|
|
1220
1436
|
/** 실행 버튼 */
|
|
@@ -1239,7 +1455,7 @@ interface ToastProviderProps {
|
|
|
1239
1455
|
label?: string;
|
|
1240
1456
|
}
|
|
1241
1457
|
/** 앱 최상단(ThemeProvider 안쪽)에 한 번 감싸고, 하위에서 useToast() 로 토스트를 띄운다. */
|
|
1242
|
-
declare function ToastProvider({ children, duration, label }: ToastProviderProps): react.JSX.Element;
|
|
1458
|
+
declare function ToastProvider({ children, duration, label: labelProp }: ToastProviderProps): react.JSX.Element;
|
|
1243
1459
|
declare function useToast(): ToastContextValue;
|
|
1244
1460
|
|
|
1245
1461
|
interface TooltipProps {
|
|
@@ -1322,29 +1538,4 @@ interface VerificationCodeInputProps {
|
|
|
1322
1538
|
*/
|
|
1323
1539
|
declare const VerificationCodeInput: react.ForwardRefExoticComponent<VerificationCodeInputProps & react.RefAttributes<HTMLInputElement>>;
|
|
1324
1540
|
|
|
1325
|
-
|
|
1326
|
-
* 숫자만 있는 전화번호에 하이픈을 넣는다. 입력 중인 값도 자연스럽게 나눈다.
|
|
1327
|
-
* @example formatPhoneNumber('01012345678') // '010-1234-5678'
|
|
1328
|
-
* @example formatPhoneNumber('021234567') // '02-123-4567'
|
|
1329
|
-
* @example formatPhoneNumber('15881234') // '1588-1234'
|
|
1330
|
-
*/
|
|
1331
|
-
declare function formatPhoneNumber(input: string): string;
|
|
1332
|
-
/**
|
|
1333
|
-
* 사업자등록번호(10자리)에 하이픈을 넣는다.
|
|
1334
|
-
* @example formatBusinessNumber('1234567890') // '123-45-67890'
|
|
1335
|
-
*/
|
|
1336
|
-
declare function formatBusinessNumber(input: string): string;
|
|
1337
|
-
/**
|
|
1338
|
-
* 사업자등록번호 검증 공식(가중치 1,3,7,1,3,7,1,3,5)으로 확인한다. 실제로 등록된 번호인지는 국세청 조회가 필요하다.
|
|
1339
|
-
* @example isValidBusinessNumber('124-81-00998') // true
|
|
1340
|
-
*/
|
|
1341
|
-
declare function isValidBusinessNumber(input: string): boolean;
|
|
1342
|
-
/**
|
|
1343
|
-
* 금액을 만·억·조 단위로 읽기 쉽게 쓴다.
|
|
1344
|
-
* @example formatKoreanAmount(125000) // '12만 5,000원'
|
|
1345
|
-
* @example formatKoreanAmount(150000000) // '1억 5,000만원'
|
|
1346
|
-
* @example formatKoreanAmount(0) // '0원'
|
|
1347
|
-
*/
|
|
1348
|
-
declare function formatKoreanAmount(amount: number, unit?: string): string;
|
|
1349
|
-
|
|
1350
|
-
export { Accordion, AccordionItem, type AccordionItemProps, type AccordionProps, AddressInput, type AddressInputProps, type AddressProvider, type AddressSearchResult, type AddressValue, AgreementGroup, type AgreementGroupProps, type AgreementItem, Alert, type AlertProps, AmountInput, type AmountInputProps, Avatar, type AvatarProps, Badge, type BadgeProps, type BestowTheme, Breadcrumb, type BreadcrumbItemData, type BreadcrumbProps, BusinessNumberInput, type BusinessNumberInputProps, Button, type ButtonProps, Card, CardBody, CardFooter, CardHeader, type CardProps, type CardSectionProps, Checkbox, type CheckboxProps, Combobox, type ComboboxOption, type ComboboxProps, type DeepPartial, Divider, type DividerProps, Drawer, DrawerClose, type DrawerProps, DropdownMenu, DropdownMenuContent, type DropdownMenuContentProps, DropdownMenuGroup, DropdownMenuItem, type DropdownMenuItemProps, DropdownMenuLabel, type DropdownMenuLabelProps, type DropdownMenuProps, DropdownMenuSeparator, type DropdownMenuSeparatorProps, DropdownMenuTrigger, type DropdownMenuTriggerProps, IconButton, type IconButtonProps, Input, type InputProps, type IntentName, Link, type LinkProps, Modal, ModalClose, type ModalProps, Pagination, type PaginationProps, PhoneNumberInput, type PhoneNumberInputProps, Popover, PopoverClose, type PopoverProps, Progress, type ProgressProps, RadioGroup, type RadioGroupProps, type RadioOption, Select, type SelectOption, type SelectProps, Skeleton, type SkeletonProps, Slider, type SliderProps, Spinner, type SpinnerProps, Stack, type StackProps, Switch, type SwitchProps, Table, TableBody, TableCell, type TableCellProps, TableFooter, TableHead, type TableHeadProps, TableHeader, type TableProps, TableRow, type TableRowProps, Tabs, TabsContent, type TabsContentProps, TabsList, type TabsListProps, type TabsProps, TabsTrigger, type TabsTriggerProps, TextField, type TextFieldProps, Textarea, type TextareaProps, type ThemeInput, type ThemeName, type ThemeOverrides, ThemeProvider, type ThemeProviderProps, type ThemeTokens, type ToastOptions, ToastProvider, type ToastProviderProps, Tooltip, type TooltipProps, Typography, type TypographyProps, type TypographyVariant, VerificationCodeInput, type VerificationCodeInputProps, composeExtraAddress, contrastRatio, createIntentColors, createTheme, formatBusinessNumber, formatKoreanAmount, formatPhoneNumber, hasAllRequiredAgreements, isValidBusinessNumber, kakaoPostcodeProvider, themeClass, usePortalClassName, usePortalProps, useTheme, useToast, vars };
|
|
1541
|
+
export { Accordion, AccordionItem, type AccordionItemProps, type AccordionProps, AddressInput, type AddressInputProps, type AddressProvider, type AddressSearchResult, type AddressValue, AgreementGroup, type AgreementGroupProps, type AgreementItem, Alert, type AlertColor, type AlertProps, AmountInput, type AmountInputProps, Avatar, type AvatarProps, Badge, type BadgeProps, type BestowMessages, type BestowTheme, Breadcrumb, type BreadcrumbItemData, type BreadcrumbProps, BusinessNumberInput, type BusinessNumberInputProps, Button, type ButtonProps, Calendar, type CalendarProps, Card, CardBody, CardFooter, CardHeader, type CardProps, type CardSectionProps, Checkbox, type CheckboxProps, Combobox, type ComboboxOption, type ComboboxProps, DatePicker, type DatePickerProps, type DeepPartial, Divider, type DividerProps, Drawer, DrawerClose, type DrawerProps, DropdownMenu, DropdownMenuContent, type DropdownMenuContentProps, DropdownMenuGroup, DropdownMenuItem, type DropdownMenuItemProps, DropdownMenuLabel, type DropdownMenuLabelProps, type DropdownMenuProps, DropdownMenuSeparator, type DropdownMenuSeparatorProps, DropdownMenuTrigger, type DropdownMenuTriggerProps, IconButton, type IconButtonProps, Input, type InputProps, type IntentName, Link, type LinkProps, LocaleProvider, type LocaleProviderProps, type Messages, Modal, ModalClose, type ModalProps, Pagination, type PaginationItemType, type PaginationProps, PhoneNumberInput, type PhoneNumberInputProps, Popover, PopoverClose, type PopoverProps, Progress, type ProgressProps, RadioGroup, type RadioGroupProps, type RadioOption, Select, type SelectOption, type SelectProps, Skeleton, type SkeletonProps, Slider, type SliderProps, Spinner, type SpinnerProps, Stack, type StackProps, Switch, type SwitchProps, Table, type TableAlign, TableBody, TableCell, type TableCellProps, TableFooter, TableHead, type TableHeadProps, TableHeader, type TableProps, TableRow, type TableRowProps, type TableSize, Tabs, TabsContent, type TabsContentProps, TabsList, type TabsListProps, type TabsProps, TabsTrigger, type TabsTriggerProps, TextField, type TextFieldProps, Textarea, type TextareaProps, type ThemeInput, type ThemeName, type ThemeOverrides, ThemeProvider, type ThemeProviderProps, type ThemeTokens, type ToastColor, type ToastContextValue, type ToastOptions, ToastProvider, type ToastProviderProps, Tooltip, type TooltipProps, Typography, type TypographyProps, type TypographyVariant, VerificationCodeInput, type VerificationCodeInputProps, composeExtraAddress, contrastRatio, createIntentColors, createTheme, en, formatBusinessNumber, formatKoreanAmount, formatKoreanDate, formatPhoneNumber, hasAllRequiredAgreements, isValidBusinessNumber, kakaoPostcodeProvider, parseISODate, themeClass, toISODate, useMessages, usePortalProps, useTheme, useToast, vars };
|