@seed-design/react 2.1.1 → 2.2.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.
Files changed (46) hide show
  1. package/lib/components/DatePicker/DatePicker.cjs +351 -0
  2. package/lib/components/DatePicker/DatePicker.d.ts +39 -0
  3. package/lib/components/DatePicker/DatePicker.d.ts.map +1 -0
  4. package/lib/components/DatePicker/DatePicker.js +345 -0
  5. package/lib/components/DatePicker/DatePicker.test.d.ts +2 -0
  6. package/lib/components/DatePicker/DatePicker.test.d.ts.map +1 -0
  7. package/lib/components/DatePicker/index.cjs +62 -0
  8. package/lib/components/DatePicker/index.d.ts +3 -0
  9. package/lib/components/DatePicker/index.d.ts.map +1 -0
  10. package/lib/components/DatePicker/index.js +3 -0
  11. package/lib/components/QuantityPicker/QuantityPicker.d.ts +13 -1
  12. package/lib/components/QuantityPicker/QuantityPicker.d.ts.map +1 -1
  13. package/lib/components/TimePicker/TimePicker.cjs +97 -0
  14. package/lib/components/TimePicker/TimePicker.d.ts +28 -0
  15. package/lib/components/TimePicker/TimePicker.d.ts.map +1 -0
  16. package/lib/components/TimePicker/TimePicker.js +94 -0
  17. package/lib/components/TimePicker/TimePicker.test.d.ts +2 -0
  18. package/lib/components/TimePicker/TimePicker.test.d.ts.map +1 -0
  19. package/lib/components/TimePicker/index.cjs +3 -0
  20. package/lib/components/TimePicker/index.d.ts +2 -0
  21. package/lib/components/TimePicker/index.d.ts.map +1 -0
  22. package/lib/components/TimePicker/index.js +2 -0
  23. package/lib/components/index.cjs +63 -1
  24. package/lib/components/index.d.ts +2 -0
  25. package/lib/components/index.d.ts.map +1 -1
  26. package/lib/components/index.js +5 -2
  27. package/lib/components/private/WheelPicker.cjs +64 -0
  28. package/lib/components/private/WheelPicker.d.ts +16 -0
  29. package/lib/components/private/WheelPicker.d.ts.map +1 -0
  30. package/lib/components/private/WheelPicker.js +59 -0
  31. package/lib/components/private/WheelPicker.test.d.ts +2 -0
  32. package/lib/components/private/WheelPicker.test.d.ts.map +1 -0
  33. package/lib/index.cjs +63 -1
  34. package/lib/index.js +5 -2
  35. package/package.json +9 -6
  36. package/src/components/DatePicker/DatePicker.test.tsx +234 -0
  37. package/src/components/DatePicker/DatePicker.tsx +574 -0
  38. package/src/components/DatePicker/index.ts +34 -0
  39. package/src/components/QuantityPicker/QuantityPicker.test.tsx +10 -0
  40. package/src/components/QuantityPicker/QuantityPicker.tsx +14 -2
  41. package/src/components/TimePicker/TimePicker.test.tsx +166 -0
  42. package/src/components/TimePicker/TimePicker.tsx +163 -0
  43. package/src/components/TimePicker/index.ts +6 -0
  44. package/src/components/index.ts +2 -0
  45. package/src/components/private/WheelPicker.test.tsx +54 -0
  46. package/src/components/private/WheelPicker.tsx +110 -0
