@bestow-ui/react 0.3.1 → 0.4.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/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, ButtonHTMLAttributes, ReactNode, InputHTMLAttributes, ElementType, ReactElement } from 'react';
4
+ import { HTMLAttributes, CSSProperties, ButtonHTMLAttributes, ReactNode, InputHTMLAttributes, ElementType, TextareaHTMLAttributes, ReactElement } from 'react';
5
5
  import * as Dialog from '@radix-ui/react-dialog';
6
6
 
7
7
  declare const lightTokens: {
@@ -360,6 +360,44 @@ declare function Modal({ open, defaultOpen, onOpenChange, trigger, title, descri
360
360
  */
361
361
  declare const ModalClose: react.ForwardRefExoticComponent<Dialog.DialogCloseProps & react.RefAttributes<HTMLButtonElement>>;
362
362
 
363
+ interface RadioOption {
364
+ value: string;
365
+ label: ReactNode;
366
+ /** 레이블 아래 보조 설명 */
367
+ description?: ReactNode;
368
+ disabled?: boolean;
369
+ }
370
+ interface RadioGroupProps {
371
+ /** 선택지 목록 */
372
+ options: RadioOption[];
373
+ /** 선택된 값 (제어 모드). undefined 를 넘기면 아무것도 선택하지 않은 상태 */
374
+ value?: string;
375
+ /** 처음 선택된 값 (비제어 모드) */
376
+ defaultValue?: string;
377
+ /** 값이 바뀔 때 호출된다 */
378
+ onValueChange?: (value: string) => void;
379
+ /** 그룹 위에 표시할 레이블 */
380
+ label?: ReactNode;
381
+ /** 그룹 아래에 표시할 도움말. error 일 때는 에러 메시지로 표시된다 */
382
+ helperText?: ReactNode;
383
+ /** 에러 상태 */
384
+ error?: boolean;
385
+ /** 배치 방향 */
386
+ orientation?: 'vertical' | 'horizontal';
387
+ /** 크기 */
388
+ size?: 'sm' | 'md';
389
+ disabled?: boolean;
390
+ required?: boolean;
391
+ /** form 제출 시 사용할 이름 */
392
+ name?: string;
393
+ id?: string;
394
+ /** label 이 없을 때 스크린리더용 이름 */
395
+ 'aria-label'?: string;
396
+ /** 바깥 래퍼 className */
397
+ className?: string;
398
+ }
399
+ declare const RadioGroup: react.ForwardRefExoticComponent<RadioGroupProps & react.RefAttributes<HTMLDivElement>>;
400
+
363
401
  interface SelectOption {
364
402
  value: string;
365
403
  label: ReactNode;
@@ -414,6 +452,51 @@ interface StackProps extends HTMLAttributes<HTMLElement> {
414
452
  }
415
453
  declare const Stack: react.ForwardRefExoticComponent<StackProps & react.RefAttributes<HTMLElement>>;
416
454
 
455
+ interface SwitchProps {
456
+ /** 스위치 옆에 표시할 레이블 */
457
+ label?: ReactNode;
458
+ /** 크기 */
459
+ size?: 'sm' | 'md';
460
+ /** 켜짐 상태 (제어 모드) */
461
+ checked?: boolean;
462
+ /** 처음 켜짐 상태 (비제어 모드) */
463
+ defaultChecked?: boolean;
464
+ /** 켜짐 상태가 바뀔 때 호출된다 */
465
+ onCheckedChange?: (checked: boolean) => void;
466
+ disabled?: boolean;
467
+ required?: boolean;
468
+ /** form 제출 시 사용할 이름 */
469
+ name?: string;
470
+ /** form 제출 시 켜져 있을 때의 값 (기본 "on") */
471
+ value?: string;
472
+ id?: string;
473
+ /** label 이 없을 때 스크린리더용 이름 */
474
+ 'aria-label'?: string;
475
+ /** 바깥 래퍼 className */
476
+ className?: string;
477
+ }
478
+ declare const Switch: react.ForwardRefExoticComponent<SwitchProps & react.RefAttributes<HTMLButtonElement>>;
479
+
480
+ interface TextareaProps extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'size'> {
481
+ /** 입력창 위에 표시할 레이블 */
482
+ label?: ReactNode;
483
+ /** 입력창 아래에 표시할 도움말. error 일 때는 에러 메시지로 표시된다 */
484
+ helperText?: ReactNode;
485
+ /** 에러 상태 */
486
+ error?: boolean;
487
+ /** 크기 (안쪽 여백과 글자 크기) */
488
+ size?: 'sm' | 'md' | 'lg';
489
+ /** 부모 너비를 꽉 채운다 */
490
+ fullWidth?: boolean;
491
+ /** 사용자가 크기를 조절할 수 있는 방향. autoResize 이면 무시된다 */
492
+ resize?: 'none' | 'vertical' | 'both';
493
+ /** 내용에 맞춰 높이가 자동으로 늘어난다. 최대 높이는 style 의 maxHeight 로 제한한다 */
494
+ autoResize?: boolean;
495
+ /** 글자 수를 표시한다. maxLength 가 있으면 "12/200" 형태 */
496
+ showCount?: boolean;
497
+ }
498
+ declare const Textarea: react.ForwardRefExoticComponent<TextareaProps & react.RefAttributes<HTMLTextAreaElement>>;
499
+
417
500
  interface ToastOptions {
418
501
  /** 제목 */
419
502
  title: ReactNode;
@@ -489,4 +572,4 @@ interface TypographyProps extends Omit<HTMLAttributes<HTMLElement>, 'color'> {
489
572
  }
490
573
  declare const Typography: react.ForwardRefExoticComponent<TypographyProps & react.RefAttributes<HTMLElement>>;
491
574
 
492
- export { type BestowTheme, Button, type ButtonProps, Checkbox, type CheckboxProps, type DeepPartial, Input, type InputProps, type IntentName, Modal, ModalClose, type ModalProps, Select, type SelectOption, type SelectProps, Stack, type StackProps, TextField, type TextFieldProps, type ThemeInput, type ThemeName, type ThemeOverrides, ThemeProvider, type ThemeProviderProps, type ThemeTokens, type ToastOptions, ToastProvider, type ToastProviderProps, Tooltip, type TooltipProps, Typography, type TypographyProps, type TypographyVariant, contrastRatio, createIntentColors, createTheme, themeClass, usePortalClassName, usePortalProps, useTheme, useToast, vars };
575
+ export { type BestowTheme, Button, type ButtonProps, Checkbox, type CheckboxProps, type DeepPartial, Input, type InputProps, type IntentName, Modal, ModalClose, type ModalProps, RadioGroup, type RadioGroupProps, type RadioOption, Select, type SelectOption, type SelectProps, Stack, type StackProps, Switch, type SwitchProps, 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, contrastRatio, createIntentColors, createTheme, themeClass, usePortalClassName, usePortalProps, useTheme, useToast, vars };
package/dist/index.d.ts 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, ButtonHTMLAttributes, ReactNode, InputHTMLAttributes, ElementType, ReactElement } from 'react';
4
+ import { HTMLAttributes, CSSProperties, ButtonHTMLAttributes, ReactNode, InputHTMLAttributes, ElementType, TextareaHTMLAttributes, ReactElement } from 'react';
5
5
  import * as Dialog from '@radix-ui/react-dialog';
6
6
 
7
7
  declare const lightTokens: {
@@ -360,6 +360,44 @@ declare function Modal({ open, defaultOpen, onOpenChange, trigger, title, descri
360
360
  */
361
361
  declare const ModalClose: react.ForwardRefExoticComponent<Dialog.DialogCloseProps & react.RefAttributes<HTMLButtonElement>>;
362
362
 
363
+ interface RadioOption {
364
+ value: string;
365
+ label: ReactNode;
366
+ /** 레이블 아래 보조 설명 */
367
+ description?: ReactNode;
368
+ disabled?: boolean;
369
+ }
370
+ interface RadioGroupProps {
371
+ /** 선택지 목록 */
372
+ options: RadioOption[];
373
+ /** 선택된 값 (제어 모드). undefined 를 넘기면 아무것도 선택하지 않은 상태 */
374
+ value?: string;
375
+ /** 처음 선택된 값 (비제어 모드) */
376
+ defaultValue?: string;
377
+ /** 값이 바뀔 때 호출된다 */
378
+ onValueChange?: (value: string) => void;
379
+ /** 그룹 위에 표시할 레이블 */
380
+ label?: ReactNode;
381
+ /** 그룹 아래에 표시할 도움말. error 일 때는 에러 메시지로 표시된다 */
382
+ helperText?: ReactNode;
383
+ /** 에러 상태 */
384
+ error?: boolean;
385
+ /** 배치 방향 */
386
+ orientation?: 'vertical' | 'horizontal';
387
+ /** 크기 */
388
+ size?: 'sm' | 'md';
389
+ disabled?: boolean;
390
+ required?: boolean;
391
+ /** form 제출 시 사용할 이름 */
392
+ name?: string;
393
+ id?: string;
394
+ /** label 이 없을 때 스크린리더용 이름 */
395
+ 'aria-label'?: string;
396
+ /** 바깥 래퍼 className */
397
+ className?: string;
398
+ }
399
+ declare const RadioGroup: react.ForwardRefExoticComponent<RadioGroupProps & react.RefAttributes<HTMLDivElement>>;
400
+
363
401
  interface SelectOption {
364
402
  value: string;
365
403
  label: ReactNode;
@@ -414,6 +452,51 @@ interface StackProps extends HTMLAttributes<HTMLElement> {
414
452
  }
415
453
  declare const Stack: react.ForwardRefExoticComponent<StackProps & react.RefAttributes<HTMLElement>>;
416
454
 
455
+ interface SwitchProps {
456
+ /** 스위치 옆에 표시할 레이블 */
457
+ label?: ReactNode;
458
+ /** 크기 */
459
+ size?: 'sm' | 'md';
460
+ /** 켜짐 상태 (제어 모드) */
461
+ checked?: boolean;
462
+ /** 처음 켜짐 상태 (비제어 모드) */
463
+ defaultChecked?: boolean;
464
+ /** 켜짐 상태가 바뀔 때 호출된다 */
465
+ onCheckedChange?: (checked: boolean) => void;
466
+ disabled?: boolean;
467
+ required?: boolean;
468
+ /** form 제출 시 사용할 이름 */
469
+ name?: string;
470
+ /** form 제출 시 켜져 있을 때의 값 (기본 "on") */
471
+ value?: string;
472
+ id?: string;
473
+ /** label 이 없을 때 스크린리더용 이름 */
474
+ 'aria-label'?: string;
475
+ /** 바깥 래퍼 className */
476
+ className?: string;
477
+ }
478
+ declare const Switch: react.ForwardRefExoticComponent<SwitchProps & react.RefAttributes<HTMLButtonElement>>;
479
+
480
+ interface TextareaProps extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'size'> {
481
+ /** 입력창 위에 표시할 레이블 */
482
+ label?: ReactNode;
483
+ /** 입력창 아래에 표시할 도움말. error 일 때는 에러 메시지로 표시된다 */
484
+ helperText?: ReactNode;
485
+ /** 에러 상태 */
486
+ error?: boolean;
487
+ /** 크기 (안쪽 여백과 글자 크기) */
488
+ size?: 'sm' | 'md' | 'lg';
489
+ /** 부모 너비를 꽉 채운다 */
490
+ fullWidth?: boolean;
491
+ /** 사용자가 크기를 조절할 수 있는 방향. autoResize 이면 무시된다 */
492
+ resize?: 'none' | 'vertical' | 'both';
493
+ /** 내용에 맞춰 높이가 자동으로 늘어난다. 최대 높이는 style 의 maxHeight 로 제한한다 */
494
+ autoResize?: boolean;
495
+ /** 글자 수를 표시한다. maxLength 가 있으면 "12/200" 형태 */
496
+ showCount?: boolean;
497
+ }
498
+ declare const Textarea: react.ForwardRefExoticComponent<TextareaProps & react.RefAttributes<HTMLTextAreaElement>>;
499
+
417
500
  interface ToastOptions {
418
501
  /** 제목 */
419
502
  title: ReactNode;
@@ -489,4 +572,4 @@ interface TypographyProps extends Omit<HTMLAttributes<HTMLElement>, 'color'> {
489
572
  }
490
573
  declare const Typography: react.ForwardRefExoticComponent<TypographyProps & react.RefAttributes<HTMLElement>>;
491
574
 
492
- export { type BestowTheme, Button, type ButtonProps, Checkbox, type CheckboxProps, type DeepPartial, Input, type InputProps, type IntentName, Modal, ModalClose, type ModalProps, Select, type SelectOption, type SelectProps, Stack, type StackProps, TextField, type TextFieldProps, type ThemeInput, type ThemeName, type ThemeOverrides, ThemeProvider, type ThemeProviderProps, type ThemeTokens, type ToastOptions, ToastProvider, type ToastProviderProps, Tooltip, type TooltipProps, Typography, type TypographyProps, type TypographyVariant, contrastRatio, createIntentColors, createTheme, themeClass, usePortalClassName, usePortalProps, useTheme, useToast, vars };
575
+ export { type BestowTheme, Button, type ButtonProps, Checkbox, type CheckboxProps, type DeepPartial, Input, type InputProps, type IntentName, Modal, ModalClose, type ModalProps, RadioGroup, type RadioGroupProps, type RadioOption, Select, type SelectOption, type SelectProps, Stack, type StackProps, Switch, type SwitchProps, 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, contrastRatio, createIntentColors, createTheme, themeClass, usePortalClassName, usePortalProps, useTheme, useToast, vars };