@spark-web/row 1.0.0 → 1.0.3

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/CHANGELOG.md CHANGED
@@ -1,5 +1,54 @@
1
1
  # @spark-web/row
2
2
 
3
+ ## 1.0.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#42](https://github.com/brighte-labs/spark-web/pull/42)
8
+ [`435779a`](https://github.com/brighte-labs/spark-web/commit/435779aa42bd635bbf43e1fd41724c666402caa2)
9
+ Thanks [@lukebennett88](https://github.com/lukebennett88)! - Prevent multiple
10
+ versions of React
11
+
12
+ - Updated dependencies
13
+ [[`435779a`](https://github.com/brighte-labs/spark-web/commit/435779aa42bd635bbf43e1fd41724c666402caa2)]:
14
+ - @spark-web/box@1.0.3
15
+ - @spark-web/divider@1.0.3
16
+ - @spark-web/theme@2.0.2
17
+ - @spark-web/utils@1.1.1
18
+
19
+ ## 1.0.2
20
+
21
+ ### Patch Changes
22
+
23
+ - [#40](https://github.com/brighte-labs/spark-web/pull/40)
24
+ [`062c8ab`](https://github.com/brighte-labs/spark-web/commit/062c8ab8c7b4120f8d14c269b5f7801288c678ca)
25
+ Thanks [@lukebennett88](https://github.com/lukebennett88)! - Add
26
+ @babel/transform-runtime
27
+
28
+ - Updated dependencies
29
+ [[`062c8ab`](https://github.com/brighte-labs/spark-web/commit/062c8ab8c7b4120f8d14c269b5f7801288c678ca)]:
30
+ - @spark-web/box@1.0.2
31
+ - @spark-web/divider@1.0.2
32
+ - @spark-web/theme@2.0.1
33
+ - @spark-web/utils@1.0.2
34
+
35
+ ## 1.0.1
36
+
37
+ ### Patch Changes
38
+
39
+ - [#36](https://github.com/brighte-labs/spark-web/pull/36)
40
+ [`8546f8f`](https://github.com/brighte-labs/spark-web/commit/8546f8f05daaa79ea3ff954c6c4928a7a2d0622d)
41
+ Thanks [@lukebennett88](https://github.com/lukebennett88)! - Update Babel
42
+ config
43
+
44
+ - Updated dependencies
45
+ [[`aebff30`](https://github.com/brighte-labs/spark-web/commit/aebff30c86cb0a9db22b545c46159ce0d1c14afb),
46
+ [`8546f8f`](https://github.com/brighte-labs/spark-web/commit/8546f8f05daaa79ea3ff954c6c4928a7a2d0622d)]:
47
+ - @spark-web/theme@2.0.0
48
+ - @spark-web/box@1.0.1
49
+ - @spark-web/divider@1.0.1
50
+ - @spark-web/utils@1.0.1
51
+
3
52
  ## 1.0.0
4
53
 
5
54
  ### Major Changes
package/README.md CHANGED
@@ -114,8 +114,8 @@ element in the Row.
114
114
 
115
115
  | Prop | Type | Default | Description |
116
116
  | --------- | ---------------------------------- | --------- | ----------------------------------------------------- |
117
- | align? | [ResponsiveProp<Align\>][align] | 'left' | Horizontally align items within the container. |
118
- | alignY? | [ResponsiveProp<AlignY\>][align-y] | 'stretch' | Vertically align items within the container. |
117
+ | align? | [ResponsiveProp\<Align>][align] | 'left' | Horizontally align items within the container. |
118
+ | alignY? | [ResponsiveProp\<AlignY>][align-y] | 'stretch' | Vertically align items within the container. |
119
119
  | dividers? | boolean | | Sets whether to place a divider between each element. |
120
120
 
121
121
  `Row` props also include [`Box`](/package/box) props and are not listed here
@@ -2,17 +2,14 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var _defineProperty = require('@babel/runtime/helpers/esm/defineProperty');
6
- var _objectWithoutProperties = require('@babel/runtime/helpers/esm/objectWithoutProperties');
7
- var React = require('react');
5
+ var _objectSpread = require('@babel/runtime/helpers/objectSpread2');
6
+ var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
8
7
  var box = require('@spark-web/box');
9
8
  var divider = require('@spark-web/divider');
10
9
  var ts = require('@spark-web/utils/ts');
10
+ var react = require('react');
11
11
  var theme = require('@spark-web/theme');
12
-
13
- function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
14
-
15
- var React__default = /*#__PURE__*/_interopDefault(React);
12
+ var jsxRuntime = require('react/jsx-runtime');
16
13
 
17
14
  var alignLookup = {
18
15
  left: 'start',
@@ -29,11 +26,6 @@ var alignToJustifyContent = theme.createResponsiveMapFn(alignLookup);
29
26
  var alignYToAlignItems = theme.createResponsiveMapFn(alignYLookup);
30
27
 
31
28
  var _excluded = ["align", "alignY", "children", "dividers"];
32
- var __jsx = React__default["default"].createElement;
33
-
34
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
35
-
36
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
37
29
  var Row = ts.forwardRefWithAs(function (_ref, forwardedRef) {
38
30
  var _ref$align = _ref.align,
39
31
  align = _ref$align === void 0 ? 'left' : _ref$align,
@@ -55,18 +47,22 @@ var Row = ts.forwardRefWithAs(function (_ref, forwardedRef) {
55
47
 
56
48
 
57
49
  if (!dividers) {
58
- return __jsx(box.Box, rootProps, children);
50
+ return /*#__PURE__*/jsxRuntime.jsx(box.Box, _objectSpread(_objectSpread({}, rootProps), {}, {
51
+ children: children
52
+ }));
59
53
  } // map over children to insert dividers
60
54
  // remove falsy values before mapping, keeps the index in sync
61
55
 
62
56
 
63
- var childArray = React.Children.toArray(children);
64
- return __jsx(box.Box, rootProps, childArray.map(function (child, idx) {
65
- return __jsx(React.Fragment, {
66
- key: child.key || idx
67
- }, dividers && idx ? __jsx(divider.Divider, {
68
- vertical: true
69
- }) : null, child);
57
+ var childArray = react.Children.toArray(children);
58
+ return /*#__PURE__*/jsxRuntime.jsx(box.Box, _objectSpread(_objectSpread({}, rootProps), {}, {
59
+ children: childArray.map(function (child, idx) {
60
+ return /*#__PURE__*/jsxRuntime.jsxs(react.Fragment, {
61
+ children: [dividers && idx ? /*#__PURE__*/jsxRuntime.jsx(divider.Divider, {
62
+ vertical: true
63
+ }) : null, child]
64
+ }, child.key || idx);
65
+ })
70
66
  }));
71
67
  });
72
68
 
@@ -2,17 +2,14 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var _defineProperty = require('@babel/runtime/helpers/esm/defineProperty');
6
- var _objectWithoutProperties = require('@babel/runtime/helpers/esm/objectWithoutProperties');
7
- var React = require('react');
5
+ var _objectSpread = require('@babel/runtime/helpers/objectSpread2');
6
+ var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
8
7
  var box = require('@spark-web/box');
9
8
  var divider = require('@spark-web/divider');
10
9
  var ts = require('@spark-web/utils/ts');
10
+ var react = require('react');
11
11
  var theme = require('@spark-web/theme');
12
-
13
- function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
14
-
15
- var React__default = /*#__PURE__*/_interopDefault(React);
12
+ var jsxRuntime = require('react/jsx-runtime');
16
13
 
17
14
  var alignLookup = {
18
15
  left: 'start',
@@ -29,11 +26,6 @@ var alignToJustifyContent = theme.createResponsiveMapFn(alignLookup);
29
26
  var alignYToAlignItems = theme.createResponsiveMapFn(alignYLookup);
30
27
 
31
28
  var _excluded = ["align", "alignY", "children", "dividers"];
32
- var __jsx = React__default["default"].createElement;
33
-
34
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
35
-
36
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
37
29
  var Row = ts.forwardRefWithAs(function (_ref, forwardedRef) {
38
30
  var _ref$align = _ref.align,
39
31
  align = _ref$align === void 0 ? 'left' : _ref$align,
@@ -55,18 +47,22 @@ var Row = ts.forwardRefWithAs(function (_ref, forwardedRef) {
55
47
 
56
48
 
57
49
  if (!dividers) {
58
- return __jsx(box.Box, rootProps, children);
50
+ return /*#__PURE__*/jsxRuntime.jsx(box.Box, _objectSpread(_objectSpread({}, rootProps), {}, {
51
+ children: children
52
+ }));
59
53
  } // map over children to insert dividers
60
54
  // remove falsy values before mapping, keeps the index in sync
61
55
 
62
56
 
63
- var childArray = React.Children.toArray(children);
64
- return __jsx(box.Box, rootProps, childArray.map(function (child, idx) {
65
- return __jsx(React.Fragment, {
66
- key: child.key || idx
67
- }, dividers && idx ? __jsx(divider.Divider, {
68
- vertical: true
69
- }) : null, child);
57
+ var childArray = react.Children.toArray(children);
58
+ return /*#__PURE__*/jsxRuntime.jsx(box.Box, _objectSpread(_objectSpread({}, rootProps), {}, {
59
+ children: childArray.map(function (child, idx) {
60
+ return /*#__PURE__*/jsxRuntime.jsxs(react.Fragment, {
61
+ children: [dividers && idx ? /*#__PURE__*/jsxRuntime.jsx(divider.Divider, {
62
+ vertical: true
63
+ }) : null, child]
64
+ }, child.key || idx);
65
+ })
70
66
  }));
71
67
  });
72
68
 
@@ -1,10 +1,11 @@
1
- import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
1
+ import _objectSpread from '@babel/runtime/helpers/esm/objectSpread2';
2
2
  import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
3
- import React, { Children, Fragment } from 'react';
4
3
  import { Box } from '@spark-web/box';
5
4
  import { Divider } from '@spark-web/divider';
6
5
  import { forwardRefWithAs } from '@spark-web/utils/ts';
6
+ import { Children, Fragment } from 'react';
7
7
  import { createResponsiveMapFn } from '@spark-web/theme';
8
+ import { jsx, jsxs } from 'react/jsx-runtime';
8
9
 
9
10
  var alignLookup = {
10
11
  left: 'start',
@@ -21,11 +22,6 @@ var alignToJustifyContent = createResponsiveMapFn(alignLookup);
21
22
  var alignYToAlignItems = createResponsiveMapFn(alignYLookup);
22
23
 
23
24
  var _excluded = ["align", "alignY", "children", "dividers"];
24
- var __jsx = React.createElement;
25
-
26
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
27
-
28
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
29
25
  var Row = forwardRefWithAs(function (_ref, forwardedRef) {
30
26
  var _ref$align = _ref.align,
31
27
  align = _ref$align === void 0 ? 'left' : _ref$align,
@@ -47,18 +43,22 @@ var Row = forwardRefWithAs(function (_ref, forwardedRef) {
47
43
 
48
44
 
49
45
  if (!dividers) {
50
- return __jsx(Box, rootProps, children);
46
+ return /*#__PURE__*/jsx(Box, _objectSpread(_objectSpread({}, rootProps), {}, {
47
+ children: children
48
+ }));
51
49
  } // map over children to insert dividers
52
50
  // remove falsy values before mapping, keeps the index in sync
53
51
 
54
52
 
55
53
  var childArray = Children.toArray(children);
56
- return __jsx(Box, rootProps, childArray.map(function (child, idx) {
57
- return __jsx(Fragment, {
58
- key: child.key || idx
59
- }, dividers && idx ? __jsx(Divider, {
60
- vertical: true
61
- }) : null, child);
54
+ return /*#__PURE__*/jsx(Box, _objectSpread(_objectSpread({}, rootProps), {}, {
55
+ children: childArray.map(function (child, idx) {
56
+ return /*#__PURE__*/jsxs(Fragment, {
57
+ children: [dividers && idx ? /*#__PURE__*/jsx(Divider, {
58
+ vertical: true
59
+ }) : null, child]
60
+ }, child.key || idx);
61
+ })
62
62
  }));
63
63
  });
64
64
 
package/package.json CHANGED
@@ -1,21 +1,24 @@
1
1
  {
2
2
  "name": "@spark-web/row",
3
+ "version": "1.0.3",
3
4
  "license": "MIT",
4
- "version": "1.0.0",
5
5
  "main": "dist/spark-web-row.cjs.js",
6
6
  "module": "dist/spark-web-row.esm.js",
7
- "devDependencies": {
8
- "@types/react": "^17.0.12"
9
- },
10
7
  "dependencies": {
11
8
  "@babel/runtime": "^7.14.6",
12
9
  "@emotion/css": "^11.7.1",
13
- "@spark-web/box": "^1.0.0",
14
- "@spark-web/divider": "^1.0.0",
15
- "@spark-web/theme": "^1.0.0",
16
- "@spark-web/utils": "^1.0.0",
10
+ "@spark-web/box": "^1.0.3",
11
+ "@spark-web/divider": "^1.0.3",
12
+ "@spark-web/theme": "^2.0.2",
13
+ "@spark-web/utils": "^1.1.1"
14
+ },
15
+ "devDependencies": {
16
+ "@types/react": "^17.0.12",
17
17
  "react": "^17.0.2"
18
18
  },
19
+ "peerDependencies": {
20
+ "react": ">=17.0.2"
21
+ },
19
22
  "engines": {
20
23
  "node": ">= 14.13"
21
24
  }