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

@leafygreen-ui/lib

Package Overview
Dependencies
Maintainers
6
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 10.3.4 to 10.4.0

dist/storybook/GeneratedStoryDecorator.types.d.ts

12

CHANGELOG.md
# @leafygreen-ui/lib
## 10.4.0
### Minor Changes
- 76161cf0: Adds types for GeneratedStory decorator
- 76161cf0: Exports ExtendedComponentProps & InstanceDecorator types. Adds `XP` (extra props) to StoryMetaType generic signature
### Patch Changes
- 76161cf0: Ensures `XP` is passed to the `StoryFn` props in `StoryType`.
Exports `PlayFn` type
## 10.3.4

@@ -4,0 +16,0 @@

2

dist/esm/index.js

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

import e from"lodash/isObject";import t from"lodash/once";import n from"lodash/isUndefined";import r from"react";import o from"lodash/mergeWith";function i(e){return i="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},i(e)}function a(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;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:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e){return function(e){if(Array.isArray(e))return c(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 c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return c(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 c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function u(e){return null!=e&&e.nodeType===Node.ELEMENT_NODE}var s=Object.freeze({__proto__:null,element:u,button:function(e){return u(e)&&"button"===e.tagName.toLowerCase()},input:function(e){return u(e)&&"input"===e.tagName.toLowerCase()},array:function(e){return null!=e&&e instanceof Array}}),p=function(e){var t,n,r=(null!==(t=null===(n=d.get(e))||void 0===n?void 0:n.length)&&void 0!==t?t:0).toString().padStart(4,"0");return"lg-ui".concat(e?"-".concat(e):"","-").concat(r)},d=new Map,f=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=p(e);if(d.has(e)){var n=d.get(e);d.set(e,[t].concat(l(n)))}else d.set(e,[t]);return t};function m(e){return"string"==typeof(t=e)||"number"==typeof t?e.toString().trim():Array.isArray(e)?e.map(m).join(" ").trim():function(e){return e&&"object"===i(e)&&e.props}(e)?m(e.props.children):"";var t}var b={Light:"light",Dark:"dark"},y=function(e){return e?b.Dark:b.Light};function v(e){return 1==new Set(e).size}var h=function(e,t){var o,i=null===(o=r.Children.map(e,(function(e){if(t.some((function(t){return T(e,t)})))return e})))||void 0===o?void 0:o.filter((function(e){return!n(e)}));return n(e)||(null==i?void 0:i.length)===r.Children.count(e)||D.error("Children must be one of: ".concat(t.join(", ")),"Received children: ",e),i},g=function(e,t){Object.defineProperty(e,"target",{writable:!1,value:t});var n=!1,r=!1;return{nativeEvent:e,currentTarget:e.currentTarget,target:e.target,bubbles:e.bubbles,cancelable:e.cancelable,defaultPrevented:e.defaultPrevented,eventPhase:e.eventPhase,isTrusted:e.isTrusted,preventDefault:function(){n=!0,e.preventDefault()},isDefaultPrevented:function(){return n},stopPropagation:function(){r=!0,e.stopPropagation()},isPropagationStopped:function(){return r},persist:function(){},timeStamp:e.timeStamp,type:e.type}},S=["small","button","a","abbr","address","article","aside","b","big","blockquote","caption","cite","code","dd","del","details","dfn","dialog","div","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","i","ins","kbd","keygen","label","legend","li","main","map","mark","menu","menuitem","meter","nav","noscript","ol","p","picture","pre","progress","q","rp","rt","ruby","s","samp","slot","script","section","select","span","strong","style","sub","summary","sup","template","tbody","td","tfoot","th","thead","time","title","tr","u","ul"],C={baseFontSize:{description:"The base font size passed to the LeafyGreenProvider that wraps the component",control:{type:"radio"},options:[14,16]},updatedBaseFontSize:{description:"The base font size passed to the LeafyGreenProvider that wraps the component. Uses the updated font size values for Euclid Circular A.",control:{type:"radio"},options:[13,16]},darkMode:{description:"Render the component in dark mode.",control:"boolean"},children:{description:"Element rendered inside the component",control:"text"},as:{description:"The component will be rendered in HTML as the element selected here",options:S,type:{name:"string"},control:{type:"select"},defaultValue:"button"}},w={"aria-controls":{control:"none"},"aria-describedby":{control:"none"},"aria-label":{control:"none"},"aria-labelledby":{control:"none"},className:{control:"none"},id:{control:"none"},onBlur:{control:"none"},onCancel:{control:"none"},onChange:{control:"none"},onClear:{control:"none"},onClick:{control:"none"},onClose:{control:"none"},onConfirm:{control:"none"},onDismiss:{control:"none"},onFilter:{control:"none"},onSubmit:{control:"none"},portalClassName:{control:"none"},portalContainer:{control:"none"},popoverZIndex:{control:"none"},ref:{control:"none"},scrollContainer:{control:"none"},usePortal:{control:"none"}},A=["aria-controls","aria-describedby","aria-label","aria-labelledby","aria-describedby","className","id","onBlur","onCancel","onChange","onClear","onClick","onConfirm","onDismiss","onFilter","popoverZIndex","portalClassName","portalContainer","ref","setOpen","scrollContainer","usePortal"],P=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o(e,{},(function(e,t){return Array.isArray(e)?e.concat(t):"string"==typeof e?e:void 0}))};function T(t,n){var r;return null!=t&&"object"===i(t)&&"type"in t&&(t.type.displayName===n||e(t.type)&&"render"in t.type&&(null===(r=t.type.render)||void 0===r?void 0:r.displayName)===n)}function j(e){var t="data-leafygreen-ui";return{prop:a({},t,e),selector:"[".concat(t,'="').concat(e,'"]')}}var k={ArrowUp:38,ArrowDown:40,ArrowLeft:37,ArrowRight:39,Backspace:8,BracketLeft:91,Delete:46,Enter:13,Escape:27,Space:32,Tab:9},E={Page:"page",Step:"step",Location:"location",Date:"date",Time:"time",True:"true",Unset:"false"};function N(e){throw Error("Received unhandled value: ".concat(e))}var D={error:t(console.error),warn:t(console.warn),log:t(console.log)};export{E as AriaCurrentValue,S as IntrinsicElements,P as StoryMeta,b as Theme,v as allEqual,D as consoleOnce,j as createDataProp,g as createSyntheticEvent,f as createUniqueClassName,N as enforceExhaustive,m as getNodeTextContent,y as getTheme,T as isComponentType,k as keyMap,C as storybookArgTypes,w as storybookExcludedArgTypes,A as storybookExcludedControlParams,s as typeIs,h as validateChildren};
import e from"lodash/isObject";import n from"lodash/once";import t from"lodash/isUndefined";import r from"react";import{mergeWith as o}from"lodash";function a(e){return a="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},a(e)}function i(e,n,t){return n=function(e){var n=function(e,n){if("object"!=typeof e||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,n||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"==typeof n?n:String(n)}(n),n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function l(e){return function(e){if(Array.isArray(e))return c(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,n){if(!e)return;if("string"==typeof e)return c(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return c(e,n)}(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 c(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}function u(e){return null!=e&&e.nodeType===Node.ELEMENT_NODE}var s=Object.freeze({__proto__:null,element:u,button:function(e){return u(e)&&"button"===e.tagName.toLowerCase()},input:function(e){return u(e)&&"input"===e.tagName.toLowerCase()},array:function(e){return null!=e&&e instanceof Array}}),p=function(e){var n,t,r=(null!==(n=null===(t=d.get(e))||void 0===t?void 0:t.length)&&void 0!==n?n:0).toString().padStart(4,"0");return"lg-ui".concat(e?"-".concat(e):"","-").concat(r)},d=new Map,f=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=p(e);if(d.has(e)){var t=d.get(e);d.set(e,[n].concat(l(t)))}else d.set(e,[n]);return n};function m(e){return"string"==typeof(n=e)||"number"==typeof n?e.toString().trim():Array.isArray(e)?e.map(m).join(" ").trim():function(e){return e&&"object"===a(e)&&e.props}(e)?m(e.props.children):"";var n}var b={Light:"light",Dark:"dark"},y=function(e){return e?b.Dark:b.Light};function v(e){return 1==new Set(e).size}var h=function(e,n){var o,a=null===(o=r.Children.map(e,(function(e){if(n.some((function(n){return T(e,n)})))return e})))||void 0===o?void 0:o.filter((function(e){return!t(e)}));return t(e)||(null==a?void 0:a.length)===r.Children.count(e)||D.error("Children must be one of: ".concat(n.join(", ")),"Received children: ",e),a},g=function(e,n){Object.defineProperty(e,"target",{writable:!1,value:n});var t=!1,r=!1;return{nativeEvent:e,currentTarget:e.currentTarget,target:e.target,bubbles:e.bubbles,cancelable:e.cancelable,defaultPrevented:e.defaultPrevented,eventPhase:e.eventPhase,isTrusted:e.isTrusted,preventDefault:function(){t=!0,e.preventDefault()},isDefaultPrevented:function(){return t},stopPropagation:function(){r=!0,e.stopPropagation()},isPropagationStopped:function(){return r},persist:function(){},timeStamp:e.timeStamp,type:e.type}},S=["small","button","a","abbr","address","article","aside","b","big","blockquote","caption","cite","code","dd","del","details","dfn","dialog","div","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","i","ins","kbd","keygen","label","legend","li","main","map","mark","menu","menuitem","meter","nav","noscript","ol","p","picture","pre","progress","q","rp","rt","ruby","s","samp","slot","script","section","select","span","strong","style","sub","summary","sup","template","tbody","td","tfoot","th","thead","time","title","tr","u","ul"],C={baseFontSize:{description:"The base font size passed to the LeafyGreenProvider that wraps the component",control:{type:"radio"},options:[14,16]},updatedBaseFontSize:{description:"The base font size passed to the LeafyGreenProvider that wraps the component. Uses the updated font size values for Euclid Circular A.",control:{type:"radio"},options:[13,16]},darkMode:{description:"Render the component in dark mode.",control:"boolean"},children:{description:"Element rendered inside the component",control:"text"},as:{description:"The component will be rendered in HTML as the element selected here",options:S,type:{name:"string"},control:{type:"select"},defaultValue:"button"}},w={"aria-controls":{control:"none"},"aria-describedby":{control:"none"},"aria-label":{control:"none"},"aria-labelledby":{control:"none"},className:{control:"none"},id:{control:"none"},onBlur:{control:"none"},onCancel:{control:"none"},onChange:{control:"none"},onClear:{control:"none"},onClick:{control:"none"},onClose:{control:"none"},onConfirm:{control:"none"},onDismiss:{control:"none"},onFilter:{control:"none"},onSubmit:{control:"none"},portalClassName:{control:"none"},portalContainer:{control:"none"},popoverZIndex:{control:"none"},ref:{control:"none"},scrollContainer:{control:"none"},usePortal:{control:"none"}},A=["aria-controls","aria-describedby","aria-label","aria-labelledby","aria-describedby","className","id","onBlur","onCancel","onChange","onClear","onClick","onConfirm","onDismiss","onFilter","popoverZIndex","portalClassName","portalContainer","ref","setOpen","scrollContainer","usePortal"],P=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o(e,{},(function(e,n){return Array.isArray(e)?e.concat(n):"string"==typeof e?e:void 0}))};function T(n,t){var r;return null!=n&&"object"===a(n)&&"type"in n&&(n.type.displayName===t||e(n.type)&&"render"in n.type&&(null===(r=n.type.render)||void 0===r?void 0:r.displayName)===t)}function j(e){var n="data-leafygreen-ui";return{prop:i({},n,e),selector:"[".concat(n,'="').concat(e,'"]')}}var k={ArrowUp:38,ArrowDown:40,ArrowLeft:37,ArrowRight:39,Backspace:8,BracketLeft:91,Delete:46,Enter:13,Escape:27,Space:32,Tab:9},E={Page:"page",Step:"step",Location:"location",Date:"date",Time:"time",True:"true",Unset:"false"};function N(e){throw Error("Received unhandled value: ".concat(e))}var D={error:n(console.error),warn:n(console.warn),log:n(console.log)};export{E as AriaCurrentValue,S as IntrinsicElements,P as StoryMeta,b as Theme,v as allEqual,D as consoleOnce,j as createDataProp,g as createSyntheticEvent,f as createUniqueClassName,N as enforceExhaustive,m as getNodeTextContent,y as getTheme,T as isComponentType,k as keyMap,C as storybookArgTypes,w as storybookExcludedArgTypes,A as storybookExcludedControlParams,s as typeIs,h as validateChildren};
//# sourceMappingURL=index.js.map

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

export { createSyntheticEvent } from './createSyntheticEvent';
export { StoryMeta, type StoryMetaType, storybookArgTypes, storybookExcludedArgTypes, storybookExcludedControlParams, IntrinsicElements, } from './storybook';
export { type ExtendedComponentProps, type GeneratedStoryConfig, type GeneratedStoryFn, type InstanceDecorator, type PlayFn, StoryMeta, type StoryMetaType, type StoryType, storybookArgTypes, storybookExcludedArgTypes, storybookExcludedControlParams, IntrinsicElements, } from './storybook';
export { typeIs, createUniqueClassName, getNodeTextContent, getTheme, Theme, allEqual, };

@@ -13,0 +13,0 @@ export type { DarkModeProps };

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

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("lodash/isObject"),require("lodash/once"),require("lodash/isUndefined"),require("react"),require("lodash/mergeWith")):"function"==typeof define&&define.amd?define(["exports","lodash/isObject","lodash/once","lodash/isUndefined","react","lodash/mergeWith"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@leafygreen-ui/lib"]={},e.isObject,e.once,e.isUndefined,e.React,e.mergeWith)}(this,(function(e,t,n,r,o,a){"use strict";function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=i(t),c=i(n),u=i(r),s=i(o),d=i(a);function f(e){return f="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},f(e)}function p(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;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:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function m(e){return function(e){if(Array.isArray(e))return y(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 y(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return y(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 y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function b(e){return null!=e&&e.nodeType===Node.ELEMENT_NODE}var h=Object.freeze({__proto__:null,element:b,button:function(e){return b(e)&&"button"===e.tagName.toLowerCase()},input:function(e){return b(e)&&"input"===e.tagName.toLowerCase()},array:function(e){return null!=e&&e instanceof Array}}),g=function(e){var t,n,r=(null!==(t=null===(n=v.get(e))||void 0===n?void 0:n.length)&&void 0!==t?t:0).toString().padStart(4,"0");return"lg-ui".concat(e?"-".concat(e):"","-").concat(r)},v=new Map;var C={Light:"light",Dark:"dark"};var S=["small","button","a","abbr","address","article","aside","b","big","blockquote","caption","cite","code","dd","del","details","dfn","dialog","div","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","i","ins","kbd","keygen","label","legend","li","main","map","mark","menu","menuitem","meter","nav","noscript","ol","p","picture","pre","progress","q","rp","rt","ruby","s","samp","slot","script","section","select","span","strong","style","sub","summary","sup","template","tbody","td","tfoot","th","thead","time","title","tr","u","ul"],T={baseFontSize:{description:"The base font size passed to the LeafyGreenProvider that wraps the component",control:{type:"radio"},options:[14,16]},updatedBaseFontSize:{description:"The base font size passed to the LeafyGreenProvider that wraps the component. Uses the updated font size values for Euclid Circular A.",control:{type:"radio"},options:[13,16]},darkMode:{description:"Render the component in dark mode.",control:"boolean"},children:{description:"Element rendered inside the component",control:"text"},as:{description:"The component will be rendered in HTML as the element selected here",options:S,type:{name:"string"},control:{type:"select"},defaultValue:"button"}};function w(e,t){var n;return null!=e&&"object"===f(e)&&"type"in e&&(e.type.displayName===t||l.default(e.type)&&"render"in e.type&&(null===(n=e.type.render)||void 0===n?void 0:n.displayName)===t)}var A={error:c.default(console.error),warn:c.default(console.warn),log:c.default(console.log)};e.AriaCurrentValue={Page:"page",Step:"step",Location:"location",Date:"date",Time:"time",True:"true",Unset:"false"},e.IntrinsicElements=S,e.StoryMeta=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return d.default(e,{},(function(e,t){return Array.isArray(e)?e.concat(t):"string"==typeof e?e:void 0}))},e.Theme=C,e.allEqual=function(e){return 1==new Set(e).size},e.consoleOnce=A,e.createDataProp=function(e){var t="data-leafygreen-ui";return{prop:p({},t,e),selector:"[".concat(t,'="').concat(e,'"]')}},e.createSyntheticEvent=function(e,t){Object.defineProperty(e,"target",{writable:!1,value:t});var n=!1,r=!1;return{nativeEvent:e,currentTarget:e.currentTarget,target:e.target,bubbles:e.bubbles,cancelable:e.cancelable,defaultPrevented:e.defaultPrevented,eventPhase:e.eventPhase,isTrusted:e.isTrusted,preventDefault:function(){n=!0,e.preventDefault()},isDefaultPrevented:function(){return n},stopPropagation:function(){r=!0,e.stopPropagation()},isPropagationStopped:function(){return r},persist:function(){},timeStamp:e.timeStamp,type:e.type}},e.createUniqueClassName=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=g(e);if(v.has(e)){var n=v.get(e);v.set(e,[t].concat(m(n)))}else v.set(e,[t]);return t},e.enforceExhaustive=function(e){throw Error("Received unhandled value: ".concat(e))},e.getNodeTextContent=function e(t){return"string"==typeof(n=t)||"number"==typeof n?t.toString().trim():Array.isArray(t)?t.map(e).join(" ").trim():function(e){return e&&"object"===f(e)&&e.props}(t)?e(t.props.children):"";var n},e.getTheme=function(e){return e?C.Dark:C.Light},e.isComponentType=w,e.keyMap={ArrowUp:38,ArrowDown:40,ArrowLeft:37,ArrowRight:39,Backspace:8,BracketLeft:91,Delete:46,Enter:13,Escape:27,Space:32,Tab:9},e.storybookArgTypes=T,e.storybookExcludedArgTypes={"aria-controls":{control:"none"},"aria-describedby":{control:"none"},"aria-label":{control:"none"},"aria-labelledby":{control:"none"},className:{control:"none"},id:{control:"none"},onBlur:{control:"none"},onCancel:{control:"none"},onChange:{control:"none"},onClear:{control:"none"},onClick:{control:"none"},onClose:{control:"none"},onConfirm:{control:"none"},onDismiss:{control:"none"},onFilter:{control:"none"},onSubmit:{control:"none"},portalClassName:{control:"none"},portalContainer:{control:"none"},popoverZIndex:{control:"none"},ref:{control:"none"},scrollContainer:{control:"none"},usePortal:{control:"none"}},e.storybookExcludedControlParams=["aria-controls","aria-describedby","aria-label","aria-labelledby","aria-describedby","className","id","onBlur","onCancel","onChange","onClear","onClick","onConfirm","onDismiss","onFilter","popoverZIndex","portalClassName","portalContainer","ref","setOpen","scrollContainer","usePortal"],e.typeIs=h,e.validateChildren=function(e,t){var n,r=null===(n=s.default.Children.map(e,(function(e){if(t.some((function(t){return w(e,t)})))return e})))||void 0===n?void 0:n.filter((function(e){return!u.default(e)}));return u.default(e)||(null==r?void 0:r.length)===s.default.Children.count(e)||A.error("Children must be one of: ".concat(t.join(", ")),"Received children: ",e),r},Object.defineProperty(e,"__esModule",{value:!0})}));
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("lodash/isObject"),require("lodash/once"),require("lodash/isUndefined"),require("react"),require("lodash")):"function"==typeof define&&define.amd?define(["exports","lodash/isObject","lodash/once","lodash/isUndefined","react","lodash"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@leafygreen-ui/lib"]={},e.isObject,e.once,e.isUndefined,e.React,e._)}(this,(function(e,t,n,r,o,a){"use strict";function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=i(t),c=i(n),u=i(r),s=i(o);function d(e){return d="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},d(e)}function f(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;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:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function p(e){return function(e){if(Array.isArray(e))return y(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 y(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return y(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 y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function m(e){return null!=e&&e.nodeType===Node.ELEMENT_NODE}var b=Object.freeze({__proto__:null,element:m,button:function(e){return m(e)&&"button"===e.tagName.toLowerCase()},input:function(e){return m(e)&&"input"===e.tagName.toLowerCase()},array:function(e){return null!=e&&e instanceof Array}}),h=function(e){var t,n,r=(null!==(t=null===(n=v.get(e))||void 0===n?void 0:n.length)&&void 0!==t?t:0).toString().padStart(4,"0");return"lg-ui".concat(e?"-".concat(e):"","-").concat(r)},v=new Map;var g={Light:"light",Dark:"dark"};var C=["small","button","a","abbr","address","article","aside","b","big","blockquote","caption","cite","code","dd","del","details","dfn","dialog","div","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","i","ins","kbd","keygen","label","legend","li","main","map","mark","menu","menuitem","meter","nav","noscript","ol","p","picture","pre","progress","q","rp","rt","ruby","s","samp","slot","script","section","select","span","strong","style","sub","summary","sup","template","tbody","td","tfoot","th","thead","time","title","tr","u","ul"],S={baseFontSize:{description:"The base font size passed to the LeafyGreenProvider that wraps the component",control:{type:"radio"},options:[14,16]},updatedBaseFontSize:{description:"The base font size passed to the LeafyGreenProvider that wraps the component. Uses the updated font size values for Euclid Circular A.",control:{type:"radio"},options:[13,16]},darkMode:{description:"Render the component in dark mode.",control:"boolean"},children:{description:"Element rendered inside the component",control:"text"},as:{description:"The component will be rendered in HTML as the element selected here",options:C,type:{name:"string"},control:{type:"select"},defaultValue:"button"}};function T(e,t){var n;return null!=e&&"object"===d(e)&&"type"in e&&(e.type.displayName===t||l.default(e.type)&&"render"in e.type&&(null===(n=e.type.render)||void 0===n?void 0:n.displayName)===t)}var w={error:c.default(console.error),warn:c.default(console.warn),log:c.default(console.log)};e.AriaCurrentValue={Page:"page",Step:"step",Location:"location",Date:"date",Time:"time",True:"true",Unset:"false"},e.IntrinsicElements=C,e.StoryMeta=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return a.mergeWith(e,{},(function(e,t){return Array.isArray(e)?e.concat(t):"string"==typeof e?e:void 0}))},e.Theme=g,e.allEqual=function(e){return 1==new Set(e).size},e.consoleOnce=w,e.createDataProp=function(e){var t="data-leafygreen-ui";return{prop:f({},t,e),selector:"[".concat(t,'="').concat(e,'"]')}},e.createSyntheticEvent=function(e,t){Object.defineProperty(e,"target",{writable:!1,value:t});var n=!1,r=!1;return{nativeEvent:e,currentTarget:e.currentTarget,target:e.target,bubbles:e.bubbles,cancelable:e.cancelable,defaultPrevented:e.defaultPrevented,eventPhase:e.eventPhase,isTrusted:e.isTrusted,preventDefault:function(){n=!0,e.preventDefault()},isDefaultPrevented:function(){return n},stopPropagation:function(){r=!0,e.stopPropagation()},isPropagationStopped:function(){return r},persist:function(){},timeStamp:e.timeStamp,type:e.type}},e.createUniqueClassName=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=h(e);if(v.has(e)){var n=v.get(e);v.set(e,[t].concat(p(n)))}else v.set(e,[t]);return t},e.enforceExhaustive=function(e){throw Error("Received unhandled value: ".concat(e))},e.getNodeTextContent=function e(t){return"string"==typeof(n=t)||"number"==typeof n?t.toString().trim():Array.isArray(t)?t.map(e).join(" ").trim():function(e){return e&&"object"===d(e)&&e.props}(t)?e(t.props.children):"";var n},e.getTheme=function(e){return e?g.Dark:g.Light},e.isComponentType=T,e.keyMap={ArrowUp:38,ArrowDown:40,ArrowLeft:37,ArrowRight:39,Backspace:8,BracketLeft:91,Delete:46,Enter:13,Escape:27,Space:32,Tab:9},e.storybookArgTypes=S,e.storybookExcludedArgTypes={"aria-controls":{control:"none"},"aria-describedby":{control:"none"},"aria-label":{control:"none"},"aria-labelledby":{control:"none"},className:{control:"none"},id:{control:"none"},onBlur:{control:"none"},onCancel:{control:"none"},onChange:{control:"none"},onClear:{control:"none"},onClick:{control:"none"},onClose:{control:"none"},onConfirm:{control:"none"},onDismiss:{control:"none"},onFilter:{control:"none"},onSubmit:{control:"none"},portalClassName:{control:"none"},portalContainer:{control:"none"},popoverZIndex:{control:"none"},ref:{control:"none"},scrollContainer:{control:"none"},usePortal:{control:"none"}},e.storybookExcludedControlParams=["aria-controls","aria-describedby","aria-label","aria-labelledby","aria-describedby","className","id","onBlur","onCancel","onChange","onClear","onClick","onConfirm","onDismiss","onFilter","popoverZIndex","portalClassName","portalContainer","ref","setOpen","scrollContainer","usePortal"],e.typeIs=b,e.validateChildren=function(e,t){var n,r=null===(n=s.default.Children.map(e,(function(e){if(t.some((function(t){return T(e,t)})))return e})))||void 0===n?void 0:n.filter((function(e){return!u.default(e)}));return u.default(e)||(null==r?void 0:r.length)===s.default.Children.count(e)||w.error("Children must be one of: ".concat(t.join(", ")),"Received children: ",e),r},Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=index.js.map
export { storybookArgTypes, storybookExcludedArgTypes, } from './storybookArgTypes';
export { storybookExcludedControlParams } from './storybookExcludedControlParams';
export { default as IntrinsicElements } from './IntrinsicElements';
export { StoryMeta, type StoryMetaType } from './StoryMeta';
export { StoryMeta } from './StoryMeta';
export { type StoryMetaType, type StoryType, type PlayFn, } from './StoryMeta.types';
export { type ExtendedComponentProps, type GeneratedStoryFn, type GeneratedStoryConfig, type InstanceDecorator, } from './GeneratedStoryDecorator.types';
//# sourceMappingURL=index.d.ts.map

@@ -17,2 +17,10 @@ import { InputType } from '@storybook/csf';

};
/**
* `defaultValue` is deprecated in Storybook 7.
*
* Use `args` instead
*
* @deprecated
*/
defaultValue?: any;
}

@@ -19,0 +27,0 @@ export declare const storybookArgTypes: Record<string, StoryArgType>;

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

import { Meta } from '@storybook/react';
import { ComponentProps } from 'react';
import DarkModeProps from '../DarkModeProps';
import { StoryArgType } from './storybookArgTypes';
interface LeafyGreenProviderProps extends DarkModeProps {
baseFontSize?: number;
}
export declare type StoryMetaType<T extends React.ElementType, XP extends Record<string, any> = {}> = Omit<Meta<T>, 'component' | 'argTypes' | 'args'> & {
parameters: Meta<T>['parameters'] & {
/**
* The default story to be displayed on `mongodb.design`.
* Explicitly exclude a default story by setting this to `null`
*/
default: string | null;
};
argTypes?: Partial<{
[key in keyof ComponentProps<T>]: StoryArgType;
} | {
[key in keyof LeafyGreenProviderProps]: StoryArgType;
} | {
[key in keyof XP]: StoryArgType;
}>;
args?: Partial<ComponentProps<T> | LeafyGreenProviderProps | XP>;
component?: T;
title?: string;
};
/// <reference types="react" />
import { StoryMetaType } from './StoryMeta.types';
/**
* Base Meta definition declared in ./.storybook/preview.js
*/
/**
*

@@ -50,3 +23,2 @@ * Storybook 7.x requires a statically defined object as the default export.

export declare const StoryMeta: <T extends import("react").ElementType<any>, XP extends Record<string, any>>(meta?: StoryMetaType<T, XP>) => StoryMetaType<T, XP>;
export {};
//# sourceMappingURL=StoryMeta.d.ts.map
{
"name": "@leafygreen-ui/lib",
"version": "10.3.4",
"version": "10.4.0",
"description": "leafyGreen UI Kit Internal Library",

@@ -27,6 +27,14 @@ "main": "./dist/index.js",

"dependencies": {
"@storybook/csf": "^0.0.2-next.10",
"@storybook/csf": "^0.1.0",
"lodash": "^4.17.21",
"prop-types": "^15.7.2"
},
"devDependencies": {
"@leafygreen-ui/badge": "^8.0.8",
"@leafygreen-ui/emotion": "^4.0.4",
"@leafygreen-ui/icon": "^11.17.0",
"@leafygreen-ui/leafygreen-provider": "^3.1.2",
"@leafygreen-ui/palette": "^4.0.4",
"@leafygreen-ui/tokens": "^2.1.1"
},
"gitHead": "dd71a2d404218ccec2e657df9c0263dc1c15b9e0",

@@ -33,0 +41,0 @@ "homepage": "https://github.com/mongodb/leafygreen-ui/tree/main/packages/lib",

@@ -13,4 +13,10 @@ import isObject from 'lodash/isObject';

export {
type ExtendedComponentProps,
type GeneratedStoryConfig,
type GeneratedStoryFn,
type InstanceDecorator,
type PlayFn,
StoryMeta,
type StoryMetaType,
type StoryType,
storybookArgTypes,

@@ -17,0 +23,0 @@ storybookExcludedArgTypes,

@@ -7,2 +7,13 @@ export {

export { default as IntrinsicElements } from './IntrinsicElements';
export { StoryMeta, type StoryMetaType } from './StoryMeta';
export { StoryMeta } from './StoryMeta';
export {
type StoryMetaType,
type StoryType,
type PlayFn,
} from './StoryMeta.types';
export {
type ExtendedComponentProps,
type GeneratedStoryFn,
type GeneratedStoryConfig,
type InstanceDecorator,
} from './GeneratedStoryDecorator.types';

@@ -22,2 +22,11 @@ import { InputType } from '@storybook/csf';

};
/**
* `defaultValue` is deprecated in Storybook 7.
*
* Use `args` instead
*
* @deprecated
*/
defaultValue?: any;
}

@@ -24,0 +33,0 @@

@@ -1,46 +0,6 @@

import { Meta } from '@storybook/react';
import mergeWith from 'lodash/mergeWith';
import { ComponentProps } from 'react';
import DarkModeProps from '../DarkModeProps';
import { mergeWith } from 'lodash';
import { StoryArgType } from './storybookArgTypes';
import { StoryMetaType } from './StoryMeta.types';
// Re-defining LG provider prop keys here since importing from the package
// will cause circular dependencies
interface LeafyGreenProviderProps extends DarkModeProps {
baseFontSize?: number;
}
export type StoryMetaType<
T extends React.ElementType,
XP extends Record<string, any> = {},
> = Omit<Meta<T>, 'component' | 'argTypes' | 'args'> & {
parameters: Meta<T>['parameters'] & {
/**
* The default story to be displayed on `mongodb.design`.
* Explicitly exclude a default story by setting this to `null`
*/
default: string | null;
};
argTypes?: Partial<
| {
[key in keyof ComponentProps<T>]: StoryArgType;
}
| {
[key in keyof LeafyGreenProviderProps]: StoryArgType;
}
| {
[key in keyof XP]: StoryArgType;
}
>;
args?: Partial<ComponentProps<T> | LeafyGreenProviderProps | XP>;
component?: T;
title?: string;
};
/**
* Base Meta definition declared in ./.storybook/preview.js
*/
/**
*

@@ -47,0 +7,0 @@ * Storybook 7.x requires a statically defined object as the default export.

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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