@cronocode/react-box 1.1.4 → 1.1.5

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/box.d.ts CHANGED
@@ -1,7 +1,8 @@
1
- import React from 'react';
1
+ import React, { Ref } from 'react';
2
2
  import { BoxStyles } from './types';
3
3
  import ClassNameUtils from './utils/className/classNameUtils';
4
- declare type TagPropsType<TTag extends keyof React.ReactHTML> = Omit<React.ComponentProps<TTag>, 'className' | 'style'>;
4
+ declare type AllProps<TTag extends keyof React.ReactHTML> = React.ComponentProps<TTag>;
5
+ declare type TagPropsType<TTag extends keyof React.ReactHTML> = Omit<AllProps<TTag>, 'className' | 'style' | 'ref'>;
5
6
  interface Props<TTag extends keyof React.ReactHTML> extends BoxStyles {
6
7
  children?: React.ReactNode | ((props: {
7
8
  isHover: boolean;
@@ -10,266 +11,7 @@ interface Props<TTag extends keyof React.ReactHTML> extends BoxStyles {
10
11
  props?: TagPropsType<TTag>;
11
12
  style?: React.ComponentProps<TTag>['style'];
12
13
  className?: ClassNameUtils.ClassNameType;
14
+ ref?: Ref<HTMLElement>;
13
15
  }
14
- export default function Box<TTag extends keyof React.ReactHTML = 'div'>(props: Props<TTag>): React.DetailedReactHTMLElement<{
15
- style: React.ComponentProps<TTag>["style"] | undefined;
16
- className: string;
17
- slot?: React.ComponentProps<TTag>["slot"] | undefined;
18
- title?: React.ComponentProps<TTag>["title"] | undefined;
19
- color?: React.ComponentProps<TTag>["color"] | undefined;
20
- children?: React.ComponentProps<TTag>["children"] | undefined;
21
- ref?: React.ComponentProps<TTag>["ref"] | undefined;
22
- key?: React.ComponentProps<TTag>["key"] | undefined;
23
- defaultChecked?: React.ComponentProps<TTag>["defaultChecked"] | undefined;
24
- defaultValue?: React.ComponentProps<TTag>["defaultValue"] | undefined;
25
- suppressContentEditableWarning?: React.ComponentProps<TTag>["suppressContentEditableWarning"] | undefined;
26
- suppressHydrationWarning?: React.ComponentProps<TTag>["suppressHydrationWarning"] | undefined;
27
- accessKey?: React.ComponentProps<TTag>["accessKey"] | undefined;
28
- contentEditable?: React.ComponentProps<TTag>["contentEditable"] | undefined;
29
- contextMenu?: React.ComponentProps<TTag>["contextMenu"] | undefined;
30
- dir?: React.ComponentProps<TTag>["dir"] | undefined;
31
- draggable?: React.ComponentProps<TTag>["draggable"] | undefined;
32
- hidden?: React.ComponentProps<TTag>["hidden"] | undefined;
33
- id?: React.ComponentProps<TTag>["id"] | undefined;
34
- lang?: React.ComponentProps<TTag>["lang"] | undefined;
35
- nonce?: React.ComponentProps<TTag>["nonce"] | undefined;
36
- placeholder?: React.ComponentProps<TTag>["placeholder"] | undefined;
37
- spellCheck?: React.ComponentProps<TTag>["spellCheck"] | undefined;
38
- tabIndex?: React.ComponentProps<TTag>["tabIndex"] | undefined;
39
- translate?: React.ComponentProps<TTag>["translate"] | undefined;
40
- radioGroup?: React.ComponentProps<TTag>["radioGroup"] | undefined;
41
- role?: React.ComponentProps<TTag>["role"] | undefined;
42
- about?: React.ComponentProps<TTag>["about"] | undefined;
43
- datatype?: React.ComponentProps<TTag>["datatype"] | undefined;
44
- inlist?: React.ComponentProps<TTag>["inlist"] | undefined;
45
- prefix?: React.ComponentProps<TTag>["prefix"] | undefined;
46
- property?: React.ComponentProps<TTag>["property"] | undefined;
47
- resource?: React.ComponentProps<TTag>["resource"] | undefined;
48
- typeof?: React.ComponentProps<TTag>["typeof"] | undefined;
49
- vocab?: React.ComponentProps<TTag>["vocab"] | undefined;
50
- autoCapitalize?: React.ComponentProps<TTag>["autoCapitalize"] | undefined;
51
- autoCorrect?: React.ComponentProps<TTag>["autoCorrect"] | undefined;
52
- autoSave?: React.ComponentProps<TTag>["autoSave"] | undefined;
53
- itemProp?: React.ComponentProps<TTag>["itemProp"] | undefined;
54
- itemScope?: React.ComponentProps<TTag>["itemScope"] | undefined;
55
- itemType?: React.ComponentProps<TTag>["itemType"] | undefined;
56
- itemID?: React.ComponentProps<TTag>["itemID"] | undefined;
57
- itemRef?: React.ComponentProps<TTag>["itemRef"] | undefined;
58
- results?: React.ComponentProps<TTag>["results"] | undefined;
59
- security?: React.ComponentProps<TTag>["security"] | undefined;
60
- unselectable?: React.ComponentProps<TTag>["unselectable"] | undefined;
61
- inputMode?: React.ComponentProps<TTag>["inputMode"] | undefined;
62
- is?: React.ComponentProps<TTag>["is"] | undefined;
63
- 'aria-activedescendant'?: React.ComponentProps<TTag>["aria-activedescendant"] | undefined;
64
- 'aria-atomic'?: React.ComponentProps<TTag>["aria-atomic"] | undefined;
65
- 'aria-autocomplete'?: React.ComponentProps<TTag>["aria-autocomplete"] | undefined;
66
- 'aria-busy'?: React.ComponentProps<TTag>["aria-busy"] | undefined;
67
- 'aria-checked'?: React.ComponentProps<TTag>["aria-checked"] | undefined;
68
- 'aria-colcount'?: React.ComponentProps<TTag>["aria-colcount"] | undefined;
69
- 'aria-colindex'?: React.ComponentProps<TTag>["aria-colindex"] | undefined;
70
- 'aria-colspan'?: React.ComponentProps<TTag>["aria-colspan"] | undefined;
71
- 'aria-controls'?: React.ComponentProps<TTag>["aria-controls"] | undefined;
72
- 'aria-current'?: React.ComponentProps<TTag>["aria-current"] | undefined;
73
- 'aria-describedby'?: React.ComponentProps<TTag>["aria-describedby"] | undefined;
74
- 'aria-details'?: React.ComponentProps<TTag>["aria-details"] | undefined;
75
- 'aria-disabled'?: React.ComponentProps<TTag>["aria-disabled"] | undefined;
76
- 'aria-dropeffect'?: React.ComponentProps<TTag>["aria-dropeffect"] | undefined;
77
- 'aria-errormessage'?: React.ComponentProps<TTag>["aria-errormessage"] | undefined;
78
- 'aria-expanded'?: React.ComponentProps<TTag>["aria-expanded"] | undefined;
79
- 'aria-flowto'?: React.ComponentProps<TTag>["aria-flowto"] | undefined;
80
- 'aria-grabbed'?: React.ComponentProps<TTag>["aria-grabbed"] | undefined;
81
- 'aria-haspopup'?: React.ComponentProps<TTag>["aria-haspopup"] | undefined;
82
- 'aria-hidden'?: React.ComponentProps<TTag>["aria-hidden"] | undefined;
83
- 'aria-invalid'?: React.ComponentProps<TTag>["aria-invalid"] | undefined;
84
- 'aria-keyshortcuts'?: React.ComponentProps<TTag>["aria-keyshortcuts"] | undefined;
85
- 'aria-label'?: React.ComponentProps<TTag>["aria-label"] | undefined;
86
- 'aria-labelledby'?: React.ComponentProps<TTag>["aria-labelledby"] | undefined;
87
- 'aria-level'?: React.ComponentProps<TTag>["aria-level"] | undefined;
88
- 'aria-live'?: React.ComponentProps<TTag>["aria-live"] | undefined;
89
- 'aria-modal'?: React.ComponentProps<TTag>["aria-modal"] | undefined;
90
- 'aria-multiline'?: React.ComponentProps<TTag>["aria-multiline"] | undefined;
91
- 'aria-multiselectable'?: React.ComponentProps<TTag>["aria-multiselectable"] | undefined;
92
- 'aria-orientation'?: React.ComponentProps<TTag>["aria-orientation"] | undefined;
93
- 'aria-owns'?: React.ComponentProps<TTag>["aria-owns"] | undefined;
94
- 'aria-placeholder'?: React.ComponentProps<TTag>["aria-placeholder"] | undefined;
95
- 'aria-posinset'?: React.ComponentProps<TTag>["aria-posinset"] | undefined;
96
- 'aria-pressed'?: React.ComponentProps<TTag>["aria-pressed"] | undefined;
97
- 'aria-readonly'?: React.ComponentProps<TTag>["aria-readonly"] | undefined;
98
- 'aria-relevant'?: React.ComponentProps<TTag>["aria-relevant"] | undefined;
99
- 'aria-required'?: React.ComponentProps<TTag>["aria-required"] | undefined;
100
- 'aria-roledescription'?: React.ComponentProps<TTag>["aria-roledescription"] | undefined;
101
- 'aria-rowcount'?: React.ComponentProps<TTag>["aria-rowcount"] | undefined;
102
- 'aria-rowindex'?: React.ComponentProps<TTag>["aria-rowindex"] | undefined;
103
- 'aria-rowspan'?: React.ComponentProps<TTag>["aria-rowspan"] | undefined;
104
- 'aria-selected'?: React.ComponentProps<TTag>["aria-selected"] | undefined;
105
- 'aria-setsize'?: React.ComponentProps<TTag>["aria-setsize"] | undefined;
106
- 'aria-sort'?: React.ComponentProps<TTag>["aria-sort"] | undefined;
107
- 'aria-valuemax'?: React.ComponentProps<TTag>["aria-valuemax"] | undefined;
108
- 'aria-valuemin'?: React.ComponentProps<TTag>["aria-valuemin"] | undefined;
109
- 'aria-valuenow'?: React.ComponentProps<TTag>["aria-valuenow"] | undefined;
110
- 'aria-valuetext'?: React.ComponentProps<TTag>["aria-valuetext"] | undefined;
111
- dangerouslySetInnerHTML?: React.ComponentProps<TTag>["dangerouslySetInnerHTML"] | undefined;
112
- onCopy?: React.ComponentProps<TTag>["onCopy"] | undefined;
113
- onCopyCapture?: React.ComponentProps<TTag>["onCopyCapture"] | undefined;
114
- onCut?: React.ComponentProps<TTag>["onCut"] | undefined;
115
- onCutCapture?: React.ComponentProps<TTag>["onCutCapture"] | undefined;
116
- onPaste?: React.ComponentProps<TTag>["onPaste"] | undefined;
117
- onPasteCapture?: React.ComponentProps<TTag>["onPasteCapture"] | undefined;
118
- onCompositionEnd?: React.ComponentProps<TTag>["onCompositionEnd"] | undefined;
119
- onCompositionEndCapture?: React.ComponentProps<TTag>["onCompositionEndCapture"] | undefined;
120
- onCompositionStart?: React.ComponentProps<TTag>["onCompositionStart"] | undefined;
121
- onCompositionStartCapture?: React.ComponentProps<TTag>["onCompositionStartCapture"] | undefined;
122
- onCompositionUpdate?: React.ComponentProps<TTag>["onCompositionUpdate"] | undefined;
123
- onCompositionUpdateCapture?: React.ComponentProps<TTag>["onCompositionUpdateCapture"] | undefined;
124
- onFocus?: React.ComponentProps<TTag>["onFocus"] | undefined;
125
- onFocusCapture?: React.ComponentProps<TTag>["onFocusCapture"] | undefined;
126
- onBlur?: React.ComponentProps<TTag>["onBlur"] | undefined;
127
- onBlurCapture?: React.ComponentProps<TTag>["onBlurCapture"] | undefined;
128
- onChange?: React.ComponentProps<TTag>["onChange"] | undefined;
129
- onChangeCapture?: React.ComponentProps<TTag>["onChangeCapture"] | undefined;
130
- onBeforeInput?: React.ComponentProps<TTag>["onBeforeInput"] | undefined;
131
- onBeforeInputCapture?: React.ComponentProps<TTag>["onBeforeInputCapture"] | undefined;
132
- onInput?: React.ComponentProps<TTag>["onInput"] | undefined;
133
- onInputCapture?: React.ComponentProps<TTag>["onInputCapture"] | undefined;
134
- onReset?: React.ComponentProps<TTag>["onReset"] | undefined;
135
- onResetCapture?: React.ComponentProps<TTag>["onResetCapture"] | undefined;
136
- onSubmit?: React.ComponentProps<TTag>["onSubmit"] | undefined;
137
- onSubmitCapture?: React.ComponentProps<TTag>["onSubmitCapture"] | undefined;
138
- onInvalid?: React.ComponentProps<TTag>["onInvalid"] | undefined;
139
- onInvalidCapture?: React.ComponentProps<TTag>["onInvalidCapture"] | undefined;
140
- onLoad?: React.ComponentProps<TTag>["onLoad"] | undefined;
141
- onLoadCapture?: React.ComponentProps<TTag>["onLoadCapture"] | undefined;
142
- onError?: React.ComponentProps<TTag>["onError"] | undefined;
143
- onErrorCapture?: React.ComponentProps<TTag>["onErrorCapture"] | undefined;
144
- onKeyDown?: React.ComponentProps<TTag>["onKeyDown"] | undefined;
145
- onKeyDownCapture?: React.ComponentProps<TTag>["onKeyDownCapture"] | undefined;
146
- onKeyPress?: React.ComponentProps<TTag>["onKeyPress"] | undefined;
147
- onKeyPressCapture?: React.ComponentProps<TTag>["onKeyPressCapture"] | undefined;
148
- onKeyUp?: React.ComponentProps<TTag>["onKeyUp"] | undefined;
149
- onKeyUpCapture?: React.ComponentProps<TTag>["onKeyUpCapture"] | undefined;
150
- onAbort?: React.ComponentProps<TTag>["onAbort"] | undefined;
151
- onAbortCapture?: React.ComponentProps<TTag>["onAbortCapture"] | undefined;
152
- onCanPlay?: React.ComponentProps<TTag>["onCanPlay"] | undefined;
153
- onCanPlayCapture?: React.ComponentProps<TTag>["onCanPlayCapture"] | undefined;
154
- onCanPlayThrough?: React.ComponentProps<TTag>["onCanPlayThrough"] | undefined;
155
- onCanPlayThroughCapture?: React.ComponentProps<TTag>["onCanPlayThroughCapture"] | undefined;
156
- onDurationChange?: React.ComponentProps<TTag>["onDurationChange"] | undefined;
157
- onDurationChangeCapture?: React.ComponentProps<TTag>["onDurationChangeCapture"] | undefined;
158
- onEmptied?: React.ComponentProps<TTag>["onEmptied"] | undefined;
159
- onEmptiedCapture?: React.ComponentProps<TTag>["onEmptiedCapture"] | undefined;
160
- onEncrypted?: React.ComponentProps<TTag>["onEncrypted"] | undefined;
161
- onEncryptedCapture?: React.ComponentProps<TTag>["onEncryptedCapture"] | undefined;
162
- onEnded?: React.ComponentProps<TTag>["onEnded"] | undefined;
163
- onEndedCapture?: React.ComponentProps<TTag>["onEndedCapture"] | undefined;
164
- onLoadedData?: React.ComponentProps<TTag>["onLoadedData"] | undefined;
165
- onLoadedDataCapture?: React.ComponentProps<TTag>["onLoadedDataCapture"] | undefined;
166
- onLoadedMetadata?: React.ComponentProps<TTag>["onLoadedMetadata"] | undefined;
167
- onLoadedMetadataCapture?: React.ComponentProps<TTag>["onLoadedMetadataCapture"] | undefined;
168
- onLoadStart?: React.ComponentProps<TTag>["onLoadStart"] | undefined;
169
- onLoadStartCapture?: React.ComponentProps<TTag>["onLoadStartCapture"] | undefined;
170
- onPause?: React.ComponentProps<TTag>["onPause"] | undefined;
171
- onPauseCapture?: React.ComponentProps<TTag>["onPauseCapture"] | undefined;
172
- onPlay?: React.ComponentProps<TTag>["onPlay"] | undefined;
173
- onPlayCapture?: React.ComponentProps<TTag>["onPlayCapture"] | undefined;
174
- onPlaying?: React.ComponentProps<TTag>["onPlaying"] | undefined;
175
- onPlayingCapture?: React.ComponentProps<TTag>["onPlayingCapture"] | undefined;
176
- onProgress?: React.ComponentProps<TTag>["onProgress"] | undefined;
177
- onProgressCapture?: React.ComponentProps<TTag>["onProgressCapture"] | undefined;
178
- onRateChange?: React.ComponentProps<TTag>["onRateChange"] | undefined;
179
- onRateChangeCapture?: React.ComponentProps<TTag>["onRateChangeCapture"] | undefined;
180
- onResize?: React.ComponentProps<TTag>["onResize"] | undefined;
181
- onResizeCapture?: React.ComponentProps<TTag>["onResizeCapture"] | undefined;
182
- onSeeked?: React.ComponentProps<TTag>["onSeeked"] | undefined;
183
- onSeekedCapture?: React.ComponentProps<TTag>["onSeekedCapture"] | undefined;
184
- onSeeking?: React.ComponentProps<TTag>["onSeeking"] | undefined;
185
- onSeekingCapture?: React.ComponentProps<TTag>["onSeekingCapture"] | undefined;
186
- onStalled?: React.ComponentProps<TTag>["onStalled"] | undefined;
187
- onStalledCapture?: React.ComponentProps<TTag>["onStalledCapture"] | undefined;
188
- onSuspend?: React.ComponentProps<TTag>["onSuspend"] | undefined;
189
- onSuspendCapture?: React.ComponentProps<TTag>["onSuspendCapture"] | undefined;
190
- onTimeUpdate?: React.ComponentProps<TTag>["onTimeUpdate"] | undefined;
191
- onTimeUpdateCapture?: React.ComponentProps<TTag>["onTimeUpdateCapture"] | undefined;
192
- onVolumeChange?: React.ComponentProps<TTag>["onVolumeChange"] | undefined;
193
- onVolumeChangeCapture?: React.ComponentProps<TTag>["onVolumeChangeCapture"] | undefined;
194
- onWaiting?: React.ComponentProps<TTag>["onWaiting"] | undefined;
195
- onWaitingCapture?: React.ComponentProps<TTag>["onWaitingCapture"] | undefined;
196
- onAuxClick?: React.ComponentProps<TTag>["onAuxClick"] | undefined;
197
- onAuxClickCapture?: React.ComponentProps<TTag>["onAuxClickCapture"] | undefined;
198
- onClick?: React.ComponentProps<TTag>["onClick"] | undefined;
199
- onClickCapture?: React.ComponentProps<TTag>["onClickCapture"] | undefined;
200
- onContextMenu?: React.ComponentProps<TTag>["onContextMenu"] | undefined;
201
- onContextMenuCapture?: React.ComponentProps<TTag>["onContextMenuCapture"] | undefined;
202
- onDoubleClick?: React.ComponentProps<TTag>["onDoubleClick"] | undefined;
203
- onDoubleClickCapture?: React.ComponentProps<TTag>["onDoubleClickCapture"] | undefined;
204
- onDrag?: React.ComponentProps<TTag>["onDrag"] | undefined;
205
- onDragCapture?: React.ComponentProps<TTag>["onDragCapture"] | undefined;
206
- onDragEnd?: React.ComponentProps<TTag>["onDragEnd"] | undefined;
207
- onDragEndCapture?: React.ComponentProps<TTag>["onDragEndCapture"] | undefined;
208
- onDragEnter?: React.ComponentProps<TTag>["onDragEnter"] | undefined;
209
- onDragEnterCapture?: React.ComponentProps<TTag>["onDragEnterCapture"] | undefined;
210
- onDragExit?: React.ComponentProps<TTag>["onDragExit"] | undefined;
211
- onDragExitCapture?: React.ComponentProps<TTag>["onDragExitCapture"] | undefined;
212
- onDragLeave?: React.ComponentProps<TTag>["onDragLeave"] | undefined;
213
- onDragLeaveCapture?: React.ComponentProps<TTag>["onDragLeaveCapture"] | undefined;
214
- onDragOver?: React.ComponentProps<TTag>["onDragOver"] | undefined;
215
- onDragOverCapture?: React.ComponentProps<TTag>["onDragOverCapture"] | undefined;
216
- onDragStart?: React.ComponentProps<TTag>["onDragStart"] | undefined;
217
- onDragStartCapture?: React.ComponentProps<TTag>["onDragStartCapture"] | undefined;
218
- onDrop?: React.ComponentProps<TTag>["onDrop"] | undefined;
219
- onDropCapture?: React.ComponentProps<TTag>["onDropCapture"] | undefined;
220
- onMouseDown?: React.ComponentProps<TTag>["onMouseDown"] | undefined;
221
- onMouseDownCapture?: React.ComponentProps<TTag>["onMouseDownCapture"] | undefined;
222
- onMouseEnter?: React.ComponentProps<TTag>["onMouseEnter"] | undefined;
223
- onMouseLeave?: React.ComponentProps<TTag>["onMouseLeave"] | undefined;
224
- onMouseMove?: React.ComponentProps<TTag>["onMouseMove"] | undefined;
225
- onMouseMoveCapture?: React.ComponentProps<TTag>["onMouseMoveCapture"] | undefined;
226
- onMouseOut?: React.ComponentProps<TTag>["onMouseOut"] | undefined;
227
- onMouseOutCapture?: React.ComponentProps<TTag>["onMouseOutCapture"] | undefined;
228
- onMouseOver?: React.ComponentProps<TTag>["onMouseOver"] | undefined;
229
- onMouseOverCapture?: React.ComponentProps<TTag>["onMouseOverCapture"] | undefined;
230
- onMouseUp?: React.ComponentProps<TTag>["onMouseUp"] | undefined;
231
- onMouseUpCapture?: React.ComponentProps<TTag>["onMouseUpCapture"] | undefined;
232
- onSelect?: React.ComponentProps<TTag>["onSelect"] | undefined;
233
- onSelectCapture?: React.ComponentProps<TTag>["onSelectCapture"] | undefined;
234
- onTouchCancel?: React.ComponentProps<TTag>["onTouchCancel"] | undefined;
235
- onTouchCancelCapture?: React.ComponentProps<TTag>["onTouchCancelCapture"] | undefined;
236
- onTouchEnd?: React.ComponentProps<TTag>["onTouchEnd"] | undefined;
237
- onTouchEndCapture?: React.ComponentProps<TTag>["onTouchEndCapture"] | undefined;
238
- onTouchMove?: React.ComponentProps<TTag>["onTouchMove"] | undefined;
239
- onTouchMoveCapture?: React.ComponentProps<TTag>["onTouchMoveCapture"] | undefined;
240
- onTouchStart?: React.ComponentProps<TTag>["onTouchStart"] | undefined;
241
- onTouchStartCapture?: React.ComponentProps<TTag>["onTouchStartCapture"] | undefined;
242
- onPointerDown?: React.ComponentProps<TTag>["onPointerDown"] | undefined;
243
- onPointerDownCapture?: React.ComponentProps<TTag>["onPointerDownCapture"] | undefined;
244
- onPointerMove?: React.ComponentProps<TTag>["onPointerMove"] | undefined;
245
- onPointerMoveCapture?: React.ComponentProps<TTag>["onPointerMoveCapture"] | undefined;
246
- onPointerUp?: React.ComponentProps<TTag>["onPointerUp"] | undefined;
247
- onPointerUpCapture?: React.ComponentProps<TTag>["onPointerUpCapture"] | undefined;
248
- onPointerCancel?: React.ComponentProps<TTag>["onPointerCancel"] | undefined;
249
- onPointerCancelCapture?: React.ComponentProps<TTag>["onPointerCancelCapture"] | undefined;
250
- onPointerEnter?: React.ComponentProps<TTag>["onPointerEnter"] | undefined;
251
- onPointerEnterCapture?: React.ComponentProps<TTag>["onPointerEnterCapture"] | undefined;
252
- onPointerLeave?: React.ComponentProps<TTag>["onPointerLeave"] | undefined;
253
- onPointerLeaveCapture?: React.ComponentProps<TTag>["onPointerLeaveCapture"] | undefined;
254
- onPointerOver?: React.ComponentProps<TTag>["onPointerOver"] | undefined;
255
- onPointerOverCapture?: React.ComponentProps<TTag>["onPointerOverCapture"] | undefined;
256
- onPointerOut?: React.ComponentProps<TTag>["onPointerOut"] | undefined;
257
- onPointerOutCapture?: React.ComponentProps<TTag>["onPointerOutCapture"] | undefined;
258
- onGotPointerCapture?: React.ComponentProps<TTag>["onGotPointerCapture"] | undefined;
259
- onGotPointerCaptureCapture?: React.ComponentProps<TTag>["onGotPointerCaptureCapture"] | undefined;
260
- onLostPointerCapture?: React.ComponentProps<TTag>["onLostPointerCapture"] | undefined;
261
- onLostPointerCaptureCapture?: React.ComponentProps<TTag>["onLostPointerCaptureCapture"] | undefined;
262
- onScroll?: React.ComponentProps<TTag>["onScroll"] | undefined;
263
- onScrollCapture?: React.ComponentProps<TTag>["onScrollCapture"] | undefined;
264
- onWheel?: React.ComponentProps<TTag>["onWheel"] | undefined;
265
- onWheelCapture?: React.ComponentProps<TTag>["onWheelCapture"] | undefined;
266
- onAnimationStart?: React.ComponentProps<TTag>["onAnimationStart"] | undefined;
267
- onAnimationStartCapture?: React.ComponentProps<TTag>["onAnimationStartCapture"] | undefined;
268
- onAnimationEnd?: React.ComponentProps<TTag>["onAnimationEnd"] | undefined;
269
- onAnimationEndCapture?: React.ComponentProps<TTag>["onAnimationEndCapture"] | undefined;
270
- onAnimationIteration?: React.ComponentProps<TTag>["onAnimationIteration"] | undefined;
271
- onAnimationIterationCapture?: React.ComponentProps<TTag>["onAnimationIterationCapture"] | undefined;
272
- onTransitionEnd?: React.ComponentProps<TTag>["onTransitionEnd"] | undefined;
273
- onTransitionEndCapture?: React.ComponentProps<TTag>["onTransitionEndCapture"] | undefined;
274
- }, HTMLWebViewElement>;
275
- export {};
16
+ declare const _default: <TTag extends keyof React.ReactHTML = "div">(props: Props<TTag>) => JSX.Element;
17
+ export default _default;
package/box.mjs CHANGED
@@ -1,15 +1,18 @@
1
- import x, { useState as N } from "react";
1
+ import x, { forwardRef as N, useState as v } from "react";
2
2
  import { c as a } from "./box.module.css.mjs";
3
3
  import { C as b, t as g } from "./utils/utils.mjs";
4
- function H(c) {
5
- const { tag: m, children: s, props: u, className: n, style: p } = c, e = n ? b.classNames(n, a.box) : [a.box];
6
- Object.entries(c).forEach(([o, i]) => {
7
- const f = a[o + i];
8
- f ? e.push(f) : g.includes(o) && e.push(`${o}${i}`);
4
+ function C(c, n) {
5
+ const { tag: p, children: e, props: d, className: r, style: l } = c, t = r ? b.classNames(r, a.box) : [a.box];
6
+ Object.entries(c).forEach(([o, m]) => {
7
+ const u = a[o + m];
8
+ u ? t.push(u) : g.includes(o) && t.push(`${o}${m}`);
9
9
  });
10
- const d = m || "div", t = { ...u, style: p, className: e.join(" ") }, [h, r] = N(!1), l = typeof s == "function";
11
- return l && (t.onMouseEnter = () => r(!0), t.onMouseLeave = () => r(!1)), x.createElement(d, t, l ? s({ isHover: h }) : s);
10
+ const s = { ...d, className: t.join(" ") };
11
+ l && (s.style = l), n && (s.ref = n);
12
+ const [h, f] = v(!1), i = typeof e == "function";
13
+ return i && (s.onMouseEnter = () => f(!0), s.onMouseLeave = () => f(!1)), x.createElement(p || "div", s, i ? e({ isHover: h }) : e);
12
14
  }
15
+ const j = N(C);
13
16
  export {
14
- H as default
17
+ j as default
15
18
  };
@@ -1,5 +1,5 @@
1
1
  import Box from '../box';
2
- declare type BoxProps = React.ComponentProps<typeof Box<'button'>>;
2
+ declare type BoxProps = Omit<React.ComponentProps<typeof Box<'button'>>, 'ref' | 'tag'>;
3
3
  declare type BoxTagProps = Required<BoxProps>['props'];
4
4
  declare type ButtonTagProps = Omit<BoxTagProps, 'type' | 'onClick' | 'disabled'>;
5
5
  declare type ButtonType = Required<React.ComponentProps<'button'>>['type'];
@@ -9,5 +9,5 @@ interface Props extends Omit<BoxProps, 'props'> {
9
9
  onClick?: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
10
10
  disabled?: boolean;
11
11
  }
12
- export default function ButtonCore(props: Props): JSX.Element;
13
- export {};
12
+ declare const _default: import("react").ForwardRefExoticComponent<Props & import("react").RefAttributes<HTMLButtonElement>>;
13
+ export default _default;
@@ -1,12 +1,13 @@
1
- import { jsx as s } from "react/jsx-runtime";
2
- import u from "../box.mjs";
3
- import "react";
1
+ import { jsx as n } from "react/jsx-runtime";
2
+ import { forwardRef as p } from "react";
3
+ import i from "../box.mjs";
4
+ import { O as s } from "../utils/utils.mjs";
4
5
  import "../box.module.css.mjs";
5
- import "../utils/utils.mjs";
6
- function l(t) {
7
- const { tag: o, type: r, onClick: n, disabled: p, props: e } = t, i = { ...e, type: r || "button", onClick: n, disabled: p };
8
- return /* @__PURE__ */ s(u, { tag: o || "button", cursor: "pointer", inline: !0, ...t, props: i });
6
+ function m(o, r) {
7
+ const [t, e] = s.moveToTagProps(o, "type", "onClick", "disabled");
8
+ return /* @__PURE__ */ n(i, { ref: r, tag: "button", cursor: "pointer", inline: !0, ...e, props: { ...o.props, ...t } });
9
9
  }
10
+ const b = p(m);
10
11
  export {
11
- l as default
12
+ b as default
12
13
  };
@@ -1,19 +1,19 @@
1
1
  import React from 'react';
2
2
  import Box from '../box';
3
- declare type BoxProps = React.ComponentProps<typeof Box<'input'>>;
3
+ declare type BoxProps = Omit<React.ComponentProps<typeof Box<'input'>>, 'ref' | 'tag'>;
4
4
  declare type BoxTagProps = Required<BoxProps>['props'];
5
- declare type UncontrolledCheckboxCoreTagProps = Omit<BoxTagProps, 'name' | 'onInput' | 'onChange' | 'type' | 'placeholder' | 'disabled' | 'value' | 'autoFocus' | 'readOnly' | 'required' | 'defaultChecked'>;
5
+ declare type CheckboxCoreTagProps = Omit<BoxTagProps, 'name' | 'onInput' | 'onChange' | 'type' | 'placeholder' | 'disabled' | 'value' | 'autoFocus' | 'readOnly' | 'required' | 'checked' | 'defaultChecked'>;
6
6
  interface Props extends Omit<BoxProps, 'props'> {
7
- name: string;
8
- props?: UncontrolledCheckboxCoreTagProps;
7
+ name?: string;
8
+ props?: CheckboxCoreTagProps;
9
9
  onInput?: (e: React.FormEvent<HTMLInputElement>) => void;
10
10
  onChange?: (e: React.FormEvent<HTMLInputElement>) => void;
11
- placeholder?: string;
12
11
  disabled?: boolean;
13
12
  value?: string | number;
14
13
  autoFocus?: boolean;
15
14
  readOnly?: boolean;
16
15
  required?: boolean;
16
+ checked?: boolean;
17
17
  defaultChecked?: boolean;
18
18
  }
19
19
  declare const _default: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLInputElement>>;
@@ -0,0 +1,25 @@
1
+ import { jsx as n } from "react/jsx-runtime";
2
+ import { forwardRef as a } from "react";
3
+ import p from "../box.mjs";
4
+ import { O as c } from "../utils/utils.mjs";
5
+ import "../box.module.css.mjs";
6
+ function i(o, e) {
7
+ const [r, t] = c.moveToTagProps(
8
+ o,
9
+ "name",
10
+ "onInput",
11
+ "onChange",
12
+ "disabled",
13
+ "value",
14
+ "autoFocus",
15
+ "readOnly",
16
+ "required",
17
+ "checked",
18
+ "defaultChecked"
19
+ );
20
+ return /* @__PURE__ */ n(p, { ref: e, tag: "input", inline: !0, ...t, props: { ...o.props, ...r, type: "checkbox" } });
21
+ }
22
+ const l = a(i);
23
+ export {
24
+ l as default
25
+ };
@@ -1,18 +1,20 @@
1
1
  import React from 'react';
2
2
  import Box from '../box';
3
- declare type BoxProps = React.ComponentProps<typeof Box<'input'>>;
3
+ declare type BoxProps = Omit<React.ComponentProps<typeof Box<'input'>>, 'ref' | 'tag'>;
4
4
  declare type BoxTagProps = Required<BoxProps>['props'];
5
- declare type UncontrolledTextboxCoreTagProps = Omit<BoxTagProps, 'name' | 'onInput' | 'onChange' | 'type' | 'placeholder' | 'disabled' | 'defaultValue' | 'autoFocus' | 'readOnly' | 'required'>;
6
- declare type UncontrolledTextboxCoreType = 'date' | 'datetime-local' | 'email' | 'hidden' | 'month' | 'number' | 'password' | 'search' | 'tel' | 'text' | 'time' | 'url' | 'week';
5
+ declare type TextboxCoreTagProps = Omit<BoxTagProps, 'name' | 'onInput' | 'onChange' | 'type' | 'placeholder' | 'disabled' | 'defaultValue' | 'autoFocus' | 'readOnly' | 'required' | 'value' | 'pattern'>;
6
+ declare type TextboxCoreType = 'date' | 'datetime-local' | 'email' | 'hidden' | 'month' | 'number' | 'password' | 'search' | 'tel' | 'text' | 'time' | 'url' | 'week';
7
7
  interface Props extends Omit<BoxProps, 'props'> {
8
- name: string;
9
- props?: UncontrolledTextboxCoreTagProps;
8
+ name?: string;
9
+ props?: TextboxCoreTagProps;
10
10
  onInput?: (e: React.FormEvent<HTMLInputElement>) => void;
11
11
  onChange?: (e: React.FormEvent<HTMLInputElement>) => void;
12
- type?: UncontrolledTextboxCoreType;
12
+ type?: TextboxCoreType;
13
13
  placeholder?: string;
14
14
  disabled?: boolean;
15
+ value?: string | number;
15
16
  defaultValue?: string | number;
17
+ pattern?: string;
16
18
  autoFocus?: boolean;
17
19
  readOnly?: boolean;
18
20
  required?: boolean;
@@ -0,0 +1,27 @@
1
+ import { jsx as p } from "react/jsx-runtime";
2
+ import { forwardRef as a } from "react";
3
+ import n from "../box.mjs";
4
+ import { O as s } from "../utils/utils.mjs";
5
+ import "../box.module.css.mjs";
6
+ function i(o, t) {
7
+ const [e, r] = s.moveToTagProps(
8
+ o,
9
+ "onInput",
10
+ "onChange",
11
+ "type",
12
+ "placeholder",
13
+ "disabled",
14
+ "value",
15
+ "defaultValue",
16
+ "pattern",
17
+ "autoFocus",
18
+ "readOnly",
19
+ "required",
20
+ "step"
21
+ );
22
+ return /* @__PURE__ */ p(n, { ref: t, tag: "input", inline: !0, ...r, props: { ...o.props, ...e } });
23
+ }
24
+ const x = a(i);
25
+ export {
26
+ x as default
27
+ };
@@ -16,5 +16,5 @@ interface Props extends Omit<BoxProps, 'props'> {
16
16
  required?: boolean;
17
17
  defaultChecked?: boolean;
18
18
  }
19
- declare const _default: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLInputElement>>;
19
+ declare const _default: React.ForwardRefExoticComponent<Pick<Props, "b" | "br" | "p" | "style" | "className" | "hover" | "focus" | "display" | "inline" | "boxSizing" | "position" | "inset" | "top" | "right" | "bottom" | "left" | "width" | "height" | "minWidth" | "minHeight" | "maxWidth" | "maxHeight" | "margin" | "m" | "marginHorizontal" | "mx" | "marginVertical" | "my" | "marginTop" | "mt" | "marginRight" | "mr" | "marginBottom" | "mb" | "marginLeft" | "ml" | "padding" | "paddingHorizontal" | "px" | "paddingVertical" | "py" | "paddingTop" | "pt" | "paddingRight" | "pr" | "paddingBottom" | "pb" | "paddingLeft" | "pl" | "border" | "borderHorizontal" | "bx" | "borderVertical" | "by" | "borderTop" | "bt" | "borderRight" | "borderBottom" | "bb" | "borderLeft" | "bl" | "borderStyle" | "borderRadius" | "borderRadiusTop" | "borderRadiusRight" | "borderRadiusBottom" | "borderRadiusLeft" | "borderRadiusTopLeft" | "borderRadiusTopRight" | "borderRadiusBottomLeft" | "borderRadiusBottomRight" | "shadow" | "background" | "bg" | "color" | "backgroundColor" | "bgColor" | "borderColor" | "outlineColor" | "cursor" | "zIndex" | "overflow" | "overflowX" | "overflowY" | "opacity" | "fontSize" | "lineHeight" | "fontWeight" | "letterSpacing" | "textDecoration" | "textTransform" | "textAlign" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "flex1" | "flexDirection" | "gap" | "rowGap" | "columnGap" | "order" | "flexGrow" | "flexShrink" | "alignSelf" | "justifySelf" | "outline" | "outlineStyle" | "outlineOffset" | "transition" | "hoverH" | "focusH" | "displayH" | "inlineH" | "boxSizingH" | "positionH" | "insetH" | "topH" | "rightH" | "bottomH" | "leftH" | "widthH" | "heightH" | "minWidthH" | "minHeightH" | "maxWidthH" | "maxHeightH" | "marginH" | "mH" | "marginHorizontalH" | "mxH" | "marginVerticalH" | "myH" | "marginTopH" | "mtH" | "marginRightH" | "mrH" | "marginBottomH" | "mbH" | "marginLeftH" | "mlH" | "paddingH" | "pH" | "paddingHorizontalH" | "pxH" | "paddingVerticalH" | "pyH" | "paddingTopH" | "ptH" | "paddingRightH" | "prH" | "paddingBottomH" | "pbH" | "paddingLeftH" | "plH" | "borderH" | "bH" | "borderHorizontalH" | "bxH" | "borderVerticalH" | "byH" | "borderTopH" | "btH" | "borderRightH" | "brH" | "borderBottomH" | "bbH" | "borderLeftH" | "blH" | "borderStyleH" | "borderRadiusH" | "borderRadiusTopH" | "borderRadiusRightH" | "borderRadiusBottomH" | "borderRadiusLeftH" | "borderRadiusTopLeftH" | "borderRadiusTopRightH" | "borderRadiusBottomLeftH" | "borderRadiusBottomRightH" | "shadowH" | "backgroundH" | "bgH" | "colorH" | "backgroundColorH" | "bgColorH" | "borderColorH" | "outlineColorH" | "cursorH" | "zIndexH" | "overflowH" | "overflowXH" | "overflowYH" | "opacityH" | "fontSizeH" | "lineHeightH" | "fontWeightH" | "letterSpacingH" | "textDecorationH" | "textTransformH" | "textAlignH" | "flexWrapH" | "justifyContentH" | "alignItemsH" | "alignContentH" | "flex1H" | "flexDirectionH" | "gapH" | "rowGapH" | "columnGapH" | "orderH" | "flexGrowH" | "flexShrinkH" | "alignSelfH" | "justifySelfH" | "outlineH" | "outlineStyleH" | "outlineOffsetH" | "transitionH" | "hoverF" | "focusF" | "displayF" | "inlineF" | "boxSizingF" | "positionF" | "insetF" | "topF" | "rightF" | "bottomF" | "leftF" | "widthF" | "heightF" | "minWidthF" | "minHeightF" | "maxWidthF" | "maxHeightF" | "marginF" | "mF" | "marginHorizontalF" | "mxF" | "marginVerticalF" | "myF" | "marginTopF" | "mtF" | "marginRightF" | "mrF" | "marginBottomF" | "mbF" | "marginLeftF" | "mlF" | "paddingF" | "pF" | "paddingHorizontalF" | "pxF" | "paddingVerticalF" | "pyF" | "paddingTopF" | "ptF" | "paddingRightF" | "prF" | "paddingBottomF" | "pbF" | "paddingLeftF" | "plF" | "borderF" | "bF" | "borderHorizontalF" | "bxF" | "borderVerticalF" | "byF" | "borderTopF" | "btF" | "borderRightF" | "brF" | "borderBottomF" | "bbF" | "borderLeftF" | "blF" | "borderStyleF" | "borderRadiusF" | "borderRadiusTopF" | "borderRadiusRightF" | "borderRadiusBottomF" | "borderRadiusLeftF" | "borderRadiusTopLeftF" | "borderRadiusTopRightF" | "borderRadiusBottomLeftF" | "borderRadiusBottomRightF" | "shadowF" | "backgroundF" | "bgF" | "colorF" | "backgroundColorF" | "bgColorF" | "borderColorF" | "outlineColorF" | "cursorF" | "zIndexF" | "overflowF" | "overflowXF" | "overflowYF" | "opacityF" | "fontSizeF" | "lineHeightF" | "fontWeightF" | "letterSpacingF" | "textDecorationF" | "textTransformF" | "textAlignF" | "flexWrapF" | "justifyContentF" | "alignItemsF" | "alignContentF" | "flex1F" | "flexDirectionF" | "gapF" | "rowGapF" | "columnGapF" | "orderF" | "flexGrowF" | "flexShrinkF" | "alignSelfF" | "justifySelfF" | "outlineF" | "outlineStyleF" | "outlineOffsetF" | "transitionF" | "hoverA" | "focusA" | "displayA" | "inlineA" | "boxSizingA" | "positionA" | "insetA" | "topA" | "rightA" | "bottomA" | "leftA" | "widthA" | "heightA" | "minWidthA" | "minHeightA" | "maxWidthA" | "maxHeightA" | "marginA" | "mA" | "marginHorizontalA" | "mxA" | "marginVerticalA" | "myA" | "marginTopA" | "mtA" | "marginRightA" | "mrA" | "marginBottomA" | "mbA" | "marginLeftA" | "mlA" | "paddingA" | "pA" | "paddingHorizontalA" | "pxA" | "paddingVerticalA" | "pyA" | "paddingTopA" | "ptA" | "paddingRightA" | "prA" | "paddingBottomA" | "pbA" | "paddingLeftA" | "plA" | "borderA" | "bA" | "borderHorizontalA" | "bxA" | "borderVerticalA" | "byA" | "borderTopA" | "btA" | "borderRightA" | "brA" | "borderBottomA" | "bbA" | "borderLeftA" | "blA" | "borderStyleA" | "borderRadiusA" | "borderRadiusTopA" | "borderRadiusRightA" | "borderRadiusBottomA" | "borderRadiusLeftA" | "borderRadiusTopLeftA" | "borderRadiusTopRightA" | "borderRadiusBottomLeftA" | "borderRadiusBottomRightA" | "shadowA" | "backgroundA" | "bgA" | "colorA" | "backgroundColorA" | "bgColorA" | "borderColorA" | "outlineColorA" | "cursorA" | "zIndexA" | "overflowA" | "overflowXA" | "overflowYA" | "opacityA" | "fontSizeA" | "lineHeightA" | "fontWeightA" | "letterSpacingA" | "textDecorationA" | "textTransformA" | "textAlignA" | "flexWrapA" | "justifyContentA" | "alignItemsA" | "alignContentA" | "flex1A" | "flexDirectionA" | "gapA" | "rowGapA" | "columnGapA" | "orderA" | "flexGrowA" | "flexShrinkA" | "alignSelfA" | "justifySelfA" | "outlineA" | "outlineStyleA" | "outlineOffsetA" | "transitionA" | "children" | "tag" | "props" | "name" | "defaultChecked" | "placeholder" | "onChange" | "onInput" | "autoFocus" | "disabled" | "value" | "readOnly" | "required"> & React.RefAttributes<HTMLInputElement>>;
20
20
  export default _default;
@@ -19,5 +19,5 @@ interface Props extends Omit<BoxProps, 'props'> {
19
19
  readOnly?: boolean;
20
20
  required?: boolean;
21
21
  }
22
- declare const _default: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLTextAreaElement>>;
22
+ declare const _default: React.ForwardRefExoticComponent<Pick<Props, "b" | "br" | "p" | "style" | "className" | "hover" | "focus" | "display" | "inline" | "boxSizing" | "position" | "inset" | "top" | "right" | "bottom" | "left" | "width" | "height" | "minWidth" | "minHeight" | "maxWidth" | "maxHeight" | "margin" | "m" | "marginHorizontal" | "mx" | "marginVertical" | "my" | "marginTop" | "mt" | "marginRight" | "mr" | "marginBottom" | "mb" | "marginLeft" | "ml" | "padding" | "paddingHorizontal" | "px" | "paddingVertical" | "py" | "paddingTop" | "pt" | "paddingRight" | "pr" | "paddingBottom" | "pb" | "paddingLeft" | "pl" | "border" | "borderHorizontal" | "bx" | "borderVertical" | "by" | "borderTop" | "bt" | "borderRight" | "borderBottom" | "bb" | "borderLeft" | "bl" | "borderStyle" | "borderRadius" | "borderRadiusTop" | "borderRadiusRight" | "borderRadiusBottom" | "borderRadiusLeft" | "borderRadiusTopLeft" | "borderRadiusTopRight" | "borderRadiusBottomLeft" | "borderRadiusBottomRight" | "shadow" | "background" | "bg" | "color" | "backgroundColor" | "bgColor" | "borderColor" | "outlineColor" | "cursor" | "zIndex" | "overflow" | "overflowX" | "overflowY" | "opacity" | "fontSize" | "lineHeight" | "fontWeight" | "letterSpacing" | "textDecoration" | "textTransform" | "textAlign" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "flex1" | "flexDirection" | "gap" | "rowGap" | "columnGap" | "order" | "flexGrow" | "flexShrink" | "alignSelf" | "justifySelf" | "outline" | "outlineStyle" | "outlineOffset" | "transition" | "hoverH" | "focusH" | "displayH" | "inlineH" | "boxSizingH" | "positionH" | "insetH" | "topH" | "rightH" | "bottomH" | "leftH" | "widthH" | "heightH" | "minWidthH" | "minHeightH" | "maxWidthH" | "maxHeightH" | "marginH" | "mH" | "marginHorizontalH" | "mxH" | "marginVerticalH" | "myH" | "marginTopH" | "mtH" | "marginRightH" | "mrH" | "marginBottomH" | "mbH" | "marginLeftH" | "mlH" | "paddingH" | "pH" | "paddingHorizontalH" | "pxH" | "paddingVerticalH" | "pyH" | "paddingTopH" | "ptH" | "paddingRightH" | "prH" | "paddingBottomH" | "pbH" | "paddingLeftH" | "plH" | "borderH" | "bH" | "borderHorizontalH" | "bxH" | "borderVerticalH" | "byH" | "borderTopH" | "btH" | "borderRightH" | "brH" | "borderBottomH" | "bbH" | "borderLeftH" | "blH" | "borderStyleH" | "borderRadiusH" | "borderRadiusTopH" | "borderRadiusRightH" | "borderRadiusBottomH" | "borderRadiusLeftH" | "borderRadiusTopLeftH" | "borderRadiusTopRightH" | "borderRadiusBottomLeftH" | "borderRadiusBottomRightH" | "shadowH" | "backgroundH" | "bgH" | "colorH" | "backgroundColorH" | "bgColorH" | "borderColorH" | "outlineColorH" | "cursorH" | "zIndexH" | "overflowH" | "overflowXH" | "overflowYH" | "opacityH" | "fontSizeH" | "lineHeightH" | "fontWeightH" | "letterSpacingH" | "textDecorationH" | "textTransformH" | "textAlignH" | "flexWrapH" | "justifyContentH" | "alignItemsH" | "alignContentH" | "flex1H" | "flexDirectionH" | "gapH" | "rowGapH" | "columnGapH" | "orderH" | "flexGrowH" | "flexShrinkH" | "alignSelfH" | "justifySelfH" | "outlineH" | "outlineStyleH" | "outlineOffsetH" | "transitionH" | "hoverF" | "focusF" | "displayF" | "inlineF" | "boxSizingF" | "positionF" | "insetF" | "topF" | "rightF" | "bottomF" | "leftF" | "widthF" | "heightF" | "minWidthF" | "minHeightF" | "maxWidthF" | "maxHeightF" | "marginF" | "mF" | "marginHorizontalF" | "mxF" | "marginVerticalF" | "myF" | "marginTopF" | "mtF" | "marginRightF" | "mrF" | "marginBottomF" | "mbF" | "marginLeftF" | "mlF" | "paddingF" | "pF" | "paddingHorizontalF" | "pxF" | "paddingVerticalF" | "pyF" | "paddingTopF" | "ptF" | "paddingRightF" | "prF" | "paddingBottomF" | "pbF" | "paddingLeftF" | "plF" | "borderF" | "bF" | "borderHorizontalF" | "bxF" | "borderVerticalF" | "byF" | "borderTopF" | "btF" | "borderRightF" | "brF" | "borderBottomF" | "bbF" | "borderLeftF" | "blF" | "borderStyleF" | "borderRadiusF" | "borderRadiusTopF" | "borderRadiusRightF" | "borderRadiusBottomF" | "borderRadiusLeftF" | "borderRadiusTopLeftF" | "borderRadiusTopRightF" | "borderRadiusBottomLeftF" | "borderRadiusBottomRightF" | "shadowF" | "backgroundF" | "bgF" | "colorF" | "backgroundColorF" | "bgColorF" | "borderColorF" | "outlineColorF" | "cursorF" | "zIndexF" | "overflowF" | "overflowXF" | "overflowYF" | "opacityF" | "fontSizeF" | "lineHeightF" | "fontWeightF" | "letterSpacingF" | "textDecorationF" | "textTransformF" | "textAlignF" | "flexWrapF" | "justifyContentF" | "alignItemsF" | "alignContentF" | "flex1F" | "flexDirectionF" | "gapF" | "rowGapF" | "columnGapF" | "orderF" | "flexGrowF" | "flexShrinkF" | "alignSelfF" | "justifySelfF" | "outlineF" | "outlineStyleF" | "outlineOffsetF" | "transitionF" | "hoverA" | "focusA" | "displayA" | "inlineA" | "boxSizingA" | "positionA" | "insetA" | "topA" | "rightA" | "bottomA" | "leftA" | "widthA" | "heightA" | "minWidthA" | "minHeightA" | "maxWidthA" | "maxHeightA" | "marginA" | "mA" | "marginHorizontalA" | "mxA" | "marginVerticalA" | "myA" | "marginTopA" | "mtA" | "marginRightA" | "mrA" | "marginBottomA" | "mbA" | "marginLeftA" | "mlA" | "paddingA" | "pA" | "paddingHorizontalA" | "pxA" | "paddingVerticalA" | "pyA" | "paddingTopA" | "ptA" | "paddingRightA" | "prA" | "paddingBottomA" | "pbA" | "paddingLeftA" | "plA" | "borderA" | "bA" | "borderHorizontalA" | "bxA" | "borderVerticalA" | "byA" | "borderTopA" | "btA" | "borderRightA" | "brA" | "borderBottomA" | "bbA" | "borderLeftA" | "blA" | "borderStyleA" | "borderRadiusA" | "borderRadiusTopA" | "borderRadiusRightA" | "borderRadiusBottomA" | "borderRadiusLeftA" | "borderRadiusTopLeftA" | "borderRadiusTopRightA" | "borderRadiusBottomLeftA" | "borderRadiusBottomRightA" | "shadowA" | "backgroundA" | "bgA" | "colorA" | "backgroundColorA" | "bgColorA" | "borderColorA" | "outlineColorA" | "cursorA" | "zIndexA" | "overflowA" | "overflowXA" | "overflowYA" | "opacityA" | "fontSizeA" | "lineHeightA" | "fontWeightA" | "letterSpacingA" | "textDecorationA" | "textTransformA" | "textAlignA" | "flexWrapA" | "justifyContentA" | "alignItemsA" | "alignContentA" | "flex1A" | "flexDirectionA" | "gapA" | "rowGapA" | "columnGapA" | "orderA" | "flexGrowA" | "flexShrinkA" | "alignSelfA" | "justifySelfA" | "outlineA" | "outlineStyleA" | "outlineOffsetA" | "transitionA" | "children" | "tag" | "props" | "name" | "defaultValue" | "placeholder" | "onChange" | "onInput" | "autoFocus" | "disabled" | "maxLength" | "minLength" | "readOnly" | "required" | "cols" | "rows"> & React.RefAttributes<HTMLTextAreaElement>>;
23
23
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cronocode/react-box",
3
- "version": "1.1.4",
3
+ "version": "1.1.5",
4
4
  "main": "./box.mjs",
5
5
  "module": "./box.mjs",
6
6
  "types": "./box.d.ts",
@@ -0,0 +1,4 @@
1
+ declare namespace ObjectUtils {
2
+ function moveToTagProps<T extends Object, TKey extends keyof T>(props: T, ...keys: TKey[]): Record<TKey, T[TKey]>[];
3
+ }
4
+ export default ObjectUtils;
package/utils/utils.mjs CHANGED
@@ -1,4 +1,4 @@
1
- const g = [
1
+ const p = [
2
2
  "shadow",
3
3
  "shadowH",
4
4
  "shadowA",
@@ -24,57 +24,69 @@ const g = [
24
24
  "outlineColorH",
25
25
  "outlineColorA"
26
26
  ];
27
- var a;
28
- ((h) => {
29
- function l(...d) {
30
- return d.reduce((e, t) => t ? typeof t == "string" ? (e.push(t), e) : Array.isArray(t) ? (e.push(...l(...t)), e) : (Object.entries(t).forEach(([o, s]) => {
31
- s && e.push(o);
32
- }), e) : e, []);
27
+ var g;
28
+ ((l) => {
29
+ function i(...u) {
30
+ return u.reduce((s, o) => o ? typeof o == "string" ? (s.push(o), s) : Array.isArray(o) ? (s.push(...i(...o)), s) : (Object.entries(o).forEach(([t, e]) => {
31
+ e && s.push(t);
32
+ }), s) : s, []);
33
33
  }
34
- h.classNames = l;
35
- })(a || (a = {}));
36
- const C = a;
34
+ l.classNames = i;
35
+ })(g || (g = {}));
36
+ const C = g;
37
+ var h;
38
+ ((l) => {
39
+ function i(u, ...s) {
40
+ const o = { ...u }, t = {};
41
+ return s.forEach((e) => {
42
+ e in o && (t[e] = o[e], delete o[e]);
43
+ }), [t, o];
44
+ }
45
+ l.moveToTagProps = i;
46
+ })(h || (h = {}));
47
+ const A = h;
37
48
  var b;
38
- ((h) => {
39
- function l(e) {
40
- const t = Array.from(e.elements).reduce((o, s) => {
41
- const r = s.name;
42
- return r && (o[r] || (o[r] = []), o[r].push(s)), o;
49
+ ((l) => {
50
+ function i(s) {
51
+ const o = Array.from(s.elements).reduce((t, e) => {
52
+ const r = e.name;
53
+ return r && (t[r] || (t[r] = []), t[r].push(e)), t;
43
54
  }, {});
44
- return Object.entries(t).reduce((o, [s, r]) => {
55
+ return Object.entries(o).reduce((t, [e, r]) => {
45
56
  if (r.length === 1) {
46
57
  const c = r[0];
47
- d(o, s, c.type === "checkbox" || c.type === "radio" ? c.checked : c.value);
58
+ u(t, e, c.type === "checkbox" || c.type === "radio" ? c.checked : c.value);
48
59
  } else {
49
- const c = r.reduce((i, n) => (n.type === "checkbox" || n.type === "radio" ? n.checked && i.push(n.value) : i.push(n.value), i), []);
50
- d(o, s, c);
60
+ const c = r.reduce((d, n) => (n.type === "checkbox" || n.type === "radio" ? n.checked && d.push(n.value) : d.push(n.value), d), []);
61
+ u(t, e, c);
51
62
  }
52
- return o;
63
+ return t;
53
64
  }, {});
54
65
  }
55
- h.getFormEntries = l;
56
- function d(e, t, o) {
57
- if (t.includes(".")) {
58
- const s = t.split(".");
59
- let r = e;
60
- s.forEach((c, i) => {
61
- if (s.length > i + 1) {
66
+ l.getFormEntries = i;
67
+ function u(s, o, t) {
68
+ if (o.includes(".")) {
69
+ const e = o.split(".");
70
+ let r = s;
71
+ e.forEach((c, d) => {
72
+ if (e.length > d + 1) {
62
73
  const n = c.match(/^(.+)\[(\d)\]$/);
63
74
  if (n) {
64
- const [, u, f] = n;
65
- r[u] = r[u] || [], r[u][f] = r[u][f] || {}, r = r[u][f];
75
+ const [, a, f] = n;
76
+ r[a] = r[a] || [], r[a][f] = r[a][f] || {}, r = r[a][f];
66
77
  } else
67
78
  r[c] = r[c] || {}, r = r[c];
68
79
  } else
69
- r[c] = o;
80
+ r[c] = t;
70
81
  });
71
82
  } else
72
- e[t] = o;
83
+ s[o] = t;
73
84
  }
74
85
  })(b || (b = {}));
75
- const p = b;
86
+ const H = b;
76
87
  export {
77
88
  C,
78
- p as F,
79
- g as t
89
+ H as F,
90
+ A as O,
91
+ p as t
80
92
  };
@@ -1,27 +0,0 @@
1
- import { jsx as f } from "react/jsx-runtime";
2
- import { forwardRef as h } from "react";
3
- import x from "../box.mjs";
4
- import "../box.module.css.mjs";
5
- import "../utils/utils.mjs";
6
- function C(o, e) {
7
- const { props: r, name: t, disabled: n, placeholder: a, value: p, onInput: c, onChange: l, autoFocus: u, readOnly: d, required: i, defaultChecked: s } = o, m = {
8
- ...r,
9
- type: "checkbox",
10
- name: t,
11
- disabled: n,
12
- placeholder: a,
13
- onInput: c,
14
- onChange: l,
15
- value: p,
16
- autoFocus: u,
17
- readOnly: d,
18
- required: i,
19
- defaultChecked: s,
20
- ref: e
21
- };
22
- return /* @__PURE__ */ f(x, { tag: "input", inline: !0, ...o, props: m });
23
- }
24
- const P = h(C);
25
- export {
26
- P as default
27
- };
@@ -1,40 +0,0 @@
1
- import { jsx as x } from "react/jsx-runtime";
2
- import { forwardRef as g } from "react";
3
- import b from "../box.mjs";
4
- import "../box.module.css.mjs";
5
- import "../utils/utils.mjs";
6
- function y(o, t) {
7
- const {
8
- props: e,
9
- name: r,
10
- type: n,
11
- disabled: p,
12
- placeholder: a,
13
- defaultValue: l,
14
- onInput: u,
15
- onChange: i,
16
- autoFocus: s,
17
- readOnly: d,
18
- required: m,
19
- step: c
20
- } = o, f = {
21
- ...e,
22
- type: n || "text",
23
- name: r,
24
- disabled: p,
25
- placeholder: a,
26
- onInput: u,
27
- onChange: i,
28
- defaultValue: l,
29
- autoFocus: s,
30
- readOnly: d,
31
- required: m,
32
- step: c,
33
- ref: t
34
- };
35
- return /* @__PURE__ */ x(b, { tag: "input", inline: !0, ...o, props: f });
36
- }
37
- const j = g(y);
38
- export {
39
- j as default
40
- };