@cronocode/react-box 1.1.5 → 1.1.6

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,20 @@
1
+ import React from 'react';
2
+ import Box from '../box';
3
+ declare type BoxProps = Omit<React.ComponentProps<typeof Box<'input'>>, 'ref' | 'tag'>;
4
+ declare type BoxTagProps = Required<BoxProps>['props'];
5
+ declare type RadioButtonCoreTagProps = Omit<BoxTagProps, 'name' | 'onInput' | 'onChange' | 'type' | 'placeholder' | 'disabled' | 'value' | 'autoFocus' | 'readOnly' | 'required' | 'checked' | 'defaultChecked'>;
6
+ interface Props extends Omit<BoxProps, 'props'> {
7
+ name?: string;
8
+ props?: RadioButtonCoreTagProps;
9
+ onInput?: (e: React.FormEvent<HTMLInputElement>) => void;
10
+ onChange?: (e: React.FormEvent<HTMLInputElement>) => void;
11
+ disabled?: boolean;
12
+ value?: string | number;
13
+ autoFocus?: boolean;
14
+ readOnly?: boolean;
15
+ required?: boolean;
16
+ checked?: boolean;
17
+ defaultChecked?: boolean;
18
+ }
19
+ declare const _default: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLInputElement>>;
20
+ export default _default;
@@ -0,0 +1,25 @@
1
+ import { jsx as a } from "react/jsx-runtime";
2
+ import { forwardRef as n } from "react";
3
+ import i from "../box.mjs";
4
+ import { O as p } from "../utils/utils.mjs";
5
+ import "../box.module.css.mjs";
6
+ function u(o, r) {
7
+ const [t, e] = p.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__ */ a(i, { ref: r, tag: "input", inline: !0, ...e, props: { ...o.props, ...t, type: "radio" } });
21
+ }
22
+ const l = n(u);
23
+ export {
24
+ l as default
25
+ };
@@ -0,0 +1,24 @@
1
+ import React from 'react';
2
+ import Box from '../box';
3
+ declare type BoxProps = Omit<React.ComponentProps<typeof Box<'textarea'>>, 'ref' | 'tag'>;
4
+ declare type BoxTagProps = Required<BoxProps>['props'];
5
+ declare type TextareaCoreTagProps = Omit<BoxTagProps, 'name' | 'onInput' | 'onChange' | 'placeholder' | 'disabled' | 'value' | 'defaultValue' | 'rows' | 'cols' | 'autoFocus' | 'maxLength' | 'minLength' | 'readOnly' | 'required'>;
6
+ interface Props extends Omit<BoxProps, 'props'> {
7
+ name?: string;
8
+ props?: TextareaCoreTagProps;
9
+ onInput?: (e: React.FormEvent<HTMLTextAreaElement>) => void;
10
+ onChange?: (e: React.FormEvent<HTMLTextAreaElement>) => void;
11
+ placeholder?: string;
12
+ disabled?: boolean;
13
+ value?: string;
14
+ defaultValue?: string;
15
+ rows?: number;
16
+ cols?: number;
17
+ autoFocus?: boolean;
18
+ maxLength?: number;
19
+ minLength?: number;
20
+ readOnly?: boolean;
21
+ required?: boolean;
22
+ }
23
+ declare const _default: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLTextAreaElement>>;
24
+ export default _default;
@@ -0,0 +1,29 @@
1
+ import { jsx as a } from "react/jsx-runtime";
2
+ import { forwardRef as n } from "react";
3
+ import s from "../box.mjs";
4
+ import { O as m } from "../utils/utils.mjs";
5
+ import "../box.module.css.mjs";
6
+ function p(e, o) {
7
+ const [r, t] = m.moveToTagProps(
8
+ e,
9
+ "name",
10
+ "onInput",
11
+ "onChange",
12
+ "placeholder",
13
+ "disabled",
14
+ "value",
15
+ "defaultValue",
16
+ "rows",
17
+ "cols",
18
+ "autoFocus",
19
+ "maxLength",
20
+ "minLength",
21
+ "readOnly",
22
+ "required"
23
+ );
24
+ return /* @__PURE__ */ a(s, { ref: o, tag: "textarea", inline: !0, ...t, props: { ...e.props, ...r } });
25
+ }
26
+ const c = n(p);
27
+ export {
28
+ c as default
29
+ };
@@ -1,11 +1,12 @@
1
- import { jsx as p } from "react/jsx-runtime";
2
- import { forwardRef as a } from "react";
1
+ import { jsx as a } from "react/jsx-runtime";
2
+ import { forwardRef as p } from "react";
3
3
  import n from "../box.mjs";
4
4
  import { O as s } from "../utils/utils.mjs";
5
5
  import "../box.module.css.mjs";
6
- function i(o, t) {
7
- const [e, r] = s.moveToTagProps(
6
+ function i(o, e) {
7
+ const [t, r] = s.moveToTagProps(
8
8
  o,
9
+ "name",
9
10
  "onInput",
10
11
  "onChange",
11
12
  "type",
@@ -19,9 +20,9 @@ function i(o, t) {
19
20
  "required",
20
21
  "step"
21
22
  );
22
- return /* @__PURE__ */ p(n, { ref: t, tag: "input", inline: !0, ...r, props: { ...o.props, ...e } });
23
+ return /* @__PURE__ */ a(n, { ref: e, tag: "input", inline: !0, ...r, props: { ...o.props, ...t } });
23
24
  }
24
- const x = a(i);
25
+ const x = p(i);
25
26
  export {
26
27
  x as default
27
28
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cronocode/react-box",
3
- "version": "1.1.5",
3
+ "version": "1.1.6",
4
4
  "main": "./box.mjs",
5
5
  "module": "./box.mjs",
6
6
  "types": "./box.d.ts",