@spark-web/text
Advanced tools
Comparing version 1.0.7 to 1.1.0
@@ -9,5 +9,6 @@ 'use strict'; | ||
var theme = require('@spark-web/theme'); | ||
var _objectSpread = require('@babel/runtime/helpers/objectSpread2'); | ||
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties'); | ||
var box = require('@spark-web/box'); | ||
var ts = require('@spark-web/utils/ts'); | ||
var _objectSpread = require('@babel/runtime/helpers/objectSpread2'); | ||
@@ -183,2 +184,3 @@ var TextContext = /*#__PURE__*/react.createContext(undefined); | ||
var _excluded = ["as", "children", "data", "id", "align", "baseline", "inline", "overflowStrategy", "size", "tabularNumbers", "tone", "transform", "weight"]; | ||
var Text = ts.forwardRefWithAs(function (_ref, forwardedRef) { | ||
@@ -197,3 +199,5 @@ var as = _ref.as, | ||
transform = _ref.transform, | ||
weightProp = _ref.weight; | ||
weightProp = _ref.weight, | ||
consumerProps = _objectWithoutProperties(_ref, _excluded); | ||
var overflowStyles = useOverflowStrategy(overflowStrategy); | ||
@@ -226,3 +230,3 @@ var textContext = useTextContext(); | ||
if (inline) { | ||
return /*#__PURE__*/jsxRuntime.jsx(box.Box, { | ||
return /*#__PURE__*/jsxRuntime.jsx(box.Box, _objectSpread(_objectSpread({}, consumerProps), {}, { | ||
as: as !== null && as !== void 0 ? as : 'span', | ||
@@ -234,3 +238,3 @@ data: data, | ||
children: children | ||
}); | ||
})); | ||
} // prepare block variant | ||
@@ -252,3 +256,3 @@ | ||
value: textContextValue, | ||
children: /*#__PURE__*/jsxRuntime.jsx(box.Box, { | ||
children: /*#__PURE__*/jsxRuntime.jsx(box.Box, _objectSpread(_objectSpread({}, consumerProps), {}, { | ||
as: as, | ||
@@ -260,3 +264,3 @@ data: data, | ||
children: content | ||
}) | ||
})) | ||
}); | ||
@@ -263,0 +267,0 @@ }); |
@@ -9,5 +9,6 @@ 'use strict'; | ||
var theme = require('@spark-web/theme'); | ||
var _objectSpread = require('@babel/runtime/helpers/objectSpread2'); | ||
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties'); | ||
var box = require('@spark-web/box'); | ||
var ts = require('@spark-web/utils/ts'); | ||
var _objectSpread = require('@babel/runtime/helpers/objectSpread2'); | ||
@@ -183,2 +184,3 @@ var TextContext = /*#__PURE__*/react.createContext(undefined); | ||
var _excluded = ["as", "children", "data", "id", "align", "baseline", "inline", "overflowStrategy", "size", "tabularNumbers", "tone", "transform", "weight"]; | ||
var Text = ts.forwardRefWithAs(function (_ref, forwardedRef) { | ||
@@ -197,3 +199,5 @@ var as = _ref.as, | ||
transform = _ref.transform, | ||
weightProp = _ref.weight; | ||
weightProp = _ref.weight, | ||
consumerProps = _objectWithoutProperties(_ref, _excluded); | ||
var overflowStyles = useOverflowStrategy(overflowStrategy); | ||
@@ -226,3 +230,3 @@ var textContext = useTextContext(); | ||
if (inline) { | ||
return /*#__PURE__*/jsxRuntime.jsx(box.Box, { | ||
return /*#__PURE__*/jsxRuntime.jsx(box.Box, _objectSpread(_objectSpread({}, consumerProps), {}, { | ||
as: as !== null && as !== void 0 ? as : 'span', | ||
@@ -234,3 +238,3 @@ data: data, | ||
children: children | ||
}); | ||
})); | ||
} // prepare block variant | ||
@@ -252,3 +256,3 @@ | ||
value: textContextValue, | ||
children: /*#__PURE__*/jsxRuntime.jsx(box.Box, { | ||
children: /*#__PURE__*/jsxRuntime.jsx(box.Box, _objectSpread(_objectSpread({}, consumerProps), {}, { | ||
as: as, | ||
@@ -260,3 +264,3 @@ data: data, | ||
children: content | ||
}) | ||
})) | ||
}); | ||
@@ -263,0 +267,0 @@ }); |
@@ -5,5 +5,6 @@ import { useContext, createContext, useMemo } from 'react'; | ||
import { useTheme } from '@spark-web/theme'; | ||
import _objectSpread from '@babel/runtime/helpers/esm/objectSpread2'; | ||
import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties'; | ||
import { useBackgroundLightness, Box } from '@spark-web/box'; | ||
import { forwardRefWithAs } from '@spark-web/utils/ts'; | ||
import _objectSpread from '@babel/runtime/helpers/esm/objectSpread2'; | ||
@@ -179,2 +180,3 @@ var TextContext = /*#__PURE__*/createContext(undefined); | ||
var _excluded = ["as", "children", "data", "id", "align", "baseline", "inline", "overflowStrategy", "size", "tabularNumbers", "tone", "transform", "weight"]; | ||
var Text = forwardRefWithAs(function (_ref, forwardedRef) { | ||
@@ -193,3 +195,5 @@ var as = _ref.as, | ||
transform = _ref.transform, | ||
weightProp = _ref.weight; | ||
weightProp = _ref.weight, | ||
consumerProps = _objectWithoutProperties(_ref, _excluded); | ||
var overflowStyles = useOverflowStrategy(overflowStrategy); | ||
@@ -222,3 +226,3 @@ var textContext = useTextContext(); | ||
if (inline) { | ||
return /*#__PURE__*/jsx(Box, { | ||
return /*#__PURE__*/jsx(Box, _objectSpread(_objectSpread({}, consumerProps), {}, { | ||
as: as !== null && as !== void 0 ? as : 'span', | ||
@@ -230,3 +234,3 @@ data: data, | ||
children: children | ||
}); | ||
})); | ||
} // prepare block variant | ||
@@ -248,3 +252,3 @@ | ||
value: textContextValue, | ||
children: /*#__PURE__*/jsx(Box, { | ||
children: /*#__PURE__*/jsx(Box, _objectSpread(_objectSpread({}, consumerProps), {}, { | ||
as: as, | ||
@@ -256,3 +260,3 @@ data: data, | ||
children: content | ||
}) | ||
})) | ||
}); | ||
@@ -259,0 +263,0 @@ }); |
{ | ||
"name": "@spark-web/text", | ||
"version": "1.0.7", | ||
"version": "1.1.0", | ||
"license": "MIT", | ||
@@ -13,5 +13,5 @@ "main": "dist/spark-web-text.cjs.js", | ||
"@emotion/css": "^11.9.0", | ||
"@spark-web/box": "^1.0.7", | ||
"@spark-web/theme": "^3.0.3", | ||
"@spark-web/utils": "^1.2.0" | ||
"@spark-web/box": "^1.0.8", | ||
"@spark-web/theme": "^3.0.5", | ||
"@spark-web/utils": "^1.2.1" | ||
}, | ||
@@ -18,0 +18,0 @@ "devDependencies": { |
@@ -154,2 +154,4 @@ --- | ||
Extra props are also passed into the underlying [`Box`](/package/box) component. | ||
[brighte-theme]: | ||
@@ -156,0 +158,0 @@ https://github.com/brighte-labs/spark-web/blob/e503bea4f7668d187ec7a78f99c5ed374417588b/packages/theme/src/makeTheme.ts#L158 |
38276
866
160
Updated@spark-web/box@^1.0.8
Updated@spark-web/theme@^3.0.5
Updated@spark-web/utils@^1.2.1