Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@peersyst/react-utils

Package Overview
Dependencies
Maintainers
1
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@peersyst/react-utils - npm Package Compare versions

Comparing version 1.8.7 to 2.0.0

4

./@types/createSlot.d.ts

@@ -1,4 +0,4 @@

import { JSXElementConstructor, ReactNode } from "react";
export default function <S extends string = string, P = {
import { JSXElementConstructor, PropsWithChildren, ReactNode } from "react";
export default function <S extends string = string, P extends PropsWithChildren = {
children: ReactNode;
}>(slot: S, Component?: JSXElementConstructor<P>): JSXElementConstructor<P>;

@@ -7,11 +7,6 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";

import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
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; }
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; }
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
import { Component as ReactComponent } from "react";

@@ -22,11 +17,7 @@ import { jsx as _jsx } from "react/jsx-runtime";

_inherits(ClassComponent, _ReactComponent);
var _super = _createSuper(ClassComponent);
function ClassComponent() {
_classCallCheck(this, ClassComponent);
return _super.apply(this, arguments);
}
_createClass(ClassComponent, [{

@@ -38,5 +29,4 @@ key: "render",

}]);
return ClassComponent;
}(ReactComponent);
}

@@ -13,3 +13,2 @@ //MUI Color utils

var max = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
if (process.env.NODE_ENV !== "production") {

@@ -20,5 +19,5 @@ if (value < min || value > max) {

}
return Math.min(Math.max(min, value), max);
}
/**

@@ -29,4 +28,2 @@ * Converts a color from CSS hex format to CSS rgb format.

*/
export function hexToRgb(color) {

@@ -36,3 +33,2 @@ color = color.substr(1);

var colors = color.match(re);
if (colors && colors[0].length === 1) {

@@ -43,3 +39,2 @@ colors = colors.map(function (n) {

}
return colors ? "rgb".concat(colors.length === 4 ? "a" : "", "(").concat(colors.map(function (n, index) {

@@ -49,2 +44,3 @@ return index < 3 ? parseInt(n, 16) : Math.round(parseInt(n, 16) / 255 * 1000) / 1000;

}
/**

@@ -57,3 +53,2 @@ * Returns an object with the type and values of a color.

*/
export function decomposeColor(color) {

@@ -64,25 +59,18 @@ // Idempotent

}
if (color.charAt(0) === "#") {
return decomposeColor(hexToRgb(color));
}
var marker = color.indexOf("(");
var type = color.substring(0, marker);
if (["rgb", "rgba", "hsl", "hsla", "color"].indexOf(type) === -1) {
throw new Error("Unsupported `%s` color. " + color + "\n" + "The following formats are supported: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().");
}
var values = color.substring(marker + 1, color.length - 1);
var colorSpace;
if (type === "color") {
values = values.split(" ");
colorSpace = values.shift();
if (values.length === 4 && values[3].charAt(0) === "/") {
values[3] = values[3].substr(1);
}
if (!colorSpace || ["srgb", "display-p3", "a98-rgb", "prophoto-rgb", "rec-2020"].indexOf(colorSpace) === -1) {

@@ -94,3 +82,2 @@ throw new Error("MUI: unsupported `%s` color space." + colorSpace + "\n" + "The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rgb, rec-2020.");

}
values = values.map(function (value) {

@@ -105,2 +92,3 @@ return parseFloat(value);

}
/**

@@ -113,9 +101,7 @@ * Converts a color object with type and values to a string.

*/
export function recomposeColor(color) {
var type = color.type,
colorSpace = color.colorSpace,
colorValues = color.values;
colorSpace = color.colorSpace,
colorValues = color.values;
var values = [];
if (type.indexOf("rgb") !== -1) {

@@ -130,3 +116,2 @@ // Only convert the first 3 values to int (i.e. not alpha)

}
if (type.indexOf("color") !== -1) {

@@ -137,5 +122,5 @@ values = "".concat(colorSpace, " ").concat(values.join(" "));

}
return "".concat(type, "(").concat(values, ")");
}
/**

@@ -148,11 +133,8 @@ * Sets the absolute transparency of a color.

*/
export function alpha(color, value) {
color = decomposeColor(color);
value = clamp(value);
if (color.type === "rgb" || color.type === "hsl") {
color.type += "a";
}
if (color.type === "color") {

@@ -163,5 +145,5 @@ color.values[3] = "/".concat(value);

}
return recomposeColor(color);
}
/**

@@ -172,7 +154,6 @@ * Converts a color from hsl format to rgb format.

*/
export function hslToRgb(color) {
color = decomposeColor(color);
var _color = color,
values = _color.values;
values = _color.values;
var h = values[0];

@@ -182,3 +163,2 @@ var s = values[1] / 100;

var a = s * Math.min(l, 1 - l);
var f = function f(n) {

@@ -188,6 +168,4 @@ var k = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (n + h / 30) % 12;

};
var type = "rgb";
var rgb = [Math.round(f(0) * 255), Math.round(f(8) * 255), Math.round(f(4) * 255)];
if (color.type === "hsla") {

@@ -197,3 +175,2 @@ type += "a";

}
return recomposeColor({

@@ -204,2 +181,3 @@ type: type,

}
/**

@@ -213,3 +191,2 @@ * The relative brightness of any point in a color space,

*/
export function getLuminance(color) {

@@ -224,6 +201,8 @@ color = decomposeColor(color);

return val <= 0.03928 ? val / 12.92 : Math.pow((val + 0.055) / 1.055, 2.4);
}); // Truncate at 3 digits
});
// Truncate at 3 digits
return Number((0.2126 * rgb[0] + 0.7152 * rgb[1] + 0.0722 * rgb[2]).toFixed(3));
}
/**

@@ -235,7 +214,5 @@ * Darkens a color.

*/
export function darken(color, coefficient) {
color = decomposeColor(color);
coefficient = clamp(coefficient);
if (color.type.indexOf("hsl") !== -1) {

@@ -248,5 +225,5 @@ color.values[2] *= 1 - coefficient;

}
return recomposeColor(color);
}
/**

@@ -258,7 +235,5 @@ * Lightens a color.

*/
export function lighten(color, coefficient) {
color = decomposeColor(color);
coefficient = clamp(coefficient);
if (color.type.indexOf("hsl") !== -1) {

@@ -275,5 +250,5 @@ color.values[2] += (100 - color.values[2]) * coefficient;

}
return recomposeColor(color);
}
/**

@@ -286,3 +261,2 @@ * Darken or lighten a color, depending on its luminance.

*/
export function emphasize(color) {

@@ -292,2 +266,3 @@ var coefficient = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.15;

}
/**

@@ -300,3 +275,2 @@ * Darken or lighten a color, depending on its luminance.

*/
export function deemphasize(color) {

@@ -303,0 +277,0 @@ var coefficient = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.15;

import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
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; }
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; }
import { Fragment } from "react";

@@ -13,7 +10,5 @@ import { jsx as _jsx } from "react/jsx-runtime";

};
var Slot = function Slot(props) {
return /*#__PURE__*/_jsx(Component, _objectSpread({}, props));
};
Object.defineProperty(Slot, "name", {

@@ -20,0 +15,0 @@ value: slot,

@@ -9,3 +9,2 @@ /**

}
return classes.filter(function (c) {

@@ -12,0 +11,0 @@ return c && c !== "";

export default function debounce(func) {
var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 166;
var timeout;
function debounced() {

@@ -9,3 +8,2 @@ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {

}
var later = function later() {

@@ -15,12 +13,9 @@ // eslint-disable-next-line prefer-spread

};
clearTimeout(timeout);
timeout = setTimeout(later, wait);
}
debounced.clear = function () {
clearTimeout(timeout);
};
return debounced;
}
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
import _typeof from "@babel/runtime/helpers/esm/typeof";
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; }
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; }
export function isPlainObject(item) {

@@ -16,3 +13,2 @@ return item !== null && _typeof(item) === "object" && (item == null ? void 0 : item.constructor) === Object;

var output = options.clone ? _objectSpread({}, target) : target;
if (isPlainObject(target) && isPlainObject(source)) {

@@ -24,3 +20,2 @@ Object.keys(source).forEach(function (key) {

}
if (isPlainObject(source[key]) && key in target && isPlainObject(target[key])) {

@@ -34,4 +29,3 @@ // Since `output` is a clone of `target` and we have narrowed `target` in this block we can cast to the same type.

}
return output;
}
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
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; }
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; }
import { Children, isValidElement } from "react";
import { Children, isValidElement } from "react";
/**

@@ -14,3 +12,2 @@ * Extracts all slots from children and other remaining children

*/
export default function extractSlots(children) {

@@ -23,9 +20,7 @@ var slots = {};

var childType = elementChild.type;
if (childType == Symbol["for"]("react.fragment")) {
var _extractSlots = extractSlots(child.props.children),
_extractSlots2 = _slicedToArray(_extractSlots, 2),
fragmentSlots = _extractSlots2[0],
fragmentRemainingChildren = _extractSlots2[1];
_extractSlots2 = _slicedToArray(_extractSlots, 2),
fragmentSlots = _extractSlots2[0],
fragmentRemainingChildren = _extractSlots2[1];
slots = _objectSpread(_objectSpread({}, slots), fragmentSlots);

@@ -32,0 +27,0 @@ remainingChildren = [].concat(_toConsumableArray(remainingChildren), [fragmentRemainingChildren]);

import { Children } from "react";
/**

@@ -7,3 +8,2 @@ * Deprecated

*/
export default function findSlot(children, type) {

@@ -10,0 +10,0 @@ return Children.toArray(children).find(function (child) {

import _toArray from "@babel/runtime/helpers/esm/toArray";
export default function (obj, key) {
var _key$split = key.split("."),
_key$split2 = _toArray(_key$split),
firstKey = _key$split2[0],
restKeys = _key$split2.slice(1); // @ts-ignore
_key$split2 = _toArray(_key$split),
firstKey = _key$split2[0],
restKeys = _key$split2.slice(1);
// @ts-ignore
return restKeys.reduce(function (prev, curr) {

@@ -10,0 +10,0 @@ return prev[curr];

@@ -8,3 +8,2 @@ import { Children, isValidElement } from "react";

var childType = elementChild.type;
if (typeof childType === "function" && "name" in childType) {

@@ -11,0 +10,0 @@ slots[childType.name] = elementChild;

import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
export default function (n, d) {
var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
_ref$fill = _ref.fill,
fill = _ref$fill === void 0 ? "left" : _ref$fill;
_ref$fill = _ref.fill,
fill = _ref$fill === void 0 ? "left" : _ref$fill;
var num = n.toString();

@@ -8,0 +7,0 @@ var dif = d - num.length;

@@ -5,16 +5,12 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";

var _excluded = ["children"];
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
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; }
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; }
import extractSlots from "./extractSlots";
import createSlot from "./createSlot"; //eslint-disable-next-line @typescript-eslint/ban-types
import createSlot from "./createSlot";
//eslint-disable-next-line @typescript-eslint/ban-types
/**

@@ -32,13 +28,11 @@ * Utility that creates racks and its slots.

var extensions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
var RackComponent = function RackComponent(_ref) {
var children = _ref.children,
rest = _objectWithoutProperties(_ref, _excluded);
rest = _objectWithoutProperties(_ref, _excluded);
var _extractSlots = extractSlots(children),
_extractSlots2 = _slicedToArray(_extractSlots, 2),
slots = _extractSlots2[0],
remainingChildren = _extractSlots2[1]; // @ts-ignore
_extractSlots2 = _slicedToArray(_extractSlots, 2),
slots = _extractSlots2[0],
remainingChildren = _extractSlots2[1];
// @ts-ignore
return factory(_objectSpread({

@@ -48,10 +42,7 @@ children: remainingChildren

};
var Rack = RackComponent;
for (var _i = 0, _Object$entries = Object.entries(extensions); _i < _Object$entries.length; _i++) {
var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
name = _Object$entries$_i[0],
element = _Object$entries$_i[1];
name = _Object$entries$_i[0],
element = _Object$entries$_i[1];
//console.log(name, element);

@@ -63,6 +54,4 @@ Object.defineProperty(Rack, name, {

}
var _iterator = _createForOfIteratorHelper(slots),
_step;
_step;
try {

@@ -81,4 +70,3 @@ for (_iterator.s(); !(_step = _iterator.n()).done;) {

}
return Rack;
}

@@ -7,11 +7,6 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";

import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
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; }
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; }
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
import { Component as ReactComponent } from "react";

@@ -22,11 +17,7 @@ import { jsx as _jsx } from "react/jsx-runtime";

_inherits(ClassComponent, _ReactComponent);
var _super = _createSuper(ClassComponent);
function ClassComponent() {
_classCallCheck(this, ClassComponent);
return _super.apply(this, arguments);
}
_createClass(ClassComponent, [{

@@ -38,5 +29,4 @@ key: "render",

}]);
return ClassComponent;
}(ReactComponent);
}

@@ -13,3 +13,2 @@ //MUI Color utils

var max = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
if (process.env.NODE_ENV !== "production") {

@@ -20,5 +19,5 @@ if (value < min || value > max) {

}
return Math.min(Math.max(min, value), max);
}
/**

@@ -29,4 +28,2 @@ * Converts a color from CSS hex format to CSS rgb format.

*/
export function hexToRgb(color) {

@@ -36,3 +33,2 @@ color = color.substr(1);

var colors = color.match(re);
if (colors && colors[0].length === 1) {

@@ -43,3 +39,2 @@ colors = colors.map(function (n) {

}
return colors ? "rgb".concat(colors.length === 4 ? "a" : "", "(").concat(colors.map(function (n, index) {

@@ -49,2 +44,3 @@ return index < 3 ? parseInt(n, 16) : Math.round(parseInt(n, 16) / 255 * 1000) / 1000;

}
/**

@@ -57,3 +53,2 @@ * Returns an object with the type and values of a color.

*/
export function decomposeColor(color) {

@@ -64,25 +59,18 @@ // Idempotent

}
if (color.charAt(0) === "#") {
return decomposeColor(hexToRgb(color));
}
var marker = color.indexOf("(");
var type = color.substring(0, marker);
if (["rgb", "rgba", "hsl", "hsla", "color"].indexOf(type) === -1) {
throw new Error("Unsupported `%s` color. " + color + "\n" + "The following formats are supported: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().");
}
var values = color.substring(marker + 1, color.length - 1);
var colorSpace;
if (type === "color") {
values = values.split(" ");
colorSpace = values.shift();
if (values.length === 4 && values[3].charAt(0) === "/") {
values[3] = values[3].substr(1);
}
if (!colorSpace || ["srgb", "display-p3", "a98-rgb", "prophoto-rgb", "rec-2020"].indexOf(colorSpace) === -1) {

@@ -94,3 +82,2 @@ throw new Error("MUI: unsupported `%s` color space." + colorSpace + "\n" + "The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rgb, rec-2020.");

}
values = values.map(function (value) {

@@ -105,2 +92,3 @@ return parseFloat(value);

}
/**

@@ -113,9 +101,7 @@ * Converts a color object with type and values to a string.

*/
export function recomposeColor(color) {
var type = color.type,
colorSpace = color.colorSpace,
colorValues = color.values;
colorSpace = color.colorSpace,
colorValues = color.values;
var values = [];
if (type.indexOf("rgb") !== -1) {

@@ -130,3 +116,2 @@ // Only convert the first 3 values to int (i.e. not alpha)

}
if (type.indexOf("color") !== -1) {

@@ -137,5 +122,5 @@ values = "".concat(colorSpace, " ").concat(values.join(" "));

}
return "".concat(type, "(").concat(values, ")");
}
/**

@@ -148,11 +133,8 @@ * Sets the absolute transparency of a color.

*/
export function alpha(color, value) {
color = decomposeColor(color);
value = clamp(value);
if (color.type === "rgb" || color.type === "hsl") {
color.type += "a";
}
if (color.type === "color") {

@@ -163,5 +145,5 @@ color.values[3] = "/".concat(value);

}
return recomposeColor(color);
}
/**

@@ -172,7 +154,6 @@ * Converts a color from hsl format to rgb format.

*/
export function hslToRgb(color) {
color = decomposeColor(color);
var _color = color,
values = _color.values;
values = _color.values;
var h = values[0];

@@ -182,3 +163,2 @@ var s = values[1] / 100;

var a = s * Math.min(l, 1 - l);
var f = function f(n) {

@@ -188,6 +168,4 @@ var k = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (n + h / 30) % 12;

};
var type = "rgb";
var rgb = [Math.round(f(0) * 255), Math.round(f(8) * 255), Math.round(f(4) * 255)];
if (color.type === "hsla") {

@@ -197,3 +175,2 @@ type += "a";

}
return recomposeColor({

@@ -204,2 +181,3 @@ type: type,

}
/**

@@ -213,3 +191,2 @@ * The relative brightness of any point in a color space,

*/
export function getLuminance(color) {

@@ -224,6 +201,8 @@ color = decomposeColor(color);

return val <= 0.03928 ? val / 12.92 : Math.pow((val + 0.055) / 1.055, 2.4);
}); // Truncate at 3 digits
});
// Truncate at 3 digits
return Number((0.2126 * rgb[0] + 0.7152 * rgb[1] + 0.0722 * rgb[2]).toFixed(3));
}
/**

@@ -235,7 +214,5 @@ * Darkens a color.

*/
export function darken(color, coefficient) {
color = decomposeColor(color);
coefficient = clamp(coefficient);
if (color.type.indexOf("hsl") !== -1) {

@@ -248,5 +225,5 @@ color.values[2] *= 1 - coefficient;

}
return recomposeColor(color);
}
/**

@@ -258,7 +235,5 @@ * Lightens a color.

*/
export function lighten(color, coefficient) {
color = decomposeColor(color);
coefficient = clamp(coefficient);
if (color.type.indexOf("hsl") !== -1) {

@@ -275,5 +250,5 @@ color.values[2] += (100 - color.values[2]) * coefficient;

}
return recomposeColor(color);
}
/**

@@ -286,3 +261,2 @@ * Darken or lighten a color, depending on its luminance.

*/
export function emphasize(color) {

@@ -292,2 +266,3 @@ var coefficient = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.15;

}
/**

@@ -300,3 +275,2 @@ * Darken or lighten a color, depending on its luminance.

*/
export function deemphasize(color) {

@@ -303,0 +277,0 @@ var coefficient = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.15;

import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
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; }
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; }
import { Fragment } from "react";

@@ -13,7 +10,5 @@ import { jsx as _jsx } from "react/jsx-runtime";

};
var Slot = function Slot(props) {
return /*#__PURE__*/_jsx(Component, _objectSpread({}, props));
};
Object.defineProperty(Slot, "name", {

@@ -20,0 +15,0 @@ value: slot,

@@ -9,3 +9,2 @@ /**

}
return classes.filter(function (c) {

@@ -12,0 +11,0 @@ return c && c !== "";

export default function debounce(func) {
var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 166;
var timeout;
function debounced() {

@@ -9,3 +8,2 @@ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {

}
var later = function later() {

@@ -15,12 +13,9 @@ // eslint-disable-next-line prefer-spread

};
clearTimeout(timeout);
timeout = setTimeout(later, wait);
}
debounced.clear = function () {
clearTimeout(timeout);
};
return debounced;
}
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
import _typeof from "@babel/runtime/helpers/esm/typeof";
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; }
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; }
export function isPlainObject(item) {

@@ -16,3 +13,2 @@ return item !== null && _typeof(item) === "object" && (item == null ? void 0 : item.constructor) === Object;

var output = options.clone ? _objectSpread({}, target) : target;
if (isPlainObject(target) && isPlainObject(source)) {

@@ -24,3 +20,2 @@ Object.keys(source).forEach(function (key) {

}
if (isPlainObject(source[key]) && key in target && isPlainObject(target[key])) {

@@ -34,4 +29,3 @@ // Since `output` is a clone of `target` and we have narrowed `target` in this block we can cast to the same type.

}
return output;
}
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
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; }
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; }
import { Children, isValidElement } from "react";
import { Children, isValidElement } from "react";
/**

@@ -14,3 +12,2 @@ * Extracts all slots from children and other remaining children

*/
export default function extractSlots(children) {

@@ -23,9 +20,7 @@ var slots = {};

var childType = elementChild.type;
if (childType == Symbol["for"]("react.fragment")) {
var _extractSlots = extractSlots(child.props.children),
_extractSlots2 = _slicedToArray(_extractSlots, 2),
fragmentSlots = _extractSlots2[0],
fragmentRemainingChildren = _extractSlots2[1];
_extractSlots2 = _slicedToArray(_extractSlots, 2),
fragmentSlots = _extractSlots2[0],
fragmentRemainingChildren = _extractSlots2[1];
slots = _objectSpread(_objectSpread({}, slots), fragmentSlots);

@@ -32,0 +27,0 @@ remainingChildren = [].concat(_toConsumableArray(remainingChildren), [fragmentRemainingChildren]);

import { Children } from "react";
/**

@@ -7,3 +8,2 @@ * Deprecated

*/
export default function findSlot(children, type) {

@@ -10,0 +10,0 @@ return Children.toArray(children).find(function (child) {

import _toArray from "@babel/runtime/helpers/esm/toArray";
export default function (obj, key) {
var _key$split = key.split("."),
_key$split2 = _toArray(_key$split),
firstKey = _key$split2[0],
restKeys = _key$split2.slice(1); // @ts-ignore
_key$split2 = _toArray(_key$split),
firstKey = _key$split2[0],
restKeys = _key$split2.slice(1);
// @ts-ignore
return restKeys.reduce(function (prev, curr) {

@@ -10,0 +10,0 @@ return prev[curr];

@@ -8,3 +8,2 @@ import { Children, isValidElement } from "react";

var childType = elementChild.type;
if (typeof childType === "function" && "name" in childType) {

@@ -11,0 +10,0 @@ slots[childType.name] = elementChild;

import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
export default function (n, d) {
var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
_ref$fill = _ref.fill,
fill = _ref$fill === void 0 ? "left" : _ref$fill;
_ref$fill = _ref.fill,
fill = _ref$fill === void 0 ? "left" : _ref$fill;
var num = n.toString();

@@ -8,0 +7,0 @@ var dif = d - num.length;

@@ -5,16 +5,12 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";

var _excluded = ["children"];
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
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; }
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; }
import extractSlots from "./extractSlots";
import createSlot from "./createSlot"; //eslint-disable-next-line @typescript-eslint/ban-types
import createSlot from "./createSlot";
//eslint-disable-next-line @typescript-eslint/ban-types
/**

@@ -32,13 +28,11 @@ * Utility that creates racks and its slots.

var extensions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
var RackComponent = function RackComponent(_ref) {
var children = _ref.children,
rest = _objectWithoutProperties(_ref, _excluded);
rest = _objectWithoutProperties(_ref, _excluded);
var _extractSlots = extractSlots(children),
_extractSlots2 = _slicedToArray(_extractSlots, 2),
slots = _extractSlots2[0],
remainingChildren = _extractSlots2[1]; // @ts-ignore
_extractSlots2 = _slicedToArray(_extractSlots, 2),
slots = _extractSlots2[0],
remainingChildren = _extractSlots2[1];
// @ts-ignore
return factory(_objectSpread({

@@ -48,10 +42,7 @@ children: remainingChildren

};
var Rack = RackComponent;
for (var _i = 0, _Object$entries = Object.entries(extensions); _i < _Object$entries.length; _i++) {
var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
name = _Object$entries$_i[0],
element = _Object$entries$_i[1];
name = _Object$entries$_i[0],
element = _Object$entries$_i[1];
//console.log(name, element);

@@ -63,6 +54,4 @@ Object.defineProperty(Rack, name, {

}
var _iterator = _createForOfIteratorHelper(slots),
_step;
_step;
try {

@@ -81,4 +70,3 @@ for (_iterator.s(); !(_step = _iterator.n()).done;) {

}
return Rack;
}

@@ -7,11 +7,6 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";

import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
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; }
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; }
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
import { Component as ReactComponent } from "react";

@@ -22,11 +17,7 @@ import { jsx as _jsx } from "react/jsx-runtime";

_inherits(ClassComponent, _ReactComponent);
var _super = _createSuper(ClassComponent);
function ClassComponent() {
_classCallCheck(this, ClassComponent);
return _super.apply(this, arguments);
}
_createClass(ClassComponent, [{

@@ -38,5 +29,4 @@ key: "render",

}]);
return ClassComponent;
}(ReactComponent);
}

@@ -13,3 +13,2 @@ //MUI Color utils

var max = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
if (process.env.NODE_ENV !== "production") {

@@ -20,5 +19,5 @@ if (value < min || value > max) {

}
return Math.min(Math.max(min, value), max);
}
/**

@@ -29,4 +28,2 @@ * Converts a color from CSS hex format to CSS rgb format.

*/
export function hexToRgb(color) {

@@ -36,3 +33,2 @@ color = color.substr(1);

var colors = color.match(re);
if (colors && colors[0].length === 1) {

@@ -43,3 +39,2 @@ colors = colors.map(function (n) {

}
return colors ? "rgb".concat(colors.length === 4 ? "a" : "", "(").concat(colors.map(function (n, index) {

@@ -49,2 +44,3 @@ return index < 3 ? parseInt(n, 16) : Math.round(parseInt(n, 16) / 255 * 1000) / 1000;

}
/**

@@ -57,3 +53,2 @@ * Returns an object with the type and values of a color.

*/
export function decomposeColor(color) {

@@ -64,25 +59,18 @@ // Idempotent

}
if (color.charAt(0) === "#") {
return decomposeColor(hexToRgb(color));
}
var marker = color.indexOf("(");
var type = color.substring(0, marker);
if (["rgb", "rgba", "hsl", "hsla", "color"].indexOf(type) === -1) {
throw new Error("Unsupported `%s` color. " + color + "\n" + "The following formats are supported: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().");
}
var values = color.substring(marker + 1, color.length - 1);
var colorSpace;
if (type === "color") {
values = values.split(" ");
colorSpace = values.shift();
if (values.length === 4 && values[3].charAt(0) === "/") {
values[3] = values[3].substr(1);
}
if (!colorSpace || ["srgb", "display-p3", "a98-rgb", "prophoto-rgb", "rec-2020"].indexOf(colorSpace) === -1) {

@@ -94,3 +82,2 @@ throw new Error("MUI: unsupported `%s` color space." + colorSpace + "\n" + "The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rgb, rec-2020.");

}
values = values.map(function (value) {

@@ -105,2 +92,3 @@ return parseFloat(value);

}
/**

@@ -113,9 +101,7 @@ * Converts a color object with type and values to a string.

*/
export function recomposeColor(color) {
var type = color.type,
colorSpace = color.colorSpace,
colorValues = color.values;
colorSpace = color.colorSpace,
colorValues = color.values;
var values = [];
if (type.indexOf("rgb") !== -1) {

@@ -130,3 +116,2 @@ // Only convert the first 3 values to int (i.e. not alpha)

}
if (type.indexOf("color") !== -1) {

@@ -137,5 +122,5 @@ values = "".concat(colorSpace, " ").concat(values.join(" "));

}
return "".concat(type, "(").concat(values, ")");
}
/**

@@ -148,11 +133,8 @@ * Sets the absolute transparency of a color.

*/
export function alpha(color, value) {
color = decomposeColor(color);
value = clamp(value);
if (color.type === "rgb" || color.type === "hsl") {
color.type += "a";
}
if (color.type === "color") {

@@ -163,5 +145,5 @@ color.values[3] = "/".concat(value);

}
return recomposeColor(color);
}
/**

@@ -172,7 +154,6 @@ * Converts a color from hsl format to rgb format.

*/
export function hslToRgb(color) {
color = decomposeColor(color);
var _color = color,
values = _color.values;
values = _color.values;
var h = values[0];

@@ -182,3 +163,2 @@ var s = values[1] / 100;

var a = s * Math.min(l, 1 - l);
var f = function f(n) {

@@ -188,6 +168,4 @@ var k = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (n + h / 30) % 12;

};
var type = "rgb";
var rgb = [Math.round(f(0) * 255), Math.round(f(8) * 255), Math.round(f(4) * 255)];
if (color.type === "hsla") {

@@ -197,3 +175,2 @@ type += "a";

}
return recomposeColor({

@@ -204,2 +181,3 @@ type: type,

}
/**

@@ -213,3 +191,2 @@ * The relative brightness of any point in a color space,

*/
export function getLuminance(color) {

@@ -224,6 +201,8 @@ color = decomposeColor(color);

return val <= 0.03928 ? val / 12.92 : Math.pow((val + 0.055) / 1.055, 2.4);
}); // Truncate at 3 digits
});
// Truncate at 3 digits
return Number((0.2126 * rgb[0] + 0.7152 * rgb[1] + 0.0722 * rgb[2]).toFixed(3));
}
/**

@@ -235,7 +214,5 @@ * Darkens a color.

*/
export function darken(color, coefficient) {
color = decomposeColor(color);
coefficient = clamp(coefficient);
if (color.type.indexOf("hsl") !== -1) {

@@ -248,5 +225,5 @@ color.values[2] *= 1 - coefficient;

}
return recomposeColor(color);
}
/**

@@ -258,7 +235,5 @@ * Lightens a color.

*/
export function lighten(color, coefficient) {
color = decomposeColor(color);
coefficient = clamp(coefficient);
if (color.type.indexOf("hsl") !== -1) {

@@ -275,5 +250,5 @@ color.values[2] += (100 - color.values[2]) * coefficient;

}
return recomposeColor(color);
}
/**

@@ -286,3 +261,2 @@ * Darken or lighten a color, depending on its luminance.

*/
export function emphasize(color) {

@@ -292,2 +266,3 @@ var coefficient = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.15;

}
/**

@@ -300,3 +275,2 @@ * Darken or lighten a color, depending on its luminance.

*/
export function deemphasize(color) {

@@ -303,0 +277,0 @@ var coefficient = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.15;

import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
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; }
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; }
import { Fragment } from "react";

@@ -13,7 +10,5 @@ import { jsx as _jsx } from "react/jsx-runtime";

};
var Slot = function Slot(props) {
return /*#__PURE__*/_jsx(Component, _objectSpread({}, props));
};
Object.defineProperty(Slot, "name", {

@@ -20,0 +15,0 @@ value: slot,

@@ -9,3 +9,2 @@ /**

}
return classes.filter(function (c) {

@@ -12,0 +11,0 @@ return c && c !== "";

export default function debounce(func) {
var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 166;
var timeout;
function debounced() {

@@ -9,3 +8,2 @@ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {

}
var later = function later() {

@@ -15,12 +13,9 @@ // eslint-disable-next-line prefer-spread

};
clearTimeout(timeout);
timeout = setTimeout(later, wait);
}
debounced.clear = function () {
clearTimeout(timeout);
};
return debounced;
}
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
import _typeof from "@babel/runtime/helpers/esm/typeof";
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; }
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; }
export function isPlainObject(item) {

@@ -16,3 +13,2 @@ return item !== null && _typeof(item) === "object" && (item == null ? void 0 : item.constructor) === Object;

var output = options.clone ? _objectSpread({}, target) : target;
if (isPlainObject(target) && isPlainObject(source)) {

@@ -24,3 +20,2 @@ Object.keys(source).forEach(function (key) {

}
if (isPlainObject(source[key]) && key in target && isPlainObject(target[key])) {

@@ -34,4 +29,3 @@ // Since `output` is a clone of `target` and we have narrowed `target` in this block we can cast to the same type.

}
return output;
}
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
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; }
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; }
import { Children, isValidElement } from "react";
import { Children, isValidElement } from "react";
/**

@@ -14,3 +12,2 @@ * Extracts all slots from children and other remaining children

*/
export default function extractSlots(children) {

@@ -23,9 +20,7 @@ var slots = {};

var childType = elementChild.type;
if (childType == Symbol["for"]("react.fragment")) {
var _extractSlots = extractSlots(child.props.children),
_extractSlots2 = _slicedToArray(_extractSlots, 2),
fragmentSlots = _extractSlots2[0],
fragmentRemainingChildren = _extractSlots2[1];
_extractSlots2 = _slicedToArray(_extractSlots, 2),
fragmentSlots = _extractSlots2[0],
fragmentRemainingChildren = _extractSlots2[1];
slots = _objectSpread(_objectSpread({}, slots), fragmentSlots);

@@ -32,0 +27,0 @@ remainingChildren = [].concat(_toConsumableArray(remainingChildren), [fragmentRemainingChildren]);

import { Children } from "react";
/**

@@ -7,3 +8,2 @@ * Deprecated

*/
export default function findSlot(children, type) {

@@ -10,0 +10,0 @@ return Children.toArray(children).find(function (child) {

import _toArray from "@babel/runtime/helpers/esm/toArray";
export default function (obj, key) {
var _key$split = key.split("."),
_key$split2 = _toArray(_key$split),
firstKey = _key$split2[0],
restKeys = _key$split2.slice(1); // @ts-ignore
_key$split2 = _toArray(_key$split),
firstKey = _key$split2[0],
restKeys = _key$split2.slice(1);
// @ts-ignore
return restKeys.reduce(function (prev, curr) {

@@ -10,0 +10,0 @@ return prev[curr];

@@ -8,3 +8,2 @@ import { Children, isValidElement } from "react";

var childType = elementChild.type;
if (typeof childType === "function" && "name" in childType) {

@@ -11,0 +10,0 @@ slots[childType.name] = elementChild;

import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
export default function (n, d) {
var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
_ref$fill = _ref.fill,
fill = _ref$fill === void 0 ? "left" : _ref$fill;
_ref$fill = _ref.fill,
fill = _ref$fill === void 0 ? "left" : _ref$fill;
var num = n.toString();

@@ -8,0 +7,0 @@ var dif = d - num.length;

@@ -5,16 +5,12 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";

var _excluded = ["children"];
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
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; }
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; }
import extractSlots from "./extractSlots";
import createSlot from "./createSlot"; //eslint-disable-next-line @typescript-eslint/ban-types
import createSlot from "./createSlot";
//eslint-disable-next-line @typescript-eslint/ban-types
/**

@@ -32,13 +28,11 @@ * Utility that creates racks and its slots.

var extensions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
var RackComponent = function RackComponent(_ref) {
var children = _ref.children,
rest = _objectWithoutProperties(_ref, _excluded);
rest = _objectWithoutProperties(_ref, _excluded);
var _extractSlots = extractSlots(children),
_extractSlots2 = _slicedToArray(_extractSlots, 2),
slots = _extractSlots2[0],
remainingChildren = _extractSlots2[1]; // @ts-ignore
_extractSlots2 = _slicedToArray(_extractSlots, 2),
slots = _extractSlots2[0],
remainingChildren = _extractSlots2[1];
// @ts-ignore
return factory(_objectSpread({

@@ -48,10 +42,7 @@ children: remainingChildren

};
var Rack = RackComponent;
for (var _i = 0, _Object$entries = Object.entries(extensions); _i < _Object$entries.length; _i++) {
var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
name = _Object$entries$_i[0],
element = _Object$entries$_i[1];
name = _Object$entries$_i[0],
element = _Object$entries$_i[1];
//console.log(name, element);

@@ -63,6 +54,4 @@ Object.defineProperty(Rack, name, {

}
var _iterator = _createForOfIteratorHelper(slots),
_step;
_step;
try {

@@ -81,4 +70,3 @@ for (_iterator.s(); !(_step = _iterator.n()).done;) {

}
return Rack;
}

@@ -7,5 +7,4 @@ "use strict";

exports["default"] = capitalize;
function capitalize(word) {
return word.charAt(0).toUpperCase() + word.slice(1);
}
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {

@@ -9,33 +8,18 @@ value: true

exports["default"] = classify;
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
var _react = require("react");
var _jsxRuntime = require("react/jsx-runtime");
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; }
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) { (0, _defineProperty2["default"])(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; }
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
function classify(Component) {
return /*#__PURE__*/function (_ReactComponent) {
(0, _inherits2["default"])(ClassComponent, _ReactComponent);
var _super = _createSuper(ClassComponent);
function ClassComponent() {

@@ -45,3 +29,2 @@ (0, _classCallCheck2["default"])(this, ClassComponent);

}
(0, _createClass2["default"])(ClassComponent, [{

@@ -48,0 +31,0 @@ key: "render",

@@ -54,3 +54,2 @@ "use strict";

});
var _validateColor = require("validate-color");

@@ -16,3 +16,2 @@ "use strict";

exports.recomposeColor = recomposeColor;
//MUI Color utils

@@ -30,3 +29,2 @@

var max = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
if (process.env.NODE_ENV !== "production") {

@@ -37,5 +35,5 @@ if (value < min || value > max) {

}
return Math.min(Math.max(min, value), max);
}
/**

@@ -46,4 +44,2 @@ * Converts a color from CSS hex format to CSS rgb format.

*/
function hexToRgb(color) {

@@ -53,3 +49,2 @@ color = color.substr(1);

var colors = color.match(re);
if (colors && colors[0].length === 1) {

@@ -60,3 +55,2 @@ colors = colors.map(function (n) {

}
return colors ? "rgb".concat(colors.length === 4 ? "a" : "", "(").concat(colors.map(function (n, index) {

@@ -66,2 +60,3 @@ return index < 3 ? parseInt(n, 16) : Math.round(parseInt(n, 16) / 255 * 1000) / 1000;

}
/**

@@ -74,4 +69,2 @@ * Returns an object with the type and values of a color.

*/
function decomposeColor(color) {

@@ -82,25 +75,18 @@ // Idempotent

}
if (color.charAt(0) === "#") {
return decomposeColor(hexToRgb(color));
}
var marker = color.indexOf("(");
var type = color.substring(0, marker);
if (["rgb", "rgba", "hsl", "hsla", "color"].indexOf(type) === -1) {
throw new Error("Unsupported `%s` color. " + color + "\n" + "The following formats are supported: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().");
}
var values = color.substring(marker + 1, color.length - 1);
var colorSpace;
if (type === "color") {
values = values.split(" ");
colorSpace = values.shift();
if (values.length === 4 && values[3].charAt(0) === "/") {
values[3] = values[3].substr(1);
}
if (!colorSpace || ["srgb", "display-p3", "a98-rgb", "prophoto-rgb", "rec-2020"].indexOf(colorSpace) === -1) {

@@ -112,3 +98,2 @@ throw new Error("MUI: unsupported `%s` color space." + colorSpace + "\n" + "The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rgb, rec-2020.");

}
values = values.map(function (value) {

@@ -123,2 +108,3 @@ return parseFloat(value);

}
/**

@@ -131,10 +117,7 @@ * Converts a color object with type and values to a string.

*/
function recomposeColor(color) {
var type = color.type,
colorSpace = color.colorSpace,
colorValues = color.values;
colorSpace = color.colorSpace,
colorValues = color.values;
var values = [];
if (type.indexOf("rgb") !== -1) {

@@ -149,3 +132,2 @@ // Only convert the first 3 values to int (i.e. not alpha)

}
if (type.indexOf("color") !== -1) {

@@ -156,5 +138,5 @@ values = "".concat(colorSpace, " ").concat(values.join(" "));

}
return "".concat(type, "(").concat(values, ")");
}
/**

@@ -167,12 +149,8 @@ * Sets the absolute transparency of a color.

*/
function alpha(color, value) {
color = decomposeColor(color);
value = clamp(value);
if (color.type === "rgb" || color.type === "hsl") {
color.type += "a";
}
if (color.type === "color") {

@@ -183,5 +161,5 @@ color.values[3] = "/".concat(value);

}
return recomposeColor(color);
}
/**

@@ -192,8 +170,6 @@ * Converts a color from hsl format to rgb format.

*/
function hslToRgb(color) {
color = decomposeColor(color);
var _color = color,
values = _color.values;
values = _color.values;
var h = values[0];

@@ -203,3 +179,2 @@ var s = values[1] / 100;

var a = s * Math.min(l, 1 - l);
var f = function f(n) {

@@ -209,6 +184,4 @@ var k = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (n + h / 30) % 12;

};
var type = "rgb";
var rgb = [Math.round(f(0) * 255), Math.round(f(8) * 255), Math.round(f(4) * 255)];
if (color.type === "hsla") {

@@ -218,3 +191,2 @@ type += "a";

}
return recomposeColor({

@@ -225,2 +197,3 @@ type: type,

}
/**

@@ -234,4 +207,2 @@ * The relative brightness of any point in a color space,

*/
function getLuminance(color) {

@@ -246,6 +217,8 @@ color = decomposeColor(color);

return val <= 0.03928 ? val / 12.92 : Math.pow((val + 0.055) / 1.055, 2.4);
}); // Truncate at 3 digits
});
// Truncate at 3 digits
return Number((0.2126 * rgb[0] + 0.7152 * rgb[1] + 0.0722 * rgb[2]).toFixed(3));
}
/**

@@ -257,8 +230,5 @@ * Darkens a color.

*/
function darken(color, coefficient) {
color = decomposeColor(color);
coefficient = clamp(coefficient);
if (color.type.indexOf("hsl") !== -1) {

@@ -271,5 +241,5 @@ color.values[2] *= 1 - coefficient;

}
return recomposeColor(color);
}
/**

@@ -281,8 +251,5 @@ * Lightens a color.

*/
function lighten(color, coefficient) {
color = decomposeColor(color);
coefficient = clamp(coefficient);
if (color.type.indexOf("hsl") !== -1) {

@@ -299,5 +266,5 @@ color.values[2] += (100 - color.values[2]) * coefficient;

}
return recomposeColor(color);
}
/**

@@ -310,4 +277,2 @@ * Darken or lighten a color, depending on its luminance.

*/
function emphasize(color) {

@@ -317,2 +282,3 @@ var coefficient = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.15;

}
/**

@@ -325,4 +291,2 @@ * Darken or lighten a color, depending on its luminance.

*/
function deemphasize(color) {

@@ -329,0 +293,0 @@ var coefficient = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.15;

@@ -6,5 +6,3 @@ "use strict";

});
var _color = require("./color");
Object.keys(_color).forEach(function (key) {

@@ -20,5 +18,3 @@ if (key === "default" || key === "__esModule") return;

});
var _color2 = require("./color.types");
Object.keys(_color2).forEach(function (key) {

@@ -34,5 +30,3 @@ if (key === "default" || key === "__esModule") return;

});
var _colorValidations = require("./color-validations");
Object.keys(_colorValidations).forEach(function (key) {

@@ -39,0 +33,0 @@ if (key === "default" || key === "__esModule") return;

"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {

@@ -9,13 +8,7 @@ value: true

exports["default"] = _default;
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _react = require("react");
var _jsxRuntime = require("react/jsx-runtime");
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; }
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) { (0, _defineProperty2["default"])(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; }
function _default(slot) {

@@ -25,7 +18,5 @@ var Component = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (p) {

};
var Slot = function Slot(props) {
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Component, _objectSpread({}, props));
};
Object.defineProperty(Slot, "name", {

@@ -32,0 +23,0 @@ value: slot,

@@ -7,3 +7,2 @@ "use strict";

exports["default"] = cx;
/**

@@ -17,3 +16,2 @@ * Accepts classNames as params and merges them into a single className string

}
return classes.filter(function (c) {

@@ -20,0 +18,0 @@ return c && c !== "";

@@ -7,7 +7,5 @@ "use strict";

exports["default"] = debounce;
function debounce(func) {
var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 166;
var timeout;
function debounced() {

@@ -17,3 +15,2 @@ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {

}
var later = function later() {

@@ -23,12 +20,9 @@ // eslint-disable-next-line prefer-spread

};
clearTimeout(timeout);
timeout = setTimeout(later, wait);
}
debounced.clear = function () {
clearTimeout(timeout);
};
return debounced;
}
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {

@@ -10,15 +9,9 @@ value: true

exports.isPlainObject = isPlainObject;
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
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; }
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) { (0, _defineProperty2["default"])(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; }
function isPlainObject(item) {
return item !== null && (0, _typeof2["default"])(item) === "object" && (item == null ? void 0 : item.constructor) === Object;
}
function deepmerge(target, source) {

@@ -29,3 +22,2 @@ var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {

var output = options.clone ? _objectSpread({}, target) : target;
if (isPlainObject(target) && isPlainObject(source)) {

@@ -37,3 +29,2 @@ Object.keys(source).forEach(function (key) {

}
if (isPlainObject(source[key]) && key in target && isPlainObject(target[key])) {

@@ -47,4 +38,3 @@ // Since `output` is a clone of `target` and we have narrowed `target` in this block we can cast to the same type.

}
return output;
}
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {

@@ -9,15 +8,8 @@ value: true

exports["default"] = extractSlots;
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
var _react = require("react");
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; }
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) { (0, _defineProperty2["default"])(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; }
/**

@@ -30,3 +22,2 @@ * Extracts all slots from children and other remaining children

var remainingChildren = [];
_react.Children.forEach(children, function (child) {

@@ -36,9 +27,7 @@ if ( /*#__PURE__*/(0, _react.isValidElement)(child)) {

var childType = elementChild.type;
if (childType == Symbol["for"]("react.fragment")) {
var _extractSlots = extractSlots(child.props.children),
_extractSlots2 = (0, _slicedToArray2["default"])(_extractSlots, 2),
fragmentSlots = _extractSlots2[0],
fragmentRemainingChildren = _extractSlots2[1];
_extractSlots2 = (0, _slicedToArray2["default"])(_extractSlots, 2),
fragmentSlots = _extractSlots2[0],
fragmentRemainingChildren = _extractSlots2[1];
slots = _objectSpread(_objectSpread({}, slots), fragmentSlots);

@@ -51,4 +40,3 @@ remainingChildren = [].concat((0, _toConsumableArray2["default"])(remainingChildren), [fragmentRemainingChildren]);

});
return [slots, remainingChildren];
}

@@ -7,5 +7,3 @@ "use strict";

exports["default"] = findSlot;
var _react = require("react");
/**

@@ -12,0 +10,0 @@ * Deprecated

@@ -7,3 +7,2 @@ "use strict";

exports["default"] = formatHash;
function formatHash(hash) {

@@ -10,0 +9,0 @@ var ellipsis = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "middle";

@@ -7,3 +7,2 @@ "use strict";

exports["default"] = fsx;
/**

@@ -10,0 +9,0 @@ * Accepts a PropStyle (function that returns CSSProperties or CSSProperties) and returns the appropriate CSSProperties

"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {

@@ -9,12 +8,10 @@ value: true

exports["default"] = _default;
var _toArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toArray"));
function _default(obj, key) {
var _key$split = key.split("."),
_key$split2 = (0, _toArray2["default"])(_key$split),
firstKey = _key$split2[0],
restKeys = _key$split2.slice(1); // @ts-ignore
_key$split2 = (0, _toArray2["default"])(_key$split),
firstKey = _key$split2[0],
restKeys = _key$split2.slice(1);
// @ts-ignore
return restKeys.reduce(function (prev, curr) {

@@ -21,0 +18,0 @@ return prev[curr];

@@ -7,8 +7,5 @@ "use strict";

exports["default"] = _default;
var _react = require("react");
function _default(children) {
var slots = {};
_react.Children.forEach(children, function (child) {

@@ -18,3 +15,2 @@ if ( /*#__PURE__*/(0, _react.isValidElement)(child)) {

var childType = elementChild.type;
if (typeof childType === "function" && "name" in childType) {

@@ -25,4 +21,3 @@ slots[childType.name] = elementChild;

});
return slots;
}
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _typeof = require("@babel/runtime/helpers/typeof");
Object.defineProperty(exports, "__esModule", {

@@ -145,11 +143,6 @@ value: true

});
var _capitalize = _interopRequireDefault(require("./capitalize"));
var _classify = _interopRequireDefault(require("./classify"));
var _createSlot = _interopRequireDefault(require("./createSlot"));
var _color = require("./color");
Object.keys(_color).forEach(function (key) {

@@ -166,15 +159,8 @@ if (key === "default" || key === "__esModule") return;

});
var _cx = _interopRequireDefault(require("./cx"));
var _debounce = _interopRequireDefault(require("./debounce"));
var _deepmerge = _interopRequireWildcard(require("./deepmerge"));
var _extractSlots = _interopRequireDefault(require("./extractSlots"));
var _findSlot = _interopRequireDefault(require("./find-slot"));
var _formatHash = _interopRequireWildcard(require("./formatHash"));
Object.keys(_formatHash).forEach(function (key) {

@@ -191,23 +177,12 @@ if (key === "default" || key === "__esModule") return;

});
var _fsx = _interopRequireDefault(require("./fsx"));
var _getAttribute = _interopRequireDefault(require("./getAttribute"));
var _getSlots = _interopRequireDefault(require("./getSlots"));
var _minDigits = _interopRequireDefault(require("./minDigits"));
var _nullifyEvent = _interopRequireDefault(require("./nullifyEvent"));
var _ownerDocument = _interopRequireDefault(require("./ownerDocument"));
var _ownerWindow = _interopRequireDefault(require("./ownerWindow"));
var _rack = _interopRequireDefault(require("./rack"));
var _setRef = _interopRequireDefault(require("./setRef"));
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {

@@ -9,10 +8,7 @@ value: true

exports["default"] = _default;
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
function _default(n, d) {
var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
_ref$fill = _ref.fill,
fill = _ref$fill === void 0 ? "left" : _ref$fill;
_ref$fill = _ref.fill,
fill = _ref$fill === void 0 ? "left" : _ref$fill;
var num = n.toString();

@@ -19,0 +15,0 @@ var dif = d - num.length;

@@ -7,3 +7,2 @@ "use strict";

exports["default"] = nullifyEvent;
function nullifyEvent(e) {

@@ -10,0 +9,0 @@ e.preventDefault();

@@ -7,5 +7,4 @@ "use strict";

exports["default"] = ownerDocument;
function ownerDocument(node) {
return node && node.ownerDocument || document;
}
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {

@@ -9,5 +8,3 @@ value: true

exports["default"] = ownerWindow;
var _ownerDocument = _interopRequireDefault(require("./ownerDocument"));
function ownerWindow(node) {

@@ -14,0 +11,0 @@ var doc = (0, _ownerDocument["default"])(node);

"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {

@@ -9,25 +8,13 @@ value: true

exports["default"] = _default;
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
var _extractSlots3 = _interopRequireDefault(require("./extractSlots"));
var _createSlot = _interopRequireDefault(require("./createSlot"));
var _excluded = ["children"];
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
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; }
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) { (0, _defineProperty2["default"])(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; }
/**

@@ -45,13 +32,11 @@ * Utility that creates racks and its slots.

var extensions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
var RackComponent = function RackComponent(_ref) {
var children = _ref.children,
rest = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
rest = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
var _extractSlots = (0, _extractSlots3["default"])(children),
_extractSlots2 = (0, _slicedToArray2["default"])(_extractSlots, 2),
slots = _extractSlots2[0],
remainingChildren = _extractSlots2[1]; // @ts-ignore
_extractSlots2 = (0, _slicedToArray2["default"])(_extractSlots, 2),
slots = _extractSlots2[0],
remainingChildren = _extractSlots2[1];
// @ts-ignore
return factory(_objectSpread({

@@ -61,10 +46,7 @@ children: remainingChildren

};
var Rack = RackComponent;
for (var _i = 0, _Object$entries = Object.entries(extensions); _i < _Object$entries.length; _i++) {
var _Object$entries$_i = (0, _slicedToArray2["default"])(_Object$entries[_i], 2),
name = _Object$entries$_i[0],
element = _Object$entries$_i[1];
name = _Object$entries$_i[0],
element = _Object$entries$_i[1];
//console.log(name, element);

@@ -76,6 +58,4 @@ Object.defineProperty(Rack, name, {

}
var _iterator = _createForOfIteratorHelper(slots),
_step;
_step;
try {

@@ -94,4 +74,3 @@ for (_iterator.s(); !(_step = _iterator.n()).done;) {

}
return Rack;
}

@@ -7,3 +7,2 @@ "use strict";

exports["default"] = setRef;
/**

@@ -10,0 +9,0 @@ *

{
"name": "@peersyst/react-utils",
"author": "Peersyst",
"version": "1.8.7",
"version": "2.0.0",
"license": "MIT",

@@ -11,4 +11,4 @@ "main": "./node/index.js",

"peerDependencies": {
"@types/react": "^17.0.38",
"react": "^17.0.0"
"@types/react": "^18.0.25",
"react": "^18.2.0"
},

@@ -15,0 +15,0 @@ "peerDependenciesMeta": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc