@liner-fe/prism 3.4.12 → 3.5.1
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/lib/index.css +314 -250
- package/lib/index.d.ts +161 -32
- package/lib/index.js +962 -472
- package/package.json +6 -3
package/lib/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SystemKeys, TypographyCaptionPrefix, TypographyParagraphPrefix, TypographyHeadingPrefix, TypographyTitlePrefix, TypographyDisplayPrefix, BasicColorType } from '@liner-fe/design-token-primitive';
|
|
2
2
|
import * as react from 'react';
|
|
3
|
-
import react__default, { ButtonHTMLAttributes, HTMLAttributes, JSX, ReactNode, ComponentPropsWithoutRef, InputHTMLAttributes,
|
|
3
|
+
import react__default, { ButtonHTMLAttributes, HTMLAttributes, JSX, ReactNode, ComponentPropsWithoutRef, InputHTMLAttributes, MouseEventHandler, ReactElement } from 'react';
|
|
4
4
|
import * as cva from 'cva';
|
|
5
5
|
import { VariantProps } from 'cva';
|
|
6
6
|
import { IconProps, IconComponentType } from '@liner-fe/icon';
|
|
@@ -375,48 +375,177 @@ interface TextfieldProps extends InputHTMLAttributes<HTMLInputElement>, VariantP
|
|
|
375
375
|
}
|
|
376
376
|
declare const Textfield: react.ForwardRefExoticComponent<TextfieldProps & react.RefAttributes<HTMLInputElement>>;
|
|
377
377
|
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
378
|
+
type RadixSelectRootProps = ComponentPropsWithoutRef<typeof Select$1.Root>;
|
|
379
|
+
type SelectTriggerType = 'select-field' | 'select-button';
|
|
380
|
+
type SelectFieldSize = 's' | 'l';
|
|
381
|
+
type SelectButtonSize = 's' | 'm';
|
|
382
|
+
interface SelectWidthOptions {
|
|
383
|
+
/** Trigger 폭 px override. 미지정 시 Figma 기본 (size별 hardcoded). */
|
|
384
|
+
trigger?: number;
|
|
385
|
+
/** Popover list 폭 px override. 미지정 시 default (field=trigger 추종, button=320). */
|
|
386
|
+
list?: number;
|
|
387
|
+
}
|
|
388
|
+
interface BaseSelectProps extends Omit<RadixSelectRootProps, 'children' | 'dir'> {
|
|
389
|
+
label?: ReactNode;
|
|
390
|
+
/**
|
|
391
|
+
* 아무것도 선택되지 않은 초기 상태에 Trigger에 노출되는 안내 텍스트.
|
|
392
|
+
* `ReactNode` — 단순 문자열 외 아이콘 + 텍스트 조합 등 가능.
|
|
393
|
+
* field trigger: Paragraph size=3 tertiary color (Figma 17113:2379).
|
|
394
|
+
* button trigger: Paragraph size=4 primary color (Figma 17228:64663).
|
|
395
|
+
*/
|
|
396
|
+
placeholder?: ReactNode;
|
|
397
|
+
error?: ReactNode;
|
|
398
|
+
/**
|
|
399
|
+
* Trigger에 표시할 커스텀 ReactNode (flat prop — 객체 안 nested 금지).
|
|
400
|
+
*
|
|
401
|
+
* **객체 prop의 React element가 아닌 flat prop으로 받는 이유**:
|
|
402
|
+
* Storybook의 react-element-to-jsx-string은 object prop 안의 React element를 parse할 때
|
|
403
|
+
* 무한 재귀(stack overflow)에 빠짐 → docs 페이지 freeze. flat prop은 정상 처리.
|
|
404
|
+
*
|
|
405
|
+
* **사용 책임**:
|
|
406
|
+
* - controlled `value` + `onValueChange`로 현재 값 알고 렌더
|
|
407
|
+
* - placeholder 분기도 consumer가 처리 (예: `value ? <Custom/> : undefined`)
|
|
408
|
+
* - ARIA accessible name 보장
|
|
409
|
+
*
|
|
410
|
+
* 미제공 시 기본 RadixSelect.Value 동작: placeholder + ItemText auto-mirror.
|
|
411
|
+
*/
|
|
412
|
+
triggerContent?: ReactNode;
|
|
413
|
+
/**
|
|
414
|
+
* Width override (px). number만 — 자동 px 변환. number는 React element가 아니라
|
|
415
|
+
* react-element-to-jsx-string 무한재귀 문제 없음 (객체 nested 안전).
|
|
416
|
+
* 미지정 필드는 Figma 기본 spec:
|
|
417
|
+
* - `trigger`: trigger × size별 hardcoded (field s=200/l=240, button s=105/m=123)
|
|
418
|
+
* - `list`: field=trigger 폭 추종, button=320px
|
|
419
|
+
*/
|
|
420
|
+
width?: SelectWidthOptions;
|
|
421
|
+
dir?: 'ltr' | 'rtl';
|
|
422
|
+
children?: ReactNode;
|
|
423
|
+
className?: string;
|
|
390
424
|
}
|
|
391
|
-
|
|
425
|
+
type SelectProps = (BaseSelectProps & {
|
|
426
|
+
trigger?: 'select-field';
|
|
427
|
+
size?: SelectFieldSize;
|
|
428
|
+
}) | (BaseSelectProps & {
|
|
429
|
+
trigger: 'select-button';
|
|
430
|
+
size?: SelectButtonSize;
|
|
431
|
+
});
|
|
432
|
+
interface SelectContentProps extends ComponentPropsWithoutRef<typeof Select$1.Content> {
|
|
433
|
+
/**
|
|
434
|
+
* Popover Portal의 mount 대상 element. 미지정 시 `document.body` (Radix 기본).
|
|
435
|
+
* 사용 케이스: Radix Dialog/Sheet 내부 mount로 focus trap·z-index 정상화,
|
|
436
|
+
* scroll container 안 mount, Shadow DOM 등.
|
|
437
|
+
*/
|
|
438
|
+
container?: HTMLElement | null;
|
|
439
|
+
}
|
|
440
|
+
interface SelectItemProps extends Omit<ComponentPropsWithoutRef<typeof Select$1.Item>, 'value'> {
|
|
392
441
|
value: string;
|
|
393
|
-
|
|
442
|
+
label: ReactNode;
|
|
443
|
+
description?: ReactNode;
|
|
444
|
+
leadingSlot?: ReactNode;
|
|
445
|
+
labelEnd?: ReactNode;
|
|
446
|
+
/**
|
|
447
|
+
* 우측 영역 (chevron / IconButton / 액션 등). 미제공 + selected 시
|
|
448
|
+
* 자동으로 brand color IconCheckMark 표시 (Figma `selectItem` 스펙).
|
|
449
|
+
*/
|
|
450
|
+
trailingSlot?: ReactNode;
|
|
451
|
+
textValue?: string;
|
|
394
452
|
disabled?: boolean;
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
453
|
+
danger?: boolean;
|
|
454
|
+
/**
|
|
455
|
+
* 클릭 시 호출. 선택과 함께 navigation 등 link-like 액션을 트리거하려면
|
|
456
|
+
* 여기서 `router.push(...)` 등을 호출. RadixSelect.Item native onClick passthrough.
|
|
457
|
+
*/
|
|
458
|
+
onClick?: ComponentPropsWithoutRef<typeof Select$1.Item>['onClick'];
|
|
459
|
+
}
|
|
460
|
+
interface SelectGroupProps extends ComponentPropsWithoutRef<typeof Select$1.Group> {
|
|
461
|
+
label?: ReactNode;
|
|
462
|
+
}
|
|
463
|
+
interface BaseSelectTriggerProps {
|
|
464
|
+
label?: ReactNode;
|
|
465
|
+
placeholder?: ReactNode;
|
|
466
|
+
error?: ReactNode;
|
|
467
|
+
/** value 선택 시 표시할 ReactNode. 미제공 시 placeholder 노출. */
|
|
468
|
+
triggerContent?: ReactNode;
|
|
469
|
+
/** Trigger 폭 px override (number만). 미지정 시 Figma 기본 spec. */
|
|
470
|
+
width?: number;
|
|
471
|
+
required?: boolean;
|
|
472
|
+
disabled?: boolean;
|
|
473
|
+
className?: string;
|
|
474
|
+
onClick?: MouseEventHandler<HTMLButtonElement>;
|
|
475
|
+
/** Sheet/Dialog context용 ARIA. 기본 미설정 — consumer 책임. */
|
|
476
|
+
'aria-haspopup'?: 'dialog' | 'listbox' | 'menu' | 'tree' | 'grid';
|
|
477
|
+
'aria-expanded'?: boolean;
|
|
478
|
+
'aria-controls'?: string;
|
|
479
|
+
'aria-label'?: string;
|
|
480
|
+
id?: string;
|
|
399
481
|
}
|
|
482
|
+
type SelectTriggerProps = (BaseSelectTriggerProps & {
|
|
483
|
+
trigger?: 'select-field';
|
|
484
|
+
size?: SelectFieldSize;
|
|
485
|
+
}) | (BaseSelectTriggerProps & {
|
|
486
|
+
trigger: 'select-button';
|
|
487
|
+
size?: SelectButtonSize;
|
|
488
|
+
});
|
|
400
489
|
declare const Select: react.ForwardRefExoticComponent<SelectProps & react.RefAttributes<HTMLButtonElement>> & {
|
|
401
|
-
|
|
490
|
+
Trigger: react.ForwardRefExoticComponent<SelectTriggerProps & react.RefAttributes<HTMLButtonElement>>;
|
|
491
|
+
Content: react.ForwardRefExoticComponent<SelectContentProps & react.RefAttributes<HTMLDivElement>>;
|
|
492
|
+
Item: react.ForwardRefExoticComponent<SelectItemProps & react.RefAttributes<HTMLDivElement>>;
|
|
493
|
+
Group: react.ForwardRefExoticComponent<SelectGroupProps & react.RefAttributes<HTMLDivElement>>;
|
|
402
494
|
};
|
|
403
495
|
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
value
|
|
407
|
-
|
|
496
|
+
type NativeLiProps$1 = Omit<ComponentPropsWithoutRef<'li'>, 'onClick' | 'role'>;
|
|
497
|
+
interface ListItemProps extends NativeLiProps$1 {
|
|
498
|
+
value: string;
|
|
499
|
+
label: ReactNode;
|
|
500
|
+
description?: ReactNode;
|
|
501
|
+
leadingSlot?: ReactNode;
|
|
502
|
+
labelEnd?: ReactNode;
|
|
503
|
+
trailingSlot?: ReactNode;
|
|
504
|
+
disabled?: boolean;
|
|
505
|
+
danger?: boolean;
|
|
506
|
+
onClick?: () => void;
|
|
408
507
|
}
|
|
409
|
-
|
|
508
|
+
/**
|
|
509
|
+
* @description Figma listItem (17159:3267) 디자인을 입힌 styled ListItem.
|
|
510
|
+
* 부모 `<CollectionProvider>`(또는 향후 `<List>`)로부터 selected 자동 매칭.
|
|
511
|
+
* 커스텀 스타일이 필요하면 `PrimitiveListItem`을 직접 wrap.
|
|
512
|
+
*/
|
|
513
|
+
declare const ListItem: react.ForwardRefExoticComponent<ListItemProps & react.RefAttributes<HTMLLIElement>>;
|
|
514
|
+
|
|
515
|
+
type NativeLiProps = Omit<ComponentPropsWithoutRef<'li'>, 'onClick' | 'role'>;
|
|
516
|
+
interface PrimitiveListItemProps extends NativeLiProps {
|
|
410
517
|
value: string;
|
|
411
|
-
|
|
518
|
+
leadingSlot?: ReactNode;
|
|
519
|
+
children: ReactNode;
|
|
520
|
+
trailingSlot?: ReactNode;
|
|
412
521
|
disabled?: boolean;
|
|
413
|
-
icon?: {
|
|
414
|
-
icon: IconComponentType;
|
|
415
|
-
} & Pick<IconProps, 'fill' | 'type' | 'fillType' | 'size'>;
|
|
416
522
|
onClick?: () => void;
|
|
523
|
+
role?: 'option' | 'menuitem' | 'menuitemcheckbox' | 'menuitemradio';
|
|
524
|
+
}
|
|
525
|
+
/**
|
|
526
|
+
* @description PrimitiveListItem — 커스텀 스타일용 base.
|
|
527
|
+
* 기본 사용은 `ListItem`을 권장. `role`은 wrapper(ListItem, SelectItem, ActionMenuItem 등)가 책임 — 외부 직접 지정 금지.
|
|
528
|
+
* `<CollectionProvider>` 내부에서만 사용 — 외부 사용 시 throw.
|
|
529
|
+
* `onClick`은 event 인자 없는 `() => void`. event 접근이 필요하면 spread되는 native handler(`onMouseDown` / `onKeyDown` 등) 사용.
|
|
530
|
+
*/
|
|
531
|
+
declare const PrimitiveListItem: react.ForwardRefExoticComponent<PrimitiveListItemProps & react.RefAttributes<HTMLLIElement>>;
|
|
532
|
+
|
|
533
|
+
type NativeUlProps = Omit<ComponentPropsWithoutRef<'ul'>, 'onChange' | 'role' | 'defaultValue' | 'dir'>;
|
|
534
|
+
interface ListProps extends NativeUlProps {
|
|
535
|
+
value?: string;
|
|
536
|
+
defaultValue?: string;
|
|
537
|
+
onValueChange?: (value: string) => void;
|
|
538
|
+
loop?: boolean;
|
|
539
|
+
dir?: 'ltr' | 'rtl';
|
|
540
|
+
children?: ReactNode;
|
|
541
|
+
}
|
|
542
|
+
interface ListGroupProps extends ComponentPropsWithoutRef<'div'> {
|
|
543
|
+
label?: ReactNode;
|
|
417
544
|
}
|
|
418
|
-
declare const List:
|
|
419
|
-
Item:
|
|
545
|
+
declare const List: react.ForwardRefExoticComponent<ListProps & react.RefAttributes<HTMLUListElement>> & {
|
|
546
|
+
Item: react.ForwardRefExoticComponent<ListItemProps & react.RefAttributes<HTMLLIElement>>;
|
|
547
|
+
PrimitiveItem: react.ForwardRefExoticComponent<PrimitiveListItemProps & react.RefAttributes<HTMLLIElement>>;
|
|
548
|
+
Group: react.ForwardRefExoticComponent<ListGroupProps & react.RefAttributes<HTMLDivElement>>;
|
|
420
549
|
};
|
|
421
550
|
|
|
422
551
|
declare const defaultLabelVariants: (props?: ({
|
|
@@ -882,4 +1011,4 @@ interface RatioProps extends react.HTMLAttributes<HTMLDivElement> {
|
|
|
882
1011
|
*/
|
|
883
1012
|
declare const Ratio: react.ForwardRefExoticComponent<RatioProps & react.RefAttributes<HTMLDivElement>>;
|
|
884
1013
|
|
|
885
|
-
export { AlertDialog, type AlertDialogAction, type AlertDialogConfirmAction, type AlertDialogContentProps, Avatar, type AvatarLoadingStatus, type AvatarProps, type AvatarSize, Badge, type BadgeColor, type BadgeIconProps, type BadgeProps, type BadgeSize, type BadgeVariant, BottomSheet, type BottomSheetAction, type BottomSheetConfirmAction, type BottomSheetContentProps, type BottomSheetMode, type BreakPointsKey, Button, type ButtonIconProps, type ButtonProps, type ButtonSizeType, Caption, Checkbox, CoachMark, type CoachMarkContentProps, type CommonButtonProps, CompactCoachMark, type CompactCoachMarkContentProps, DEFAULT_LEVEL_OPTIONS, DEFAULT_SIZE_OPTIONS, DefaultButton, type DefaultButtonProps, type DefaultLevelType, Dialog, type DialogAction, type DialogConfirmAction, type DialogContentProps, Display, Heading, ICON_LEVEL_OPTIONS, ICON_SIZE_OPTIONS, type ICaptionProps, type IDisplayProps, type IHeadingProps, type IPropsAccent, type IPropsAnswer, type IPropsNormal, type IPropsNormalBold, type IPropsPost, type ITitleProps, IconButton, type IconButtonProps, type
|
|
1014
|
+
export { AlertDialog, type AlertDialogAction, type AlertDialogConfirmAction, type AlertDialogContentProps, Avatar, type AvatarLoadingStatus, type AvatarProps, type AvatarSize, Badge, type BadgeColor, type BadgeIconProps, type BadgeProps, type BadgeSize, type BadgeVariant, BottomSheet, type BottomSheetAction, type BottomSheetConfirmAction, type BottomSheetContentProps, type BottomSheetMode, type BreakPointsKey, Button, type ButtonIconProps, type ButtonProps, type ButtonSizeType, Caption, Checkbox, CoachMark, type CoachMarkContentProps, type CommonButtonProps, CompactCoachMark, type CompactCoachMarkContentProps, DEFAULT_LEVEL_OPTIONS, DEFAULT_SIZE_OPTIONS, DefaultButton, type DefaultButtonProps, type DefaultLevelType, Dialog, type DialogAction, type DialogConfirmAction, type DialogContentProps, Display, Heading, ICON_LEVEL_OPTIONS, ICON_SIZE_OPTIONS, type ICaptionProps, type IDisplayProps, type IHeadingProps, type IPropsAccent, type IPropsAnswer, type IPropsNormal, type IPropsNormalBold, type IPropsPost, type ITitleProps, IconButton, type IconButtonProps, LOGOS, Label, List, type ListGroupProps, ListItem, type ListItemProps, type ListProps, Loading, type LoadingLevelType, Logo, type LogoCategory, type LogoName, type LogoProps, Media, MediaContextProvider, Paragraph, type ParagraphProps, Popover, type PopoverContentProps, PrimitiveCoachMark, type PrimitiveCoachMarkContentProps, type PrimitiveCoachMarkRootProps, PrimitiveListItem, type PrimitiveListItemProps, type PromiseToastOptions, RATIO, Radio, Ratio, type RatioProps, Select, type SelectButtonSize, type SelectContentProps, type SelectFieldSize, type SelectGroupProps, type SelectItemProps, type SelectProps, type SelectTriggerProps, type SelectTriggerType, type SelectWidthOptions, TEXT_LEVEL_OPTIONS, TEXT_SIZE_OPTIONS, Tag, TextButton, type TextButtonProps, type TextSizeType, Textfield, type TextfieldButtonProps, type TextfieldLabelType, type TextfieldProps, Title, type ToastOptions, type ToastType, Toaster, Tooltip, Typography, arrayToStyleObject, isEmptyObject, objectToArray, rootMediaStyle, toast };
|