@cronocode/react-box 0.1.9 → 0.2.2

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,33 @@
1
+ import React from "react";
2
+ var jsxRuntime = { exports: {} };
3
+ var reactJsxRuntime_production_min = {};
4
+ /**
5
+ * @license React
6
+ * react-jsx-runtime.production.min.js
7
+ *
8
+ * Copyright (c) Facebook, Inc. and its affiliates.
9
+ *
10
+ * This source code is licensed under the MIT license found in the
11
+ * LICENSE file in the root directory of this source tree.
12
+ */
13
+ var f = React, k = Symbol.for("react.element"), l = Symbol.for("react.fragment"), m = Object.prototype.hasOwnProperty, n = f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, p = { key: true, ref: true, __self: true, __source: true };
14
+ function q(c, a, g) {
15
+ var b, d = {}, e = null, h = null;
16
+ g !== void 0 && (e = "" + g);
17
+ a.key !== void 0 && (e = "" + a.key);
18
+ a.ref !== void 0 && (h = a.ref);
19
+ for (b in a)
20
+ m.call(a, b) && !p.hasOwnProperty(b) && (d[b] = a[b]);
21
+ if (c && c.defaultProps)
22
+ for (b in a = c.defaultProps, a)
23
+ d[b] === void 0 && (d[b] = a[b]);
24
+ return { $$typeof: k, type: c, key: e, ref: h, props: d, _owner: n.current };
25
+ }
26
+ reactJsxRuntime_production_min.Fragment = l;
27
+ reactJsxRuntime_production_min.jsx = q;
28
+ reactJsxRuntime_production_min.jsxs = q;
29
+ {
30
+ jsxRuntime.exports = reactJsxRuntime_production_min;
31
+ }
32
+ const jsx = jsxRuntime.exports.jsx;
33
+ export { jsx as j };
@@ -0,0 +1,9 @@
1
+ import Box from '../box';
2
+ declare type BoxProps = React.ComponentProps<typeof Box>;
3
+ interface Props extends BoxProps {
4
+ onClick?: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
5
+ type?: React.ComponentProps<'button'>['type'];
6
+ disabled?: boolean;
7
+ }
8
+ export default function Button(props: Props): JSX.Element;
9
+ export {};
@@ -0,0 +1,41 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
4
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
5
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
+ var __spreadValues = (a, b) => {
7
+ for (var prop in b || (b = {}))
8
+ if (__hasOwnProp.call(b, prop))
9
+ __defNormalProp(a, prop, b[prop]);
10
+ if (__getOwnPropSymbols)
11
+ for (var prop of __getOwnPropSymbols(b)) {
12
+ if (__propIsEnum.call(b, prop))
13
+ __defNormalProp(a, prop, b[prop]);
14
+ }
15
+ return a;
16
+ };
17
+ import Box from "../box.js";
18
+ import { j as jsx } from "../chunk/jsx-runtime-8434466e.js";
19
+ import "react";
20
+ function Button(props) {
21
+ const {
22
+ props: tagProps,
23
+ onClick,
24
+ type,
25
+ disabled
26
+ } = props;
27
+ const newTagProps = __spreadValues(__spreadValues({}, {
28
+ onClick,
29
+ type: type || "button",
30
+ disabled
31
+ }), tagProps);
32
+ const newProps = __spreadValues(__spreadValues({}, props), {
33
+ props: newTagProps
34
+ });
35
+ return /* @__PURE__ */ jsx(Box, __spreadValues({
36
+ tag: "button",
37
+ cursor: "pointer",
38
+ display: "inline-block"
39
+ }, newProps));
40
+ }
41
+ export { Button as default };
@@ -0,0 +1,14 @@
1
+ import Box from '../box';
2
+ declare type BoxProps = React.ComponentProps<typeof Box>;
3
+ interface Props extends BoxProps {
4
+ wrap?: BoxProps['flexWrap'];
5
+ jc?: BoxProps['justifyContent'];
6
+ ai?: BoxProps['alignItems'];
7
+ ac?: BoxProps['alignContent'];
8
+ d?: BoxProps['direction'];
9
+ grow?: BoxProps['flexGrow'];
10
+ shrink?: BoxProps['flexShrink'];
11
+ as?: BoxProps['alignSelf'];
12
+ }
13
+ export default function Flex(props: Props): JSX.Element;
14
+ export {};
@@ -0,0 +1,43 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
4
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
5
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
+ var __spreadValues = (a, b) => {
7
+ for (var prop in b || (b = {}))
8
+ if (__hasOwnProp.call(b, prop))
9
+ __defNormalProp(a, prop, b[prop]);
10
+ if (__getOwnPropSymbols)
11
+ for (var prop of __getOwnPropSymbols(b)) {
12
+ if (__propIsEnum.call(b, prop))
13
+ __defNormalProp(a, prop, b[prop]);
14
+ }
15
+ return a;
16
+ };
17
+ import Box from "../box.js";
18
+ import { j as jsx } from "../chunk/jsx-runtime-8434466e.js";
19
+ import "react";
20
+ function Flex(props) {
21
+ const {
22
+ wrap,
23
+ jc,
24
+ ai,
25
+ ac,
26
+ d,
27
+ grow,
28
+ shrink,
29
+ as
30
+ } = props;
31
+ return /* @__PURE__ */ jsx(Box, __spreadValues({
32
+ display: "flex",
33
+ flexWrap: wrap,
34
+ justifyContent: jc,
35
+ alignItems: ai,
36
+ alignContent: ac,
37
+ direction: d,
38
+ flexGrow: grow,
39
+ flexShrink: shrink,
40
+ alignSelf: as
41
+ }, props));
42
+ }
43
+ export { Flex as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cronocode/react-box",
3
- "version": "0.1.9",
3
+ "version": "0.2.2",
4
4
  "main": "./box.js",
5
5
  "module": "./box.js",
6
6
  "types": "./box.d.ts",
@@ -43,7 +43,7 @@
43
43
  "@cronocode/identity-factory": "^0.0.6",
44
44
  "@types/node": "^18.7.6",
45
45
  "@types/react": "^18.0.17",
46
- "@vitejs/plugin-react": "^2.0.1",
46
+ "@vitejs/plugin-react": "^1.3.2",
47
47
  "autoprefixer": "^10.4.8",
48
48
  "postcss": "^8.4.16",
49
49
  "postcss-calc": "^8.2.4",
@@ -53,7 +53,7 @@
53
53
  "react": "^18.1.0",
54
54
  "react-dom": "^18.2.0",
55
55
  "typescript": "^4.7.4",
56
- "vite": "^3.0.8",
56
+ "vite": "^2.9.14",
57
57
  "vite-plugin-dts": "^1.4.1"
58
58
  }
59
59
  }