@pushwoosh/kit-helpers 1.4.6 → 1.4.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.js CHANGED
@@ -1,2 +1,2 @@
1
- !function(n,e){for(var t in e)n[t]=e[t]}(exports,function(n){var e={};function t(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return n[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}return t.m=n,t.c=e,t.d=function(n,e,r){t.o(n,e)||Object.defineProperty(n,e,{enumerable:!0,get:r})},t.r=function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},t.t=function(n,e){if(1&e&&(n=t(n)),8&e)return n;if(4&e&&"object"==typeof n&&n&&n.__esModule)return n;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:n}),2&e&&"string"!=typeof n)for(var i in n)t.d(r,i,function(e){return n[e]}.bind(null,i));return r},t.n=function(n){var e=n&&n.__esModule?function(){return n.default}:function(){return n};return t.d(e,"a",e),e},t.o=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)},t.p="/",t(t.s=5)}([function(n,e){n.exports=require("react")},function(n,e){n.exports=require("tslib")},function(n,e){n.exports=require("styled-components")},function(n,e){n.exports=require("react-transition-group")},function(n,e){n.exports=require("classnames")},function(n,e,t){"use strict";t.r(e),t.d(e,"GridContainer",(function(){return s})),t.d(e,"Horizontal",(function(){return f})),t.d(e,"Vertical",(function(){return d})),t.d(e,"usePersistentFunction",(function(){return h})),t.d(e,"elementAddListener",(function(){return g})),t.d(e,"subscribeClickAway",(function(){return v})),t.d(e,"useClickAway",(function(){return y})),t.d(e,"VerticalExpand",(function(){return w}));var r,i,o,a=t(1),c=t(2),u=t.n(c),l=function(n){return"number"==typeof n},s=u.a.div.withConfig({displayName:"GridContainer",componentId:"sc-td6pqh-0"})(r||(r=Object(a.__makeTemplateObject)(["\n display: grid;\n ","\n ","\n ","\n ","\n"],["\n display: grid;\n ","\n ","\n ","\n ","\n"])),(function(n){var e=n.gap;return e&&"grid-gap: ".concat(l(e)?"".concat(e,"px"):e,";")}),(function(n){var e=n.columns;return e&&"grid-template-columns: ".concat(l(e)?"repeat(".concat(e,", 1fr)"):e,";")}),(function(n){var e=n.padding;return e&&"padding: ".concat(l(e)?"".concat(e,"px"):e,";")}),(function(n){var e=n.justify;return e&&"justify-content: ".concat(e,";")})),f=u()(s).withConfig({displayName:"Horizontal",componentId:"sc-td6pqh-1"})(i||(i=Object(a.__makeTemplateObject)(["\n grid-auto-flow: column;\n"],["\n grid-auto-flow: column;\n"]))),d=u()(s).withConfig({displayName:"Vertical",componentId:"sc-td6pqh-2"})(o||(o=Object(a.__makeTemplateObject)(["\n grid-auto-flow: row;\n"],["\n grid-auto-flow: row;\n"]))),p=t(0),m=t.n(p);function h(n){var e=Object(p.useRef)(n);return e.current=n,Object(p.useCallback)((function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return e.current.apply(e,n)}),[])}function g(n,e,t){var r=Array.isArray(e)?e:[e];return r.forEach((function(e){n.addEventListener(e,t)})),function(){r.forEach((function(e){n.removeEventListener(e,t)}))}}function v(n,e){return g(document,["mousedown","touchstart"],(function(t){n&&!n.contains(t.target)&&e(t)}))}function y(n,e,t){var r=h(t);Object(p.useEffect)((function(){if(n)return v(e.current,r)}),[n,e,r])}var b,j=t(3),x=t(4),O=t.n(x),_=u()((function(n){var e=n.className,t=n.externalClassName,r=n.internalClassName,i=n.timeout,o=void 0===i?100:i,c=n.children,u=Object(a.__rest)(n,["className","externalClassName","internalClassName","timeout","children"]),l=Object(p.useRef)(null),s=Object(p.useRef)(null),f=Object(p.useState)(),d=f[0],h=f[1];function g(){var n=s.current.getBoundingClientRect();h({"--timeout":"".concat(o,"ms"),"--width":"".concat(n.width,"px"),"--height":"".concat(n.height,"px")})}return Object(p.useEffect)(g,[o]),m.a.createElement(j.CSSTransition,Object(a.__assign)({},u,{timeout:o,classNames:e,onEnter:g,onExit:g,nodeRef:l}),m.a.createElement("div",{ref:l,className:O()(e,t),style:d},m.a.createElement("div",{ref:s,className:r},c)))})).withConfig({displayName:"ExpandTransition",componentId:"sc-7jjhp8-0"})(b||(b=Object(a.__makeTemplateObject)(["\n overflow: hidden;\n transition: height var(--timeout) linear, opacity var(--timeout) linear;\n\n &-enter {\n opacity: 0;\n height: 0;\n }\n\n &-enter-active {\n opacity: 1;\n height: var(--height);\n }\n\n &-exit {\n opacity: 1;\n height: var(--height);\n }\n\n &-exit-active {\n opacity: 0;\n height: 0;\n }\n"],["\n overflow: hidden;\n transition: height var(--timeout) linear, opacity var(--timeout) linear;\n\n &-enter {\n opacity: 0;\n height: 0;\n }\n\n &-enter-active {\n opacity: 1;\n height: var(--height);\n }\n\n &-exit {\n opacity: 1;\n height: var(--height);\n }\n\n &-exit-active {\n opacity: 0;\n height: 0;\n }\n"]))),w=function(n){var e=n.expanded,t=n.children,r=Object(a.__rest)(n,["expanded","children"]);return m.a.createElement(j.TransitionGroup,{component:null},e&&m.a.createElement(_,Object(a.__assign)({},r,{key:0}),"function"==typeof t?t():t))}}]));
1
+ !function(n,t){for(var e in t)n[e]=t[e]}(exports,function(n){var t={};function e(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return n[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}return e.m=n,e.c=t,e.d=function(n,t,r){e.o(n,t)||Object.defineProperty(n,t,{enumerable:!0,get:r})},e.r=function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},e.t=function(n,t){if(1&t&&(n=e(n)),8&t)return n;if(4&t&&"object"==typeof n&&n&&n.__esModule)return n;var r=Object.create(null);if(e.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:n}),2&t&&"string"!=typeof n)for(var i in n)e.d(r,i,function(t){return n[t]}.bind(null,i));return r},e.n=function(n){var t=n&&n.__esModule?function(){return n.default}:function(){return n};return e.d(t,"a",t),t},e.o=function(n,t){return Object.prototype.hasOwnProperty.call(n,t)},e.p="/",e(e.s=4)}([function(n,t){n.exports=require("react")},function(n,t){n.exports=require("tslib")},function(n,t){n.exports=require("styled-components")},function(n,t){n.exports=require("react-transition-group")},function(n,t,e){"use strict";e.r(t),e.d(t,"GridContainer",(function(){return f})),e.d(t,"Horizontal",(function(){return s})),e.d(t,"Vertical",(function(){return d})),e.d(t,"usePersistentFunction",(function(){return h})),e.d(t,"elementAddListener",(function(){return g})),e.d(t,"subscribeClickAway",(function(){return v})),e.d(t,"useClickAway",(function(){return y})),e.d(t,"VerticalExpand",(function(){return x}));var r,i,o,a=e(1),c=e(2),u=e.n(c),l=function(n){return"number"==typeof n},f=u.a.div.withConfig({displayName:"GridContainer",componentId:"sc-td6pqh-0"})(r||(r=Object(a.__makeTemplateObject)(["\n display: grid;\n ","\n ","\n ","\n ","\n"],["\n display: grid;\n ","\n ","\n ","\n ","\n"])),(function(n){var t=n.gap;return t&&"grid-gap: ".concat(l(t)?"".concat(t,"px"):t,";")}),(function(n){var t=n.columns;return t&&"grid-template-columns: ".concat(l(t)?"repeat(".concat(t,", 1fr)"):t,";")}),(function(n){var t=n.padding;return t&&"padding: ".concat(l(t)?"".concat(t,"px"):t,";")}),(function(n){var t=n.justify;return t&&"justify-content: ".concat(t,";")})),s=u()(f).withConfig({displayName:"Horizontal",componentId:"sc-td6pqh-1"})(i||(i=Object(a.__makeTemplateObject)(["\n grid-auto-flow: column;\n"],["\n grid-auto-flow: column;\n"]))),d=u()(f).withConfig({displayName:"Vertical",componentId:"sc-td6pqh-2"})(o||(o=Object(a.__makeTemplateObject)(["\n grid-auto-flow: row;\n"],["\n grid-auto-flow: row;\n"]))),p=e(0),m=e.n(p);function h(n){var t=Object(p.useRef)(n);return t.current=n,Object(p.useCallback)((function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return t.current.apply(t,n)}),[])}function g(n,t,e){var r=Array.isArray(t)?t:[t];return r.forEach((function(t){n.addEventListener(t,e)})),function(){r.forEach((function(t){n.removeEventListener(t,e)}))}}function v(n,t){return g(document,["mousedown","touchstart"],(function(e){n&&!n.contains(e.target)&&t(e)}))}function y(n,t,e){var r=h(e);Object(p.useEffect)((function(){if(n)return v(t.current,r)}),[n,t,r])}var b,j=e(3),O=u()((function(n){var t=n.className,e=n.externalClassName,r=n.internalClassName,i=n.timeout,o=void 0===i?100:i,c=n.children,u=Object(a.__rest)(n,["className","externalClassName","internalClassName","timeout","children"]),l=Object(p.useRef)(null),f=Object(p.useRef)(null),s=Object(p.useState)(),d=s[0],h=s[1];function g(){var n=f.current.getBoundingClientRect();h({"--timeout":"".concat(o,"ms"),"--width":"".concat(n.width,"px"),"--height":"".concat(n.height,"px")})}return Object(p.useEffect)(g,[o]),m.a.createElement(j.CSSTransition,Object(a.__assign)({},u,{timeout:o,classNames:t,onEnter:g,onExit:g,nodeRef:l}),m.a.createElement("div",{ref:l,className:e?"".concat(t," ").concat(e):t,style:d},m.a.createElement("div",{ref:f,className:r},c)))})).withConfig({displayName:"ExpandTransition",componentId:"sc-7jjhp8-0"})(b||(b=Object(a.__makeTemplateObject)(["\n overflow: hidden;\n transition: height var(--timeout) linear, opacity var(--timeout) linear;\n\n &-enter {\n opacity: 0;\n height: 0;\n }\n\n &-enter-active {\n opacity: 1;\n height: var(--height);\n }\n\n &-exit {\n opacity: 1;\n height: var(--height);\n }\n\n &-exit-active {\n opacity: 0;\n height: 0;\n }\n"],["\n overflow: hidden;\n transition: height var(--timeout) linear, opacity var(--timeout) linear;\n\n &-enter {\n opacity: 0;\n height: 0;\n }\n\n &-enter-active {\n opacity: 1;\n height: var(--height);\n }\n\n &-exit {\n opacity: 1;\n height: var(--height);\n }\n\n &-exit-active {\n opacity: 0;\n height: 0;\n }\n"]))),x=function(n){var t=n.expanded,e=n.children,r=Object(a.__rest)(n,["expanded","children"]);return m.a.createElement(j.TransitionGroup,{component:null},t&&m.a.createElement(O,Object(a.__assign)({},r,{key:0}),"function"==typeof e?e():e))}}]));
2
2
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"react\"","webpack:///external \"tslib\"","webpack:///external \"styled-components\"","webpack:///external \"react-transition-group\"","webpack:///external \"classnames\"","webpack:///./src/grid.tsx","webpack:///./src/hooks.ts","webpack:///./src/expand.tsx"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","require","isNumber","GridContainer","styled","div","_a","gap","columns","padding","justify","Horizontal","Vertical","usePersistentFunction","callback","ref","useRef","current","useCallback","_i","args","elementAddListener","element","eventNames","listener","eventNamesArray","Array","isArray","forEach","eventName","addEventListener","removeEventListener","subscribeClickAway","document","event","contains","target","useClickAway","use","cb","mcb","useEffect","ExpandTransition","className","externalClassName","internalClassName","_b","timeout","children","rest","refExternal","refInternal","useState","externalStyle","setExternalStyle","updateStyle","rect","getBoundingClientRect","width","height","React","CSSTransition","classNames","onEnter","onExit","nodeRef","cn","style","VerticalExpand","expanded","TransitionGroup","component"],"mappings":"6DACE,IAAIA,EAAmB,CAAC,EAGxB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,CAAC,GAUX,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,OACf,CAyDA,OArDAF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU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GACF,CAEM,SAAUG,EAAaC,EAAcvB,EAAUwB,GACnD,IAAMC,EAAM3B,EAAsB0B,GAElCE,qBAAU,WACR,GAAIH,EACF,OAAON,EAAmBjB,EAAIE,QAASuB,EAE3C,GAAG,CAACF,EAAKvB,EAAKyB,GAChB,C,6BCsBME,EAAmBtC,KA/C+B,SAACE,GACvD,IAAAqC,EAAS,YACTC,EAAiB,oBACjBC,EAAiB,oBACjBC,YAAAC,OAAO,IAAG,MAAG,EACbC,EAAQ,WACLC,EAAI,mBANgD,4EAQjDC,EAAclC,iBAAuB,MACrCmC,EAAcnC,iBAAuB,MACrC,EAAoCoC,qBAAnCC,EAAa,KAAEC,EAAgB,KAEtC,SAASC,IACP,IAAMC,EAAQL,EAAYlC,QAA2BwC,wBACrDH,EAAiB,CACf,YAAa,UAAGP,EAAO,MACvB,UAAW,UAAGS,EAAKE,MAAK,MACxB,WAAY,UAAGF,EAAKG,OAAM,OAE9B,CAGA,OAFAlB,oBAAUc,EAAa,CAACR,IAGtBa,kBAACC,gBAAa,sBACRZ,EAAI,CACRF,QAASA,EACTe,WAAYnB,EACZoB,QAASR,EACTS,OAAQT,EACRU,QAASf,IAETU,yBACE7C,IAAKmC,EACLP,UAAWuB,IAAGvB,EAAWC,GACzBuB,MAAOd,GAEPO,yBACE7C,IAAKoC,EACLR,UAAWE,GAEVG,IAKX,IAEqD,sEAA5B5C,CAA4B,wuBAgCxCgE,EAA0C,SAAC9D,GACtD,IAAA+D,EAAQ,WACRrB,EAAQ,WACLC,EAAI,mBAH+C,yBAIlD,OACJW,kBAACU,kBAAe,CAACC,UAAW,MACzBF,GACCT,kBAAClB,EAAgB,sBACXO,EAAI,CACRzD,IAAK,IAEgB,mBAAbwD,EAA0BA,IAAaA,G","file":"index.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 5);\n","module.exports = require(\"react\");","module.exports = require(\"tslib\");","module.exports = require(\"styled-components\");","module.exports = require(\"react-transition-group\");","module.exports = require(\"classnames\");","import styled from 'styled-components';\n\nconst isNumber = (value: unknown): value is number => typeof value === 'number';\n\nexport const GridContainer = styled.div<{\n gap?: number | string;\n columns?: number | string;\n padding?: number | string;\n justify?: 'center' | 'start' | 'end' | 'space-between';\n}>`\n display: grid;\n ${({ gap }): any => gap && `grid-gap: ${isNumber(gap) ? `${gap}px` : gap};`}\n ${({ columns }): any => columns && `grid-template-columns: ${isNumber(columns) ? `repeat(${columns}, 1fr)` : columns};`}\n ${({ padding }): any => padding && `padding: ${isNumber(padding) ? `${padding}px` : padding};`}\n ${({ justify }): any => justify && `justify-content: ${justify};`}\n`;\n\nexport const Horizontal = styled(GridContainer)`\n grid-auto-flow: column;\n`;\n\nexport const Vertical = styled(GridContainer)`\n grid-auto-flow: row;\n`;\n","import { useRef, useCallback, useEffect } from 'react';\n\nexport function usePersistentFunction<T extends (...args: any[]) => any>(callback: T): T {\n const ref = useRef(callback);\n ref.current = callback;\n return useCallback((...args: any) => ref.current(...args), []) as T;\n}\n\nexport function elementAddListener<K extends keyof HTMLElementEventMap, E extends HTMLElement>(\n element: E,\n eventNames: K | K[],\n listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => void,\n): () => void {\n const eventNamesArray = Array.isArray(eventNames) ? eventNames : [eventNames];\n eventNamesArray.forEach((eventName) => {\n element.addEventListener(eventName, listener);\n });\n return (): void => {\n eventNamesArray.forEach((eventName) => {\n element.removeEventListener(eventName, listener);\n });\n };\n}\n\nexport function subscribeClickAway<T extends HTMLElement>(element: T, callback: EventListener): () => void {\n return elementAddListener(document as any, ['mousedown', 'touchstart'], (event) => {\n if (element && !element.contains(event.target as any)) {\n callback(event);\n }\n });\n}\n\nexport function useClickAway(use: boolean, ref: any, cb: EventListener): void {\n const mcb = usePersistentFunction(cb);\n\n useEffect(() => { // eslint-disable-line consistent-return\n if (use) {\n return subscribeClickAway(ref.current, mcb) as any;\n }\n }, [use, ref, mcb]);\n}\n","/* eslint-disable react/require-default-props, react/jsx-no-bind */\n\nimport React, {\n FC, useEffect, useRef, useState,\n} from 'react';\nimport { CSSTransition, TransitionGroup } from 'react-transition-group';\nimport styled from 'styled-components';\nimport cn from 'classnames';\n\ntype ExpandTransitionProps = {\n className?: string;\n timeout?: number;\n externalClassName?: string;\n internalClassName?: string;\n};\nconst ExpandTransitionComp: FC<ExpandTransitionProps> = ({\n className,\n externalClassName,\n internalClassName,\n timeout = 100,\n children,\n ...rest\n}) => {\n const refExternal = useRef<HTMLDivElement>(null);\n const refInternal = useRef<HTMLDivElement>(null);\n const [externalStyle, setExternalStyle] = useState<Record<string, string>>();\n\n function updateStyle(): void {\n const rect = (refInternal.current as HTMLDivElement).getBoundingClientRect();\n setExternalStyle({\n '--timeout': `${timeout}ms`,\n '--width': `${rect.width}px`,\n '--height': `${rect.height}px`,\n });\n }\n useEffect(updateStyle, [timeout]);\n\n return (\n <CSSTransition\n {...rest}\n timeout={timeout}\n classNames={className}\n onEnter={updateStyle}\n onExit={updateStyle}\n nodeRef={refExternal}\n >\n <div\n ref={refExternal}\n className={cn(className, externalClassName)}\n style={externalStyle}\n >\n <div\n ref={refInternal}\n className={internalClassName}\n >\n {children}\n </div>\n </div>\n </CSSTransition>\n );\n};\n\nconst ExpandTransition = styled(ExpandTransitionComp)`\n overflow: hidden;\n transition: height var(--timeout) linear, opacity var(--timeout) linear;\n\n &-enter {\n opacity: 0;\n height: 0;\n }\n\n &-enter-active {\n opacity: 1;\n height: var(--height);\n }\n\n &-exit {\n opacity: 1;\n height: var(--height);\n }\n\n &-exit-active {\n opacity: 0;\n height: 0;\n }\n`;\n\ntype VerticalExpandProps = {\n expanded: boolean;\n timeout?: number;\n externalClassName?: string;\n internalClassName?: string;\n\n};\nexport const VerticalExpand: FC<VerticalExpandProps> = ({\n expanded,\n children,\n ...rest\n}) => (\n <TransitionGroup component={null}>\n {expanded && (\n <ExpandTransition\n {...rest}\n key={0}\n >\n {typeof children === 'function' ? children() : children}\n </ExpandTransition>\n )}\n </TransitionGroup>\n);\n"],"sourceRoot":""}
1
+ {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"react\"","webpack:///external \"tslib\"","webpack:///external \"styled-components\"","webpack:///external \"react-transition-group\"","webpack:///./src/grid.tsx","webpack:///./src/hooks.ts","webpack:///./src/expand.tsx"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","require","isNumber","GridContainer","styled","div","_a","gap","columns","padding","justify","Horizontal","Vertical","usePersistentFunction","callback","ref","useRef","current","useCallback","_i","args","elementAddListener","element","eventNames","listener","eventNamesArray","Array","isArray","forEach","eventName","addEventListener","removeEventListener","subscribeClickAway","document","event","contains","target","useClickAway","use","cb","mcb","useEffect","ExpandTransition","className","externalClassName","internalClassName","_b","timeout","children","rest","refExternal","refInternal","useState","externalStyle","setExternalStyle","updateStyle","rect","getBoundingClientRect","width","height","React","CSSTransition","classNames","onEnter","onExit","nodeRef","style","VerticalExpand","expanded","TransitionGroup","component"],"mappings":"6DACE,IAAIA,EAAmB,CAAC,EAGxB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,CAAC,GAUX,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QA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\tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 4);\n","module.exports = require(\"react\");","module.exports = require(\"tslib\");","module.exports = require(\"styled-components\");","module.exports = require(\"react-transition-group\");","import styled from 'styled-components';\n\nconst isNumber = (value: unknown): value is number => typeof value === 'number';\n\nexport const GridContainer = styled.div<{\n gap?: number | string;\n columns?: number | string;\n padding?: number | string;\n justify?: 'center' | 'start' | 'end' | 'space-between';\n}>`\n display: grid;\n ${({ gap }): any => gap && `grid-gap: ${isNumber(gap) ? `${gap}px` : gap};`}\n ${({ columns }): any => columns && `grid-template-columns: ${isNumber(columns) ? `repeat(${columns}, 1fr)` : columns};`}\n ${({ padding }): any => padding && `padding: ${isNumber(padding) ? `${padding}px` : padding};`}\n ${({ justify }): any => justify && `justify-content: ${justify};`}\n`;\n\nexport const Horizontal = styled(GridContainer)`\n grid-auto-flow: column;\n`;\n\nexport const Vertical = styled(GridContainer)`\n grid-auto-flow: row;\n`;\n","import { useRef, useCallback, useEffect } from 'react';\n\nexport function usePersistentFunction<T extends (...args: any[]) => any>(callback: T): T {\n const ref = useRef(callback);\n ref.current = callback;\n return useCallback((...args: any) => ref.current(...args), []) as T;\n}\n\nexport function elementAddListener<K extends keyof HTMLElementEventMap, E extends HTMLElement>(\n element: E,\n eventNames: K | K[],\n listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => void,\n): () => void {\n const eventNamesArray = Array.isArray(eventNames) ? eventNames : [eventNames];\n eventNamesArray.forEach((eventName) => {\n element.addEventListener(eventName, listener);\n });\n return (): void => {\n eventNamesArray.forEach((eventName) => {\n element.removeEventListener(eventName, listener);\n });\n };\n}\n\nexport function subscribeClickAway<T extends HTMLElement>(element: T, callback: EventListener): () => void {\n return elementAddListener(document as any, ['mousedown', 'touchstart'], (event) => {\n if (element && !element.contains(event.target as any)) {\n callback(event);\n }\n });\n}\n\nexport function useClickAway(use: boolean, ref: any, cb: EventListener): void {\n const mcb = usePersistentFunction(cb);\n\n useEffect(() => { // eslint-disable-line consistent-return\n if (use) {\n return subscribeClickAway(ref.current, mcb) as any;\n }\n }, [use, ref, mcb]);\n}\n","/* eslint-disable react/require-default-props, react/jsx-no-bind */\n\nimport React, {\n FC, useEffect, useRef, useState,\n} from 'react';\nimport { CSSTransition, TransitionGroup } from 'react-transition-group';\nimport styled from 'styled-components';\n\ntype ExpandTransitionProps = {\n className?: string;\n timeout?: number;\n externalClassName?: string;\n internalClassName?: string;\n};\nconst ExpandTransitionComp: FC<ExpandTransitionProps> = ({\n className,\n externalClassName,\n internalClassName,\n timeout = 100,\n children,\n ...rest\n}) => {\n const refExternal = useRef<HTMLDivElement>(null);\n const refInternal = useRef<HTMLDivElement>(null);\n const [externalStyle, setExternalStyle] = useState<Record<string, string>>();\n\n function updateStyle(): void {\n const rect = (refInternal.current as HTMLDivElement).getBoundingClientRect();\n setExternalStyle({\n '--timeout': `${timeout}ms`,\n '--width': `${rect.width}px`,\n '--height': `${rect.height}px`,\n });\n }\n useEffect(updateStyle, [timeout]);\n\n return (\n <CSSTransition\n {...rest}\n timeout={timeout}\n classNames={className}\n onEnter={updateStyle}\n onExit={updateStyle}\n nodeRef={refExternal}\n >\n <div\n ref={refExternal}\n className={externalClassName ? `${className} ${externalClassName}` : className}\n style={externalStyle}\n >\n <div\n ref={refInternal}\n className={internalClassName}\n >\n {children}\n </div>\n </div>\n </CSSTransition>\n );\n};\n\nconst ExpandTransition = styled(ExpandTransitionComp)`\n overflow: hidden;\n transition: height var(--timeout) linear, opacity var(--timeout) linear;\n\n &-enter {\n opacity: 0;\n height: 0;\n }\n\n &-enter-active {\n opacity: 1;\n height: var(--height);\n }\n\n &-exit {\n opacity: 1;\n height: var(--height);\n }\n\n &-exit-active {\n opacity: 0;\n height: 0;\n }\n`;\n\ntype VerticalExpandProps = {\n expanded: boolean;\n timeout?: number;\n externalClassName?: string;\n internalClassName?: string;\n};\nexport const VerticalExpand: FC<VerticalExpandProps> = ({\n expanded,\n children,\n ...rest\n}) => (\n <TransitionGroup component={null}>\n {expanded && (\n <ExpandTransition\n {...rest}\n key={0}\n >\n {typeof children === 'function' ? children() : children}\n </ExpandTransition>\n )}\n </TransitionGroup>\n);\n"],"sourceRoot":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushwoosh/kit-helpers",
3
- "version": "1.4.6",
3
+ "version": "1.4.8",
4
4
  "description": "React component for build Pushwoosh products",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -33,7 +33,6 @@
33
33
  "@typescript-eslint/parser": "^4.33.0",
34
34
  "babel-loader": "^8.2.3",
35
35
  "babel-plugin-styled-components": "^1.13.3",
36
- "classnames": "^2.3.2",
37
36
  "clean-webpack-plugin": "^3.0.0",
38
37
  "cross-env": "^7.0.3",
39
38
  "dotenv": "^10.0.0",
@@ -62,7 +61,6 @@
62
61
  "webpack-merge": "^5.8.0"
63
62
  },
64
63
  "peerDependencies": {
65
- "classnames": "^2.0.0",
66
64
  "react": "^16.14.0",
67
65
  "react-transition-group": "^4.4.4",
68
66
  "styled-components": "^5.3.3",