@bigtablet/design-system 3.22.0 → 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.d.ts +37 -4
- package/dist/index.js +107 -52
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1633,6 +1633,18 @@ interface DataViewProps<T extends object> extends Omit<React$1.HTMLAttributes<HT
|
|
|
1633
1633
|
onRowClick?: (row: T, index: number) => void;
|
|
1634
1634
|
/** 표의 접근성 이름 */
|
|
1635
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;
|
|
1636
1648
|
/** 선택 액션 줄의 안내 문구 (기본값: (n) => `${n}개 선택됨`) */
|
|
1637
1649
|
selectionSummary?: (count: number) => string;
|
|
1638
1650
|
/** 선택 해제 버튼 라벨 */
|
|
@@ -1664,7 +1676,7 @@ interface DataViewProps<T extends object> extends Omit<React$1.HTMLAttributes<HT
|
|
|
1664
1676
|
* />
|
|
1665
1677
|
* ```
|
|
1666
1678
|
*/
|
|
1667
|
-
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;
|
|
1668
1680
|
|
|
1669
1681
|
interface DividerProps extends React$1.HTMLAttributes<HTMLHRElement> {
|
|
1670
1682
|
/** 구분선 두께 (기본값: "standard") */
|
|
@@ -2100,6 +2112,11 @@ interface DatePickerBaseProps {
|
|
|
2100
2112
|
selectableRange?: SelectableRange;
|
|
2101
2113
|
/** 비활성화 여부 */
|
|
2102
2114
|
disabled?: boolean;
|
|
2115
|
+
/**
|
|
2116
|
+
* 필수 입력 여부. `Field` 안에서는 `Field` 의 `required` 가 이긴다.
|
|
2117
|
+
* `role="group"` 에는 `aria-required` 를 붙일 수 없어 안쪽 컨트롤마다 내려보낸다.
|
|
2118
|
+
*/
|
|
2119
|
+
required?: boolean;
|
|
2103
2120
|
/** 데이트 피커가 컨테이너의 전체 너비를 차지할지 여부 */
|
|
2104
2121
|
fullWidth?: boolean;
|
|
2105
2122
|
/**
|
|
@@ -2138,7 +2155,7 @@ type DatePickerProps = DatePickerBaseProps & DatePickerCallbacks;
|
|
|
2138
2155
|
* 연/월/일 선택형 데이트 피커를 렌더링한다.
|
|
2139
2156
|
* 내부적으로 DS Dropdown 3개를 조합해 드롭다운 UX 일관성을 유지한다.
|
|
2140
2157
|
*/
|
|
2141
|
-
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;
|
|
2142
2159
|
|
|
2143
2160
|
interface DateRange {
|
|
2144
2161
|
/** 시작일 (`"YYYY-MM-DD"`). 아직 고르지 않았으면 undefined */
|
|
@@ -2165,6 +2182,11 @@ interface DateRangePickerProps {
|
|
|
2165
2182
|
selectableRange?: "all" | "until-today";
|
|
2166
2183
|
/** 비활성 여부 */
|
|
2167
2184
|
disabled?: boolean;
|
|
2185
|
+
/**
|
|
2186
|
+
* 필수 입력 여부. `Field` 안에서는 `Field` 의 `required` 가 이긴다.
|
|
2187
|
+
* `role="group"` 에는 `aria-required` 를 붙일 수 없어 안쪽 컨트롤마다 내려보낸다.
|
|
2188
|
+
*/
|
|
2189
|
+
required?: boolean;
|
|
2168
2190
|
/** 전체 너비 차지 (기본값: true) */
|
|
2169
2191
|
fullWidth?: boolean;
|
|
2170
2192
|
}
|
|
@@ -2185,7 +2207,7 @@ interface DateRangePickerProps {
|
|
|
2185
2207
|
* </Field>
|
|
2186
2208
|
* ```
|
|
2187
2209
|
*/
|
|
2188
|
-
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;
|
|
2189
2211
|
|
|
2190
2212
|
type DropdownSize = "sm" | "md" | "lg";
|
|
2191
2213
|
/**
|
|
@@ -2219,6 +2241,12 @@ interface DropdownCommonProps {
|
|
|
2219
2241
|
options: DropdownOption[];
|
|
2220
2242
|
/** 비활성화 여부 */
|
|
2221
2243
|
disabled?: boolean;
|
|
2244
|
+
/**
|
|
2245
|
+
* 필수 입력 여부. `Field` 안에서는 `Field` 의 `required` 가 이긴다.
|
|
2246
|
+
* `role="group"` 은 `aria-required` 를 받지 못하므로 DatePicker·TimePicker 가 안쪽
|
|
2247
|
+
* Dropdown 마다 이 prop 으로 필수 여부를 내려보낸다.
|
|
2248
|
+
*/
|
|
2249
|
+
required?: boolean;
|
|
2222
2250
|
/** 드롭다운 크기 */
|
|
2223
2251
|
size?: DropdownSize;
|
|
2224
2252
|
/**
|
|
@@ -2857,6 +2885,11 @@ interface TimePickerProps {
|
|
|
2857
2885
|
maxTime?: string;
|
|
2858
2886
|
/** 비활성 여부 */
|
|
2859
2887
|
disabled?: boolean;
|
|
2888
|
+
/**
|
|
2889
|
+
* 필수 입력 여부. `Field` 안에서는 `Field` 의 `required` 가 이긴다.
|
|
2890
|
+
* `role="group"` 에는 `aria-required` 를 붙일 수 없어 안쪽 컨트롤마다 내려보낸다.
|
|
2891
|
+
*/
|
|
2892
|
+
required?: boolean;
|
|
2860
2893
|
/** 전체 너비 차지 (기본값: true) */
|
|
2861
2894
|
fullWidth?: boolean;
|
|
2862
2895
|
/** 시 select 의 라벨/placeholder */
|
|
@@ -2883,7 +2916,7 @@ interface TimePickerProps {
|
|
|
2883
2916
|
* </Field>
|
|
2884
2917
|
* ```
|
|
2885
2918
|
*/
|
|
2886
|
-
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;
|
|
2887
2920
|
|
|
2888
2921
|
interface ToggleProps extends Omit<React$1.ButtonHTMLAttributes<HTMLButtonElement>, "onChange"> {
|
|
2889
2922
|
/** 제어형 토글 상태 */
|
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
|
|
@@ -2689,7 +2722,11 @@ var Card = ({
|
|
|
2689
2722
|
{ card_bordered: bordered, card_interactive: interactive },
|
|
2690
2723
|
className
|
|
2691
2724
|
);
|
|
2692
|
-
const
|
|
2725
|
+
const activation = keyActivationProps({
|
|
2726
|
+
onClick: props.onClick,
|
|
2727
|
+
role: props.role,
|
|
2728
|
+
onKeyDown: props.onKeyDown
|
|
2729
|
+
});
|
|
2693
2730
|
return (
|
|
2694
2731
|
// biome-ignore lint/a11y/noStaticElementInteractions: onClick 이 있을 때만 role=button + tabIndex 를 붙인다 (ListItem 과 같은 규칙)
|
|
2695
2732
|
/* @__PURE__ */ jsxs(
|
|
@@ -2697,18 +2734,10 @@ var Card = ({
|
|
|
2697
2734
|
{
|
|
2698
2735
|
ref,
|
|
2699
2736
|
className: cardClassName,
|
|
2700
|
-
role:
|
|
2701
|
-
tabIndex:
|
|
2737
|
+
role: activation.role,
|
|
2738
|
+
tabIndex: activation.tabIndex,
|
|
2702
2739
|
...props,
|
|
2703
|
-
onKeyDown:
|
|
2704
|
-
props.onKeyDown?.(e);
|
|
2705
|
-
if (!props.onClick || e.defaultPrevented || e.repeat) return;
|
|
2706
|
-
const activates = e.key === "Enter" || e.key === " " && resolvedRole === "button";
|
|
2707
|
-
if (activates) {
|
|
2708
|
-
e.preventDefault();
|
|
2709
|
-
e.currentTarget.click();
|
|
2710
|
-
}
|
|
2711
|
-
},
|
|
2740
|
+
onKeyDown: activation.onKeyDown,
|
|
2712
2741
|
children: [
|
|
2713
2742
|
heading ? /* @__PURE__ */ jsx(HeadingTag, { className: "card_title", children: heading }) : null,
|
|
2714
2743
|
/* @__PURE__ */ jsx("div", { className: "card_body", children }),
|
|
@@ -3567,6 +3596,8 @@ var DataView = ({
|
|
|
3567
3596
|
onSortChange,
|
|
3568
3597
|
onRowClick,
|
|
3569
3598
|
ariaLabel,
|
|
3599
|
+
selectAllAriaLabel,
|
|
3600
|
+
selectRowAriaLabel,
|
|
3570
3601
|
selectionSummary: selectionSummaryProp,
|
|
3571
3602
|
clearSelectionLabel: clearSelectionLabelProp,
|
|
3572
3603
|
errorTitle: errorTitleProp,
|
|
@@ -3658,6 +3689,8 @@ var DataView = ({
|
|
|
3658
3689
|
onRowClick,
|
|
3659
3690
|
ariaLabel,
|
|
3660
3691
|
selectable: true,
|
|
3692
|
+
selectAllAriaLabel,
|
|
3693
|
+
selectRowAriaLabel,
|
|
3661
3694
|
rowKey,
|
|
3662
3695
|
selectedKeys,
|
|
3663
3696
|
onSelectionChange: setSelectedKeys
|
|
@@ -3776,25 +3809,26 @@ var ListItem = ({
|
|
|
3776
3809
|
onClick && "list_item_interactive",
|
|
3777
3810
|
className
|
|
3778
3811
|
);
|
|
3812
|
+
const activation = keyActivationProps({
|
|
3813
|
+
onClick,
|
|
3814
|
+
role: props.role,
|
|
3815
|
+
disabled,
|
|
3816
|
+
onKeyDown: props.onKeyDown
|
|
3817
|
+
});
|
|
3779
3818
|
return (
|
|
3780
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 는 그때만 붙는다
|
|
3781
3821
|
/* @__PURE__ */ jsx(
|
|
3782
3822
|
"div",
|
|
3783
3823
|
{
|
|
3784
3824
|
className: rootClassName,
|
|
3785
3825
|
onClick: disabled ? void 0 : onClick,
|
|
3786
|
-
|
|
3787
|
-
|
|
3788
|
-
if (e.key === "Enter" || e.key === " ") {
|
|
3789
|
-
e.preventDefault();
|
|
3790
|
-
e.currentTarget.click();
|
|
3791
|
-
}
|
|
3792
|
-
},
|
|
3793
|
-
role: onClick ? "button" : void 0,
|
|
3794
|
-
tabIndex: onClick && !disabled ? 0 : void 0,
|
|
3826
|
+
role: activation.role,
|
|
3827
|
+
tabIndex: activation.tabIndex,
|
|
3795
3828
|
"aria-disabled": disabled || void 0,
|
|
3796
3829
|
"aria-pressed": onClick && selected !== void 0 ? selected : void 0,
|
|
3797
3830
|
...props,
|
|
3831
|
+
onKeyDown: activation.onKeyDown,
|
|
3798
3832
|
children: /* @__PURE__ */ jsxs("div", { className: "list_item_state_layer", children: [
|
|
3799
3833
|
leadingElement && /* @__PURE__ */ jsx("div", { className: "list_item_leading", children: leadingElement }),
|
|
3800
3834
|
/* @__PURE__ */ jsxs("div", { className: "list_item_content", children: [
|
|
@@ -3835,7 +3869,11 @@ var MediaCard = ({
|
|
|
3835
3869
|
const isOverlay = imagePosition === "overlay";
|
|
3836
3870
|
const cardStyle = isOverlay && aspectRatio ? { aspectRatio } : void 0;
|
|
3837
3871
|
const wrapStyle = !isOverlay && aspectRatio ? { aspectRatio } : void 0;
|
|
3838
|
-
const
|
|
3872
|
+
const activation = keyActivationProps({
|
|
3873
|
+
onClick: props.onClick,
|
|
3874
|
+
role: props.role,
|
|
3875
|
+
onKeyDown: props.onKeyDown
|
|
3876
|
+
});
|
|
3839
3877
|
return (
|
|
3840
3878
|
// biome-ignore lint/a11y/noStaticElementInteractions: onClick 이 있을 때만 role=button + tabIndex 를 붙인다 (ListItem 과 같은 규칙)
|
|
3841
3879
|
/* @__PURE__ */ jsxs(
|
|
@@ -3843,18 +3881,10 @@ var MediaCard = ({
|
|
|
3843
3881
|
{
|
|
3844
3882
|
className: cardClassName,
|
|
3845
3883
|
style: cardStyle,
|
|
3846
|
-
role:
|
|
3847
|
-
tabIndex:
|
|
3884
|
+
role: activation.role,
|
|
3885
|
+
tabIndex: activation.tabIndex,
|
|
3848
3886
|
...props,
|
|
3849
|
-
onKeyDown:
|
|
3850
|
-
props.onKeyDown?.(e);
|
|
3851
|
-
if (!props.onClick || e.defaultPrevented || e.repeat) return;
|
|
3852
|
-
const activates = e.key === "Enter" || e.key === " " && resolvedRole === "button";
|
|
3853
|
-
if (activates) {
|
|
3854
|
-
e.preventDefault();
|
|
3855
|
-
e.currentTarget.click();
|
|
3856
|
-
}
|
|
3857
|
-
},
|
|
3887
|
+
onKeyDown: activation.onKeyDown,
|
|
3858
3888
|
children: [
|
|
3859
3889
|
/* @__PURE__ */ jsxs("div", { className: "media_card_image_wrap", style: wrapStyle, children: [
|
|
3860
3890
|
/* @__PURE__ */ jsx("img", { className: "media_card_image", src: image.src, alt: image.alt, loading: "lazy" }),
|
|
@@ -4321,6 +4351,8 @@ var Combobox = ({
|
|
|
4321
4351
|
const generatedId = useId();
|
|
4322
4352
|
const field = useFieldControl();
|
|
4323
4353
|
const inputId = field?.inputId ?? generatedId;
|
|
4354
|
+
const { ariaProps, restProps } = splitAriaProps(props);
|
|
4355
|
+
const labelledBy = field?.labelId ?? ariaProps["aria-labelledby"];
|
|
4324
4356
|
const listId = `${inputId}-listbox`;
|
|
4325
4357
|
const [query, setQuery] = useState("");
|
|
4326
4358
|
const [options, setOptions] = useState(defaultOptions);
|
|
@@ -4395,7 +4427,7 @@ var Combobox = ({
|
|
|
4395
4427
|
visible: isOpen,
|
|
4396
4428
|
from: popup.dropUp ? "translateY(4px)" : "translateY(-4px)"
|
|
4397
4429
|
});
|
|
4398
|
-
return /* @__PURE__ */ jsxs("div", { ref: popup.wrapperRef, className: rootClassName, ...
|
|
4430
|
+
return /* @__PURE__ */ jsxs("div", { ref: popup.wrapperRef, className: rootClassName, ...restProps, children: [
|
|
4399
4431
|
/* @__PURE__ */ jsxs("div", { className: "combobox_control", children: [
|
|
4400
4432
|
/* @__PURE__ */ jsx(
|
|
4401
4433
|
"input",
|
|
@@ -4403,6 +4435,7 @@ var Combobox = ({
|
|
|
4403
4435
|
id: inputId,
|
|
4404
4436
|
className: "combobox_input",
|
|
4405
4437
|
role: "combobox",
|
|
4438
|
+
...ariaProps,
|
|
4406
4439
|
type: "text",
|
|
4407
4440
|
autoComplete: "off",
|
|
4408
4441
|
disabled,
|
|
@@ -4412,11 +4445,11 @@ var Combobox = ({
|
|
|
4412
4445
|
"aria-controls": isOpen && hasList ? listId : void 0,
|
|
4413
4446
|
"aria-autocomplete": "list",
|
|
4414
4447
|
"aria-activedescendant": isOpen && activeIndex >= 0 && options[activeIndex] ? `${listId}-${options[activeIndex].value}` : void 0,
|
|
4415
|
-
"aria-labelledby":
|
|
4416
|
-
"aria-label":
|
|
4417
|
-
"aria-describedby": field?.describedBy,
|
|
4418
|
-
"aria-invalid": field
|
|
4419
|
-
"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"],
|
|
4420
4453
|
onChange: (event) => {
|
|
4421
4454
|
setQuery(event.target.value);
|
|
4422
4455
|
if (!isOpen) setIsOpen(true);
|
|
@@ -4507,6 +4540,7 @@ var Dropdown = (props) => {
|
|
|
4507
4540
|
placeholder: placeholderProp,
|
|
4508
4541
|
options,
|
|
4509
4542
|
disabled,
|
|
4543
|
+
required,
|
|
4510
4544
|
size = "md",
|
|
4511
4545
|
variant = "outline",
|
|
4512
4546
|
className,
|
|
@@ -4656,7 +4690,7 @@ var Dropdown = (props) => {
|
|
|
4656
4690
|
"aria-activedescendant": !searchable && isOpen && activeIndex >= 0 && visibleOptions[activeIndex] ? `${dropdownId}_option_${activeIndex}` : void 0,
|
|
4657
4691
|
"aria-describedby": field?.describedBy,
|
|
4658
4692
|
"aria-invalid": field?.invalid || void 0,
|
|
4659
|
-
"aria-required": field
|
|
4693
|
+
"aria-required": field ? field.required || void 0 : required || void 0,
|
|
4660
4694
|
"aria-controls": isOpen ? `${dropdownId}_listbox` : void 0,
|
|
4661
4695
|
onClick: () => !disabled && setIsOpen((o) => !o),
|
|
4662
4696
|
onKeyDown: onControlKeyDown,
|
|
@@ -4716,7 +4750,7 @@ var Dropdown = (props) => {
|
|
|
4716
4750
|
role: "combobox",
|
|
4717
4751
|
"aria-autocomplete": "list",
|
|
4718
4752
|
"aria-expanded": isOpen,
|
|
4719
|
-
"aria-required": field
|
|
4753
|
+
"aria-required": field ? field.required || void 0 : required || void 0,
|
|
4720
4754
|
"aria-controls": `${dropdownId}_listbox`,
|
|
4721
4755
|
"aria-activedescendant": activeIndex >= 0 && visibleOptions[activeIndex] ? `${dropdownId}_option_${activeIndex}` : void 0,
|
|
4722
4756
|
value: searchText,
|
|
@@ -4803,6 +4837,7 @@ var DatePicker = ({
|
|
|
4803
4837
|
minDate,
|
|
4804
4838
|
selectableRange = "all",
|
|
4805
4839
|
disabled,
|
|
4840
|
+
required,
|
|
4806
4841
|
fullWidth = true,
|
|
4807
4842
|
width,
|
|
4808
4843
|
yearLabel: yearLabelProp,
|
|
@@ -4818,6 +4853,7 @@ var DatePicker = ({
|
|
|
4818
4853
|
const minDateSrFormat = minDateSrFormatProp ?? t("datePicker.minDateSr");
|
|
4819
4854
|
const selectableRangeUntilTodaySrText = selectableRangeUntilTodaySrTextProp ?? t("datePicker.rangeUntilTodaySr");
|
|
4820
4855
|
const field = useFieldControl();
|
|
4856
|
+
const isRequired = field ? field.required || void 0 : required || void 0;
|
|
4821
4857
|
const groupId = React20.useId();
|
|
4822
4858
|
const constraintId = React20.useId();
|
|
4823
4859
|
const { todayYear, todayMonth, todayDay } = React20.useMemo(() => {
|
|
@@ -4985,6 +5021,7 @@ var DatePicker = ({
|
|
|
4985
5021
|
options: yearOptions,
|
|
4986
5022
|
value: year ? String(year) : null,
|
|
4987
5023
|
onValueChange: handleYearChange,
|
|
5024
|
+
required: isRequired,
|
|
4988
5025
|
disabled
|
|
4989
5026
|
}
|
|
4990
5027
|
),
|
|
@@ -4998,6 +5035,7 @@ var DatePicker = ({
|
|
|
4998
5035
|
options: monthOptions,
|
|
4999
5036
|
value: month ? String(month) : null,
|
|
5000
5037
|
onValueChange: handleMonthChange,
|
|
5038
|
+
required: isRequired,
|
|
5001
5039
|
disabled: disabled || !year
|
|
5002
5040
|
}
|
|
5003
5041
|
),
|
|
@@ -5011,6 +5049,7 @@ var DatePicker = ({
|
|
|
5011
5049
|
options: dayOptions,
|
|
5012
5050
|
value: day ? String(day) : null,
|
|
5013
5051
|
onValueChange: handleDayChange,
|
|
5052
|
+
required: isRequired,
|
|
5014
5053
|
disabled: disabled || !month
|
|
5015
5054
|
}
|
|
5016
5055
|
)
|
|
@@ -5029,12 +5068,14 @@ var DateRangePicker = ({
|
|
|
5029
5068
|
minDate,
|
|
5030
5069
|
selectableRange = "all",
|
|
5031
5070
|
disabled,
|
|
5071
|
+
required,
|
|
5032
5072
|
fullWidth = true
|
|
5033
5073
|
}) => {
|
|
5034
5074
|
const t = useLocaleText();
|
|
5035
5075
|
const startLabel = startLabelProp ?? t("dateRange.start");
|
|
5036
5076
|
const endLabel = endLabelProp ?? t("dateRange.end");
|
|
5037
5077
|
const field = useFieldControl();
|
|
5078
|
+
const isRequired = field ? field.required || void 0 : required || void 0;
|
|
5038
5079
|
const start = value?.start;
|
|
5039
5080
|
const end = value?.end;
|
|
5040
5081
|
const handleStartChange = (next) => {
|
|
@@ -5070,6 +5111,7 @@ var DateRangePicker = ({
|
|
|
5070
5111
|
endYear,
|
|
5071
5112
|
minDate,
|
|
5072
5113
|
selectableRange,
|
|
5114
|
+
required: isRequired,
|
|
5073
5115
|
disabled,
|
|
5074
5116
|
fullWidth: true
|
|
5075
5117
|
}
|
|
@@ -5084,6 +5126,7 @@ var DateRangePicker = ({
|
|
|
5084
5126
|
endYear,
|
|
5085
5127
|
minDate: endMinDate,
|
|
5086
5128
|
selectableRange,
|
|
5129
|
+
required: isRequired,
|
|
5087
5130
|
disabled: disabled || !start,
|
|
5088
5131
|
fullWidth: true
|
|
5089
5132
|
}
|
|
@@ -5184,6 +5227,7 @@ var FileInput = ({
|
|
|
5184
5227
|
accept: isPreviewVariant ? accept ?? "image/*" : accept,
|
|
5185
5228
|
"aria-describedby": [field?.describedBy, supportingText ? helperId : void 0].filter(Boolean).join(" ") || void 0,
|
|
5186
5229
|
"aria-invalid": field?.invalid || void 0,
|
|
5230
|
+
required: field ? field.required || void 0 : props.required,
|
|
5187
5231
|
onChange: handleChange
|
|
5188
5232
|
}
|
|
5189
5233
|
),
|
|
@@ -5679,6 +5723,7 @@ var OtpInput = ({
|
|
|
5679
5723
|
disabled,
|
|
5680
5724
|
"aria-label": t("otpInput.digit", { index: i + 1 }),
|
|
5681
5725
|
"aria-invalid": error || field?.invalid || void 0,
|
|
5726
|
+
"aria-required": field?.required || void 0,
|
|
5682
5727
|
"aria-describedby": [field?.describedBy, supportingText ? supportingId : void 0].filter(Boolean).join(" ") || void 0,
|
|
5683
5728
|
className: cn(
|
|
5684
5729
|
"otp_input_box",
|
|
@@ -5730,6 +5775,7 @@ var RadioGroup = ({
|
|
|
5730
5775
|
const field = useFieldControl();
|
|
5731
5776
|
const labelId = label ? `${idPrefix}-label` : void 0;
|
|
5732
5777
|
const helperId = supportingText ? `${idPrefix}-help` : void 0;
|
|
5778
|
+
const { ariaProps, restProps } = splitAriaProps(props);
|
|
5733
5779
|
const onChange = React20.useCallback(
|
|
5734
5780
|
(next) => {
|
|
5735
5781
|
if (!isControlled) setInternalValue(next);
|
|
@@ -5750,17 +5796,18 @@ var RadioGroup = ({
|
|
|
5750
5796
|
error && "radio_group_error",
|
|
5751
5797
|
className
|
|
5752
5798
|
),
|
|
5753
|
-
...
|
|
5799
|
+
...restProps,
|
|
5754
5800
|
children: [
|
|
5755
5801
|
label && /* @__PURE__ */ jsx("span", { id: labelId, className: "radio_group_label", children: label }),
|
|
5756
5802
|
/* @__PURE__ */ jsx(
|
|
5757
5803
|
"div",
|
|
5758
5804
|
{
|
|
5759
5805
|
role: "radiogroup",
|
|
5760
|
-
|
|
5761
|
-
"aria-
|
|
5762
|
-
"aria-
|
|
5763
|
-
"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"],
|
|
5764
5811
|
className: "radio_group_options",
|
|
5765
5812
|
children
|
|
5766
5813
|
}
|
|
@@ -5838,6 +5885,8 @@ var TagInput = ({
|
|
|
5838
5885
|
const generatedId = useId();
|
|
5839
5886
|
const field = useFieldControl();
|
|
5840
5887
|
const inputId = field?.inputId ?? generatedId;
|
|
5888
|
+
const { ariaProps, restProps } = splitAriaProps(props);
|
|
5889
|
+
const labelledBy = field?.labelId ?? ariaProps["aria-labelledby"];
|
|
5841
5890
|
const isControlled = value !== void 0;
|
|
5842
5891
|
const [innerTags, setInnerTags] = useState(defaultValue);
|
|
5843
5892
|
const tags = isControlled ? value : innerTags;
|
|
@@ -5916,7 +5965,7 @@ var TagInput = ({
|
|
|
5916
5965
|
{ tag_input_full_width: fullWidth, tag_input_disabled: disabled },
|
|
5917
5966
|
className
|
|
5918
5967
|
);
|
|
5919
|
-
return /* @__PURE__ */ jsxs("div", { className: rootClassName, ...
|
|
5968
|
+
return /* @__PURE__ */ jsxs("div", { className: rootClassName, ...restProps, children: [
|
|
5920
5969
|
/* @__PURE__ */ jsxs("div", { className: "tag_input_control", onClick: () => inputRef.current?.focus(), children: [
|
|
5921
5970
|
tags.length > 0 && /* @__PURE__ */ jsx("ul", { className: "tag_input_tags", children: tags.map((tag, index) => (
|
|
5922
5971
|
/* biome-ignore lint/suspicious/noArrayIndexKey: allowDuplicates 면 같은 라벨이 여러 개라 값만으로는 구분되지 않는다 */
|
|
@@ -5943,11 +5992,12 @@ var TagInput = ({
|
|
|
5943
5992
|
disabled,
|
|
5944
5993
|
readOnly: isFull,
|
|
5945
5994
|
placeholder: isFull ? "" : placeholder,
|
|
5946
|
-
|
|
5947
|
-
"aria-
|
|
5948
|
-
"aria-
|
|
5949
|
-
"aria-
|
|
5950
|
-
"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"],
|
|
5951
6001
|
onChange: (event) => setDraft(event.target.value),
|
|
5952
6002
|
onKeyDown,
|
|
5953
6003
|
onPaste,
|
|
@@ -6108,6 +6158,7 @@ var TimePicker = ({
|
|
|
6108
6158
|
minTime,
|
|
6109
6159
|
maxTime,
|
|
6110
6160
|
disabled,
|
|
6161
|
+
required,
|
|
6111
6162
|
fullWidth = true,
|
|
6112
6163
|
hourLabel: hourLabelProp,
|
|
6113
6164
|
minuteLabel: minuteLabelProp
|
|
@@ -6116,6 +6167,7 @@ var TimePicker = ({
|
|
|
6116
6167
|
const hourLabel = hourLabelProp ?? t("timePicker.hour");
|
|
6117
6168
|
const minuteLabel = minuteLabelProp ?? t("timePicker.minute");
|
|
6118
6169
|
const field = useFieldControl();
|
|
6170
|
+
const isRequired = field ? field.required || void 0 : required || void 0;
|
|
6119
6171
|
const groupId = React20.useId();
|
|
6120
6172
|
const constraintId = React20.useId();
|
|
6121
6173
|
const min = toMinutes(minTime) ?? 0;
|
|
@@ -6182,6 +6234,7 @@ var TimePicker = ({
|
|
|
6182
6234
|
options: hourOptions,
|
|
6183
6235
|
value: hour === null ? null : String(hour),
|
|
6184
6236
|
onValueChange: handleHourChange,
|
|
6237
|
+
required: isRequired,
|
|
6185
6238
|
disabled
|
|
6186
6239
|
}
|
|
6187
6240
|
),
|
|
@@ -6195,6 +6248,7 @@ var TimePicker = ({
|
|
|
6195
6248
|
options: minuteOptions,
|
|
6196
6249
|
value: minute === null ? null : String(minute),
|
|
6197
6250
|
onValueChange: handleMinuteChange,
|
|
6251
|
+
required: isRequired,
|
|
6198
6252
|
disabled: disabled || hour === null
|
|
6199
6253
|
}
|
|
6200
6254
|
)
|
|
@@ -6245,6 +6299,7 @@ var Toggle = ({
|
|
|
6245
6299
|
id: field?.inputId ?? props.id,
|
|
6246
6300
|
"aria-describedby": field?.describedBy ?? props["aria-describedby"],
|
|
6247
6301
|
"aria-invalid": field ? field.invalid || void 0 : props["aria-invalid"],
|
|
6302
|
+
"aria-required": field ? field.required || void 0 : props["aria-required"],
|
|
6248
6303
|
"aria-labelledby": field?.labelId,
|
|
6249
6304
|
"aria-label": field?.labelId ? void 0 : ariaLabel,
|
|
6250
6305
|
disabled,
|