@yamada-ui/number-input 0.1.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.
@@ -0,0 +1,539 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/number-input.tsx
21
+ var number_input_exports = {};
22
+ __export(number_input_exports, {
23
+ NumberInput: () => NumberInput,
24
+ useNumberInput: () => useNumberInput
25
+ });
26
+ module.exports = __toCommonJS(number_input_exports);
27
+ var import_core = require("@yamada-ui/core");
28
+ var import_form_control = require("@yamada-ui/form-control");
29
+ var import_icon = require("@yamada-ui/icon");
30
+ var import_use_counter = require("@yamada-ui/use-counter");
31
+ var import_use_event_listener = require("@yamada-ui/use-event-listener");
32
+ var import_use_interval = require("@yamada-ui/use-interval");
33
+ var import_utils = require("@yamada-ui/utils");
34
+ var import_react = require("react");
35
+ var import_jsx_runtime = require("react/jsx-runtime");
36
+ var isDefaultValidCharacter = (character) => /^[Ee0-9+\-.]$/.test(character);
37
+ var isValidNumericKeyboardEvent = ({ key, ctrlKey, altKey, metaKey }, isValid) => {
38
+ if (key == null)
39
+ return true;
40
+ const isModifierKey = ctrlKey || altKey || metaKey;
41
+ const isSingleCharacterKey = key.length === 1;
42
+ if (!isSingleCharacterKey || isModifierKey)
43
+ return true;
44
+ return isValid(key);
45
+ };
46
+ var getStep = ({ ctrlKey, shiftKey, metaKey }) => {
47
+ let ratio = 1;
48
+ if (metaKey || ctrlKey)
49
+ ratio = 0.1;
50
+ if (shiftKey)
51
+ ratio = 10;
52
+ return ratio;
53
+ };
54
+ var useNumberInput = (props = {}) => {
55
+ var _a;
56
+ const {
57
+ id,
58
+ name,
59
+ inputMode = "decimal",
60
+ pattern = "[0-9]*(.[0-9]+)?",
61
+ required,
62
+ disabled,
63
+ readOnly,
64
+ focusInputOnChange = true,
65
+ clampValueOnBlur = true,
66
+ keepWithinRange = true,
67
+ allowMouseWheel,
68
+ min = Number.MIN_SAFE_INTEGER,
69
+ max = Number.MAX_SAFE_INTEGER,
70
+ precision,
71
+ "aria-invalid": isInvalid,
72
+ ...rest
73
+ } = (0, import_form_control.useFormControlProps)(props);
74
+ const isRequired = required;
75
+ const isReadOnly = readOnly;
76
+ const isDisabled = disabled;
77
+ const [isFocused, setFocused] = (0, import_react.useState)(false);
78
+ const isInteractive = !(readOnly || disabled);
79
+ const inputRef = (0, import_react.useRef)(null);
80
+ const inputSelectionRef = (0, import_react.useRef)(null);
81
+ const incrementRef = (0, import_react.useRef)(null);
82
+ const decrementRef = (0, import_react.useRef)(null);
83
+ const onFocus = (0, import_utils.useCallbackRef)(
84
+ (0, import_utils.handlerAll)(rest.onFocus, (ev) => {
85
+ var _a2, _b, _c;
86
+ setFocused(true);
87
+ if (!inputSelectionRef.current)
88
+ return;
89
+ ev.target.selectionStart = (_b = inputSelectionRef.current.start) != null ? _b : (_a2 = ev.currentTarget.value) == null ? void 0 : _a2.length;
90
+ ev.currentTarget.selectionEnd = (_c = inputSelectionRef.current.end) != null ? _c : ev.currentTarget.selectionStart;
91
+ })
92
+ );
93
+ const onBlur = (0, import_utils.useCallbackRef)(
94
+ (0, import_utils.handlerAll)(rest.onBlur, () => {
95
+ setFocused(false);
96
+ if (clampValueOnBlur)
97
+ validateAndClamp();
98
+ })
99
+ );
100
+ const onInvalid = (0, import_utils.useCallbackRef)(rest.onInvalid);
101
+ const isValidCharacter = (0, import_utils.useCallbackRef)((_a = rest.isValidCharacter) != null ? _a : isDefaultValidCharacter);
102
+ const { isMin, isMax, isOut, value, valueAsNumber, setValue, update, cast, ...counter } = (0, import_use_counter.useCounter)({
103
+ min,
104
+ max,
105
+ precision,
106
+ keepWithinRange,
107
+ ...rest
108
+ });
109
+ const sanitize = (0, import_react.useCallback)(
110
+ (value2) => value2.split("").filter(isValidCharacter).join(""),
111
+ [isValidCharacter]
112
+ );
113
+ const parse = (0, import_react.useCallback)((value2) => {
114
+ var _a2, _b;
115
+ return (_b = (_a2 = rest.parse) == null ? void 0 : _a2.call(rest, value2)) != null ? _b : value2;
116
+ }, [rest]);
117
+ const format = (0, import_react.useCallback)(
118
+ (value2) => {
119
+ var _a2, _b;
120
+ return ((_b = (_a2 = rest.format) == null ? void 0 : _a2.call(rest, value2)) != null ? _b : value2).toString();
121
+ },
122
+ [rest]
123
+ );
124
+ const increment = (0, import_react.useCallback)(
125
+ (step = ((_b) => (_b = rest.step) != null ? _b : 1)()) => {
126
+ if (isInteractive)
127
+ counter.increment(step);
128
+ },
129
+ [isInteractive, counter, rest.step]
130
+ );
131
+ const decrement = (0, import_react.useCallback)(
132
+ (step = ((_c) => (_c = rest.step) != null ? _c : 1)()) => {
133
+ if (isInteractive)
134
+ counter.decrement(step);
135
+ },
136
+ [isInteractive, counter, rest.step]
137
+ );
138
+ const validateAndClamp = (0, import_react.useCallback)(() => {
139
+ let next = value;
140
+ if (value === "")
141
+ return;
142
+ const valueStartsWithE = /^[eE]/.test(value.toString());
143
+ if (valueStartsWithE) {
144
+ setValue("");
145
+ } else {
146
+ if (valueAsNumber < min)
147
+ next = min;
148
+ if (valueAsNumber > max)
149
+ next = max;
150
+ cast(next);
151
+ }
152
+ }, [cast, max, min, setValue, value, valueAsNumber]);
153
+ const onChange = (0, import_react.useCallback)(
154
+ (event) => {
155
+ const evt = event.nativeEvent;
156
+ if (evt.isComposing)
157
+ return;
158
+ const parsedInput = parse(event.currentTarget.value);
159
+ update(sanitize(parsedInput));
160
+ inputSelectionRef.current = {
161
+ start: event.currentTarget.selectionStart,
162
+ end: event.currentTarget.selectionEnd
163
+ };
164
+ },
165
+ [parse, update, sanitize]
166
+ );
167
+ const onKeyDown = (0, import_react.useCallback)(
168
+ (ev) => {
169
+ var _a2;
170
+ if (ev.nativeEvent.isComposing)
171
+ return;
172
+ if (!isValidNumericKeyboardEvent(ev, isValidCharacter))
173
+ ev.preventDefault();
174
+ const step = getStep(ev) * ((_a2 = rest.step) != null ? _a2 : 1);
175
+ const keyMap = {
176
+ ArrowUp: () => increment(step),
177
+ ArrowDown: () => decrement(step),
178
+ Home: () => update(min),
179
+ End: () => update(max)
180
+ };
181
+ const action = keyMap[ev.key];
182
+ if (!action)
183
+ return;
184
+ ev.preventDefault();
185
+ action(ev);
186
+ },
187
+ [decrement, increment, isValidCharacter, max, min, rest.step, update]
188
+ );
189
+ const { up, down, stop, isSpinning } = useSpinner(increment, decrement);
190
+ useAttributeObserver(incrementRef, ["disabled"], isSpinning, stop);
191
+ useAttributeObserver(decrementRef, ["disabled"], isSpinning, stop);
192
+ const focusInput = (0, import_react.useCallback)(() => {
193
+ if (focusInputOnChange)
194
+ requestAnimationFrame(() => {
195
+ var _a2;
196
+ (_a2 = inputRef.current) == null ? void 0 : _a2.focus();
197
+ });
198
+ }, [focusInputOnChange]);
199
+ const eventUp = (0, import_react.useCallback)(
200
+ (ev) => {
201
+ ev.preventDefault();
202
+ up();
203
+ focusInput();
204
+ },
205
+ [focusInput, up]
206
+ );
207
+ const eventDown = (0, import_react.useCallback)(
208
+ (ev) => {
209
+ ev.preventDefault();
210
+ down();
211
+ focusInput();
212
+ },
213
+ [focusInput, down]
214
+ );
215
+ (0, import_utils.useUpdateEffect)(() => {
216
+ if (valueAsNumber > max) {
217
+ onInvalid == null ? void 0 : onInvalid("rangeOverflow", format(value), valueAsNumber);
218
+ } else if (valueAsNumber < min) {
219
+ onInvalid == null ? void 0 : onInvalid("rangeOverflow", format(value), valueAsNumber);
220
+ }
221
+ }, [valueAsNumber, value, format, onInvalid]);
222
+ (0, import_utils.useSafeLayoutEffect)(() => {
223
+ if (!inputRef.current)
224
+ return;
225
+ const notInSync = inputRef.current.value != value;
226
+ if (!notInSync)
227
+ return;
228
+ const parsedInput = parse(inputRef.current.value);
229
+ setValue(sanitize(parsedInput));
230
+ }, [parse, sanitize]);
231
+ (0, import_use_event_listener.useEventListener)(
232
+ () => inputRef.current,
233
+ "wheel",
234
+ (ev) => {
235
+ var _a2, _b, _c;
236
+ const ownerDocument = (_b = (_a2 = inputRef.current) == null ? void 0 : _a2.ownerDocument) != null ? _b : document;
237
+ const isFocused2 = ownerDocument.activeElement === inputRef.current;
238
+ if (!allowMouseWheel || !isFocused2)
239
+ return;
240
+ ev.preventDefault();
241
+ const step = getStep(ev) * ((_c = rest.step) != null ? _c : 1);
242
+ const direction = Math.sign(ev.deltaY);
243
+ if (direction === -1) {
244
+ increment(step);
245
+ } else if (direction === 1) {
246
+ decrement(step);
247
+ }
248
+ },
249
+ { passive: false }
250
+ );
251
+ const getInputProps = (0, import_react.useCallback)(
252
+ (props2 = {}, ref = null) => ({
253
+ id,
254
+ name,
255
+ type: "text",
256
+ inputMode,
257
+ pattern,
258
+ required,
259
+ disabled,
260
+ readOnly,
261
+ ...(0, import_utils.pickObject)(rest, import_form_control.formControlProperties),
262
+ ...(0, import_utils.omitObject)(props2, ["defaultValue"]),
263
+ ref: (0, import_utils.mergeRefs)(inputRef, ref),
264
+ value: format(value),
265
+ "aria-invalid": (0, import_utils.ariaAttr)(isInvalid != null ? isInvalid : isOut),
266
+ autoComplete: "off",
267
+ autoCorrect: "off",
268
+ onChange: (0, import_utils.handlerAll)(props2.onChange, onChange),
269
+ onKeyDown: (0, import_utils.handlerAll)(props2.onKeyDown, onKeyDown),
270
+ onFocus: (0, import_utils.handlerAll)(props2.onFocus, onFocus),
271
+ onBlur: (0, import_utils.handlerAll)(props2.onBlur, onBlur)
272
+ }),
273
+ [
274
+ id,
275
+ name,
276
+ inputMode,
277
+ pattern,
278
+ required,
279
+ disabled,
280
+ readOnly,
281
+ rest,
282
+ format,
283
+ value,
284
+ isInvalid,
285
+ isOut,
286
+ onChange,
287
+ onKeyDown,
288
+ onFocus,
289
+ onBlur
290
+ ]
291
+ );
292
+ const getIncrementProps = (0, import_react.useCallback)(
293
+ (props2 = {}, ref = null) => {
294
+ const disabled2 = props2.disabled || keepWithinRange && isMax;
295
+ return {
296
+ required,
297
+ readOnly,
298
+ disabled: disabled2,
299
+ ...(0, import_utils.pickObject)(rest, import_form_control.formControlProperties),
300
+ ...props2,
301
+ ref: (0, import_utils.mergeRefs)(ref, incrementRef),
302
+ role: "button",
303
+ tabIndex: -1,
304
+ cursor: readOnly ? "not-allowed" : props2.cursor,
305
+ onPointerDown: (0, import_utils.handlerAll)(props2.onPointerDown, (ev) => {
306
+ if (ev.button === 0 && !disabled2)
307
+ eventUp(ev);
308
+ }),
309
+ onPointerLeave: (0, import_utils.handlerAll)(props2.onPointerLeave, stop),
310
+ onPointerUp: (0, import_utils.handlerAll)(props2.onPointerUp, stop)
311
+ };
312
+ },
313
+ [keepWithinRange, isMax, required, readOnly, rest, stop, eventUp]
314
+ );
315
+ const getDecrementProps = (0, import_react.useCallback)(
316
+ (props2 = {}, ref = null) => {
317
+ const disabled2 = props2.disabled || keepWithinRange && isMin;
318
+ return {
319
+ required,
320
+ readOnly,
321
+ disabled: disabled2,
322
+ ...(0, import_utils.pickObject)(rest, import_form_control.formControlProperties),
323
+ ...props2,
324
+ ref: (0, import_utils.mergeRefs)(ref, decrementRef),
325
+ role: "button",
326
+ tabIndex: -1,
327
+ cursor: readOnly ? "not-allowed" : props2.cursor,
328
+ onPointerDown: (0, import_utils.handlerAll)(props2.onPointerDown, (ev) => {
329
+ if (ev.button === 0 && !disabled2)
330
+ eventDown(ev);
331
+ }),
332
+ onPointerLeave: (0, import_utils.handlerAll)(props2.onPointerLeave, stop),
333
+ onPointerUp: (0, import_utils.handlerAll)(props2.onPointerUp, stop)
334
+ };
335
+ },
336
+ [keepWithinRange, isMin, required, readOnly, rest, stop, eventDown]
337
+ );
338
+ return {
339
+ value: format(value),
340
+ valueAsNumber,
341
+ isFocused,
342
+ isRequired,
343
+ isReadOnly,
344
+ isDisabled,
345
+ getInputProps,
346
+ getIncrementProps,
347
+ getDecrementProps
348
+ };
349
+ };
350
+ var INTERVAL = 50;
351
+ var DELAY = 300;
352
+ var useSpinner = (increment, decrement) => {
353
+ const [isSpinning, setIsSpinning] = (0, import_react.useState)(false);
354
+ const [action, setAction] = (0, import_react.useState)(null);
355
+ const [isOnce, setIsOnce] = (0, import_react.useState)(true);
356
+ const timeoutRef = (0, import_react.useRef)(null);
357
+ const removeTimeout = () => clearTimeout(timeoutRef.current);
358
+ (0, import_use_interval.useInterval)(
359
+ () => {
360
+ if (action === "increment")
361
+ increment();
362
+ if (action === "decrement")
363
+ decrement();
364
+ },
365
+ isSpinning ? INTERVAL : null
366
+ );
367
+ const up = (0, import_react.useCallback)(() => {
368
+ if (isOnce)
369
+ increment();
370
+ timeoutRef.current = setTimeout(() => {
371
+ setIsOnce(false);
372
+ setIsSpinning(true);
373
+ setAction("increment");
374
+ }, DELAY);
375
+ }, [increment, isOnce]);
376
+ const down = (0, import_react.useCallback)(() => {
377
+ if (isOnce)
378
+ decrement();
379
+ timeoutRef.current = setTimeout(() => {
380
+ setIsOnce(false);
381
+ setIsSpinning(true);
382
+ setAction("decrement");
383
+ }, DELAY);
384
+ }, [decrement, isOnce]);
385
+ const stop = (0, import_react.useCallback)(() => {
386
+ setIsOnce(true);
387
+ setIsSpinning(false);
388
+ removeTimeout();
389
+ }, []);
390
+ (0, import_react.useEffect)(() => {
391
+ return () => removeTimeout();
392
+ }, []);
393
+ return { up, down, stop, isSpinning };
394
+ };
395
+ var useAttributeObserver = (ref, attributeFilter, enabled, func) => {
396
+ (0, import_react.useEffect)(() => {
397
+ var _a;
398
+ if (!ref.current || !enabled)
399
+ return;
400
+ const ownerDocument = (_a = ref.current.ownerDocument.defaultView) != null ? _a : window;
401
+ const observer = new ownerDocument.MutationObserver((changes) => {
402
+ for (const { type, attributeName } of changes) {
403
+ if (type === "attributes" && attributeName && attributeFilter.includes(attributeName))
404
+ func();
405
+ }
406
+ });
407
+ observer.observe(ref.current, { attributes: true, attributeFilter });
408
+ return () => observer.disconnect();
409
+ });
410
+ };
411
+ var [NumberInputContextProvider, useNumberInputContext] = (0, import_utils.createContext)({
412
+ strict: false,
413
+ name: "NumberInputContext"
414
+ });
415
+ var NumberInput = (0, import_core.forwardRef)((props, ref) => {
416
+ const [styles, mergedProps] = (0, import_core.useMultiComponentStyle)("NumberInput", props);
417
+ const {
418
+ className,
419
+ isStepper = true,
420
+ container,
421
+ addon,
422
+ increment,
423
+ decrement,
424
+ onChange,
425
+ ...rest
426
+ } = (0, import_core.omitThemeProps)(mergedProps);
427
+ const { getInputProps, getIncrementProps, getDecrementProps } = useNumberInput({
428
+ onChange,
429
+ ...rest
430
+ });
431
+ const css = {
432
+ position: "relative",
433
+ zIndex: 0,
434
+ ...styles.container
435
+ };
436
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
437
+ NumberInputContextProvider,
438
+ {
439
+ value: { getInputProps, getIncrementProps, getDecrementProps, styles },
440
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_core.ui.div, { className: (0, import_utils.cx)("ui-number-input", className), __css: css, ...container, children: [
441
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(NumberInputField, { ...getInputProps(rest, ref) }),
442
+ isStepper ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(NumberInputAddon, { ...addon, children: [
443
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(NumberIncrementStepper, { ...increment }),
444
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(NumberDecrementStepper, { ...decrement })
445
+ ] }) : null
446
+ ] })
447
+ }
448
+ );
449
+ });
450
+ var NumberInputField = (0, import_core.forwardRef)(
451
+ ({ className, ...rest }, ref) => {
452
+ const { styles } = useNumberInputContext();
453
+ const css = {
454
+ width: "100%",
455
+ ...styles.field
456
+ };
457
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
458
+ import_core.ui.input,
459
+ {
460
+ ref,
461
+ className: (0, import_utils.cx)("ui-number-input-field", className),
462
+ __css: css,
463
+ ...rest
464
+ }
465
+ );
466
+ }
467
+ );
468
+ var NumberInputAddon = (0, import_core.forwardRef)(({ className, ...rest }, ref) => {
469
+ const { styles } = useNumberInputContext();
470
+ const css = {
471
+ display: "flex",
472
+ flexDirection: "column",
473
+ position: "absolute",
474
+ top: "0",
475
+ insetEnd: "0px",
476
+ margin: "1px",
477
+ height: "calc(100% - 2px)",
478
+ zIndex: 1,
479
+ ...styles.addon
480
+ };
481
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
482
+ import_core.ui.div,
483
+ {
484
+ ref,
485
+ className: (0, import_utils.cx)("ui-number-input-addon", className),
486
+ "aria-hidden": true,
487
+ __css: css,
488
+ ...rest
489
+ }
490
+ );
491
+ });
492
+ var Stepper = (0, import_core.ui)("div", {
493
+ baseStyle: {
494
+ display: "flex",
495
+ justifyContent: "center",
496
+ alignItems: "center",
497
+ flex: 1,
498
+ transitionProperty: "common",
499
+ transitionDuration: "normal",
500
+ userSelect: "none",
501
+ cursor: "pointer",
502
+ lineHeight: "normal"
503
+ }
504
+ });
505
+ var NumberIncrementStepper = (0, import_core.forwardRef)(
506
+ ({ className, children, ...rest }, ref) => {
507
+ const { getIncrementProps, styles } = useNumberInputContext();
508
+ const css = { ...styles.stepper };
509
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
510
+ Stepper,
511
+ {
512
+ className: (0, import_utils.cx)("ui-number-input-stepper", className),
513
+ ...getIncrementProps(rest, ref),
514
+ __css: css,
515
+ children: children != null ? children : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icon.ChevronIcon, { __css: { transform: "rotate(180deg)" } })
516
+ }
517
+ );
518
+ }
519
+ );
520
+ var NumberDecrementStepper = (0, import_core.forwardRef)(
521
+ ({ className, children, ...rest }, ref) => {
522
+ const { getDecrementProps, styles } = useNumberInputContext();
523
+ const css = { ...styles.stepper };
524
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
525
+ Stepper,
526
+ {
527
+ className: (0, import_utils.cx)("ui-number-input-stepper", className),
528
+ ...getDecrementProps(rest, ref),
529
+ __css: css,
530
+ children: children != null ? children : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icon.ChevronIcon, {})
531
+ }
532
+ );
533
+ }
534
+ );
535
+ // Annotate the CommonJS export names for ESM import in node:
536
+ 0 && (module.exports = {
537
+ NumberInput,
538
+ useNumberInput
539
+ });
@@ -0,0 +1,8 @@
1
+ import {
2
+ NumberInput,
3
+ useNumberInput
4
+ } from "./chunk-L2FQDPVY.mjs";
5
+ export {
6
+ NumberInput,
7
+ useNumberInput
8
+ };
package/package.json ADDED
@@ -0,0 +1,80 @@
1
+ {
2
+ "name": "@yamada-ui/number-input",
3
+ "version": "0.1.0",
4
+ "description": "Yamada UI number input component",
5
+ "keywords": [
6
+ "yamada",
7
+ "yamada ui",
8
+ "react",
9
+ "emotion",
10
+ "component",
11
+ "number-input",
12
+ "ui",
13
+ "uikit",
14
+ "styled",
15
+ "style-props",
16
+ "styled-component",
17
+ "css-in-js"
18
+ ],
19
+ "author": "Hirotomo Yamada <hirotomo.yamada@avap.co.jp>",
20
+ "license": "MIT",
21
+ "main": "dist/index.js",
22
+ "files": [
23
+ "dist"
24
+ ],
25
+ "sideEffects": false,
26
+ "publishConfig": {
27
+ "access": "public"
28
+ },
29
+ "repository": {
30
+ "type": "git",
31
+ "url": "git+https://github.com/hirotomoyamada/yamada-ui",
32
+ "directory": "packages/components/number-input"
33
+ },
34
+ "bugs": {
35
+ "url": "https://github.com/hirotomoyamada/yamada-ui/issues"
36
+ },
37
+ "dependencies": {
38
+ "@yamada-ui/utils": "0.1.0",
39
+ "@yamada-ui/core": "0.1.0",
40
+ "@yamada-ui/form-control": "0.1.0",
41
+ "@yamada-ui/icon": "0.1.0",
42
+ "@yamada-ui/use-interval": "0.1.0",
43
+ "@yamada-ui/use-counter": "0.1.0",
44
+ "@yamada-ui/use-event-listener": "0.1.0"
45
+ },
46
+ "devDependencies": {
47
+ "react": "^18.0.0",
48
+ "clean-package": "2.2.0"
49
+ },
50
+ "peerDependencies": {
51
+ "react": ">=18"
52
+ },
53
+ "clean-package": "../../../clean-package.config.json",
54
+ "tsup": {
55
+ "clean": true,
56
+ "target": "es2019",
57
+ "format": [
58
+ "cjs",
59
+ "esm"
60
+ ]
61
+ },
62
+ "module": "dist/index.mjs",
63
+ "types": "dist/index.d.ts",
64
+ "exports": {
65
+ ".": {
66
+ "types": "./dist/index.d.ts",
67
+ "import": "./dist/index.mjs",
68
+ "require": "./dist/index.js"
69
+ },
70
+ "./package.json": "./package.json"
71
+ },
72
+ "scripts": {
73
+ "dev": "pnpm build:fast -- --watch",
74
+ "build": "tsup src --dts",
75
+ "build:fast": "tsup src",
76
+ "clean": "rimraf dist .turbo",
77
+ "typecheck": "tsc --noEmit",
78
+ "gen:docs": "tsx ../../../scripts/generate-docs"
79
+ }
80
+ }