@bigtablet/design-system 3.21.1 → 3.23.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.css +12 -0
- package/dist/index.d.ts +68 -8
- package/dist/index.js +165 -53
- package/package.json +1 -1
package/dist/index.css
CHANGED
|
@@ -1971,6 +1971,11 @@ body:has(.bottom_nav) {
|
|
|
1971
1971
|
border-radius: 12px;
|
|
1972
1972
|
transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1);
|
|
1973
1973
|
}
|
|
1974
|
+
.card:focus-visible,
|
|
1975
|
+
.card:focus-visible:hover {
|
|
1976
|
+
outline: none;
|
|
1977
|
+
box-shadow: var(--bt-focus-ring);
|
|
1978
|
+
}
|
|
1974
1979
|
.card_interactive {
|
|
1975
1980
|
cursor: pointer;
|
|
1976
1981
|
}
|
|
@@ -3837,6 +3842,13 @@ body:has(.bottom_nav) {
|
|
|
3837
3842
|
background: var(--bt-color-bg-solid);
|
|
3838
3843
|
border-radius: 12px;
|
|
3839
3844
|
overflow: hidden;
|
|
3845
|
+
}
|
|
3846
|
+
.media_card:focus-visible,
|
|
3847
|
+
.media_card:focus-visible:hover {
|
|
3848
|
+
outline: none;
|
|
3849
|
+
box-shadow: var(--bt-focus-ring);
|
|
3850
|
+
}
|
|
3851
|
+
.media_card {
|
|
3840
3852
|
transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
|
|
3841
3853
|
}
|
|
3842
3854
|
.media_card_shadow_sm {
|
package/dist/index.d.ts
CHANGED
|
@@ -68,7 +68,20 @@ type PolymorphicProps<T extends React$1.ElementType, Own> = Own & {
|
|
|
68
68
|
/** `as` 에 준 요소의 ref 타입 */
|
|
69
69
|
type PolymorphicRef<T extends React$1.ElementType> = React$1.ComponentPropsWithRef<T>["ref"];
|
|
70
70
|
|
|
71
|
-
|
|
71
|
+
interface FocusTrapOptions {
|
|
72
|
+
/**
|
|
73
|
+
* 초기 포커스를 **먼저 찾을** 영역. 여기 안에 포커스 가능한 컨트롤이 있으면 그 첫 번째로
|
|
74
|
+
* 간다. 없으면 기존 순서(skip 표시가 없는 첫 요소 → 첫 요소 → 컨테이너)로 떨어진다.
|
|
75
|
+
*
|
|
76
|
+
* 오버레이의 초기 포커스 규칙이 세 갈래("본문 첫 컨트롤 → 닫기 버튼 → 패널")라 표시
|
|
77
|
+
* 속성만으로는 표현되지 않는다. 닫기 버튼에 skip 을 붙여 본문을 우선하게 만들면, 본문이
|
|
78
|
+
* 없는 확인 모달에서는 그다음 후보가 **footer 의 첫 버튼**이 된다 - 그 자리가 destructive
|
|
79
|
+
* 액션인 패턴이 흔해서 열자마자 삭제에 포커스가 놓인다. 우선 영역을 직접 지정하면 그런
|
|
80
|
+
* 우회 없이 세 갈래가 그대로 표현된다.
|
|
81
|
+
*/
|
|
82
|
+
preferWithin?: React$1.RefObject<HTMLElement | null>;
|
|
83
|
+
}
|
|
84
|
+
declare function useFocusTrap(containerRef: React$1.RefObject<HTMLElement | null>, isActive: boolean, options?: FocusTrapOptions): void;
|
|
72
85
|
|
|
73
86
|
/**
|
|
74
87
|
* 사용자가 OS 수준에서 "동작 줄이기"를 켰는지 반환한다 (WCAG 2.3.3).
|
|
@@ -1526,15 +1539,24 @@ type TableProps<T extends object> = {
|
|
|
1526
1539
|
onSortChange?: (sort: TableSort | undefined) => void;
|
|
1527
1540
|
/** 전체 선택 체크박스 aria-label */
|
|
1528
1541
|
selectAllAriaLabel?: string;
|
|
1529
|
-
/** 개별 행 선택 체크박스 aria-label (기본값: (i) => `${i+1}번째 행 선택`) */
|
|
1542
|
+
/** 개별 행 선택 체크박스 aria-label. 인자는 `rowIndexOffset` 이 더해진 **전체 순번**이다 (기본값: (i) => `${i+1}번째 행 선택`) */
|
|
1530
1543
|
selectRowAriaLabel?: (index: number) => string;
|
|
1544
|
+
/**
|
|
1545
|
+
* 이 표의 첫 행이 전체에서 몇 번째인지 (0-based, 기본 0). 서버 페이지네이션처럼 한 쪽만
|
|
1546
|
+
* 받아 그릴 때 준다.
|
|
1547
|
+
*
|
|
1548
|
+
* 없으면 쪽마다 행 번호가 1 부터 다시 시작해, 3쪽의 체크박스도 1쪽과 **글자까지 같은**
|
|
1549
|
+
* "1번째 행 선택" 으로 읽힌다 - 스크린리더 사용자는 쪽이 넘어갔는지도, 지금 누른 것이 어느
|
|
1550
|
+
* 행인지도 이름만으로는 구분할 수 없다.
|
|
1551
|
+
*/
|
|
1552
|
+
rowIndexOffset?: number;
|
|
1531
1553
|
} & TableSelectionProps<T>;
|
|
1532
1554
|
/**
|
|
1533
1555
|
* 데이터 테이블을 렌더링한다. 로딩 중에는 헤더 유지, 바디에 스켈레톤 행을 표시한다.
|
|
1534
1556
|
* @param props 테이블 속성
|
|
1535
1557
|
* @returns 테이블 컴포넌트
|
|
1536
1558
|
*/
|
|
1537
|
-
declare const Table: <T extends object>({ columns, data, keyExtractor, emptyMessage: emptyMessageProp, isLoading, skeletonRows, size, hoverable, stickyHeader, ariaLabel, className, onRowClick, rowClickHint: rowClickHintProp, sort, onSortChange, selectAllAriaLabel: selectAllAriaLabelProp, selectRowAriaLabel: selectRowAriaLabelProp, selectable, rowKey, selectedKeys, onSelectionChange, }: TableProps<T>) => React$1.JSX.Element;
|
|
1559
|
+
declare const Table: <T extends object>({ columns, data, keyExtractor, emptyMessage: emptyMessageProp, isLoading, skeletonRows, size, hoverable, stickyHeader, ariaLabel, className, onRowClick, rowClickHint: rowClickHintProp, sort, onSortChange, selectAllAriaLabel: selectAllAriaLabelProp, selectRowAriaLabel: selectRowAriaLabelProp, rowIndexOffset, selectable, rowKey, selectedKeys, onSelectionChange, }: TableProps<T>) => React$1.JSX.Element;
|
|
1538
1560
|
|
|
1539
1561
|
/**
|
|
1540
1562
|
* 목록 화면이 데이터를 받는 모양.
|
|
@@ -1577,6 +1599,11 @@ interface DataViewPagination {
|
|
|
1577
1599
|
page: number;
|
|
1578
1600
|
/** 전체 페이지 수 */
|
|
1579
1601
|
totalPages: number;
|
|
1602
|
+
/**
|
|
1603
|
+
* 한 쪽에 몇 행인지. 주면 행 선택 체크박스의 기본 라벨이 쪽마다 1 부터 다시 시작하지 않고
|
|
1604
|
+
* 전체 순번을 쓴다 - 없으면 3쪽의 체크박스도 1쪽과 같은 "1번째 행 선택" 으로 읽힌다.
|
|
1605
|
+
*/
|
|
1606
|
+
pageSize?: number;
|
|
1580
1607
|
/** 페이지 변경 콜백 */
|
|
1581
1608
|
onPageChange: (page: number) => void;
|
|
1582
1609
|
}
|
|
@@ -1606,6 +1633,18 @@ interface DataViewProps<T extends object> extends Omit<React$1.HTMLAttributes<HT
|
|
|
1606
1633
|
onRowClick?: (row: T, index: number) => void;
|
|
1607
1634
|
/** 표의 접근성 이름 */
|
|
1608
1635
|
ariaLabel?: string;
|
|
1636
|
+
/** 전체 선택 체크박스의 라벨 (기본값: `Table` 의 기본 라벨) */
|
|
1637
|
+
selectAllAriaLabel?: string;
|
|
1638
|
+
/**
|
|
1639
|
+
* 행 선택 체크박스의 라벨. 인자는 `pagination.pageSize` 를 반영한 **전체 순번**(0-based)이다.
|
|
1640
|
+
* 기본값은 순번만 읽어 주므로, 행을 이름으로 구분하려면 바깥 `rows` 를 닫아 넘긴다.
|
|
1641
|
+
* @example
|
|
1642
|
+
* ```tsx
|
|
1643
|
+
* const offset = (page - 1) * SIZE;
|
|
1644
|
+
* selectRowAriaLabel={(index) => `${rows[index - offset].name} 선택`}
|
|
1645
|
+
* ```
|
|
1646
|
+
*/
|
|
1647
|
+
selectRowAriaLabel?: (index: number) => string;
|
|
1609
1648
|
/** 선택 액션 줄의 안내 문구 (기본값: (n) => `${n}개 선택됨`) */
|
|
1610
1649
|
selectionSummary?: (count: number) => string;
|
|
1611
1650
|
/** 선택 해제 버튼 라벨 */
|
|
@@ -1637,7 +1676,7 @@ interface DataViewProps<T extends object> extends Omit<React$1.HTMLAttributes<HT
|
|
|
1637
1676
|
* />
|
|
1638
1677
|
* ```
|
|
1639
1678
|
*/
|
|
1640
|
-
declare const DataView: <T extends object>({ query, columns, rowKey, toolbar, selectionActions, pagination, empty, sort, onSortChange, onRowClick, ariaLabel, selectionSummary: selectionSummaryProp, clearSelectionLabel: clearSelectionLabelProp, errorTitle: errorTitleProp, retryLabel: retryLabelProp, className, ...props }: DataViewProps<T>) => React$1.JSX.Element;
|
|
1679
|
+
declare const DataView: <T extends object>({ query, columns, rowKey, toolbar, selectionActions, pagination, empty, sort, onSortChange, onRowClick, ariaLabel, selectAllAriaLabel, selectRowAriaLabel, selectionSummary: selectionSummaryProp, clearSelectionLabel: clearSelectionLabelProp, errorTitle: errorTitleProp, retryLabel: retryLabelProp, className, ...props }: DataViewProps<T>) => React$1.JSX.Element;
|
|
1641
1680
|
|
|
1642
1681
|
interface DividerProps extends React$1.HTMLAttributes<HTMLHRElement> {
|
|
1643
1682
|
/** 구분선 두께 (기본값: "standard") */
|
|
@@ -2073,6 +2112,11 @@ interface DatePickerBaseProps {
|
|
|
2073
2112
|
selectableRange?: SelectableRange;
|
|
2074
2113
|
/** 비활성화 여부 */
|
|
2075
2114
|
disabled?: boolean;
|
|
2115
|
+
/**
|
|
2116
|
+
* 필수 입력 여부. `Field` 안에서는 `Field` 의 `required` 가 이긴다.
|
|
2117
|
+
* `role="group"` 에는 `aria-required` 를 붙일 수 없어 안쪽 컨트롤마다 내려보낸다.
|
|
2118
|
+
*/
|
|
2119
|
+
required?: boolean;
|
|
2076
2120
|
/** 데이트 피커가 컨테이너의 전체 너비를 차지할지 여부 */
|
|
2077
2121
|
fullWidth?: boolean;
|
|
2078
2122
|
/**
|
|
@@ -2111,7 +2155,7 @@ type DatePickerProps = DatePickerBaseProps & DatePickerCallbacks;
|
|
|
2111
2155
|
* 연/월/일 선택형 데이트 피커를 렌더링한다.
|
|
2112
2156
|
* 내부적으로 DS Dropdown 3개를 조합해 드롭다운 UX 일관성을 유지한다.
|
|
2113
2157
|
*/
|
|
2114
|
-
declare const DatePicker: ({ label, value, onValueChange, onChange, mode, startYear, endYear: endYearProp, minDate, selectableRange, disabled, fullWidth, width, yearLabel: yearLabelProp, monthLabel: monthLabelProp, dayLabel: dayLabelProp, minDateSrFormat: minDateSrFormatProp, selectableRangeUntilTodaySrText: selectableRangeUntilTodaySrTextProp, }: DatePickerProps) => React$1.JSX.Element;
|
|
2158
|
+
declare const DatePicker: ({ label, value, onValueChange, onChange, mode, startYear, endYear: endYearProp, minDate, selectableRange, disabled, required, fullWidth, width, yearLabel: yearLabelProp, monthLabel: monthLabelProp, dayLabel: dayLabelProp, minDateSrFormat: minDateSrFormatProp, selectableRangeUntilTodaySrText: selectableRangeUntilTodaySrTextProp, }: DatePickerProps) => React$1.JSX.Element;
|
|
2115
2159
|
|
|
2116
2160
|
interface DateRange {
|
|
2117
2161
|
/** 시작일 (`"YYYY-MM-DD"`). 아직 고르지 않았으면 undefined */
|
|
@@ -2138,6 +2182,11 @@ interface DateRangePickerProps {
|
|
|
2138
2182
|
selectableRange?: "all" | "until-today";
|
|
2139
2183
|
/** 비활성 여부 */
|
|
2140
2184
|
disabled?: boolean;
|
|
2185
|
+
/**
|
|
2186
|
+
* 필수 입력 여부. `Field` 안에서는 `Field` 의 `required` 가 이긴다.
|
|
2187
|
+
* `role="group"` 에는 `aria-required` 를 붙일 수 없어 안쪽 컨트롤마다 내려보낸다.
|
|
2188
|
+
*/
|
|
2189
|
+
required?: boolean;
|
|
2141
2190
|
/** 전체 너비 차지 (기본값: true) */
|
|
2142
2191
|
fullWidth?: boolean;
|
|
2143
2192
|
}
|
|
@@ -2158,7 +2207,7 @@ interface DateRangePickerProps {
|
|
|
2158
2207
|
* </Field>
|
|
2159
2208
|
* ```
|
|
2160
2209
|
*/
|
|
2161
|
-
declare const DateRangePicker: ({ value, onValueChange, startLabel: startLabelProp, endLabel: endLabelProp, startYear, endYear, minDate, selectableRange, disabled, fullWidth, }: DateRangePickerProps) => React$1.JSX.Element;
|
|
2210
|
+
declare const DateRangePicker: ({ value, onValueChange, startLabel: startLabelProp, endLabel: endLabelProp, startYear, endYear, minDate, selectableRange, disabled, required, fullWidth, }: DateRangePickerProps) => React$1.JSX.Element;
|
|
2162
2211
|
|
|
2163
2212
|
type DropdownSize = "sm" | "md" | "lg";
|
|
2164
2213
|
/**
|
|
@@ -2192,6 +2241,12 @@ interface DropdownCommonProps {
|
|
|
2192
2241
|
options: DropdownOption[];
|
|
2193
2242
|
/** 비활성화 여부 */
|
|
2194
2243
|
disabled?: boolean;
|
|
2244
|
+
/**
|
|
2245
|
+
* 필수 입력 여부. `Field` 안에서는 `Field` 의 `required` 가 이긴다.
|
|
2246
|
+
* `role="group"` 은 `aria-required` 를 받지 못하므로 DatePicker·TimePicker 가 안쪽
|
|
2247
|
+
* Dropdown 마다 이 prop 으로 필수 여부를 내려보낸다.
|
|
2248
|
+
*/
|
|
2249
|
+
required?: boolean;
|
|
2195
2250
|
/** 드롭다운 크기 */
|
|
2196
2251
|
size?: DropdownSize;
|
|
2197
2252
|
/**
|
|
@@ -2830,6 +2885,11 @@ interface TimePickerProps {
|
|
|
2830
2885
|
maxTime?: string;
|
|
2831
2886
|
/** 비활성 여부 */
|
|
2832
2887
|
disabled?: boolean;
|
|
2888
|
+
/**
|
|
2889
|
+
* 필수 입력 여부. `Field` 안에서는 `Field` 의 `required` 가 이긴다.
|
|
2890
|
+
* `role="group"` 에는 `aria-required` 를 붙일 수 없어 안쪽 컨트롤마다 내려보낸다.
|
|
2891
|
+
*/
|
|
2892
|
+
required?: boolean;
|
|
2833
2893
|
/** 전체 너비 차지 (기본값: true) */
|
|
2834
2894
|
fullWidth?: boolean;
|
|
2835
2895
|
/** 시 select 의 라벨/placeholder */
|
|
@@ -2856,7 +2916,7 @@ interface TimePickerProps {
|
|
|
2856
2916
|
* </Field>
|
|
2857
2917
|
* ```
|
|
2858
2918
|
*/
|
|
2859
|
-
declare const TimePicker: ({ label, value, onValueChange, minuteStep, minTime, maxTime, disabled, fullWidth, hourLabel: hourLabelProp, minuteLabel: minuteLabelProp, }: TimePickerProps) => React$1.JSX.Element;
|
|
2919
|
+
declare const TimePicker: ({ label, value, onValueChange, minuteStep, minTime, maxTime, disabled, required, fullWidth, hourLabel: hourLabelProp, minuteLabel: minuteLabelProp, }: TimePickerProps) => React$1.JSX.Element;
|
|
2860
2920
|
|
|
2861
2921
|
interface ToggleProps extends Omit<React$1.ButtonHTMLAttributes<HTMLButtonElement>, "onChange"> {
|
|
2862
2922
|
/** 제어형 토글 상태 */
|
|
@@ -3547,4 +3607,4 @@ type StackProps<T extends React$1.ElementType = "div"> = PolymorphicProps<T, Sta
|
|
|
3547
3607
|
*/
|
|
3548
3608
|
declare const Stack: <T extends React$1.ElementType = "div">({ direction, gap, align, justify, wrap, as, ref, className, children, style, ...props }: StackProps<T>) => React$1.JSX.Element;
|
|
3549
3609
|
|
|
3550
|
-
export { Accordion, type AccordionItem, type AccordionProps, type AlertActionsAlign, type AlertOptions, AlertProvider, type AlertVariant, AppShell, type AppShellProps, Avatar, type AvatarProps, type AvatarShape, type AvatarSize, Badge, type BadgeAppearance, type BadgeProps, type BadgeShape, type BadgeSize, type BadgeVariant, BottomNav, BottomNavItem, type BottomNavItemProps, type BottomNavProps, BottomNavSpacer, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, Button, type ButtonAsAnchor, type ButtonAsButton, type ButtonProps, type ButtonSize, type ButtonVariant, Card, type CardFooterAlign, type CardProps, type CardVariant, Checkbox, type CheckboxProps, Chip, type ChipProps, type ChipSize, type ChipTone, type ChipType, Combobox, type ComboboxOption, type ComboboxProps, type ComboboxSize, Container, type ContainerProps, type ContainerSize, type CropImageSize, type CropOffset, type CropRect, DataView, type DataViewPagination, type DataViewProps, type DataViewQuery, type DataViewSelectionAction, type DataViewToolbar, DatePicker, type DatePickerProps, type DateRange, DateRangePicker, type DateRangePickerProps, DescriptionList, type DescriptionListItem, type DescriptionListLayout, type DescriptionListProps, Divider, type DividerProps, Drawer, type DrawerPlacement, type DrawerProps, Dropdown, type DropdownMultipleProps, type DropdownOption, type DropdownProps, type DropdownSingleProps, type DropdownSize, type DropdownVariant, EmptyState, type EmptyStateProps, ErrorState, type ErrorStateProps, type ErrorStateVariant, Field, type FieldControl, type FieldProps, FileInput, type FileInputProps, type FileInputVariant, Form, type FormActionsProps, type FormProps, Grid, type GridCols, type GridGap, type GridProps, Hero, type HeroAction, type HeroAlign, type HeroHeight, type HeroOverlay, type HeroProps, Icon, IconButton, type IconButtonProps, type IconButtonSize, type IconButtonVariant, type IconProps, ImageCropper, type ImageCropperHandle, type ImageCropperProps, type ImeStrategy, LinearProgress, type LinearProgressProps, ListItem, type ListItemProps, type ListboxItem, type LocaleKey, type LocaleMessages, type LocaleName, LocaleProvider, type LocaleProviderProps, type LocaleText, MediaCard, type MediaCardImage, type MediaCardImagePosition, type MediaCardProps, type MediaCardShadow, Menu, type MenuItem, type MenuProps, Modal, type ModalFooterAlign, type ModalProps, NavBar, type NavBarLayout, type NavBarLocaleConfig, type NavBarLocaleOption, type NavBarProps, type NavBarVariant, NavLink, type NavLinkProps, OtpInput, type OtpInputProps, PageHeader, type PageHeaderProps, Pagination, type PaginationProps, type PolymorphicProps, type PolymorphicRef, Popover, type PopoverPlacement, type PopoverProps, Prose, type ProseProps, type ProseSize, Radio, RadioGroup, type RadioGroupContextValue, type RadioGroupOrientation, type RadioGroupProps, type RadioGroupSize, type RadioProps, type ResolvedTheme, Section, type SectionBg, type SectionProps, type SectionSpacing, Sidebar, SidebarItem, type SidebarItemProps, type SidebarMode, type SidebarProps, SidebarSection, type SidebarSectionProps, Skeleton, type SkeletonProps, type SkeletonVariant, Spinner, type SpinnerProps, Stack, type StackAlign, type StackDirection, type StackGap, type StackJustify, type StackProps, type StackWrap, Stat, type StatDeltaTone, type StatProps, Tab, TabList, type TabListProps, TabPanel, type TabPanelProps, type TabProps, Table, type TableColumn, type TableProps, type TableSize, type TableSort, type TableSortDirection, Tabs, type TabsProps, type TabsSize, type TabsVariant, TagInput, type TagInputProps, type TagInputSize, TextField, type TextFieldProps, type TextFieldSize, type TextFieldVariant, Textarea, type TextareaProps, type TextareaResize, type TextareaSize, type ThemeMode, ThemeProvider, type ThemeProviderProps, TimePicker, type TimePickerProps, Timeline, type TimelineItem, type TimelineProps, type TimelineStatus, ToastProvider, type ToastProviderProps, type ToastVariant, Toggle, type ToggleProps, Tooltip, type TooltipPlacement, type TooltipProps, TopLoading, type TopLoadingProps, type UseListboxPopupArgs, type UseListboxPopupResult, a11y, baseBorderWidth, baseColors, baseTypography, borderWidth, breakpoints, catalogs, cn, colors, elevation, en, iconSize, ko, motion, opacity, radius, skeleton, spacing, typography, useAlert, useFieldControl, useFocusTrap, useListboxPopup, useLocaleName, useLocaleText, useRadioGroupContext, useReducedMotion, useSpringHover, useSpringPresence, useTheme, useToast, zIndex };
|
|
3610
|
+
export { Accordion, type AccordionItem, type AccordionProps, type AlertActionsAlign, type AlertOptions, AlertProvider, type AlertVariant, AppShell, type AppShellProps, Avatar, type AvatarProps, type AvatarShape, type AvatarSize, Badge, type BadgeAppearance, type BadgeProps, type BadgeShape, type BadgeSize, type BadgeVariant, BottomNav, BottomNavItem, type BottomNavItemProps, type BottomNavProps, BottomNavSpacer, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, Button, type ButtonAsAnchor, type ButtonAsButton, type ButtonProps, type ButtonSize, type ButtonVariant, Card, type CardFooterAlign, type CardProps, type CardVariant, Checkbox, type CheckboxProps, Chip, type ChipProps, type ChipSize, type ChipTone, type ChipType, Combobox, type ComboboxOption, type ComboboxProps, type ComboboxSize, Container, type ContainerProps, type ContainerSize, type CropImageSize, type CropOffset, type CropRect, DataView, type DataViewPagination, type DataViewProps, type DataViewQuery, type DataViewSelectionAction, type DataViewToolbar, DatePicker, type DatePickerProps, type DateRange, DateRangePicker, type DateRangePickerProps, DescriptionList, type DescriptionListItem, type DescriptionListLayout, type DescriptionListProps, Divider, type DividerProps, Drawer, type DrawerPlacement, type DrawerProps, Dropdown, type DropdownMultipleProps, type DropdownOption, type DropdownProps, type DropdownSingleProps, type DropdownSize, type DropdownVariant, EmptyState, type EmptyStateProps, ErrorState, type ErrorStateProps, type ErrorStateVariant, Field, type FieldControl, type FieldProps, FileInput, type FileInputProps, type FileInputVariant, type FocusTrapOptions, Form, type FormActionsProps, type FormProps, Grid, type GridCols, type GridGap, type GridProps, Hero, type HeroAction, type HeroAlign, type HeroHeight, type HeroOverlay, type HeroProps, Icon, IconButton, type IconButtonProps, type IconButtonSize, type IconButtonVariant, type IconProps, ImageCropper, type ImageCropperHandle, type ImageCropperProps, type ImeStrategy, LinearProgress, type LinearProgressProps, ListItem, type ListItemProps, type ListboxItem, type LocaleKey, type LocaleMessages, type LocaleName, LocaleProvider, type LocaleProviderProps, type LocaleText, MediaCard, type MediaCardImage, type MediaCardImagePosition, type MediaCardProps, type MediaCardShadow, Menu, type MenuItem, type MenuProps, Modal, type ModalFooterAlign, type ModalProps, NavBar, type NavBarLayout, type NavBarLocaleConfig, type NavBarLocaleOption, type NavBarProps, type NavBarVariant, NavLink, type NavLinkProps, OtpInput, type OtpInputProps, PageHeader, type PageHeaderProps, Pagination, type PaginationProps, type PolymorphicProps, type PolymorphicRef, Popover, type PopoverPlacement, type PopoverProps, Prose, type ProseProps, type ProseSize, Radio, RadioGroup, type RadioGroupContextValue, type RadioGroupOrientation, type RadioGroupProps, type RadioGroupSize, type RadioProps, type ResolvedTheme, Section, type SectionBg, type SectionProps, type SectionSpacing, Sidebar, SidebarItem, type SidebarItemProps, type SidebarMode, type SidebarProps, SidebarSection, type SidebarSectionProps, Skeleton, type SkeletonProps, type SkeletonVariant, Spinner, type SpinnerProps, Stack, type StackAlign, type StackDirection, type StackGap, type StackJustify, type StackProps, type StackWrap, Stat, type StatDeltaTone, type StatProps, Tab, TabList, type TabListProps, TabPanel, type TabPanelProps, type TabProps, Table, type TableColumn, type TableProps, type TableSize, type TableSort, type TableSortDirection, Tabs, type TabsProps, type TabsSize, type TabsVariant, TagInput, type TagInputProps, type TagInputSize, TextField, type TextFieldProps, type TextFieldSize, type TextFieldVariant, Textarea, type TextareaProps, type TextareaResize, type TextareaSize, type ThemeMode, ThemeProvider, type ThemeProviderProps, TimePicker, type TimePickerProps, Timeline, type TimelineItem, type TimelineProps, type TimelineStatus, ToastProvider, type ToastProviderProps, type ToastVariant, Toggle, type ToggleProps, Tooltip, type TooltipPlacement, type TooltipProps, TopLoading, type TopLoadingProps, type UseListboxPopupArgs, type UseListboxPopupResult, a11y, baseBorderWidth, baseColors, baseTypography, borderWidth, breakpoints, catalogs, cn, colors, elevation, en, iconSize, ko, motion, opacity, radius, skeleton, spacing, typography, useAlert, useFieldControl, useFocusTrap, useListboxPopup, useLocaleName, useLocaleText, useRadioGroupContext, useReducedMotion, useSpringHover, useSpringPresence, useTheme, useToast, zIndex };
|
package/dist/index.js
CHANGED
|
@@ -29,6 +29,29 @@ var cn = (...classes) => {
|
|
|
29
29
|
}
|
|
30
30
|
return classNames.join(" ");
|
|
31
31
|
};
|
|
32
|
+
|
|
33
|
+
// src/utils/key-activation.ts
|
|
34
|
+
function keyActivationProps({
|
|
35
|
+
onClick,
|
|
36
|
+
role,
|
|
37
|
+
disabled,
|
|
38
|
+
onKeyDown
|
|
39
|
+
}) {
|
|
40
|
+
const resolvedRole = role ?? (onClick ? "button" : void 0);
|
|
41
|
+
const isInteractive = !!onClick && !disabled;
|
|
42
|
+
return {
|
|
43
|
+
role: resolvedRole,
|
|
44
|
+
tabIndex: isInteractive ? 0 : void 0,
|
|
45
|
+
onKeyDown: (event) => {
|
|
46
|
+
onKeyDown?.(event);
|
|
47
|
+
if (!isInteractive || event.defaultPrevented || event.repeat) return;
|
|
48
|
+
if (event.key === "Enter" || event.key === " " && resolvedRole === "button") {
|
|
49
|
+
event.preventDefault();
|
|
50
|
+
event.currentTarget.click();
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
}
|
|
32
55
|
var stack = [];
|
|
33
56
|
var handleKeyDown = (e) => {
|
|
34
57
|
if (e.key !== "Escape") return;
|
|
@@ -171,6 +194,16 @@ function springEnterFrom(reduced, transform) {
|
|
|
171
194
|
var OVERLAY_PANEL_CLOSED_TRANSFORM = "scale(0.96) translateY(-4px)";
|
|
172
195
|
var OVERLAY_PANEL_OPEN_TRANSFORM = "scale(1) translateY(0px)";
|
|
173
196
|
var OVERLAY_SPRING_CONFIG = { tension: 280, friction: 28, clamp: true };
|
|
197
|
+
|
|
198
|
+
// src/utils/split-aria-props.ts
|
|
199
|
+
function splitAriaProps(props) {
|
|
200
|
+
const ariaProps = {};
|
|
201
|
+
const restProps = {};
|
|
202
|
+
for (const key of Object.keys(props)) {
|
|
203
|
+
(key.startsWith("aria-") ? ariaProps : restProps)[key] = props[key];
|
|
204
|
+
}
|
|
205
|
+
return { ariaProps, restProps };
|
|
206
|
+
}
|
|
174
207
|
var useSafeLayoutEffect = typeof window !== "undefined" ? useLayoutEffect : useEffect;
|
|
175
208
|
|
|
176
209
|
// src/utils/use-anchored-position.ts
|
|
@@ -338,7 +371,7 @@ var FOCUSABLE_SELECTORS = [
|
|
|
338
371
|
"textarea:not([disabled])",
|
|
339
372
|
'[tabindex]:not([tabindex="-1"])'
|
|
340
373
|
].join(", ");
|
|
341
|
-
function useFocusTrap(containerRef, isActive) {
|
|
374
|
+
function useFocusTrap(containerRef, isActive, options) {
|
|
342
375
|
const previousActiveElement = React20.useRef(null);
|
|
343
376
|
React20.useEffect(() => {
|
|
344
377
|
if (!isActive) return;
|
|
@@ -350,7 +383,11 @@ function useFocusTrap(containerRef, isActive) {
|
|
|
350
383
|
};
|
|
351
384
|
let wasTabIndexAdded = false;
|
|
352
385
|
const focusableElements = getFocusableElements();
|
|
353
|
-
const
|
|
386
|
+
const preferredRoot = options?.preferWithin?.current;
|
|
387
|
+
const preferred = preferredRoot ? Array.from(preferredRoot.querySelectorAll(FOCUSABLE_SELECTORS)).find(
|
|
388
|
+
(el) => !el.hasAttribute(SKIP_AUTOFOCUS_ATTR)
|
|
389
|
+
) ?? null : null;
|
|
390
|
+
const initialTarget = preferred ?? Array.from(focusableElements).find((el) => !el.hasAttribute(SKIP_AUTOFOCUS_ATTR)) ?? focusableElements[0];
|
|
354
391
|
if (initialTarget) {
|
|
355
392
|
initialTarget.focus();
|
|
356
393
|
} else {
|
|
@@ -2685,11 +2722,30 @@ var Card = ({
|
|
|
2685
2722
|
{ card_bordered: bordered, card_interactive: interactive },
|
|
2686
2723
|
className
|
|
2687
2724
|
);
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2725
|
+
const activation = keyActivationProps({
|
|
2726
|
+
onClick: props.onClick,
|
|
2727
|
+
role: props.role,
|
|
2728
|
+
onKeyDown: props.onKeyDown
|
|
2729
|
+
});
|
|
2730
|
+
return (
|
|
2731
|
+
// biome-ignore lint/a11y/noStaticElementInteractions: onClick 이 있을 때만 role=button + tabIndex 를 붙인다 (ListItem 과 같은 규칙)
|
|
2732
|
+
/* @__PURE__ */ jsxs(
|
|
2733
|
+
"div",
|
|
2734
|
+
{
|
|
2735
|
+
ref,
|
|
2736
|
+
className: cardClassName,
|
|
2737
|
+
role: activation.role,
|
|
2738
|
+
tabIndex: activation.tabIndex,
|
|
2739
|
+
...props,
|
|
2740
|
+
onKeyDown: activation.onKeyDown,
|
|
2741
|
+
children: [
|
|
2742
|
+
heading ? /* @__PURE__ */ jsx(HeadingTag, { className: "card_title", children: heading }) : null,
|
|
2743
|
+
/* @__PURE__ */ jsx("div", { className: "card_body", children }),
|
|
2744
|
+
footer ? /* @__PURE__ */ jsx("div", { className: cn("card_footer", `card_footer_${footerAlign}`), children: footer }) : null
|
|
2745
|
+
]
|
|
2746
|
+
}
|
|
2747
|
+
)
|
|
2748
|
+
);
|
|
2693
2749
|
};
|
|
2694
2750
|
var CheckIcon = () => /* @__PURE__ */ jsx(
|
|
2695
2751
|
"svg",
|
|
@@ -3291,7 +3347,7 @@ var Checkbox = ({
|
|
|
3291
3347
|
className: "checkbox_input",
|
|
3292
3348
|
id: field?.inputId ?? props.id,
|
|
3293
3349
|
"aria-describedby": field?.describedBy ?? props["aria-describedby"],
|
|
3294
|
-
"aria-required": field
|
|
3350
|
+
"aria-required": field ? field.required || void 0 : props["aria-required"],
|
|
3295
3351
|
"aria-invalid": error || (field ? field.invalid || void 0 : props["aria-invalid"])
|
|
3296
3352
|
}
|
|
3297
3353
|
),
|
|
@@ -3318,6 +3374,7 @@ var Table = ({
|
|
|
3318
3374
|
onSortChange,
|
|
3319
3375
|
selectAllAriaLabel: selectAllAriaLabelProp,
|
|
3320
3376
|
selectRowAriaLabel: selectRowAriaLabelProp,
|
|
3377
|
+
rowIndexOffset = 0,
|
|
3321
3378
|
selectable = false,
|
|
3322
3379
|
rowKey,
|
|
3323
3380
|
selectedKeys,
|
|
@@ -3328,6 +3385,7 @@ var Table = ({
|
|
|
3328
3385
|
const emptyMessage = emptyMessageProp === void 0 ? t("table.empty") : emptyMessageProp;
|
|
3329
3386
|
const selectAllAriaLabel = selectAllAriaLabelProp ?? t("table.selectAll");
|
|
3330
3387
|
const selectRowAriaLabel = selectRowAriaLabelProp ?? ((index) => t("table.selectRow", { index: index + 1 }));
|
|
3388
|
+
const toGlobalIndex = (rowIndex) => rowIndex + rowIndexOffset;
|
|
3331
3389
|
const wrapperClassName = cn(
|
|
3332
3390
|
"table_wrapper",
|
|
3333
3391
|
`table_size_${size}`,
|
|
@@ -3496,7 +3554,7 @@ var Table = ({
|
|
|
3496
3554
|
children: /* @__PURE__ */ jsx(
|
|
3497
3555
|
Checkbox,
|
|
3498
3556
|
{
|
|
3499
|
-
"aria-label": selectRowAriaLabel(rowIndex),
|
|
3557
|
+
"aria-label": selectRowAriaLabel(toGlobalIndex(rowIndex)),
|
|
3500
3558
|
checked: isSelected,
|
|
3501
3559
|
onChange: () => handleToggleRow(rowIdentity)
|
|
3502
3560
|
}
|
|
@@ -3538,6 +3596,8 @@ var DataView = ({
|
|
|
3538
3596
|
onSortChange,
|
|
3539
3597
|
onRowClick,
|
|
3540
3598
|
ariaLabel,
|
|
3599
|
+
selectAllAriaLabel,
|
|
3600
|
+
selectRowAriaLabel,
|
|
3541
3601
|
selectionSummary: selectionSummaryProp,
|
|
3542
3602
|
clearSelectionLabel: clearSelectionLabelProp,
|
|
3543
3603
|
errorTitle: errorTitleProp,
|
|
@@ -3556,6 +3616,7 @@ var DataView = ({
|
|
|
3556
3616
|
const selectable = !!selectionActions?.length;
|
|
3557
3617
|
const rows = query.data ?? [];
|
|
3558
3618
|
const hasPagination = !!pagination;
|
|
3619
|
+
const rowIndexOffset = pagination?.pageSize !== void 0 ? Math.max(0, (pagination.page - 1) * pagination.pageSize) : 0;
|
|
3559
3620
|
const needsSelectionPrune = selectable && !hasPagination;
|
|
3560
3621
|
const visibleKeySignature = needsSelectionPrune ? JSON.stringify(rows.map(rowKey)) : "";
|
|
3561
3622
|
useEffect(() => {
|
|
@@ -3621,12 +3682,15 @@ var DataView = ({
|
|
|
3621
3682
|
columns,
|
|
3622
3683
|
data: rows,
|
|
3623
3684
|
keyExtractor: rowKey,
|
|
3685
|
+
rowIndexOffset,
|
|
3624
3686
|
isLoading: query.isLoading,
|
|
3625
3687
|
sort,
|
|
3626
3688
|
onSortChange,
|
|
3627
3689
|
onRowClick,
|
|
3628
3690
|
ariaLabel,
|
|
3629
3691
|
selectable: true,
|
|
3692
|
+
selectAllAriaLabel,
|
|
3693
|
+
selectRowAriaLabel,
|
|
3630
3694
|
rowKey,
|
|
3631
3695
|
selectedKeys,
|
|
3632
3696
|
onSelectionChange: setSelectedKeys
|
|
@@ -3638,6 +3702,7 @@ var DataView = ({
|
|
|
3638
3702
|
columns,
|
|
3639
3703
|
data: rows,
|
|
3640
3704
|
keyExtractor: rowKey,
|
|
3705
|
+
rowIndexOffset,
|
|
3641
3706
|
isLoading: query.isLoading,
|
|
3642
3707
|
sort,
|
|
3643
3708
|
onSortChange,
|
|
@@ -3744,25 +3809,26 @@ var ListItem = ({
|
|
|
3744
3809
|
onClick && "list_item_interactive",
|
|
3745
3810
|
className
|
|
3746
3811
|
);
|
|
3812
|
+
const activation = keyActivationProps({
|
|
3813
|
+
onClick,
|
|
3814
|
+
role: props.role,
|
|
3815
|
+
disabled,
|
|
3816
|
+
onKeyDown: props.onKeyDown
|
|
3817
|
+
});
|
|
3747
3818
|
return (
|
|
3748
3819
|
// biome-ignore lint/a11y/noStaticElementInteractions: optional interactive list item - role=button + tabIndex set conditionally based on onClick
|
|
3820
|
+
// biome-ignore lint/a11y/useAriaPropsSupportedByRole: role 은 keyActivationProps 가 주므로 정적 분석이 못 본다 - onClick 이 있으면 role=button 이고 aria-pressed 는 그때만 붙는다
|
|
3749
3821
|
/* @__PURE__ */ jsx(
|
|
3750
3822
|
"div",
|
|
3751
3823
|
{
|
|
3752
3824
|
className: rootClassName,
|
|
3753
3825
|
onClick: disabled ? void 0 : onClick,
|
|
3754
|
-
|
|
3755
|
-
|
|
3756
|
-
if (e.key === "Enter" || e.key === " ") {
|
|
3757
|
-
e.preventDefault();
|
|
3758
|
-
e.currentTarget.click();
|
|
3759
|
-
}
|
|
3760
|
-
},
|
|
3761
|
-
role: onClick ? "button" : void 0,
|
|
3762
|
-
tabIndex: onClick && !disabled ? 0 : void 0,
|
|
3826
|
+
role: activation.role,
|
|
3827
|
+
tabIndex: activation.tabIndex,
|
|
3763
3828
|
"aria-disabled": disabled || void 0,
|
|
3764
3829
|
"aria-pressed": onClick && selected !== void 0 ? selected : void 0,
|
|
3765
3830
|
...props,
|
|
3831
|
+
onKeyDown: activation.onKeyDown,
|
|
3766
3832
|
children: /* @__PURE__ */ jsxs("div", { className: "list_item_state_layer", children: [
|
|
3767
3833
|
leadingElement && /* @__PURE__ */ jsx("div", { className: "list_item_leading", children: leadingElement }),
|
|
3768
3834
|
/* @__PURE__ */ jsxs("div", { className: "list_item_content", children: [
|
|
@@ -3803,18 +3869,37 @@ var MediaCard = ({
|
|
|
3803
3869
|
const isOverlay = imagePosition === "overlay";
|
|
3804
3870
|
const cardStyle = isOverlay && aspectRatio ? { aspectRatio } : void 0;
|
|
3805
3871
|
const wrapStyle = !isOverlay && aspectRatio ? { aspectRatio } : void 0;
|
|
3806
|
-
|
|
3807
|
-
|
|
3808
|
-
|
|
3809
|
-
|
|
3810
|
-
|
|
3811
|
-
|
|
3812
|
-
|
|
3813
|
-
|
|
3814
|
-
|
|
3815
|
-
|
|
3816
|
-
|
|
3817
|
-
|
|
3872
|
+
const activation = keyActivationProps({
|
|
3873
|
+
onClick: props.onClick,
|
|
3874
|
+
role: props.role,
|
|
3875
|
+
onKeyDown: props.onKeyDown
|
|
3876
|
+
});
|
|
3877
|
+
return (
|
|
3878
|
+
// biome-ignore lint/a11y/noStaticElementInteractions: onClick 이 있을 때만 role=button + tabIndex 를 붙인다 (ListItem 과 같은 규칙)
|
|
3879
|
+
/* @__PURE__ */ jsxs(
|
|
3880
|
+
"div",
|
|
3881
|
+
{
|
|
3882
|
+
className: cardClassName,
|
|
3883
|
+
style: cardStyle,
|
|
3884
|
+
role: activation.role,
|
|
3885
|
+
tabIndex: activation.tabIndex,
|
|
3886
|
+
...props,
|
|
3887
|
+
onKeyDown: activation.onKeyDown,
|
|
3888
|
+
children: [
|
|
3889
|
+
/* @__PURE__ */ jsxs("div", { className: "media_card_image_wrap", style: wrapStyle, children: [
|
|
3890
|
+
/* @__PURE__ */ jsx("img", { className: "media_card_image", src: image.src, alt: image.alt, loading: "lazy" }),
|
|
3891
|
+
isOverlay && /* @__PURE__ */ jsx("div", { className: "media_card_overlay", "aria-hidden": "true" })
|
|
3892
|
+
] }),
|
|
3893
|
+
/* @__PURE__ */ jsxs("div", { className: "media_card_body", children: [
|
|
3894
|
+
eyebrow && /* @__PURE__ */ jsx("div", { className: "media_card_eyebrow", children: eyebrow }),
|
|
3895
|
+
heading && /* @__PURE__ */ jsx(HeadingTag, { className: "media_card_heading", children: heading }),
|
|
3896
|
+
children && /* @__PURE__ */ jsx("div", { className: "media_card_content", children }),
|
|
3897
|
+
meta && /* @__PURE__ */ jsx("div", { className: "media_card_meta", children: meta })
|
|
3898
|
+
] })
|
|
3899
|
+
]
|
|
3900
|
+
}
|
|
3901
|
+
)
|
|
3902
|
+
);
|
|
3818
3903
|
};
|
|
3819
3904
|
var Prose = ({ size = "md", className, children, ref, ...props }) => {
|
|
3820
3905
|
const rootRef = React20.useRef(null);
|
|
@@ -4266,6 +4351,8 @@ var Combobox = ({
|
|
|
4266
4351
|
const generatedId = useId();
|
|
4267
4352
|
const field = useFieldControl();
|
|
4268
4353
|
const inputId = field?.inputId ?? generatedId;
|
|
4354
|
+
const { ariaProps, restProps } = splitAriaProps(props);
|
|
4355
|
+
const labelledBy = field?.labelId ?? ariaProps["aria-labelledby"];
|
|
4269
4356
|
const listId = `${inputId}-listbox`;
|
|
4270
4357
|
const [query, setQuery] = useState("");
|
|
4271
4358
|
const [options, setOptions] = useState(defaultOptions);
|
|
@@ -4340,7 +4427,7 @@ var Combobox = ({
|
|
|
4340
4427
|
visible: isOpen,
|
|
4341
4428
|
from: popup.dropUp ? "translateY(4px)" : "translateY(-4px)"
|
|
4342
4429
|
});
|
|
4343
|
-
return /* @__PURE__ */ jsxs("div", { ref: popup.wrapperRef, className: rootClassName, ...
|
|
4430
|
+
return /* @__PURE__ */ jsxs("div", { ref: popup.wrapperRef, className: rootClassName, ...restProps, children: [
|
|
4344
4431
|
/* @__PURE__ */ jsxs("div", { className: "combobox_control", children: [
|
|
4345
4432
|
/* @__PURE__ */ jsx(
|
|
4346
4433
|
"input",
|
|
@@ -4348,6 +4435,7 @@ var Combobox = ({
|
|
|
4348
4435
|
id: inputId,
|
|
4349
4436
|
className: "combobox_input",
|
|
4350
4437
|
role: "combobox",
|
|
4438
|
+
...ariaProps,
|
|
4351
4439
|
type: "text",
|
|
4352
4440
|
autoComplete: "off",
|
|
4353
4441
|
disabled,
|
|
@@ -4357,11 +4445,11 @@ var Combobox = ({
|
|
|
4357
4445
|
"aria-controls": isOpen && hasList ? listId : void 0,
|
|
4358
4446
|
"aria-autocomplete": "list",
|
|
4359
4447
|
"aria-activedescendant": isOpen && activeIndex >= 0 && options[activeIndex] ? `${listId}-${options[activeIndex].value}` : void 0,
|
|
4360
|
-
"aria-labelledby":
|
|
4361
|
-
"aria-label":
|
|
4362
|
-
"aria-describedby": field?.describedBy,
|
|
4363
|
-
"aria-invalid": field
|
|
4364
|
-
"aria-required": field
|
|
4448
|
+
"aria-labelledby": labelledBy,
|
|
4449
|
+
"aria-label": labelledBy ? void 0 : ariaLabel ?? ariaProps["aria-label"],
|
|
4450
|
+
"aria-describedby": field?.describedBy ?? ariaProps["aria-describedby"],
|
|
4451
|
+
"aria-invalid": field ? field.invalid || void 0 : ariaProps["aria-invalid"],
|
|
4452
|
+
"aria-required": field ? field.required || void 0 : ariaProps["aria-required"],
|
|
4365
4453
|
onChange: (event) => {
|
|
4366
4454
|
setQuery(event.target.value);
|
|
4367
4455
|
if (!isOpen) setIsOpen(true);
|
|
@@ -4452,6 +4540,7 @@ var Dropdown = (props) => {
|
|
|
4452
4540
|
placeholder: placeholderProp,
|
|
4453
4541
|
options,
|
|
4454
4542
|
disabled,
|
|
4543
|
+
required,
|
|
4455
4544
|
size = "md",
|
|
4456
4545
|
variant = "outline",
|
|
4457
4546
|
className,
|
|
@@ -4601,7 +4690,7 @@ var Dropdown = (props) => {
|
|
|
4601
4690
|
"aria-activedescendant": !searchable && isOpen && activeIndex >= 0 && visibleOptions[activeIndex] ? `${dropdownId}_option_${activeIndex}` : void 0,
|
|
4602
4691
|
"aria-describedby": field?.describedBy,
|
|
4603
4692
|
"aria-invalid": field?.invalid || void 0,
|
|
4604
|
-
"aria-required": field
|
|
4693
|
+
"aria-required": field ? field.required || void 0 : required || void 0,
|
|
4605
4694
|
"aria-controls": isOpen ? `${dropdownId}_listbox` : void 0,
|
|
4606
4695
|
onClick: () => !disabled && setIsOpen((o) => !o),
|
|
4607
4696
|
onKeyDown: onControlKeyDown,
|
|
@@ -4661,7 +4750,7 @@ var Dropdown = (props) => {
|
|
|
4661
4750
|
role: "combobox",
|
|
4662
4751
|
"aria-autocomplete": "list",
|
|
4663
4752
|
"aria-expanded": isOpen,
|
|
4664
|
-
"aria-required": field
|
|
4753
|
+
"aria-required": field ? field.required || void 0 : required || void 0,
|
|
4665
4754
|
"aria-controls": `${dropdownId}_listbox`,
|
|
4666
4755
|
"aria-activedescendant": activeIndex >= 0 && visibleOptions[activeIndex] ? `${dropdownId}_option_${activeIndex}` : void 0,
|
|
4667
4756
|
value: searchText,
|
|
@@ -4748,6 +4837,7 @@ var DatePicker = ({
|
|
|
4748
4837
|
minDate,
|
|
4749
4838
|
selectableRange = "all",
|
|
4750
4839
|
disabled,
|
|
4840
|
+
required,
|
|
4751
4841
|
fullWidth = true,
|
|
4752
4842
|
width,
|
|
4753
4843
|
yearLabel: yearLabelProp,
|
|
@@ -4763,6 +4853,7 @@ var DatePicker = ({
|
|
|
4763
4853
|
const minDateSrFormat = minDateSrFormatProp ?? t("datePicker.minDateSr");
|
|
4764
4854
|
const selectableRangeUntilTodaySrText = selectableRangeUntilTodaySrTextProp ?? t("datePicker.rangeUntilTodaySr");
|
|
4765
4855
|
const field = useFieldControl();
|
|
4856
|
+
const isRequired = field ? field.required || void 0 : required || void 0;
|
|
4766
4857
|
const groupId = React20.useId();
|
|
4767
4858
|
const constraintId = React20.useId();
|
|
4768
4859
|
const { todayYear, todayMonth, todayDay } = React20.useMemo(() => {
|
|
@@ -4930,6 +5021,7 @@ var DatePicker = ({
|
|
|
4930
5021
|
options: yearOptions,
|
|
4931
5022
|
value: year ? String(year) : null,
|
|
4932
5023
|
onValueChange: handleYearChange,
|
|
5024
|
+
required: isRequired,
|
|
4933
5025
|
disabled
|
|
4934
5026
|
}
|
|
4935
5027
|
),
|
|
@@ -4943,6 +5035,7 @@ var DatePicker = ({
|
|
|
4943
5035
|
options: monthOptions,
|
|
4944
5036
|
value: month ? String(month) : null,
|
|
4945
5037
|
onValueChange: handleMonthChange,
|
|
5038
|
+
required: isRequired,
|
|
4946
5039
|
disabled: disabled || !year
|
|
4947
5040
|
}
|
|
4948
5041
|
),
|
|
@@ -4956,6 +5049,7 @@ var DatePicker = ({
|
|
|
4956
5049
|
options: dayOptions,
|
|
4957
5050
|
value: day ? String(day) : null,
|
|
4958
5051
|
onValueChange: handleDayChange,
|
|
5052
|
+
required: isRequired,
|
|
4959
5053
|
disabled: disabled || !month
|
|
4960
5054
|
}
|
|
4961
5055
|
)
|
|
@@ -4974,12 +5068,14 @@ var DateRangePicker = ({
|
|
|
4974
5068
|
minDate,
|
|
4975
5069
|
selectableRange = "all",
|
|
4976
5070
|
disabled,
|
|
5071
|
+
required,
|
|
4977
5072
|
fullWidth = true
|
|
4978
5073
|
}) => {
|
|
4979
5074
|
const t = useLocaleText();
|
|
4980
5075
|
const startLabel = startLabelProp ?? t("dateRange.start");
|
|
4981
5076
|
const endLabel = endLabelProp ?? t("dateRange.end");
|
|
4982
5077
|
const field = useFieldControl();
|
|
5078
|
+
const isRequired = field ? field.required || void 0 : required || void 0;
|
|
4983
5079
|
const start = value?.start;
|
|
4984
5080
|
const end = value?.end;
|
|
4985
5081
|
const handleStartChange = (next) => {
|
|
@@ -5015,6 +5111,7 @@ var DateRangePicker = ({
|
|
|
5015
5111
|
endYear,
|
|
5016
5112
|
minDate,
|
|
5017
5113
|
selectableRange,
|
|
5114
|
+
required: isRequired,
|
|
5018
5115
|
disabled,
|
|
5019
5116
|
fullWidth: true
|
|
5020
5117
|
}
|
|
@@ -5029,6 +5126,7 @@ var DateRangePicker = ({
|
|
|
5029
5126
|
endYear,
|
|
5030
5127
|
minDate: endMinDate,
|
|
5031
5128
|
selectableRange,
|
|
5129
|
+
required: isRequired,
|
|
5032
5130
|
disabled: disabled || !start,
|
|
5033
5131
|
fullWidth: true
|
|
5034
5132
|
}
|
|
@@ -5129,6 +5227,7 @@ var FileInput = ({
|
|
|
5129
5227
|
accept: isPreviewVariant ? accept ?? "image/*" : accept,
|
|
5130
5228
|
"aria-describedby": [field?.describedBy, supportingText ? helperId : void 0].filter(Boolean).join(" ") || void 0,
|
|
5131
5229
|
"aria-invalid": field?.invalid || void 0,
|
|
5230
|
+
required: field ? field.required || void 0 : props.required,
|
|
5132
5231
|
onChange: handleChange
|
|
5133
5232
|
}
|
|
5134
5233
|
),
|
|
@@ -5624,6 +5723,7 @@ var OtpInput = ({
|
|
|
5624
5723
|
disabled,
|
|
5625
5724
|
"aria-label": t("otpInput.digit", { index: i + 1 }),
|
|
5626
5725
|
"aria-invalid": error || field?.invalid || void 0,
|
|
5726
|
+
"aria-required": field?.required || void 0,
|
|
5627
5727
|
"aria-describedby": [field?.describedBy, supportingText ? supportingId : void 0].filter(Boolean).join(" ") || void 0,
|
|
5628
5728
|
className: cn(
|
|
5629
5729
|
"otp_input_box",
|
|
@@ -5675,6 +5775,7 @@ var RadioGroup = ({
|
|
|
5675
5775
|
const field = useFieldControl();
|
|
5676
5776
|
const labelId = label ? `${idPrefix}-label` : void 0;
|
|
5677
5777
|
const helperId = supportingText ? `${idPrefix}-help` : void 0;
|
|
5778
|
+
const { ariaProps, restProps } = splitAriaProps(props);
|
|
5678
5779
|
const onChange = React20.useCallback(
|
|
5679
5780
|
(next) => {
|
|
5680
5781
|
if (!isControlled) setInternalValue(next);
|
|
@@ -5695,17 +5796,18 @@ var RadioGroup = ({
|
|
|
5695
5796
|
error && "radio_group_error",
|
|
5696
5797
|
className
|
|
5697
5798
|
),
|
|
5698
|
-
...
|
|
5799
|
+
...restProps,
|
|
5699
5800
|
children: [
|
|
5700
5801
|
label && /* @__PURE__ */ jsx("span", { id: labelId, className: "radio_group_label", children: label }),
|
|
5701
5802
|
/* @__PURE__ */ jsx(
|
|
5702
5803
|
"div",
|
|
5703
5804
|
{
|
|
5704
5805
|
role: "radiogroup",
|
|
5705
|
-
|
|
5706
|
-
"aria-
|
|
5707
|
-
"aria-
|
|
5708
|
-
"aria-
|
|
5806
|
+
...ariaProps,
|
|
5807
|
+
"aria-labelledby": field?.labelId ?? labelId ?? ariaProps["aria-labelledby"],
|
|
5808
|
+
"aria-describedby": field?.describedBy ?? helperId ?? ariaProps["aria-describedby"],
|
|
5809
|
+
"aria-invalid": error || (field ? field.invalid || void 0 : ariaProps["aria-invalid"]),
|
|
5810
|
+
"aria-required": field ? field.required || void 0 : ariaProps["aria-required"],
|
|
5709
5811
|
className: "radio_group_options",
|
|
5710
5812
|
children
|
|
5711
5813
|
}
|
|
@@ -5783,6 +5885,8 @@ var TagInput = ({
|
|
|
5783
5885
|
const generatedId = useId();
|
|
5784
5886
|
const field = useFieldControl();
|
|
5785
5887
|
const inputId = field?.inputId ?? generatedId;
|
|
5888
|
+
const { ariaProps, restProps } = splitAriaProps(props);
|
|
5889
|
+
const labelledBy = field?.labelId ?? ariaProps["aria-labelledby"];
|
|
5786
5890
|
const isControlled = value !== void 0;
|
|
5787
5891
|
const [innerTags, setInnerTags] = useState(defaultValue);
|
|
5788
5892
|
const tags = isControlled ? value : innerTags;
|
|
@@ -5861,7 +5965,7 @@ var TagInput = ({
|
|
|
5861
5965
|
{ tag_input_full_width: fullWidth, tag_input_disabled: disabled },
|
|
5862
5966
|
className
|
|
5863
5967
|
);
|
|
5864
|
-
return /* @__PURE__ */ jsxs("div", { className: rootClassName, ...
|
|
5968
|
+
return /* @__PURE__ */ jsxs("div", { className: rootClassName, ...restProps, children: [
|
|
5865
5969
|
/* @__PURE__ */ jsxs("div", { className: "tag_input_control", onClick: () => inputRef.current?.focus(), children: [
|
|
5866
5970
|
tags.length > 0 && /* @__PURE__ */ jsx("ul", { className: "tag_input_tags", children: tags.map((tag, index) => (
|
|
5867
5971
|
/* biome-ignore lint/suspicious/noArrayIndexKey: allowDuplicates 면 같은 라벨이 여러 개라 값만으로는 구분되지 않는다 */
|
|
@@ -5888,11 +5992,12 @@ var TagInput = ({
|
|
|
5888
5992
|
disabled,
|
|
5889
5993
|
readOnly: isFull,
|
|
5890
5994
|
placeholder: isFull ? "" : placeholder,
|
|
5891
|
-
|
|
5892
|
-
"aria-
|
|
5893
|
-
"aria-
|
|
5894
|
-
"aria-
|
|
5895
|
-
"aria-
|
|
5995
|
+
...ariaProps,
|
|
5996
|
+
"aria-labelledby": labelledBy,
|
|
5997
|
+
"aria-label": labelledBy ? void 0 : ariaLabel ?? ariaProps["aria-label"],
|
|
5998
|
+
"aria-describedby": field?.describedBy ?? ariaProps["aria-describedby"],
|
|
5999
|
+
"aria-invalid": field ? field.invalid || void 0 : ariaProps["aria-invalid"],
|
|
6000
|
+
"aria-required": field ? field.required || void 0 : ariaProps["aria-required"],
|
|
5896
6001
|
onChange: (event) => setDraft(event.target.value),
|
|
5897
6002
|
onKeyDown,
|
|
5898
6003
|
onPaste,
|
|
@@ -6053,6 +6158,7 @@ var TimePicker = ({
|
|
|
6053
6158
|
minTime,
|
|
6054
6159
|
maxTime,
|
|
6055
6160
|
disabled,
|
|
6161
|
+
required,
|
|
6056
6162
|
fullWidth = true,
|
|
6057
6163
|
hourLabel: hourLabelProp,
|
|
6058
6164
|
minuteLabel: minuteLabelProp
|
|
@@ -6061,6 +6167,7 @@ var TimePicker = ({
|
|
|
6061
6167
|
const hourLabel = hourLabelProp ?? t("timePicker.hour");
|
|
6062
6168
|
const minuteLabel = minuteLabelProp ?? t("timePicker.minute");
|
|
6063
6169
|
const field = useFieldControl();
|
|
6170
|
+
const isRequired = field ? field.required || void 0 : required || void 0;
|
|
6064
6171
|
const groupId = React20.useId();
|
|
6065
6172
|
const constraintId = React20.useId();
|
|
6066
6173
|
const min = toMinutes(minTime) ?? 0;
|
|
@@ -6127,6 +6234,7 @@ var TimePicker = ({
|
|
|
6127
6234
|
options: hourOptions,
|
|
6128
6235
|
value: hour === null ? null : String(hour),
|
|
6129
6236
|
onValueChange: handleHourChange,
|
|
6237
|
+
required: isRequired,
|
|
6130
6238
|
disabled
|
|
6131
6239
|
}
|
|
6132
6240
|
),
|
|
@@ -6140,6 +6248,7 @@ var TimePicker = ({
|
|
|
6140
6248
|
options: minuteOptions,
|
|
6141
6249
|
value: minute === null ? null : String(minute),
|
|
6142
6250
|
onValueChange: handleMinuteChange,
|
|
6251
|
+
required: isRequired,
|
|
6143
6252
|
disabled: disabled || hour === null
|
|
6144
6253
|
}
|
|
6145
6254
|
)
|
|
@@ -6190,6 +6299,7 @@ var Toggle = ({
|
|
|
6190
6299
|
id: field?.inputId ?? props.id,
|
|
6191
6300
|
"aria-describedby": field?.describedBy ?? props["aria-describedby"],
|
|
6192
6301
|
"aria-invalid": field ? field.invalid || void 0 : props["aria-invalid"],
|
|
6302
|
+
"aria-required": field ? field.required || void 0 : props["aria-required"],
|
|
6193
6303
|
"aria-labelledby": field?.labelId,
|
|
6194
6304
|
"aria-label": field?.labelId ? void 0 : ariaLabel,
|
|
6195
6305
|
disabled,
|
|
@@ -6247,12 +6357,13 @@ var Drawer = ({
|
|
|
6247
6357
|
const overlayDismissible = dismissible ?? closeOnOverlay;
|
|
6248
6358
|
const escapeDismissible = dismissible ?? true;
|
|
6249
6359
|
const panelRef = React20.useRef(null);
|
|
6360
|
+
const bodyRef = React20.useRef(null);
|
|
6250
6361
|
const pressedOverlayRef = React20.useRef(false);
|
|
6251
6362
|
const titleId = React20.useId();
|
|
6252
6363
|
const [shouldRender, setShouldRender] = React20.useState(open);
|
|
6253
6364
|
const reduced = useReducedMotion();
|
|
6254
6365
|
const isMounted = useIsMounted();
|
|
6255
|
-
useFocusTrap(panelRef, open && isMounted);
|
|
6366
|
+
useFocusTrap(panelRef, open && isMounted, { preferWithin: bodyRef });
|
|
6256
6367
|
useOverlayEscape(open && isMounted, () => {
|
|
6257
6368
|
if (escapeDismissible) onClose?.();
|
|
6258
6369
|
});
|
|
@@ -6323,7 +6434,7 @@ var Drawer = ({
|
|
|
6323
6434
|
content.children && // 본문이 스크롤 컨테이너라 키보드로도 스크롤할 수 있어야 한다(axe
|
|
6324
6435
|
// `scrollable-region-focusable`). 다만 초기 포커스 대상에서는 제외한다 - 안쪽에
|
|
6325
6436
|
// 첫 입력이 있는데 빈 wrapper 에 포커스가 놓이면 열자마자 어디에 있는지 알 수 없다.
|
|
6326
|
-
/* @__PURE__ */ jsx("div", { className: "drawer_body", tabIndex: 0, "data-focus-trap-skip-autofocus": "", children: content.children }),
|
|
6437
|
+
/* @__PURE__ */ jsx("div", { ref: bodyRef, className: "drawer_body", tabIndex: 0, "data-focus-trap-skip-autofocus": "", children: content.children }),
|
|
6327
6438
|
content.footer && /* @__PURE__ */ jsx("div", { className: "drawer_footer", children: content.footer })
|
|
6328
6439
|
]
|
|
6329
6440
|
}
|
|
@@ -6360,11 +6471,12 @@ var Modal = ({
|
|
|
6360
6471
|
const overlayDismissible = dismissible ?? closeOnOverlay;
|
|
6361
6472
|
const escapeDismissible = dismissible ?? true;
|
|
6362
6473
|
const panelRef = React20.useRef(null);
|
|
6474
|
+
const bodyRef = React20.useRef(null);
|
|
6363
6475
|
const pressedOverlayRef = React20.useRef(false);
|
|
6364
6476
|
const titleId = React20.useId();
|
|
6365
6477
|
const [shouldRender, setShouldRender] = React20.useState(open);
|
|
6366
6478
|
const isMounted = useIsMounted();
|
|
6367
|
-
useFocusTrap(panelRef, open && isMounted);
|
|
6479
|
+
useFocusTrap(panelRef, open && isMounted, { preferWithin: bodyRef });
|
|
6368
6480
|
useOverlayEscape(open && isMounted, () => {
|
|
6369
6481
|
if (escapeDismissible) onClose?.();
|
|
6370
6482
|
});
|
|
@@ -6442,7 +6554,7 @@ var Modal = ({
|
|
|
6442
6554
|
// 스크롤 가능한 영역은 키보드로도 스크롤할 수 있어야 한다 (WCAG 2.1.1) - 포커스
|
|
6443
6555
|
// 가능해야 화살표 키가 먹는다.
|
|
6444
6556
|
// biome-ignore lint/a11y/noNoninteractiveTabindex: scrollable region needs keyboard scroll
|
|
6445
|
-
/* @__PURE__ */ jsx("div", { className: "modal_body", tabIndex: 0, "data-focus-trap-skip-autofocus": "", children: content.children }),
|
|
6557
|
+
/* @__PURE__ */ jsx("div", { ref: bodyRef, className: "modal_body", tabIndex: 0, "data-focus-trap-skip-autofocus": "", children: content.children }),
|
|
6446
6558
|
content.footer && /* @__PURE__ */ jsx("div", { className: cn("modal_footer", `modal_footer_${footerAlign}`), children: content.footer })
|
|
6447
6559
|
]
|
|
6448
6560
|
}
|