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

@leafygreen-ui/lib

Package Overview
Dependencies
Maintainers
5
Versions
89
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@leafygreen-ui/lib - npm Package Compare versions

Comparing version 13.3.0 to 13.4.0

dist/LgIdProps/index.d.ts

6

CHANGELOG.md
# @leafygreen-ui/lib
## 13.4.0
### Minor Changes
- c3906f78: Adds `LgIdProps` which exports an interface to support `['data-lgid']?: string;`, which can be extended inside components props.
## 13.3.0

@@ -4,0 +10,0 @@

2

dist/esm/index.js

@@ -1,2 +0,2 @@

import t from"lodash/once";import r from"lodash/isNull";import e from"lodash/isUndefined";import n from"lodash/omit";import o from"lodash/pick";import i from"lodash/isObject";import a from"react";function u(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),e.push.apply(e,n)}return e}function c(t){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{};r%2?u(Object(e),!0).forEach((function(r){f(t,r,e[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):u(Object(e)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))}))}return t}function l(t){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},l(t)}function f(t,r,e){return r=function(t){var r=function(t,r){if("object"!=typeof t||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,r||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==typeof r?r:String(r)}(r),r in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}function p(t){return function(t){if(Array.isArray(t))return s(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,r){if(!t)return;if("string"==typeof t)return s(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);"Object"===e&&t.constructor&&(e=t.constructor.name);if("Map"===e||"Set"===e)return Array.from(t);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return s(t,r)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function y(t){return null!=t&&t.nodeType===Node.ELEMENT_NODE}var m=Object.freeze({__proto__:null,array:function(t){return null!=t&&t instanceof Array},button:function(t){return y(t)&&"button"===t.tagName.toLowerCase()},element:y,input:function(t){return y(t)&&"input"===t.tagName.toLowerCase()}}),b=new Map,d=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",r=function(t){var r,e,n=(null!==(r=null===(e=b.get(t))||void 0===e?void 0:e.length)&&void 0!==r?r:0).toString().padStart(4,"0");return"lg-ui".concat(t?"-".concat(t):"","-").concat(n)}(t);if(b.has(t)){var e=b.get(t);b.set(t,[r].concat(p(e)))}else b.set(t,[r]);return r};function v(t){return"string"==typeof(r=t)||"number"==typeof r?t.toString().trim():Array.isArray(t)?t.map(v).join(" ").trim():function(t){return t&&"object"===l(t)&&t.props}(t)?v(t.props.children):"";var r}var g={Light:"light",Dark:"dark"},h=function(t){return t?g.Dark:g.Light};function w(t){return 1==new Set(t).size}var j=function(t){if(t&&Array.isArray(t)){var r=p(t);return r.reverse(),r}},O={error:t(console.error),warn:t(console.warn),log:t(console.log)},S=function(t){return!e(t)&&!r(t)},P=function(t){return!S(t)||["","0","00",0].includes(t)},A=function(t){return!P(t)},D=function(t,r){return[o(t,r),n(t,r)]},E=function(t,r,e){var n=e-r;return t>e?r+(t-e-1)%n:t<r?e-(r-t-1)%n:t},T={length:30},L=function(t){var r=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:T).length;return t.length<=r?t:t.substring(t.length-r)};function N(t,r){var e;return null!=t&&"object"===l(t)&&"type"in t&&(t.type.displayName===r||i(t.type)&&"render"in t.type&&(null===(e=t.type.render)||void 0===e?void 0:e.displayName)===r)}var k=function(t,r){var n,o=null===(n=a.Children.map(t,(function(t){if(r.some((function(r){return N(t,r)})))return t})))||void 0===n?void 0:n.filter((function(t){return!e(t)}));return e(t)||(null==o?void 0:o.length)===a.Children.count(t)||O.error("Children must be one of: ".concat(r.join(", ")),"Received children: ",t),o},C=function(t,r){Object.defineProperty(t,"target",{writable:!1,value:r});var e=!1,n=!1;return c(c({nativeEvent:t},t),{},{currentTarget:t.currentTarget,target:t.target,bubbles:t.bubbles,cancelable:t.cancelable,defaultPrevented:t.defaultPrevented,eventPhase:t.eventPhase,isTrusted:t.isTrusted,timeStamp:t.timeStamp,type:t.type,preventDefault:function(){e=!0,t.preventDefault()},isDefaultPrevented:function(){return e},stopPropagation:function(){n=!0,t.stopPropagation()},isPropagationStopped:function(){return n},persist:function(){}})};function U(t){var r="data-leafygreen-ui";return{prop:f({},r,t),selector:"[".concat(r,'="').concat(t,'"]')}}var _={ArrowUp:"ArrowUp",ArrowDown:"ArrowDown",ArrowLeft:"ArrowLeft",ArrowRight:"ArrowRight",Backspace:"Backspace",BracketLeft:"[",Delete:"Delete",Enter:"Enter",Escape:"Escape",Space:" ",Tab:"Tab"},R={Page:"page",Step:"step",Location:"location",Date:"date",Time:"time",True:"true",Unset:"false"};function B(t){throw Error("Received unhandled value: ".concat(t))}export{R as AriaCurrentValue,g as Theme,w as allEqual,j as cloneReverse,O as consoleOnce,U as createDataProp,C as createSyntheticEvent,d as createUniqueClassName,B as enforceExhaustive,v as getNodeTextContent,h as getTheme,N as isComponentType,S as isDefined,A as isNotZeroLike,P as isZeroLike,_ as keyMap,D as pickAndOmit,E as rollover,L as truncateStart,m as typeIs,k as validateChildren};
import t from"lodash/once";import r from"lodash/isNull";import e from"lodash/isUndefined";import n from"lodash/omit";import o from"lodash/pick";import i from"lodash/isObject";import a from"react";function u(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),e.push.apply(e,n)}return e}function c(t){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{};r%2?u(Object(e),!0).forEach((function(r){p(t,r,e[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):u(Object(e)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))}))}return t}function l(t){var r=function(t,r){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,r||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==typeof r?r:r+""}function f(t){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},f(t)}function p(t,r,e){return(r=l(r))in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}function s(t){return function(t){if(Array.isArray(t))return y(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,r){if(!t)return;if("string"==typeof t)return y(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);"Object"===e&&t.constructor&&(e=t.constructor.name);if("Map"===e||"Set"===e)return Array.from(t);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return y(t,r)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function m(t){return null!=t&&t.nodeType===Node.ELEMENT_NODE}var b=Object.freeze({__proto__:null,array:function(t){return null!=t&&t instanceof Array},button:function(t){return m(t)&&"button"===t.tagName.toLowerCase()},element:m,input:function(t){return m(t)&&"input"===t.tagName.toLowerCase()}}),d=new Map,v=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",r=function(t){var r,e,n=(null!==(r=null===(e=d.get(t))||void 0===e?void 0:e.length)&&void 0!==r?r:0).toString().padStart(4,"0");return"lg-ui".concat(t?"-".concat(t):"","-").concat(n)}(t);if(d.has(t)){var e=d.get(t);d.set(t,[r].concat(s(e)))}else d.set(t,[r]);return r};function g(t){return"string"==typeof(r=t)||"number"==typeof r?t.toString().trim():Array.isArray(t)?t.map(g).join(" ").trim():function(t){return t&&"object"===f(t)&&t.props}(t)?g(t.props.children):"";var r}var h={Light:"light",Dark:"dark"},w=function(t){return t?h.Dark:h.Light};function j(t){return 1==new Set(t).size}var O=function(t){if(t&&Array.isArray(t)){var r=s(t);return r.reverse(),r}},S={error:t(console.error),warn:t(console.warn),log:t(console.log)},P=function(t){return!e(t)&&!r(t)},A=function(t){return!P(t)||["","0","00",0].includes(t)},D=function(t){return!A(t)},E=function(t,r){return[o(t,r),n(t,r)]},T=function(t,r,e){var n=e-r;return t>e?r+(t-e-1)%n:t<r?e-(r-t-1)%n:t},L={length:30},N=function(t){var r=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:L).length;return t.length<=r?t:t.substring(t.length-r)};function k(t,r){var e;return null!=t&&"object"===f(t)&&"type"in t&&(t.type.displayName===r||i(t.type)&&"render"in t.type&&(null===(e=t.type.render)||void 0===e?void 0:e.displayName)===r)}var C=function(t,r){var n,o=null===(n=a.Children.map(t,(function(t){if(r.some((function(r){return k(t,r)})))return t})))||void 0===n?void 0:n.filter((function(t){return!e(t)}));return e(t)||(null==o?void 0:o.length)===a.Children.count(t)||S.error("Children must be one of: ".concat(r.join(", ")),"Received children: ",t),o},U=function(t,r){Object.defineProperty(t,"target",{writable:!1,value:r});var e=!1,n=!1;return c(c({nativeEvent:t},t),{},{currentTarget:t.currentTarget,target:t.target,bubbles:t.bubbles,cancelable:t.cancelable,defaultPrevented:t.defaultPrevented,eventPhase:t.eventPhase,isTrusted:t.isTrusted,timeStamp:t.timeStamp,type:t.type,preventDefault:function(){e=!0,t.preventDefault()},isDefaultPrevented:function(){return e},stopPropagation:function(){n=!0,t.stopPropagation()},isPropagationStopped:function(){return n},persist:function(){}})};function _(t){var r="data-leafygreen-ui";return{prop:p({},r,t),selector:"[".concat(r,'="').concat(t,'"]')}}var R={ArrowUp:"ArrowUp",ArrowDown:"ArrowDown",ArrowLeft:"ArrowLeft",ArrowRight:"ArrowRight",Backspace:"Backspace",BracketLeft:"[",Delete:"Delete",Enter:"Enter",Escape:"Escape",Space:" ",Tab:"Tab"},B={Page:"page",Step:"step",Location:"location",Date:"date",Time:"time",True:"true",Unset:"false"};function I(t){throw Error("Received unhandled value: ".concat(t))}export{B as AriaCurrentValue,h as Theme,j as allEqual,O as cloneReverse,S as consoleOnce,_ as createDataProp,U as createSyntheticEvent,v as createUniqueClassName,I as enforceExhaustive,g as getNodeTextContent,w as getTheme,k as isComponentType,P as isDefined,D as isNotZeroLike,A as isZeroLike,R as keyMap,E as pickAndOmit,T as rollover,N as truncateStart,b as typeIs,C as validateChildren};
//# sourceMappingURL=index.js.map

@@ -6,2 +6,3 @@ /// <reference types="react" />

import DarkModeProps, { Theme } from './DarkModeProps';
import { type LgIdProps } from './LgIdProps';
import getTheme from './getTheme';

@@ -13,3 +14,3 @@ export * from './helpers';

export { typeIs, createUniqueClassName, getNodeTextContent, getTheme, Theme };
export type { DarkModeProps };
export type { DarkModeProps, LgIdProps };
/** Helper type to extract an HTML element's valid props */

@@ -16,0 +17,0 @@ export type HTMLElementProps<Element extends keyof JSX.IntrinsicElements, RefType extends HTMLElement = never> = React.PropsWithChildren<Omit<JSX.IntrinsicElements[Element], 'ref'>> & {

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("lodash/once"),require("lodash/isNull"),require("lodash/isUndefined"),require("lodash/omit"),require("lodash/pick"),require("lodash/isObject"),require("react")):"function"==typeof define&&define.amd?define(["exports","lodash/once","lodash/isNull","lodash/isUndefined","lodash/omit","lodash/pick","lodash/isObject","react"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@leafygreen-ui/lib"]={},e["/once"],e["/isNull"],e["/isUndefined"],e["/omit"],e["/pick"],e["/isObject"],e.react)}(this,(function(e,t,r,n,o,i,a,u){"use strict";function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=l(t),f=l(r),s=l(n),p=l(o),d=l(i),y=l(a),b=l(u);function v(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function g(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?v(Object(r),!0).forEach((function(t){h(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):v(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function m(e){return m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},m(e)}function h(e,t,r){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function w(e){return function(e){if(Array.isArray(e))return j(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return j(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return j(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function j(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function O(e){return null!=e&&e.nodeType===Node.ELEMENT_NODE}var S=Object.freeze({__proto__:null,array:function(e){return null!=e&&e instanceof Array},button:function(e){return O(e)&&"button"===e.tagName.toLowerCase()},element:O,input:function(e){return O(e)&&"input"===e.tagName.toLowerCase()}}),A=new Map;var P={Light:"light",Dark:"dark"};var T={error:c.default(console.error),warn:c.default(console.warn),log:c.default(console.log)},D=function(e){return!s.default(e)&&!f.default(e)},E=function(e){return!D(e)||["","0","00",0].includes(e)},k={length:30};function N(e,t){var r;return null!=e&&"object"===m(e)&&"type"in e&&(e.type.displayName===t||y.default(e.type)&&"render"in e.type&&(null===(r=e.type.render)||void 0===r?void 0:r.displayName)===t)}e.AriaCurrentValue={Page:"page",Step:"step",Location:"location",Date:"date",Time:"time",True:"true",Unset:"false"},e.Theme=P,e.allEqual=function(e){return 1==new Set(e).size},e.cloneReverse=function(e){if(e&&Array.isArray(e)){var t=w(e);return t.reverse(),t}},e.consoleOnce=T,e.createDataProp=function(e){var t="data-leafygreen-ui";return{prop:h({},t,e),selector:"[".concat(t,'="').concat(e,'"]')}},e.createSyntheticEvent=function(e,t){Object.defineProperty(e,"target",{writable:!1,value:t});var r=!1,n=!1;return g(g({nativeEvent:e},e),{},{currentTarget:e.currentTarget,target:e.target,bubbles:e.bubbles,cancelable:e.cancelable,defaultPrevented:e.defaultPrevented,eventPhase:e.eventPhase,isTrusted:e.isTrusted,timeStamp:e.timeStamp,type:e.type,preventDefault:function(){r=!0,e.preventDefault()},isDefaultPrevented:function(){return r},stopPropagation:function(){n=!0,e.stopPropagation()},isPropagationStopped:function(){return n},persist:function(){}})},e.createUniqueClassName=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=function(e){var t,r,n=(null!==(t=null===(r=A.get(e))||void 0===r?void 0:r.length)&&void 0!==t?t:0).toString().padStart(4,"0");return"lg-ui".concat(e?"-".concat(e):"","-").concat(n)}(e);if(A.has(e)){var r=A.get(e);A.set(e,[t].concat(w(r)))}else A.set(e,[t]);return t},e.enforceExhaustive=function(e){throw Error("Received unhandled value: ".concat(e))},e.getNodeTextContent=function e(t){return"string"==typeof(r=t)||"number"==typeof r?t.toString().trim():Array.isArray(t)?t.map(e).join(" ").trim():function(e){return e&&"object"===m(e)&&e.props}(t)?e(t.props.children):"";var r},e.getTheme=function(e){return e?P.Dark:P.Light},e.isComponentType=N,e.isDefined=D,e.isNotZeroLike=function(e){return!E(e)},e.isZeroLike=E,e.keyMap={ArrowUp:"ArrowUp",ArrowDown:"ArrowDown",ArrowLeft:"ArrowLeft",ArrowRight:"ArrowRight",Backspace:"Backspace",BracketLeft:"[",Delete:"Delete",Enter:"Enter",Escape:"Escape",Space:" ",Tab:"Tab"},e.pickAndOmit=function(e,t){return[d.default(e,t),p.default(e,t)]},e.rollover=function(e,t,r){var n=r-t;return e>r?t+(e-r-1)%n:e<t?r-(t-e-1)%n:e},e.truncateStart=function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:k).length;return e.length<=t?e:e.substring(e.length-t)},e.typeIs=S,e.validateChildren=function(e,t){var r,n=null===(r=b.default.Children.map(e,(function(e){if(t.some((function(t){return N(e,t)})))return e})))||void 0===r?void 0:r.filter((function(e){return!s.default(e)}));return s.default(e)||(null==n?void 0:n.length)===b.default.Children.count(e)||T.error("Children must be one of: ".concat(t.join(", ")),"Received children: ",e),n}}));
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("lodash/once"),require("lodash/isNull"),require("lodash/isUndefined"),require("lodash/omit"),require("lodash/pick"),require("lodash/isObject"),require("react")):"function"==typeof define&&define.amd?define(["exports","lodash/once","lodash/isNull","lodash/isUndefined","lodash/omit","lodash/pick","lodash/isObject","react"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@leafygreen-ui/lib"]={},e["/once"],e["/isNull"],e["/isUndefined"],e["/omit"],e["/pick"],e["/isObject"],e.react)}(this,(function(e,t,r,n,o,i,a,u){"use strict";function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=c(t),f=c(r),s=c(n),p=c(o),d=c(i),y=c(a),b=c(u);function v(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function m(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?v(Object(r),!0).forEach((function(t){w(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):v(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function g(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}function h(e){return h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},h(e)}function w(e,t,r){return(t=g(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function j(e){return function(e){if(Array.isArray(e))return O(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return O(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return O(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function O(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function S(e){return null!=e&&e.nodeType===Node.ELEMENT_NODE}var A=Object.freeze({__proto__:null,array:function(e){return null!=e&&e instanceof Array},button:function(e){return S(e)&&"button"===e.tagName.toLowerCase()},element:S,input:function(e){return S(e)&&"input"===e.tagName.toLowerCase()}}),P=new Map;var T={Light:"light",Dark:"dark"};var D={error:l.default(console.error),warn:l.default(console.warn),log:l.default(console.log)},E=function(e){return!s.default(e)&&!f.default(e)},k=function(e){return!E(e)||["","0","00",0].includes(e)},N={length:30};function C(e,t){var r;return null!=e&&"object"===h(e)&&"type"in e&&(e.type.displayName===t||y.default(e.type)&&"render"in e.type&&(null===(r=e.type.render)||void 0===r?void 0:r.displayName)===t)}e.AriaCurrentValue={Page:"page",Step:"step",Location:"location",Date:"date",Time:"time",True:"true",Unset:"false"},e.Theme=T,e.allEqual=function(e){return 1==new Set(e).size},e.cloneReverse=function(e){if(e&&Array.isArray(e)){var t=j(e);return t.reverse(),t}},e.consoleOnce=D,e.createDataProp=function(e){var t="data-leafygreen-ui";return{prop:w({},t,e),selector:"[".concat(t,'="').concat(e,'"]')}},e.createSyntheticEvent=function(e,t){Object.defineProperty(e,"target",{writable:!1,value:t});var r=!1,n=!1;return m(m({nativeEvent:e},e),{},{currentTarget:e.currentTarget,target:e.target,bubbles:e.bubbles,cancelable:e.cancelable,defaultPrevented:e.defaultPrevented,eventPhase:e.eventPhase,isTrusted:e.isTrusted,timeStamp:e.timeStamp,type:e.type,preventDefault:function(){r=!0,e.preventDefault()},isDefaultPrevented:function(){return r},stopPropagation:function(){n=!0,e.stopPropagation()},isPropagationStopped:function(){return n},persist:function(){}})},e.createUniqueClassName=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=function(e){var t,r,n=(null!==(t=null===(r=P.get(e))||void 0===r?void 0:r.length)&&void 0!==t?t:0).toString().padStart(4,"0");return"lg-ui".concat(e?"-".concat(e):"","-").concat(n)}(e);if(P.has(e)){var r=P.get(e);P.set(e,[t].concat(j(r)))}else P.set(e,[t]);return t},e.enforceExhaustive=function(e){throw Error("Received unhandled value: ".concat(e))},e.getNodeTextContent=function e(t){return"string"==typeof(r=t)||"number"==typeof r?t.toString().trim():Array.isArray(t)?t.map(e).join(" ").trim():function(e){return e&&"object"===h(e)&&e.props}(t)?e(t.props.children):"";var r},e.getTheme=function(e){return e?T.Dark:T.Light},e.isComponentType=C,e.isDefined=E,e.isNotZeroLike=function(e){return!k(e)},e.isZeroLike=k,e.keyMap={ArrowUp:"ArrowUp",ArrowDown:"ArrowDown",ArrowLeft:"ArrowLeft",ArrowRight:"ArrowRight",Backspace:"Backspace",BracketLeft:"[",Delete:"Delete",Enter:"Enter",Escape:"Escape",Space:" ",Tab:"Tab"},e.pickAndOmit=function(e,t){return[d.default(e,t),p.default(e,t)]},e.rollover=function(e,t,r){var n=r-t;return e>r?t+(e-r-1)%n:e<t?r-(t-e-1)%n:e},e.truncateStart=function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:N).length;return e.length<=t?e:e.substring(e.length-t)},e.typeIs=A,e.validateChildren=function(e,t){var r,n=null===(r=b.default.Children.map(e,(function(e){if(t.some((function(t){return C(e,t)})))return e})))||void 0===r?void 0:r.filter((function(e){return!s.default(e)}));return s.default(e)||(null==n?void 0:n.length)===b.default.Children.count(e)||D.error("Children must be one of: ".concat(t.join(", ")),"Received children: ",e),n}}));
//# sourceMappingURL=index.js.map
{
"name": "@leafygreen-ui/lib",
"version": "13.3.0",
"version": "13.4.0",
"description": "leafyGreen UI Kit Internal Library",

@@ -5,0 +5,0 @@ "main": "./dist/index.js",

@@ -5,2 +5,3 @@ import * as typeIs from './typeIs';

import DarkModeProps, { Theme } from './DarkModeProps';
import { type LgIdProps } from './LgIdProps';
import getTheme from './getTheme';

@@ -13,3 +14,3 @@ export * from './helpers';

export { typeIs, createUniqueClassName, getNodeTextContent, getTheme, Theme };
export type { DarkModeProps };
export type { DarkModeProps, LgIdProps };

@@ -16,0 +17,0 @@ /** Helper type to extract an HTML element's valid props */

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 too big to display

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