@@ -0,0 +1,345 @@
1
+ "use client";
2
+ "use client";
3
+ import { useStyleProps } from "../../utils/styled.js";
4
+ import { Icon } from "../Icon/Icon.js";
5
+ import { ActionButton } from "../ActionButton/ActionButton.js";
6
+ import { InternalWheelPickerColumn, InternalWheelPickerRoot } from "../private/WheelPicker.js";
7
+ import { Primitive } from "@seed-design/react-primitive";
8
+ import clsx$1 from "clsx";
9
+ import * as React$1 from "react";
10
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
11
+ import { mergeProps } from "@seed-design/dom-utils";
12
+ import { composeRefs } from "@radix-ui/react-compose-refs";
13
+ import { datePicker } from "@seed-design/css/recipes/date-picker";
14
+ import { useDatePicker } from "@seed-design/react-date-picker";
15
+ //#region src/components/DatePicker/DatePicker.tsx
16
+ var WHEEL_ITEM_SIZE = 44;
17
+ var WHEEL_VISIBLE_ITEM_COUNT = 7;
18
+ function getContinuousSpacerStyle(height) {
19
+ return { "--seed-date-picker-continuous-spacer-height": `${height}px` };
20
+ }
21
+ var NavigationChevronIcon = React$1.forwardRef(({ direction, ...props }, ref) => {
22
+ const path = direction === "left" ? "M22.7931 13.0704C23.0788 13.3703 23.0672 13.8451 22.7673 14.1307L16.5875 20.0166L22.7672 25.9017C23.0672 26.1873 23.0788 26.6621 22.7931 26.962C22.5075 27.262 22.0327 27.2736 21.7328 26.9879L14.9828 20.5598C14.8341 20.4182 14.75 20.2219 14.75 20.0167C14.75 19.8114 14.8341 19.6151 14.9827 19.4736L21.7327 13.0446C22.0327 12.7589 22.5074 12.7704 22.7931 13.0704Z" : "M17.2069 13.0704C16.9212 13.3703 16.9328 13.8451 17.2327 14.1307L23.4125 20.0166L17.2328 25.9017C16.9328 26.1873 16.9212 26.6621 17.2069 26.962C17.4925 27.262 17.9673 27.2736 18.2672 26.9879L25.0172 20.5598C25.1659 20.4182 25.25 20.2219 25.25 20.0167C25.25 19.8114 25.1659 19.6151 25.0173 19.4736L18.2673 13.0446C17.9673 12.7589 17.4926 12.7704 17.2069 13.0704Z";
23
+ return /* @__PURE__ */ jsx("svg", {
24
+ ref,
25
+ ...props,
26
+ viewBox: "8 8 24 24",
27
+ fill: "none",
28
+ xmlns: "http://www.w3.org/2000/svg",
29
+ children: /* @__PURE__ */ jsx("path", {
30
+ fillRule: "evenodd",
31
+ clipRule: "evenodd",
32
+ d: path,
33
+ fill: "currentColor"
34
+ })
35
+ });
36
+ });
37
+ NavigationChevronIcon.displayName = "NavigationChevronIcon";
38
+ var HeaderChevronIcon = React$1.forwardRef(({ expanded, ...props }, ref) => /* @__PURE__ */ jsx("svg", {
39
+ ref,
40
+ ...props,
41
+ viewBox: "0 0 20 20",
42
+ fill: "none",
43
+ xmlns: "http://www.w3.org/2000/svg",
44
+ children: /* @__PURE__ */ jsx("path", {
45
+ fillRule: "evenodd",
46
+ clipRule: "evenodd",
47
+ d: "M5.2453 7.74286C5.57141 7.4181 6.09905 7.41919 6.42381 7.7453L9.98736 11.3237L13.5808 7.77134C13.9081 7.44778 14.4357 7.45081 14.7593 7.77812C15.0829 8.10542 15.0798 8.63305 14.7525 8.95661L10.5686 13.0926C10.2422 13.4154 9.7162 13.4133 9.39228 13.088L5.24286 8.92137C4.9181 8.59526 4.91919 8.06762 5.2453 7.74286Z",
48
+ fill: "currentColor",
49
+ transform: expanded ? "rotate(180 10 10)" : void 0
50
+ })
51
+ }));
52
+ HeaderChevronIcon.displayName = "HeaderChevronIcon";
53
+ function WeekdayRow({ api, classNames, semantic = true }) {
54
+ return /* @__PURE__ */ jsx(Primitive.div, {
55
+ role: semantic ? "row" : void 0,
56
+ "aria-hidden": semantic ? void 0 : true,
57
+ className: classNames.weekdayRow,
58
+ children: api.weekdayLabels.map((weekday) => /* @__PURE__ */ jsx(Primitive.div, {
59
+ role: semantic ? "columnheader" : void 0,
60
+ "aria-label": semantic ? weekday.long : void 0,
61
+ className: classNames.weekday,
62
+ children: /* @__PURE__ */ jsx("span", {
63
+ "aria-hidden": "true",
64
+ children: weekday.short
65
+ })
66
+ }, weekday.key))
67
+ });
68
+ }
69
+ function DateCellView({ cell, classNames, renderDateCellContent, renderDateCellSupplement }) {
70
+ if (cell === null) return /* @__PURE__ */ jsx(Primitive.div, {
71
+ role: "gridcell",
72
+ className: classNames.emptyCell
73
+ });
74
+ const { cellProps, buttonProps, key: _key, ...renderProps } = cell;
75
+ return /* @__PURE__ */ jsx(Primitive.div, {
76
+ ...cellProps,
77
+ className: classNames.dateCell,
78
+ children: /* @__PURE__ */ jsx(Primitive.button, {
79
+ ...buttonProps,
80
+ className: classNames.dateButton,
81
+ children: /* @__PURE__ */ jsx(Primitive.span, {
82
+ className: classNames.dateContent,
83
+ children: renderDateCellContent ? renderDateCellContent(renderProps) : /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Primitive.span, {
84
+ "data-date-picker-day": "",
85
+ children: cell.formattedDay
86
+ }), renderDateCellSupplement?.(renderProps)] })
87
+ })
88
+ })
89
+ });
90
+ }
91
+ function MonthView({ api, classNames, month, renderDateCellContent, renderDateCellSupplement, showWeekdays, showMonthLabel, renderHeader, monthRef }) {
92
+ const labelId = `${api.rootProps.id}-${month.key}-label`;
93
+ const headerLabelId = `${api.rootProps.id}-header-label`;
94
+ return /* @__PURE__ */ jsxs(Primitive.div, {
95
+ ref: monthRef,
96
+ className: classNames.month,
97
+ children: [
98
+ renderHeader?.(labelId),
99
+ showMonthLabel ? /* @__PURE__ */ jsx(Primitive.div, {
100
+ id: labelId,
101
+ className: classNames.monthLabel,
102
+ children: month.label
103
+ }) : /* @__PURE__ */ jsx(Primitive.span, {
104
+ id: labelId,
105
+ className: classNames.liveRegion,
106
+ children: month.label
107
+ }),
108
+ /* @__PURE__ */ jsxs(Primitive.div, {
109
+ ...api.gridProps,
110
+ "aria-labelledby": showMonthLabel || renderHeader ? labelId : api.visibleRange === "month" ? headerLabelId : labelId,
111
+ className: classNames.grid,
112
+ children: [showWeekdays && /* @__PURE__ */ jsx(WeekdayRow, {
113
+ api,
114
+ classNames
115
+ }), month.weeks.map((week) => /* @__PURE__ */ jsx(Primitive.div, {
116
+ role: "row",
117
+ className: classNames.weekRow,
118
+ children: week.cells.map((cell, index) => /* @__PURE__ */ jsx(DateCellView, {
119
+ cell,
120
+ classNames,
121
+ renderDateCellContent,
122
+ renderDateCellSupplement
123
+ }, cell?.key ?? `${week.key}-empty-${index}`))
124
+ }, week.key))]
125
+ })
126
+ ]
127
+ });
128
+ }
129
+ function NavigationButton({ direction, className, ...props }) {
130
+ return /* @__PURE__ */ jsx(ActionButton, {
131
+ ...props,
132
+ variant: "ghost",
133
+ size: "medium",
134
+ layout: "iconOnly",
135
+ className,
136
+ children: /* @__PURE__ */ jsx(Icon, { svg: /* @__PURE__ */ jsx(NavigationChevronIcon, { direction }) })
137
+ });
138
+ }
139
+ function Header({ api, classNames }) {
140
+ const previousDirection = api.isRtl ? "right" : "left";
141
+ const nextDirection = api.isRtl ? "left" : "right";
142
+ return /* @__PURE__ */ jsxs(Primitive.div, {
143
+ className: classNames.header,
144
+ children: [/* @__PURE__ */ jsxs(Primitive.button, {
145
+ ...api.monthYearButtonProps,
146
+ id: `${api.rootProps.id}-header-label`,
147
+ className: classNames.headerLabel,
148
+ children: [/* @__PURE__ */ jsx(Primitive.span, {
149
+ "data-date-picker-header-label": "",
150
+ children: api.headerLabel
151
+ }), /* @__PURE__ */ jsx(Primitive.span, {
152
+ className: classNames.headerChevron,
153
+ children: /* @__PURE__ */ jsx(Icon, { svg: /* @__PURE__ */ jsx(HeaderChevronIcon, { expanded: api.isWheelOpen }) })
154
+ })]
155
+ }), /* @__PURE__ */ jsxs(Primitive.div, {
156
+ className: classNames.navigation,
157
+ children: [/* @__PURE__ */ jsx(NavigationButton, {
158
+ ...api.previousButtonProps,
159
+ direction: previousDirection,
160
+ className: classNames.navigationButton
161
+ }), /* @__PURE__ */ jsx(NavigationButton, {
162
+ ...api.nextButtonProps,
163
+ direction: nextDirection,
164
+ className: classNames.navigationButton
165
+ })]
166
+ })]
167
+ });
168
+ }
169
+ function TwoMonthHeader({ api, classNames, label, labelId, position }) {
170
+ const isFirst = position === "first";
171
+ const direction = api.isRtl ? isFirst ? "right" : "left" : isFirst ? "left" : "right";
172
+ const buttonProps = isFirst ? api.previousButtonProps : api.nextButtonProps;
173
+ return /* @__PURE__ */ jsxs(Primitive.div, {
174
+ className: classNames.twoMonthHeader,
175
+ children: [/* @__PURE__ */ jsx(Primitive.div, {
176
+ id: labelId,
177
+ className: classNames.twoMonthLabel,
178
+ children: label
179
+ }), /* @__PURE__ */ jsx(NavigationButton, {
180
+ ...buttonProps,
181
+ direction,
182
+ "data-placement": isFirst ? "start" : "end",
183
+ className: classNames.twoMonthNavigationButton
184
+ })]
185
+ });
186
+ }
187
+ function WheelView({ api, classNames }) {
188
+ return /* @__PURE__ */ jsx(Primitive.div, {
189
+ className: classNames.wheelContainer,
190
+ children: /* @__PURE__ */ jsxs(InternalWheelPickerRoot, {
191
+ ...api.wheelProps,
192
+ itemSize: WHEEL_ITEM_SIZE,
193
+ visibleItemCount: WHEEL_VISIBLE_ITEM_COUNT,
194
+ disabled: api.disabled,
195
+ readOnly: api.readOnly,
196
+ "aria-label": api.headerLabel,
197
+ className: classNames.wheelView,
198
+ columnsClassName: classNames.wheelColumns,
199
+ scrollFogClassName: classNames.wheelScrollFog,
200
+ selectionIndicatorClassName: classNames.wheelSelectionIndicator,
201
+ fogSize: 102,
202
+ children: [/* @__PURE__ */ jsx(InternalWheelPickerColumn, {
203
+ "aria-label": api.ariaLabels.yearWheel,
204
+ className: classNames.yearColumn,
205
+ itemClassName: classNames.wheelItem,
206
+ options: api.wheel.yearOptions,
207
+ value: api.wheel.yearValue,
208
+ onValueChange: api.wheel.onYearValueChange,
209
+ loop: false
210
+ }), /* @__PURE__ */ jsx(InternalWheelPickerColumn, {
211
+ "aria-label": api.ariaLabels.monthWheel,
212
+ className: classNames.monthColumn,
213
+ itemClassName: classNames.wheelItem,
214
+ options: api.wheel.monthOptions,
215
+ value: api.wheel.monthValue,
216
+ onValueChange: api.wheel.onMonthValueChange,
217
+ loop: true
218
+ })]
219
+ })
220
+ });
221
+ }
222
+ var DatePickerImplementation = React$1.forwardRef((props, forwardedRef) => {
223
+ const api = useDatePicker(props);
224
+ const [variantProps, otherProps] = datePicker.splitVariantProps(props);
225
+ const classNames = datePicker({
226
+ ...variantProps,
227
+ visibleRange: api.visibleRange
228
+ });
229
+ const { renderDateCellContent, renderDateCellSupplement, actionsRef, selectionMode: _selectionMode, value: _value, defaultValue: _defaultValue, onValueChange: _onValueChange, viewDate: _viewDate, defaultViewDate: _defaultViewDate, onViewDateChange: _onViewDateChange, today: _today, locale: _locale, weekStartsOn: _weekStartsOn, yearRange: _yearRange, constraints: _constraints, disabled: _disabled, readOnly: _readOnly, ariaLabels: _ariaLabels, className, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, ...styleAndRootProps } = otherProps;
230
+ const { style: styleProps, restProps: rootProps } = useStyleProps(styleAndRootProps);
231
+ const rootRef = React$1.useRef(null);
232
+ const hasContinuousSizeConstraint = props.height !== void 0 || props.minHeight !== void 0 || props.maxHeight !== void 0;
233
+ React$1.useEffect(() => {
234
+ if (process.env.NODE_ENV === "production" || api.visibleRange !== "continuous") return;
235
+ if (!hasContinuousSizeConstraint) console.warn("ContinuousDatePicker: height, minHeight 또는 maxHeight가 필요합니다.");
236
+ }, [api.visibleRange, hasContinuousSizeConstraint]);
237
+ React$1.useImperativeHandle(actionsRef, () => api.actions, [api.actions]);
238
+ const rootAriaLabel = ariaLabelledby ? ariaLabel : ariaLabel ?? api.ariaLabels.root;
239
+ return /* @__PURE__ */ jsxs(Primitive.div, {
240
+ ref: composeRefs(forwardedRef, rootRef, api.refs.root),
241
+ ...mergeProps(api.rootProps, rootProps),
242
+ "aria-label": rootAriaLabel,
243
+ "aria-labelledby": ariaLabelledby,
244
+ className: clsx$1(classNames.root, className),
245
+ style: styleProps,
246
+ children: [api.visibleRange === "continuous" ? /* @__PURE__ */ jsxs(Primitive.div, {
247
+ ref: api.refs.continuousScroll,
248
+ ...api.continuousScrollProps,
249
+ "data-date-picker-continuous-scroll": "",
250
+ className: classNames.continuousScroll,
251
+ children: [/* @__PURE__ */ jsx(WeekdayRow, {
252
+ api,
253
+ classNames,
254
+ semantic: false
255
+ }), /* @__PURE__ */ jsxs(Primitive.div, {
256
+ className: classNames.continuousContent,
257
+ children: [
258
+ /* @__PURE__ */ jsx(Primitive.div, {
259
+ "aria-hidden": "true",
260
+ "data-date-picker-continuous-spacer": "",
261
+ className: classNames.continuousSpacer,
262
+ style: getContinuousSpacerStyle(api.virtual.topHeight)
263
+ }),
264
+ api.months.map((month) => /* @__PURE__ */ jsx(MonthView, {
265
+ api,
266
+ classNames,
267
+ month,
268
+ renderDateCellContent,
269
+ renderDateCellSupplement,
270
+ showWeekdays: false,
271
+ showMonthLabel: true,
272
+ monthRef: api.refs.continuousMonth(month.key)
273
+ }, month.key)),
274
+ /* @__PURE__ */ jsx(Primitive.div, {
275
+ "aria-hidden": "true",
276
+ "data-date-picker-continuous-spacer": "",
277
+ className: classNames.continuousSpacer,
278
+ style: getContinuousSpacerStyle(api.virtual.bottomHeight)
279
+ })
280
+ ]
281
+ })]
282
+ }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [
283
+ api.visibleRange !== "twoMonths" && /* @__PURE__ */ jsx(Header, {
284
+ api,
285
+ classNames
286
+ }),
287
+ /* @__PURE__ */ jsx(Primitive.div, {
288
+ "data-wheel-open": api.isWheelOpen && api.visibleRange !== "twoMonths" ? "" : void 0,
289
+ "aria-hidden": api.isWheelOpen && api.visibleRange !== "twoMonths" ? true : void 0,
290
+ className: classNames.months,
291
+ children: api.months.map((month, index) => /* @__PURE__ */ jsx(MonthView, {
292
+ api,
293
+ classNames,
294
+ month,
295
+ renderDateCellContent,
296
+ renderDateCellSupplement,
297
+ showWeekdays: true,
298
+ showMonthLabel: false,
299
+ renderHeader: api.visibleRange === "twoMonths" ? (labelId) => /* @__PURE__ */ jsx(TwoMonthHeader, {
300
+ api,
301
+ classNames,
302
+ label: month.label,
303
+ labelId,
304
+ position: index === 0 ? "first" : "last"
305
+ }) : void 0
306
+ }, month.key))
307
+ }),
308
+ api.isWheelOpen && api.visibleRange !== "twoMonths" && /* @__PURE__ */ jsx(WheelView, {
309
+ api,
310
+ classNames
311
+ })
312
+ ] }), /* @__PURE__ */ jsx(Primitive.span, {
313
+ ...api.liveRegionProps,
314
+ className: classNames.liveRegion,
315
+ children: api.headerLabel
316
+ })]
317
+ });
318
+ });
319
+ DatePickerImplementation.displayName = "DatePickerImplementation";
320
+ var DatePicker = React$1.forwardRef((props, ref) => /* @__PURE__ */ jsx(DatePickerImplementation, {
321
+ ref,
322
+ ...props,
323
+ visibleRange: "month"
324
+ }));
325
+ DatePicker.displayName = "DatePicker";
326
+ var TwoMonthDatePicker = React$1.forwardRef((props, ref) => /* @__PURE__ */ jsx(DatePickerImplementation, {
327
+ ref,
328
+ ...props,
329
+ visibleRange: "twoMonths"
330
+ }));
331
+ TwoMonthDatePicker.displayName = "TwoMonthDatePicker";
332
+ var WeekDatePicker = React$1.forwardRef((props, ref) => /* @__PURE__ */ jsx(DatePickerImplementation, {
333
+ ref,
334
+ ...props,
335
+ visibleRange: "week"
336
+ }));
337
+ WeekDatePicker.displayName = "WeekDatePicker";
338
+ var ContinuousDatePicker = React$1.forwardRef((props, ref) => /* @__PURE__ */ jsx(DatePickerImplementation, {
339
+ ref,
340
+ ...props,
341
+ visibleRange: "continuous"
342
+ }));
343
+ ContinuousDatePicker.displayName = "ContinuousDatePicker";
344
+ //#endregion
345
+ export { ContinuousDatePicker, DatePicker, TwoMonthDatePicker, WeekDatePicker };
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=DatePicker.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DatePicker.test.d.ts","sourceRoot":"","sources":["../../../src/components/DatePicker/DatePicker.test.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,62 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ require("../../_virtual/_rolldown/runtime.cjs");
3
+ const require_DatePicker = require("./DatePicker.cjs");
4
+ let _seed_design_react_date_picker = require("@seed-design/react-date-picker");
5
+ exports.ContinuousDatePicker = require_DatePicker.ContinuousDatePicker;
6
+ exports.DatePicker = require_DatePicker.DatePicker;
7
+ exports.TwoMonthDatePicker = require_DatePicker.TwoMonthDatePicker;
8
+ exports.WeekDatePicker = require_DatePicker.WeekDatePicker;
9
+ Object.defineProperty(exports, "compareDates", {
10
+ enumerable: true,
11
+ get: function() {
12
+ return _seed_design_react_date_picker.compareDates;
13
+ }
14
+ });
15
+ Object.defineProperty(exports, "dateKey", {
16
+ enumerable: true,
17
+ get: function() {
18
+ return _seed_design_react_date_picker.dateKey;
19
+ }
20
+ });
21
+ Object.defineProperty(exports, "dateOnOrAfter", {
22
+ enumerable: true,
23
+ get: function() {
24
+ return _seed_design_react_date_picker.dateOnOrAfter;
25
+ }
26
+ });
27
+ Object.defineProperty(exports, "dateOnOrBefore", {
28
+ enumerable: true,
29
+ get: function() {
30
+ return _seed_design_react_date_picker.dateOnOrBefore;
31
+ }
32
+ });
33
+ Object.defineProperty(exports, "excludeDates", {
34
+ enumerable: true,
35
+ get: function() {
36
+ return _seed_design_react_date_picker.excludeDates;
37
+ }
38
+ });
39
+ Object.defineProperty(exports, "isSameDate", {
40
+ enumerable: true,
41
+ get: function() {
42
+ return _seed_design_react_date_picker.isSameDate;
43
+ }
44
+ });
45
+ Object.defineProperty(exports, "maxSelectionCount", {
46
+ enumerable: true,
47
+ get: function() {
48
+ return _seed_design_react_date_picker.maxSelectionCount;
49
+ }
50
+ });
51
+ Object.defineProperty(exports, "rangeDayCountAtLeast", {
52
+ enumerable: true,
53
+ get: function() {
54
+ return _seed_design_react_date_picker.rangeDayCountAtLeast;
55
+ }
56
+ });
57
+ Object.defineProperty(exports, "rangeDayCountAtMost", {
58
+ enumerable: true,
59
+ get: function() {
60
+ return _seed_design_react_date_picker.rangeDayCountAtMost;
61
+ }
62
+ });
@@ -0,0 +1,3 @@
1
+ export { ContinuousDatePicker, DatePicker, TwoMonthDatePicker, WeekDatePicker, type ContinuousDatePickerProps, type DatePickerActions, type DatePickerAriaLabels, type DatePickerCellContentRenderProps, type DatePickerConstraint, type DatePickerConstraintContext, type DatePickerDate, type DatePickerMultipleProps, type DatePickerProps, type DatePickerRangeProps, type DatePickerRangeValue, type DatePickerSelectionMode, type DatePickerSingleProps, type DatePickerValue, type TwoMonthDatePickerProps, type WeekDatePickerProps, } from './DatePicker';
2
+ export { compareDates, dateKey, dateOnOrAfter, dateOnOrBefore, excludeDates, isSameDate, maxSelectionCount, rangeDayCountAtLeast, rangeDayCountAtMost, } from '@seed-design/react-date-picker';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/DatePicker/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,UAAU,EACV,kBAAkB,EAClB,cAAc,EACd,KAAK,yBAAyB,EAC9B,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,gCAAgC,EACrC,KAAK,oBAAoB,EACzB,KAAK,2BAA2B,EAChC,KAAK,cAAc,EACnB,KAAK,uBAAuB,EAC5B,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EACpB,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,GACzB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,YAAY,EACZ,OAAO,EACP,aAAa,EACb,cAAc,EACd,YAAY,EACZ,UAAU,EACV,iBAAiB,EACjB,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,gCAAgC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { ContinuousDatePicker, DatePicker, TwoMonthDatePicker, WeekDatePicker } from "./DatePicker.js";
2
+ import { compareDates, dateKey, dateOnOrAfter, dateOnOrBefore, excludeDates, isSameDate, maxSelectionCount, rangeDayCountAtLeast, rangeDayCountAtMost } from "@seed-design/react-date-picker";
3
+ export { ContinuousDatePicker, DatePicker, TwoMonthDatePicker, WeekDatePicker, compareDates, dateKey, dateOnOrAfter, dateOnOrBefore, excludeDates, isSameDate, maxSelectionCount, rangeDayCountAtLeast, rangeDayCountAtMost };
@@ -2,7 +2,19 @@ import { PrimitiveProps } from '@seed-design/react-primitive';
2
2
  import { QuantityPicker as QuantityPickerPrimitive } from '@seed-design/react-quantity-picker';
3
3
  import { QuantityPickerVariantProps } from '@seed-design/css/recipes/quantity-picker';
4
4
  import * as React from "react";
5
- export type QuantityPickerRootProps = QuantityPickerVariantProps & QuantityPickerPrimitive.RootProps;
5
+ export type QuantityPickerRootProps = Omit<QuantityPickerVariantProps, "size" | "layout"> & QuantityPickerPrimitive.RootProps & {
6
+ /**
7
+ * 컴포넌트의 크기입니다.
8
+ * @default "medium"
9
+ */
10
+ size?: QuantityPickerVariantProps["size"];
11
+ /**
12
+ * 컴포넌트가 부모 Flex 레이아웃의 여유 공간을 채울지 지정합니다.
13
+ * @since 2.2.0
14
+ * @default "hug"
15
+ */
16
+ layout?: QuantityPickerVariantProps["layout"];
17
+ };
6
18
  export declare const QuantityPickerRoot: React.ForwardRefExoticComponent<QuantityPickerRootProps & React.RefAttributes<HTMLDivElement>>;
7
19
  interface QuantityPickerButtonProps extends PrimitiveProps, Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "disabled" | "type"> {
8
20
  icon?: React.ReactNode;
@@ -1 +1 @@
1
- {"version":3,"file":"QuantityPicker.d.ts","sourceRoot":"","sources":["../../../src/components/QuantityPicker/QuantityPicker.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9E,OAAO,EACL,cAAc,IAAI,uBAAuB,EAE1C,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAEL,KAAK,0BAA0B,EAChC,MAAM,0CAA0C,CAAC;AAElD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAkE/B,MAAM,MAAM,uBAAuB,GAAG,0BAA0B,GAC9D,uBAAuB,CAAC,SAAS,CAAC;AAEpC,eAAO,MAAM,kBAAkB,gGAkC9B,CAAC;AAGF,UAAU,yBACR,SAAQ,cAAc,EACpB,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,UAAU,GAAG,MAAM,CAAC;IAC1E,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,gBAAgB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACpC;AAED,MAAM,WAAW,kCACf,SAAQ,IAAI,CAAC,uBAAuB,CAAC,oBAAoB,EAAE,UAAU,CAAC,EACpE,yBAAyB;IAC3B,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC9B;AAED,eAAO,MAAM,6BAA6B,8GAsBxC,CAAC;AAGH,MAAM,WAAW,+BACf,SAAQ,uBAAuB,CAAC,iBAAiB;CAAG;AAEtD,eAAO,MAAM,0BAA0B,6JAuBtC,CAAC;AAGF,MAAM,WAAW,kCACf,SAAQ,IAAI,CAAC,uBAAuB,CAAC,oBAAoB,EAAE,UAAU,CAAC,EACpE,yBAAyB;CAAG;AAEhC,eAAO,MAAM,6BAA6B,8GAkBxC,CAAC;AAGH,MAAM,WAAW,8BAA+B,SAAQ,uBAAuB,CAAC,gBAAgB;CAAG;AAEnG,eAAO,MAAM,yBAAyB,mHAAsC,CAAC"}
1
+ {"version":3,"file":"QuantityPicker.d.ts","sourceRoot":"","sources":["../../../src/components/QuantityPicker/QuantityPicker.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9E,OAAO,EACL,cAAc,IAAI,uBAAuB,EAE1C,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAEL,KAAK,0BAA0B,EAChC,MAAM,0CAA0C,CAAC;AAElD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAkE/B,MAAM,MAAM,uBAAuB,GAAG,IAAI,CAAC,0BAA0B,EAAE,MAAM,GAAG,QAAQ,CAAC,GACvF,uBAAuB,CAAC,SAAS,GAAG;IAClC;;;OAGG;IACH,IAAI,CAAC,EAAE,0BAA0B,CAAC,MAAM,CAAC,CAAC;IAC1C;;;;OAIG;IACH,MAAM,CAAC,EAAE,0BAA0B,CAAC,QAAQ,CAAC,CAAC;CAC/C,CAAC;AAEJ,eAAO,MAAM,kBAAkB,gGAkC9B,CAAC;AAGF,UAAU,yBACR,SAAQ,cAAc,EACpB,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,UAAU,GAAG,MAAM,CAAC;IAC1E,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,gBAAgB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACpC;AAED,MAAM,WAAW,kCACf,SAAQ,IAAI,CAAC,uBAAuB,CAAC,oBAAoB,EAAE,UAAU,CAAC,EACpE,yBAAyB;IAC3B,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC9B;AAED,eAAO,MAAM,6BAA6B,8GAsBxC,CAAC;AAGH,MAAM,WAAW,+BACf,SAAQ,uBAAuB,CAAC,iBAAiB;CAAG;AAEtD,eAAO,MAAM,0BAA0B,6JAuBtC,CAAC;AAGF,MAAM,WAAW,kCACf,SAAQ,IAAI,CAAC,uBAAuB,CAAC,oBAAoB,EAAE,UAAU,CAAC,EACpE,yBAAyB;CAAG;AAEhC,eAAO,MAAM,6BAA6B,8GAkBxC,CAAC;AAGH,MAAM,WAAW,8BAA+B,SAAQ,uBAAuB,CAAC,gBAAgB;CAAG;AAEnG,eAAO,MAAM,yBAAyB,mHAAsC,CAAC"}
@@ -0,0 +1,97 @@
1
+ "use client";
2
+ "use client";
3
+ const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
4
+ const require_WheelPicker = require("../private/WheelPicker.cjs");
5
+ let clsx = require("clsx");
6
+ clsx = require_runtime.__toESM(clsx);
7
+ let react = require("react");
8
+ react = require_runtime.__toESM(react);
9
+ let react_jsx_runtime = require("react/jsx-runtime");
10
+ let _seed_design_css_recipes_time_picker = require("@seed-design/css/recipes/time-picker");
11
+ let _seed_design_react_time_picker = require("@seed-design/react-time-picker");
12
+ //#region src/components/TimePicker/TimePicker.tsx
13
+ var ITEM_SIZE = 44;
14
+ var VISIBLE_ITEM_COUNT = 5;
15
+ var DEFAULT_ARIA_LABELS = {
16
+ ko: {
17
+ root: "시간 선택",
18
+ period: "오전/오후",
19
+ hour: "시",
20
+ minute: "분"
21
+ },
22
+ en: {
23
+ root: "Select time",
24
+ period: "AM/PM",
25
+ hour: "Hour",
26
+ minute: "Minute"
27
+ },
28
+ ja: {
29
+ root: "時刻を選択",
30
+ period: "午前/午後",
31
+ hour: "時",
32
+ minute: "分"
33
+ }
34
+ };
35
+ function getDefaultAriaLabels(locale) {
36
+ const [canonicalLocale = "ko-KR"] = Intl.getCanonicalLocales(locale ?? "ko-KR");
37
+ const language = new Intl.Locale(canonicalLocale).language;
38
+ if (language === "ko") return DEFAULT_ARIA_LABELS.ko;
39
+ if (language === "ja") return DEFAULT_ARIA_LABELS.ja;
40
+ return DEFAULT_ARIA_LABELS.en;
41
+ }
42
+ var classNames = (0, _seed_design_css_recipes_time_picker.timePicker)();
43
+ var columnClassNames = {
44
+ period: classNames.periodColumn,
45
+ hour: classNames.hourColumn,
46
+ minute: classNames.minuteColumn
47
+ };
48
+ /**
49
+ * 휠을 스크롤하여 오전·오후, 시, 분을 선택하는 12시간제 시간 선택 컴포넌트입니다.
50
+ *
51
+ * 값은 오전·오후를 별도 필드로 나누지 않고 24시간 형식의 `TimePickerValue`로 주고받습니다.
52
+ */
53
+ var TimePicker = react.forwardRef(({ value, defaultValue, onValueChange, minuteStep, locale, disabled, periodAriaLabel, hourAriaLabel, minuteAriaLabel, className, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, ...props }, ref) => {
54
+ const api = (0, _seed_design_react_time_picker.useTimePicker)({
55
+ value,
56
+ defaultValue,
57
+ onValueChange,
58
+ minuteStep,
59
+ locale,
60
+ disabled
61
+ });
62
+ const defaultAriaLabels = getDefaultAriaLabels(locale);
63
+ const ariaLabels = {
64
+ period: periodAriaLabel ?? defaultAriaLabels.period,
65
+ hour: hourAriaLabel ?? defaultAriaLabels.hour,
66
+ minute: minuteAriaLabel ?? defaultAriaLabels.minute
67
+ };
68
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_WheelPicker.InternalWheelPickerRoot, {
69
+ ref,
70
+ itemSize: ITEM_SIZE,
71
+ visibleItemCount: VISIBLE_ITEM_COUNT,
72
+ disabled,
73
+ "aria-label": ariaLabelledby ? ariaLabel : ariaLabel ?? defaultAriaLabels.root,
74
+ "aria-labelledby": ariaLabelledby,
75
+ className: (0, clsx.default)(classNames.root, className),
76
+ columnsClassName: classNames.columns,
77
+ scrollFogClassName: classNames.scrollFog,
78
+ selectionIndicatorClassName: classNames.selectionIndicator,
79
+ ...props,
80
+ children: api.columnOrder.map((type) => {
81
+ const column = api.columns[type];
82
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_WheelPicker.InternalWheelPickerColumn, {
83
+ "aria-label": ariaLabels[type],
84
+ className: columnClassNames[type],
85
+ itemClassName: classNames.item,
86
+ options: column.options,
87
+ value: column.value,
88
+ onValueChange: column.onValueChange,
89
+ loop: column.loop,
90
+ valueChangeBehavior: type === "period" ? "smooth" : "auto"
91
+ }, type);
92
+ })
93
+ });
94
+ });
95
+ TimePicker.displayName = "TimePicker";
96
+ //#endregion
97
+ exports.TimePicker = TimePicker;
@@ -0,0 +1,28 @@
1
+ import { UseTimePickerProps } from '@seed-design/react-time-picker';
2
+ import { InternalWheelPickerRootProps } from '../private/WheelPicker';
3
+ import * as React from "react";
4
+ export interface TimePickerProps extends UseTimePickerProps, Omit<InternalWheelPickerRootProps, keyof UseTimePickerProps | "asChild" | "children" | "columnsClassName" | "fogSize" | "itemSize" | "readOnly" | "scrollFogClassName" | "selectionIndicatorClassName" | "visibleItemCount"> {
5
+ /**
6
+ * 오전·오후 컬럼의 접근성 이름입니다.
7
+ * 지정하지 않으면 `locale`에 맞는 기본값을 사용합니다.
8
+ */
9
+ periodAriaLabel?: string;
10
+ /**
11
+ * 시 컬럼의 접근성 이름입니다.
12
+ * 지정하지 않으면 `locale`에 맞는 기본값을 사용합니다.
13
+ */
14
+ hourAriaLabel?: string;
15
+ /**
16
+ * 분 컬럼의 접근성 이름입니다.
17
+ * 지정하지 않으면 `locale`에 맞는 기본값을 사용합니다.
18
+ */
19
+ minuteAriaLabel?: string;
20
+ }
21
+ /**
22
+ * 휠을 스크롤하여 오전·오후, 시, 분을 선택하는 12시간제 시간 선택 컴포넌트입니다.
23
+ *
24
+ * 값은 오전·오후를 별도 필드로 나누지 않고 24시간 형식의 `TimePickerValue`로 주고받습니다.
25
+ */
26
+ export declare const TimePicker: React.ForwardRefExoticComponent<TimePickerProps & React.RefAttributes<HTMLDivElement>>;
27
+ export type { MinuteStep, TimePickerValue } from '@seed-design/react-time-picker';
28
+ //# sourceMappingURL=TimePicker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TimePicker.d.ts","sourceRoot":"","sources":["../../../src/components/TimePicker/TimePicker.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAiB,KAAK,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAExF,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAGL,KAAK,4BAA4B,EAClC,MAAM,wBAAwB,CAAC;AA0ChC,MAAM,WAAW,eACf,SAAQ,kBAAkB,EACxB,IAAI,CACF,4BAA4B,EAC1B,MAAM,kBAAkB,GACxB,SAAS,GACT,UAAU,GACV,kBAAkB,GAClB,SAAS,GACT,UAAU,GACV,UAAU,GACV,oBAAoB,GACpB,6BAA6B,GAC7B,kBAAkB,CACrB;IACH;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;;GAIG;AACH,eAAO,MAAM,UAAU,wFAoEtB,CAAC;AAGF,YAAY,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC"}