@cronocode/react-box 0.3.4 → 0.3.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 +265 -1058
- package/box.js +22 -8144
- package/box.module.css.js +10641 -0
- package/components/buttonCore.d.ts +7 -3
- package/components/buttonCore.js +14 -14
- package/components/flex.d.ts +3 -1
- package/components/flex.js +8 -23
- package/components/uncontrolledTextboxCore.d.ts +6 -3
- package/components/uncontrolledTextboxCore.js +17 -18
- package/css.variables.d.ts +1 -1
- package/package.json +2 -1
- package/style.css +1 -1
- package/types.d.ts +5 -0
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import Box from '../box';
|
|
2
2
|
declare type BoxProps = React.ComponentProps<typeof Box>;
|
|
3
|
-
|
|
3
|
+
declare type BoxTagProps = Required<BoxProps>['props'];
|
|
4
|
+
declare type ButtonTagProps = Omit<BoxTagProps, 'type' | 'onClick' | 'disabled'>;
|
|
5
|
+
declare type ButtonType = Required<React.ComponentProps<'button'>>['type'];
|
|
6
|
+
interface Props extends Omit<BoxProps, 'props'> {
|
|
7
|
+
props?: ButtonTagProps;
|
|
8
|
+
type?: ButtonType;
|
|
4
9
|
onClick?: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
5
|
-
type?: React.ComponentProps<'button'>['type'];
|
|
6
10
|
disabled?: boolean;
|
|
7
11
|
}
|
|
8
|
-
export default function
|
|
12
|
+
export default function ButtonCore(props: Props): JSX.Element;
|
|
9
13
|
export {};
|
package/components/buttonCore.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import
|
|
1
|
+
import s from "../box.js";
|
|
2
2
|
import { jsx as u } from "react/jsx-runtime";
|
|
3
3
|
import "react";
|
|
4
|
+
import "../box.module.css.js";
|
|
4
5
|
import "../utils/utils.js";
|
|
5
6
|
function l(t) {
|
|
6
7
|
const {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
disabled: p
|
|
11
|
-
} = t, e = {
|
|
12
|
-
onClick: r,
|
|
13
|
-
type: n || "button",
|
|
8
|
+
tag: o,
|
|
9
|
+
type: r,
|
|
10
|
+
onClick: n,
|
|
14
11
|
disabled: p,
|
|
15
|
-
...o
|
|
16
|
-
}, s = {
|
|
17
|
-
...t,
|
|
18
12
|
props: e
|
|
13
|
+
} = t, i = {
|
|
14
|
+
...e,
|
|
15
|
+
type: r || "button",
|
|
16
|
+
onClick: n,
|
|
17
|
+
disabled: p
|
|
19
18
|
};
|
|
20
|
-
return /* @__PURE__ */ u(
|
|
21
|
-
tag: "button",
|
|
19
|
+
return /* @__PURE__ */ u(s, {
|
|
20
|
+
tag: o || "button",
|
|
22
21
|
cursor: "pointer",
|
|
23
22
|
inline: !0,
|
|
24
|
-
...
|
|
23
|
+
...t,
|
|
24
|
+
props: i
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
27
|
export {
|
package/components/flex.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Box from '../box';
|
|
2
2
|
declare type BoxProps = React.ComponentProps<typeof Box>;
|
|
3
|
-
interface
|
|
3
|
+
interface FlexStylesShortCuts {
|
|
4
4
|
wrap?: BoxProps['flexWrap'];
|
|
5
5
|
jc?: BoxProps['justifyContent'];
|
|
6
6
|
ai?: BoxProps['alignItems'];
|
|
@@ -9,6 +9,8 @@ interface Props extends BoxProps {
|
|
|
9
9
|
grow?: BoxProps['flexGrow'];
|
|
10
10
|
shrink?: BoxProps['flexShrink'];
|
|
11
11
|
as?: BoxProps['alignSelf'];
|
|
12
|
+
js?: BoxProps['justifySelf'];
|
|
12
13
|
}
|
|
14
|
+
declare type Props = BoxProps & FlexStylesShortCuts & Hovered<FlexStylesShortCuts>;
|
|
13
15
|
export default function Flex(props: Props): JSX.Element;
|
|
14
16
|
export {};
|
package/components/flex.js
CHANGED
|
@@ -1,32 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { jsx as
|
|
1
|
+
import t from "../box.js";
|
|
2
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
3
3
|
import "react";
|
|
4
|
+
import "../box.module.css.js";
|
|
4
5
|
import "../utils/utils.js";
|
|
5
|
-
function
|
|
6
|
+
function x(i) {
|
|
6
7
|
const {
|
|
7
|
-
|
|
8
|
-
jc: e,
|
|
9
|
-
ai: t,
|
|
10
|
-
ac: r,
|
|
11
|
-
d: l,
|
|
12
|
-
grow: o,
|
|
13
|
-
shrink: a,
|
|
14
|
-
as: f,
|
|
15
|
-
inline: x
|
|
8
|
+
inline: o
|
|
16
9
|
} = i;
|
|
17
|
-
return /* @__PURE__ */
|
|
18
|
-
display:
|
|
19
|
-
flexWrap: n,
|
|
20
|
-
justifyContent: e,
|
|
21
|
-
alignItems: t,
|
|
22
|
-
alignContent: r,
|
|
23
|
-
direction: l,
|
|
24
|
-
flexGrow: o,
|
|
25
|
-
flexShrink: a,
|
|
26
|
-
alignSelf: f,
|
|
10
|
+
return /* @__PURE__ */ r(t, {
|
|
11
|
+
display: o ? "inline-flex" : "flex",
|
|
27
12
|
...i
|
|
28
13
|
});
|
|
29
14
|
}
|
|
30
15
|
export {
|
|
31
|
-
|
|
16
|
+
x as default
|
|
32
17
|
};
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import Box from '../box';
|
|
2
2
|
declare type BoxProps = React.ComponentProps<typeof Box>;
|
|
3
|
-
declare type
|
|
4
|
-
|
|
3
|
+
declare type BoxTagProps = Required<BoxProps>['props'];
|
|
4
|
+
declare type UncontrolledTextboxCoreTagProps = Omit<BoxTagProps, 'onInput' | 'onChange' | 'type' | 'placeholder' | 'disabled' | 'defaultValue'>;
|
|
5
|
+
declare type UncontrolledTextboxCoreType = 'date' | 'datetime-local' | 'email' | 'hidden' | 'month' | 'number' | 'password' | 'search' | 'tel' | 'text' | 'time' | 'url' | 'week';
|
|
6
|
+
interface Props extends Omit<BoxProps, 'props'> {
|
|
7
|
+
props?: UncontrolledTextboxCoreTagProps;
|
|
5
8
|
onInput?: (e: React.FormEvent<HTMLInputElement>) => void;
|
|
6
9
|
onChange?: (e: React.FormEvent<HTMLInputElement>) => void;
|
|
7
|
-
type?:
|
|
10
|
+
type?: UncontrolledTextboxCoreType;
|
|
8
11
|
placeholder?: string;
|
|
9
12
|
disabled?: boolean;
|
|
10
13
|
defaultValue?: string | number;
|
|
@@ -1,32 +1,31 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { jsx as
|
|
1
|
+
import s from "../box.js";
|
|
2
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
3
3
|
import "react";
|
|
4
|
+
import "../box.module.css.js";
|
|
4
5
|
import "../utils/utils.js";
|
|
5
|
-
function g(
|
|
6
|
+
function g(t) {
|
|
6
7
|
const {
|
|
7
|
-
props:
|
|
8
|
+
props: o,
|
|
8
9
|
type: e,
|
|
9
|
-
disabled:
|
|
10
|
-
placeholder:
|
|
10
|
+
disabled: r,
|
|
11
|
+
placeholder: n,
|
|
11
12
|
defaultValue: p,
|
|
12
13
|
onInput: a,
|
|
13
|
-
onChange:
|
|
14
|
-
} =
|
|
14
|
+
onChange: i
|
|
15
|
+
} = t, l = {
|
|
16
|
+
...o,
|
|
15
17
|
type: e || "text",
|
|
16
|
-
disabled:
|
|
17
|
-
placeholder:
|
|
18
|
+
disabled: r,
|
|
19
|
+
placeholder: n,
|
|
18
20
|
onInput: a,
|
|
19
|
-
onChange:
|
|
20
|
-
defaultValue: p
|
|
21
|
-
...t
|
|
22
|
-
}, l = {
|
|
23
|
-
...o,
|
|
24
|
-
props: i
|
|
21
|
+
onChange: i,
|
|
22
|
+
defaultValue: p
|
|
25
23
|
};
|
|
26
|
-
return /* @__PURE__ */
|
|
24
|
+
return /* @__PURE__ */ u(s, {
|
|
27
25
|
tag: "input",
|
|
28
26
|
inline: !0,
|
|
29
|
-
...
|
|
27
|
+
...t,
|
|
28
|
+
props: l
|
|
30
29
|
});
|
|
31
30
|
}
|
|
32
31
|
export {
|
package/css.variables.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
declare const variables: {
|
|
2
|
-
sizes: readonly [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
|
|
2
|
+
sizes: readonly [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100];
|
|
3
3
|
sizeMultiplier: number;
|
|
4
4
|
colors: readonly ["primary", "primaryLight", "primaryDark", "secondary", "secondaryLight", "secondaryDark", "tertiary", "tertiaryLight", "tertiaryDark", "blue", "blueLight", "blueDark", "red", "redLight", "redDark", "purple", "purpleLight", "purpleDark", "yellow", "yellowLight", "yellowDark", "pink", "pinkLight", "pinkDark", "green", "greenLight", "greenDark", "orange", "orangeLight", "orangeDark", "navy", "navyLight", "navyDark", "teal", "tealLight", "tealDark", "violet", "violetLight", "violetDark", "black", "white", "gray", "grayLight", "grayDark", "brown", "brownLight", "brownDark", "orange", "orangeLight", "orangeDark"];
|
|
5
5
|
cursors: readonly ["auto", "default", "none", "context-menu", "help", "pointer", "progress", "wait", "cell", "crosshair", "text", "vertical-text", "alias", "copy", "move", "no-drop", "not-allowed", "e-resize", "n-resize", "ne-resize", "nw-resize", "s-resize", "se-resize", "sw-resize", "w-resize", "ew-resize", "ns-resize", "nesw-resize", "nwse-resize", "col-resize", "row-resize", "all-scroll", "zoom-in", "zoom-out", "grab", "grabbing"];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cronocode/react-box",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.5",
|
|
4
4
|
"main": "./box.js",
|
|
5
5
|
"module": "./box.js",
|
|
6
6
|
"types": "./box.d.ts",
|
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
"@cronocode/identity-factory": "^0.0.6",
|
|
44
44
|
"@types/node": "^18.7.14",
|
|
45
45
|
"@types/react": "^18.0.18",
|
|
46
|
+
"@types/react-dom": "^18.0.6",
|
|
46
47
|
"@vitejs/plugin-react": "^2.0.1",
|
|
47
48
|
"autoprefixer": "^10.4.8",
|
|
48
49
|
"postcss": "^8.4.16",
|