@daren/utils
Advanced tools
Comparing version 1.8.5 to 1.9.0
@@ -10,10 +10,8 @@ "use strict"; | ||
setState = _useState[1]; | ||
var value = propValue ? stateValue : undefined; | ||
var value = propValue != null ? propValue : stateValue; | ||
return [value, function (newValue) { | ||
setState(newValue); | ||
if (changeHandler) { | ||
changeHandler(newValue); | ||
} | ||
changeHandler == null ? void 0 : changeHandler(newValue); | ||
}]; | ||
} | ||
//# sourceMappingURL=hooks.js.map |
@@ -7,4 +7,3 @@ "use strict"; | ||
}; | ||
var _clsx = _interopRequireDefault(require("clsx")); | ||
exports.cx = _clsx["default"]; | ||
exports.cx = void 0; | ||
var _assertion = require("./assertion"); | ||
@@ -31,9 +30,2 @@ Object.keys(_assertion).forEach(function (key) { | ||
}); | ||
var _drip = require("./drip"); | ||
Object.keys(_drip).forEach(function (key) { | ||
if (key === "default" || key === "__esModule") return; | ||
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; | ||
if (key in exports && exports[key] === _drip[key]) return; | ||
exports[key] = _drip[key]; | ||
}); | ||
var _hooks = require("./hooks"); | ||
@@ -74,3 +66,4 @@ Object.keys(_hooks).forEach(function (key) { | ||
}); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
var _cx = require("./cx"); | ||
exports.cx = _cx.cx; | ||
//# sourceMappingURL=index.js.map |
import { useState } from 'react'; | ||
function useControllableState(propValue, initialValue, changeHandler) { | ||
var [stateValue, setState] = useState(initialValue); | ||
var value = propValue ? stateValue : undefined; | ||
var value = propValue != null ? propValue : stateValue; | ||
return [value, newValue => { | ||
setState(newValue); | ||
if (changeHandler) { | ||
changeHandler(newValue); | ||
} | ||
changeHandler == null ? void 0 : changeHandler(newValue); | ||
}]; | ||
@@ -11,0 +9,0 @@ } |
@@ -1,6 +0,4 @@ | ||
import cx from 'clsx'; | ||
export * from './assertion'; | ||
export * from './bionify'; | ||
export * from './date'; | ||
export * from './drip'; | ||
export * from './hooks'; | ||
@@ -11,3 +9,3 @@ export * from './misc'; | ||
export * from './walk-object'; | ||
export { cx }; | ||
export { cx } from './cx'; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@daren/utils", | ||
"version": "1.8.5", | ||
"version": "1.9.0", | ||
"repository": { | ||
@@ -40,3 +40,4 @@ "type": "git", | ||
"dependencies": { | ||
"clsx": "^1.2.1" | ||
"clsx": "^1.2.1", | ||
"tailwind-merge": "^1.8.1" | ||
}, | ||
@@ -51,3 +52,4 @@ "devDependencies": { | ||
"access": "public" | ||
} | ||
}, | ||
"gitHead": "e71bdf170fb05651469080fb51af607b2cac3eae" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
113189
3
42
729
+ Addedtailwind-merge@^1.8.1
+ Addedtailwind-merge@1.14.0(transitive)