@bigbinary/neetoui 6.8.1 → 6.8.3
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/dist/Accordion.js +9 -7
- package/dist/Accordion.js.map +1 -1
- package/dist/Input.js +1 -0
- package/dist/Input.js.map +1 -1
- package/dist/MultiEmailInput.js +37 -5
- package/dist/MultiEmailInput.js.map +1 -1
- package/dist/cjs/Accordion.js +11 -9
- package/dist/cjs/Accordion.js.map +1 -1
- package/dist/cjs/Input.js +1 -0
- package/dist/cjs/Input.js.map +1 -1
- package/dist/cjs/MultiEmailInput.js +37 -5
- package/dist/cjs/MultiEmailInput.js.map +1 -1
- package/dist/cjs/index.css +1 -1
- package/dist/cjs/index.js +2 -2
- package/dist/index.css +1 -1
- package/dist/index.js +2 -2
- package/package.json +1 -1
- package/types/Accordion.d.ts +1 -0
package/dist/Accordion.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import _extends from '@babel/runtime/helpers/extends';
|
|
1
2
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
3
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
4
|
+
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
3
5
|
import * as React from 'react';
|
|
4
6
|
import React__default, { useRef, useState, useCallback, useId, useInsertionEffect, useMemo, useEffect, useContext, cloneElement, Children, isValidElement } from 'react';
|
|
5
7
|
import classnames from 'classnames';
|
|
6
8
|
import { isEmpty } from 'ramda';
|
|
7
|
-
import _extends from '@babel/runtime/helpers/extends';
|
|
8
9
|
import { Right } from '@bigbinary/neeto-icons';
|
|
9
|
-
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
10
10
|
import { u as useIsomorphicLayoutEffect, f as frame, a as useConstant, P as PresenceContext, i as invariant, L as LayoutGroupContext, m as motion } from './motion-087daf52.js';
|
|
11
11
|
|
|
12
12
|
function useIsMounted() {
|
|
@@ -296,14 +296,14 @@ const AnimatePresence = ({ children, custom, initial = true, onExitComplete, exi
|
|
|
296
296
|
: childrenToRender.map((child) => cloneElement(child))));
|
|
297
297
|
};
|
|
298
298
|
|
|
299
|
-
var _excluded = ["open", "children", "className"];
|
|
299
|
+
var _excluded$1 = ["open", "children", "className"];
|
|
300
300
|
var Collapse = function Collapse(_ref) {
|
|
301
301
|
var _ref$open = _ref.open,
|
|
302
302
|
open = _ref$open === void 0 ? false : _ref$open,
|
|
303
303
|
children = _ref.children,
|
|
304
304
|
_ref$className = _ref.className,
|
|
305
305
|
className = _ref$className === void 0 ? "" : _ref$className,
|
|
306
|
-
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
306
|
+
otherProps = _objectWithoutProperties(_ref, _excluded$1);
|
|
307
307
|
return /*#__PURE__*/React__default.createElement(AnimatePresence, null, open && /*#__PURE__*/React__default.createElement(motion.div, _extends({
|
|
308
308
|
animate: {
|
|
309
309
|
opacity: 1,
|
|
@@ -391,6 +391,7 @@ var Item = function Item(_ref) {
|
|
|
391
391
|
};
|
|
392
392
|
Item.displayName = "Accordion.Item";
|
|
393
393
|
|
|
394
|
+
var _excluded = ["children", "defaultActiveKey", "padded", "style", "className"];
|
|
394
395
|
var ACCORDION_STYLES = {
|
|
395
396
|
primary: "primary",
|
|
396
397
|
secondary: "secondary"
|
|
@@ -404,7 +405,8 @@ var Accordion = function Accordion(_ref) {
|
|
|
404
405
|
_ref$style = _ref.style,
|
|
405
406
|
style = _ref$style === void 0 ? ACCORDION_STYLES.primary : _ref$style,
|
|
406
407
|
_ref$className = _ref.className,
|
|
407
|
-
className = _ref$className === void 0 ? "" : _ref$className
|
|
408
|
+
className = _ref$className === void 0 ? "" : _ref$className,
|
|
409
|
+
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
408
410
|
var _useState = useState(defaultActiveKey),
|
|
409
411
|
_useState2 = _slicedToArray(_useState, 2),
|
|
410
412
|
openTab = _useState2[0],
|
|
@@ -412,12 +414,12 @@ var Accordion = function Accordion(_ref) {
|
|
|
412
414
|
useEffect(function () {
|
|
413
415
|
setOpenTab(defaultActiveKey);
|
|
414
416
|
}, [defaultActiveKey]);
|
|
415
|
-
return /*#__PURE__*/React__default.createElement("div", {
|
|
417
|
+
return /*#__PURE__*/React__default.createElement("div", _extends({
|
|
416
418
|
className: classnames("neeto-ui-accordions-outer-wrapper", _defineProperty({
|
|
417
419
|
"neeto-ui-accordions-outer-wrapper--padded": padded,
|
|
418
420
|
"neeto-ui-accordions-outer-wrapper--secondary": style === ACCORDION_STYLES.secondary
|
|
419
421
|
}, className, className))
|
|
420
|
-
}, React__default.Children.map(children, function (child, index) {
|
|
422
|
+
}, otherProps), React__default.Children.map(children, function (child, index) {
|
|
421
423
|
var isSingleOrLastChild = isEmpty(children) || index === children.length - 1;
|
|
422
424
|
return /*#__PURE__*/React__default.cloneElement(child, {
|
|
423
425
|
id: index,
|
package/dist/Accordion.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Accordion.js","sources":["../node_modules/framer-motion/dist/es/utils/use-is-mounted.mjs","../node_modules/framer-motion/dist/es/utils/use-force-update.mjs","../node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.mjs","../node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.mjs","../node_modules/framer-motion/dist/es/utils/use-unmount-effect.mjs","../node_modules/framer-motion/dist/es/components/AnimatePresence/index.mjs","../src/components/Accordion/Collapse.jsx","../src/components/Accordion/Item.jsx","../src/components/Accordion/index.jsx"],"sourcesContent":["import { useRef } from 'react';\nimport { useIsomorphicLayoutEffect } from './use-isomorphic-effect.mjs';\n\nfunction useIsMounted() {\n const isMounted = useRef(false);\n useIsomorphicLayoutEffect(() => {\n isMounted.current = true;\n return () => {\n isMounted.current = false;\n };\n }, []);\n return isMounted;\n}\n\nexport { useIsMounted };\n","import { useState, useCallback } from 'react';\nimport { useIsMounted } from './use-is-mounted.mjs';\nimport { frame } from '../frameloop/frame.mjs';\n\nfunction useForceUpdate() {\n const isMounted = useIsMounted();\n const [forcedRenderCount, setForcedRenderCount] = useState(0);\n const forceRender = useCallback(() => {\n isMounted.current && setForcedRenderCount(forcedRenderCount + 1);\n }, [forcedRenderCount]);\n /**\n * Defer this to the end of the next animation frame in case there are multiple\n * synchronous calls.\n */\n const deferredForceRender = useCallback(() => frame.postRender(forceRender), [forceRender]);\n return [deferredForceRender, forcedRenderCount];\n}\n\nexport { useForceUpdate };\n","import * as React from 'react';\nimport { useId, useRef, useInsertionEffect } from 'react';\n\n/**\n * Measurement functionality has to be within a separate component\n * to leverage snapshot lifecycle.\n */\nclass PopChildMeasure extends React.Component {\n getSnapshotBeforeUpdate(prevProps) {\n const element = this.props.childRef.current;\n if (element && prevProps.isPresent && !this.props.isPresent) {\n const size = this.props.sizeRef.current;\n size.height = element.offsetHeight || 0;\n size.width = element.offsetWidth || 0;\n size.top = element.offsetTop;\n size.left = element.offsetLeft;\n }\n return null;\n }\n /**\n * Required with getSnapshotBeforeUpdate to stop React complaining.\n */\n componentDidUpdate() { }\n render() {\n return this.props.children;\n }\n}\nfunction PopChild({ children, isPresent }) {\n const id = useId();\n const ref = useRef(null);\n const size = useRef({\n width: 0,\n height: 0,\n top: 0,\n left: 0,\n });\n /**\n * We create and inject a style block so we can apply this explicit\n * sizing in a non-destructive manner by just deleting the style block.\n *\n * We can't apply size via render as the measurement happens\n * in getSnapshotBeforeUpdate (post-render), likewise if we apply the\n * styles directly on the DOM node, we might be overwriting\n * styles set via the style prop.\n */\n useInsertionEffect(() => {\n const { width, height, top, left } = size.current;\n if (isPresent || !ref.current || !width || !height)\n return;\n ref.current.dataset.motionPopId = id;\n const style = document.createElement(\"style\");\n document.head.appendChild(style);\n if (style.sheet) {\n style.sheet.insertRule(`\n [data-motion-pop-id=\"${id}\"] {\n position: absolute !important;\n width: ${width}px !important;\n height: ${height}px !important;\n top: ${top}px !important;\n left: ${left}px !important;\n }\n `);\n }\n return () => {\n document.head.removeChild(style);\n };\n }, [isPresent]);\n return (React.createElement(PopChildMeasure, { isPresent: isPresent, childRef: ref, sizeRef: size }, React.cloneElement(children, { ref })));\n}\n\nexport { PopChild };\n","import * as React from 'react';\nimport { useId, useMemo } from 'react';\nimport { PresenceContext } from '../../context/PresenceContext.mjs';\nimport { useConstant } from '../../utils/use-constant.mjs';\nimport { PopChild } from './PopChild.mjs';\n\nconst PresenceChild = ({ children, initial, isPresent, onExitComplete, custom, presenceAffectsLayout, mode, }) => {\n const presenceChildren = useConstant(newChildrenMap);\n const id = useId();\n const context = useMemo(() => ({\n id,\n initial,\n isPresent,\n custom,\n onExitComplete: (childId) => {\n presenceChildren.set(childId, true);\n for (const isComplete of presenceChildren.values()) {\n if (!isComplete)\n return; // can stop searching when any is incomplete\n }\n onExitComplete && onExitComplete();\n },\n register: (childId) => {\n presenceChildren.set(childId, false);\n return () => presenceChildren.delete(childId);\n },\n }), \n /**\n * If the presence of a child affects the layout of the components around it,\n * we want to make a new context value to ensure they get re-rendered\n * so they can detect that layout change.\n */\n presenceAffectsLayout ? undefined : [isPresent]);\n useMemo(() => {\n presenceChildren.forEach((_, key) => presenceChildren.set(key, false));\n }, [isPresent]);\n /**\n * If there's no `motion` components to fire exit animations, we want to remove this\n * component immediately.\n */\n React.useEffect(() => {\n !isPresent &&\n !presenceChildren.size &&\n onExitComplete &&\n onExitComplete();\n }, [isPresent]);\n if (mode === \"popLayout\") {\n children = React.createElement(PopChild, { isPresent: isPresent }, children);\n }\n return (React.createElement(PresenceContext.Provider, { value: context }, children));\n};\nfunction newChildrenMap() {\n return new Map();\n}\n\nexport { PresenceChild };\n","import { useEffect } from 'react';\n\nfunction useUnmountEffect(callback) {\n return useEffect(() => () => callback(), []);\n}\n\nexport { useUnmountEffect };\n","import * as React from 'react';\nimport { useContext, useRef, cloneElement, Children, isValidElement } from 'react';\nimport { useForceUpdate } from '../../utils/use-force-update.mjs';\nimport { useIsMounted } from '../../utils/use-is-mounted.mjs';\nimport { PresenceChild } from './PresenceChild.mjs';\nimport { LayoutGroupContext } from '../../context/LayoutGroupContext.mjs';\nimport { useIsomorphicLayoutEffect } from '../../utils/use-isomorphic-effect.mjs';\nimport { useUnmountEffect } from '../../utils/use-unmount-effect.mjs';\nimport { invariant } from '../../utils/errors.mjs';\n\nconst getChildKey = (child) => child.key || \"\";\nfunction updateChildLookup(children, allChildren) {\n children.forEach((child) => {\n const key = getChildKey(child);\n allChildren.set(key, child);\n });\n}\nfunction onlyElements(children) {\n const filtered = [];\n // We use forEach here instead of map as map mutates the component key by preprending `.$`\n Children.forEach(children, (child) => {\n if (isValidElement(child))\n filtered.push(child);\n });\n return filtered;\n}\n/**\n * `AnimatePresence` enables the animation of components that have been removed from the tree.\n *\n * When adding/removing more than a single child, every child **must** be given a unique `key` prop.\n *\n * Any `motion` components that have an `exit` property defined will animate out when removed from\n * the tree.\n *\n * ```jsx\n * import { motion, AnimatePresence } from 'framer-motion'\n *\n * export const Items = ({ items }) => (\n * <AnimatePresence>\n * {items.map(item => (\n * <motion.div\n * key={item.id}\n * initial={{ opacity: 0 }}\n * animate={{ opacity: 1 }}\n * exit={{ opacity: 0 }}\n * />\n * ))}\n * </AnimatePresence>\n * )\n * ```\n *\n * You can sequence exit animations throughout a tree using variants.\n *\n * If a child contains multiple `motion` components with `exit` props, it will only unmount the child\n * once all `motion` components have finished animating out. Likewise, any components using\n * `usePresence` all need to call `safeToRemove`.\n *\n * @public\n */\nconst AnimatePresence = ({ children, custom, initial = true, onExitComplete, exitBeforeEnter, presenceAffectsLayout = true, mode = \"sync\", }) => {\n invariant(!exitBeforeEnter, \"Replace exitBeforeEnter with mode='wait'\");\n // We want to force a re-render once all exiting animations have finished. We\n // either use a local forceRender function, or one from a parent context if it exists.\n const forceRender = useContext(LayoutGroupContext).forceRender || useForceUpdate()[0];\n const isMounted = useIsMounted();\n // Filter out any children that aren't ReactElements. We can only track ReactElements with a props.key\n const filteredChildren = onlyElements(children);\n let childrenToRender = filteredChildren;\n const exitingChildren = useRef(new Map()).current;\n // Keep a living record of the children we're actually rendering so we\n // can diff to figure out which are entering and exiting\n const presentChildren = useRef(childrenToRender);\n // A lookup table to quickly reference components by key\n const allChildren = useRef(new Map()).current;\n // If this is the initial component render, just deal with logic surrounding whether\n // we play onMount animations or not.\n const isInitialRender = useRef(true);\n useIsomorphicLayoutEffect(() => {\n isInitialRender.current = false;\n updateChildLookup(filteredChildren, allChildren);\n presentChildren.current = childrenToRender;\n });\n useUnmountEffect(() => {\n isInitialRender.current = true;\n allChildren.clear();\n exitingChildren.clear();\n });\n if (isInitialRender.current) {\n return (React.createElement(React.Fragment, null, childrenToRender.map((child) => (React.createElement(PresenceChild, { key: getChildKey(child), isPresent: true, initial: initial ? undefined : false, presenceAffectsLayout: presenceAffectsLayout, mode: mode }, child)))));\n }\n // If this is a subsequent render, deal with entering and exiting children\n childrenToRender = [...childrenToRender];\n // Diff the keys of the currently-present and target children to update our\n // exiting list.\n const presentKeys = presentChildren.current.map(getChildKey);\n const targetKeys = filteredChildren.map(getChildKey);\n // Diff the present children with our target children and mark those that are exiting\n const numPresent = presentKeys.length;\n for (let i = 0; i < numPresent; i++) {\n const key = presentKeys[i];\n if (targetKeys.indexOf(key) === -1 && !exitingChildren.has(key)) {\n exitingChildren.set(key, undefined);\n }\n }\n // If we currently have exiting children, and we're deferring rendering incoming children\n // until after all current children have exiting, empty the childrenToRender array\n if (mode === \"wait\" && exitingChildren.size) {\n childrenToRender = [];\n }\n // Loop through all currently exiting components and clone them to overwrite `animate`\n // with any `exit` prop they might have defined.\n exitingChildren.forEach((component, key) => {\n // If this component is actually entering again, early return\n if (targetKeys.indexOf(key) !== -1)\n return;\n const child = allChildren.get(key);\n if (!child)\n return;\n const insertionIndex = presentKeys.indexOf(key);\n let exitingComponent = component;\n if (!exitingComponent) {\n const onExit = () => {\n allChildren.delete(key);\n exitingChildren.delete(key);\n // Remove this child from the present children\n const removeIndex = presentChildren.current.findIndex((presentChild) => presentChild.key === key);\n presentChildren.current.splice(removeIndex, 1);\n // Defer re-rendering until all exiting children have indeed left\n if (!exitingChildren.size) {\n presentChildren.current = filteredChildren;\n if (isMounted.current === false)\n return;\n forceRender();\n onExitComplete && onExitComplete();\n }\n };\n exitingComponent = (React.createElement(PresenceChild, { key: getChildKey(child), isPresent: false, onExitComplete: onExit, custom: custom, presenceAffectsLayout: presenceAffectsLayout, mode: mode }, child));\n exitingChildren.set(key, exitingComponent);\n }\n childrenToRender.splice(insertionIndex, 0, exitingComponent);\n });\n // Add `MotionContext` even to children that don't need it to ensure we're rendering\n // the same tree between renders\n childrenToRender = childrenToRender.map((child) => {\n const key = child.key;\n return exitingChildren.has(key) ? (child) : (React.createElement(PresenceChild, { key: getChildKey(child), isPresent: true, presenceAffectsLayout: presenceAffectsLayout, mode: mode }, child));\n });\n if (process.env.NODE_ENV !== \"production\" &&\n mode === \"wait\" &&\n childrenToRender.length > 1) {\n console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to \"wait\". This will lead to odd visual behaviour.`);\n }\n return (React.createElement(React.Fragment, null, exitingChildren.size\n ? childrenToRender\n : childrenToRender.map((child) => cloneElement(child))));\n};\n\nexport { AnimatePresence };\n","import React from \"react\";\n\nimport { AnimatePresence, motion } from \"framer-motion\";\n\nconst Collapse = ({\n open = false,\n children,\n className = \"\",\n ...otherProps\n}) => (\n <AnimatePresence>\n {open && (\n <motion.div\n animate={{ opacity: 1, height: \"auto\" }}\n exit={{ opacity: 0, height: 0 }}\n initial={{ opacity: 0, height: 0, overflow: \"hidden\" }}\n transition={{ duration: 0.3 }}\n {...otherProps}\n >\n <div className={className}>{children}</div>\n </motion.div>\n )}\n </AnimatePresence>\n);\n\nexport default Collapse;\n","import React from \"react\";\n\nimport classnames from \"classnames\";\nimport { motion } from \"framer-motion\";\nimport { Right } from \"neetoicons\";\nimport PropTypes from \"prop-types\";\n\nimport Collapse from \"./Collapse\";\n\nconst Item = ({\n id,\n title = \"\",\n isOpen = false,\n onClick = () => {},\n children,\n className = \"\",\n titleProps = {},\n iconProps = {},\n}) => {\n const onKeyDown = e => {\n switch (e.key) {\n case \" \":\n case \"Enter\":\n onClick();\n break;\n default:\n }\n };\n\n return (\n <div\n className={classnames(\"neeto-ui-accordion__wrapper\", {\n [className]: className,\n })}\n >\n <div\n {...{ onClick, onKeyDown }}\n aria-controls={`neeto-ui-accordion-section-${id}`}\n aria-disabled={isOpen}\n aria-expanded={isOpen}\n id={`neeto-ui-accordion-item-${id}`}\n role=\"button\"\n tabIndex={0}\n className={classnames(\n \"neeto-ui-accordion__item neeto-ui-flex neeto-ui-justify-between neeto-ui-items-center\",\n { \"neeto-ui-accordion__item--open\": isOpen }\n )}\n >\n <div\n {...titleProps}\n className=\"neeto-ui-accordion__item-handle neeto-ui-flex neeto-ui-flex-grow neeto-ui-items-center neeto-ui-break-words\"\n >\n {title}\n </div>\n <motion.div\n animate={isOpen ? \"open\" : \"collapsed\"}\n className=\"neeto-ui-accordion__item-toggle-icon neeto-ui-flex-grow-0\"\n transition={{ duration: 0.3 }}\n variants={{ open: { rotate: 90 }, collapsed: { rotate: 0 } }}\n >\n <Right size={16} {...iconProps} />\n </motion.div>\n </div>\n <Collapse\n aria-labelledby={`neeto-ui-accordion-item-${id}`}\n className=\"neeto-ui-accordion__drop\"\n id={`neeto-ui-accordion-section-${id}`}\n open={isOpen}\n role=\"region\"\n >\n {children}\n </Collapse>\n </div>\n );\n};\n\nItem.displayName = \"Accordion.Item\";\n\nItem.propTypes = {\n /**\n * To specify a unique ID to the AccordionItem.\n */\n id: PropTypes.number,\n /**\n * To add title to the AccordionItem.\n */\n title: PropTypes.string,\n /**\n * To specify whether the Accordion item is open or not.\n */\n isOpen: PropTypes.bool,\n /**\n * To specify the action to be triggered on click of the AccordionItem.\n */\n onClick: PropTypes.func,\n /**\n * To specify the content to be rendered inside the AccordionItem.\n */\n children: PropTypes.node,\n /**\n * To pass props to Accordion title.\n */\n titleProps: PropTypes.object,\n /**\n * To pass props to Accordion toggle icon.\n */\n iconProps: PropTypes.object,\n /**\n * To provide external classnames to Accordion item.\n */\n className: PropTypes.string,\n};\n\nexport default Item;\n","import React, { useState, useEffect } from \"react\";\n\nimport classnames from \"classnames\";\nimport PropTypes from \"prop-types\";\nimport { isEmpty } from \"ramda\";\n\nimport Item from \"./Item\";\n\nconst ACCORDION_STYLES = {\n primary: \"primary\",\n secondary: \"secondary\",\n};\n\nconst Accordion = ({\n children,\n defaultActiveKey = null,\n padded = false,\n style = ACCORDION_STYLES.primary,\n className = \"\",\n}) => {\n const [openTab, setOpenTab] = useState(defaultActiveKey);\n\n useEffect(() => {\n setOpenTab(defaultActiveKey);\n }, [defaultActiveKey]);\n\n return (\n <div\n className={classnames(\"neeto-ui-accordions-outer-wrapper\", {\n \"neeto-ui-accordions-outer-wrapper--padded\": padded,\n \"neeto-ui-accordions-outer-wrapper--secondary\":\n style === ACCORDION_STYLES.secondary,\n [className]: className,\n })}\n >\n {React.Children.map(children, (child, index) => {\n const isSingleOrLastChild =\n isEmpty(children) || index === children.length - 1;\n\n return React.cloneElement(child, {\n id: index,\n key: index,\n isOpen: openTab === index,\n className: classnames(child.props.className, {\n \"neeto-ui-accordion__wrapper--last-item\": isSingleOrLastChild,\n }),\n onClick: () => {\n setOpenTab(openTab === index ? null : index);\n child.props.onClick && child.props.onClick();\n },\n });\n })}\n </div>\n );\n};\n\nAccordion.propTypes = {\n /**\n * To specify the content to be rendered inside the Accordion.\n */\n children: PropTypes.node,\n /**\n * To set the style of the Accordion.\n */\n style: PropTypes.oneOf(Object.values(ACCORDION_STYLES)),\n /**\n * To add padding to the Accordion container.\n */\n padded: PropTypes.bool,\n /**\n * Index of the Accordion item to be opened initially.\n */\n defaultActiveKey: PropTypes.number,\n /**\n * To provide external classnames to Accordion container.\n */\n className: PropTypes.string,\n};\n\nAccordion.Item = Item;\n\nexport default Accordion;\n"],"names":["Collapse","_ref","_ref$open","open","children","_ref$className","className","otherProps","_objectWithoutProperties","_excluded","React","createElement","AnimatePresence","motion","div","_extends","animate","opacity","height","exit","initial","overflow","transition","duration","Item","id","_ref$title","title","_ref$isOpen","isOpen","_ref$onClick","onClick","_ref$titleProps","titleProps","_ref$iconProps","iconProps","onKeyDown","e","key","classnames","_defineProperty","concat","role","tabIndex","variants","rotate","collapsed","Right","size","displayName","ACCORDION_STYLES","primary","secondary","Accordion","_ref$defaultActiveKey","defaultActiveKey","_ref$padded","padded","_ref$style","style","_useState","useState","_useState2","_slicedToArray","openTab","setOpenTab","useEffect","Children","map","child","index","isSingleOrLastChild","isEmpty","length","cloneElement","props"],"mappings":";;;;;;;;;;;AAGA,SAAS,YAAY,GAAG;AACxB,IAAI,MAAM,SAAS,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;AACpC,IAAI,yBAAyB,CAAC,MAAM;AACpC,QAAQ,SAAS,CAAC,OAAO,GAAG,IAAI,CAAC;AACjC,QAAQ,OAAO,MAAM;AACrB,YAAY,SAAS,CAAC,OAAO,GAAG,KAAK,CAAC;AACtC,SAAS,CAAC;AACV,KAAK,EAAE,EAAE,CAAC,CAAC;AACX,IAAI,OAAO,SAAS,CAAC;AACrB;;ACRA,SAAS,cAAc,GAAG;AAC1B,IAAI,MAAM,SAAS,GAAG,YAAY,EAAE,CAAC;AACrC,IAAI,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;AAClE,IAAI,MAAM,WAAW,GAAG,WAAW,CAAC,MAAM;AAC1C,QAAQ,SAAS,CAAC,OAAO,IAAI,oBAAoB,CAAC,iBAAiB,GAAG,CAAC,CAAC,CAAC;AACzE,KAAK,EAAE,CAAC,iBAAiB,CAAC,CAAC,CAAC;AAC5B;AACA;AACA;AACA;AACA,IAAI,MAAM,mBAAmB,GAAG,WAAW,CAAC,MAAM,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC;AAChG,IAAI,OAAO,CAAC,mBAAmB,EAAE,iBAAiB,CAAC,CAAC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modules/framer-motion/dist/es/utils/use-is-mounted.mjs","../node_modules/framer-motion/dist/es/utils/use-force-update.mjs","../node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.mjs","../node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.mjs","../node_modules/framer-motion/dist/es/utils/use-unmount-effect.mjs","../node_modules/framer-motion/dist/es/components/AnimatePresence/index.mjs","../src/components/Accordion/Collapse.jsx","../src/components/Accordion/Item.jsx","../src/components/Accordion/index.jsx"],"sourcesContent":["import { useRef } from 'react';\nimport { useIsomorphicLayoutEffect } from './use-isomorphic-effect.mjs';\n\nfunction useIsMounted() {\n const isMounted = useRef(false);\n useIsomorphicLayoutEffect(() => {\n isMounted.current = true;\n return () => {\n isMounted.current = false;\n };\n }, []);\n return isMounted;\n}\n\nexport { useIsMounted };\n","import { useState, useCallback } from 'react';\nimport { useIsMounted } from './use-is-mounted.mjs';\nimport { frame } from '../frameloop/frame.mjs';\n\nfunction useForceUpdate() {\n const isMounted = useIsMounted();\n const [forcedRenderCount, setForcedRenderCount] = useState(0);\n const forceRender = useCallback(() => {\n isMounted.current && setForcedRenderCount(forcedRenderCount + 1);\n }, [forcedRenderCount]);\n /**\n * Defer this to the end of the next animation frame in case there are multiple\n * synchronous calls.\n */\n const deferredForceRender = useCallback(() => frame.postRender(forceRender), [forceRender]);\n return [deferredForceRender, forcedRenderCount];\n}\n\nexport { useForceUpdate };\n","import * as React from 'react';\nimport { useId, useRef, useInsertionEffect } from 'react';\n\n/**\n * Measurement functionality has to be within a separate component\n * to leverage snapshot lifecycle.\n */\nclass PopChildMeasure extends React.Component {\n getSnapshotBeforeUpdate(prevProps) {\n const element = this.props.childRef.current;\n if (element && prevProps.isPresent && !this.props.isPresent) {\n const size = this.props.sizeRef.current;\n size.height = element.offsetHeight || 0;\n size.width = element.offsetWidth || 0;\n size.top = element.offsetTop;\n size.left = element.offsetLeft;\n }\n return null;\n }\n /**\n * Required with getSnapshotBeforeUpdate to stop React complaining.\n */\n componentDidUpdate() { }\n render() {\n return this.props.children;\n }\n}\nfunction PopChild({ children, isPresent }) {\n const id = useId();\n const ref = useRef(null);\n const size = useRef({\n width: 0,\n height: 0,\n top: 0,\n left: 0,\n });\n /**\n * We create and inject a style block so we can apply this explicit\n * sizing in a non-destructive manner by just deleting the style block.\n *\n * We can't apply size via render as the measurement happens\n * in getSnapshotBeforeUpdate (post-render), likewise if we apply the\n * styles directly on the DOM node, we might be overwriting\n * styles set via the style prop.\n */\n useInsertionEffect(() => {\n const { width, height, top, left } = size.current;\n if (isPresent || !ref.current || !width || !height)\n return;\n ref.current.dataset.motionPopId = id;\n const style = document.createElement(\"style\");\n document.head.appendChild(style);\n if (style.sheet) {\n style.sheet.insertRule(`\n [data-motion-pop-id=\"${id}\"] {\n position: absolute !important;\n width: ${width}px !important;\n height: ${height}px !important;\n top: ${top}px !important;\n left: ${left}px !important;\n }\n `);\n }\n return () => {\n document.head.removeChild(style);\n };\n }, [isPresent]);\n return (React.createElement(PopChildMeasure, { isPresent: isPresent, childRef: ref, sizeRef: size }, React.cloneElement(children, { ref })));\n}\n\nexport { PopChild };\n","import * as React from 'react';\nimport { useId, useMemo } from 'react';\nimport { PresenceContext } from '../../context/PresenceContext.mjs';\nimport { useConstant } from '../../utils/use-constant.mjs';\nimport { PopChild } from './PopChild.mjs';\n\nconst PresenceChild = ({ children, initial, isPresent, onExitComplete, custom, presenceAffectsLayout, mode, }) => {\n const presenceChildren = useConstant(newChildrenMap);\n const id = useId();\n const context = useMemo(() => ({\n id,\n initial,\n isPresent,\n custom,\n onExitComplete: (childId) => {\n presenceChildren.set(childId, true);\n for (const isComplete of presenceChildren.values()) {\n if (!isComplete)\n return; // can stop searching when any is incomplete\n }\n onExitComplete && onExitComplete();\n },\n register: (childId) => {\n presenceChildren.set(childId, false);\n return () => presenceChildren.delete(childId);\n },\n }), \n /**\n * If the presence of a child affects the layout of the components around it,\n * we want to make a new context value to ensure they get re-rendered\n * so they can detect that layout change.\n */\n presenceAffectsLayout ? undefined : [isPresent]);\n useMemo(() => {\n presenceChildren.forEach((_, key) => presenceChildren.set(key, false));\n }, [isPresent]);\n /**\n * If there's no `motion` components to fire exit animations, we want to remove this\n * component immediately.\n */\n React.useEffect(() => {\n !isPresent &&\n !presenceChildren.size &&\n onExitComplete &&\n onExitComplete();\n }, [isPresent]);\n if (mode === \"popLayout\") {\n children = React.createElement(PopChild, { isPresent: isPresent }, children);\n }\n return (React.createElement(PresenceContext.Provider, { value: context }, children));\n};\nfunction newChildrenMap() {\n return new Map();\n}\n\nexport { PresenceChild };\n","import { useEffect } from 'react';\n\nfunction useUnmountEffect(callback) {\n return useEffect(() => () => callback(), []);\n}\n\nexport { useUnmountEffect };\n","import * as React from 'react';\nimport { useContext, useRef, cloneElement, Children, isValidElement } from 'react';\nimport { useForceUpdate } from '../../utils/use-force-update.mjs';\nimport { useIsMounted } from '../../utils/use-is-mounted.mjs';\nimport { PresenceChild } from './PresenceChild.mjs';\nimport { LayoutGroupContext } from '../../context/LayoutGroupContext.mjs';\nimport { useIsomorphicLayoutEffect } from '../../utils/use-isomorphic-effect.mjs';\nimport { useUnmountEffect } from '../../utils/use-unmount-effect.mjs';\nimport { invariant } from '../../utils/errors.mjs';\n\nconst getChildKey = (child) => child.key || \"\";\nfunction updateChildLookup(children, allChildren) {\n children.forEach((child) => {\n const key = getChildKey(child);\n allChildren.set(key, child);\n });\n}\nfunction onlyElements(children) {\n const filtered = [];\n // We use forEach here instead of map as map mutates the component key by preprending `.$`\n Children.forEach(children, (child) => {\n if (isValidElement(child))\n filtered.push(child);\n });\n return filtered;\n}\n/**\n * `AnimatePresence` enables the animation of components that have been removed from the tree.\n *\n * When adding/removing more than a single child, every child **must** be given a unique `key` prop.\n *\n * Any `motion` components that have an `exit` property defined will animate out when removed from\n * the tree.\n *\n * ```jsx\n * import { motion, AnimatePresence } from 'framer-motion'\n *\n * export const Items = ({ items }) => (\n * <AnimatePresence>\n * {items.map(item => (\n * <motion.div\n * key={item.id}\n * initial={{ opacity: 0 }}\n * animate={{ opacity: 1 }}\n * exit={{ opacity: 0 }}\n * />\n * ))}\n * </AnimatePresence>\n * )\n * ```\n *\n * You can sequence exit animations throughout a tree using variants.\n *\n * If a child contains multiple `motion` components with `exit` props, it will only unmount the child\n * once all `motion` components have finished animating out. Likewise, any components using\n * `usePresence` all need to call `safeToRemove`.\n *\n * @public\n */\nconst AnimatePresence = ({ children, custom, initial = true, onExitComplete, exitBeforeEnter, presenceAffectsLayout = true, mode = \"sync\", }) => {\n invariant(!exitBeforeEnter, \"Replace exitBeforeEnter with mode='wait'\");\n // We want to force a re-render once all exiting animations have finished. We\n // either use a local forceRender function, or one from a parent context if it exists.\n const forceRender = useContext(LayoutGroupContext).forceRender || useForceUpdate()[0];\n const isMounted = useIsMounted();\n // Filter out any children that aren't ReactElements. We can only track ReactElements with a props.key\n const filteredChildren = onlyElements(children);\n let childrenToRender = filteredChildren;\n const exitingChildren = useRef(new Map()).current;\n // Keep a living record of the children we're actually rendering so we\n // can diff to figure out which are entering and exiting\n const presentChildren = useRef(childrenToRender);\n // A lookup table to quickly reference components by key\n const allChildren = useRef(new Map()).current;\n // If this is the initial component render, just deal with logic surrounding whether\n // we play onMount animations or not.\n const isInitialRender = useRef(true);\n useIsomorphicLayoutEffect(() => {\n isInitialRender.current = false;\n updateChildLookup(filteredChildren, allChildren);\n presentChildren.current = childrenToRender;\n });\n useUnmountEffect(() => {\n isInitialRender.current = true;\n allChildren.clear();\n exitingChildren.clear();\n });\n if (isInitialRender.current) {\n return (React.createElement(React.Fragment, null, childrenToRender.map((child) => (React.createElement(PresenceChild, { key: getChildKey(child), isPresent: true, initial: initial ? undefined : false, presenceAffectsLayout: presenceAffectsLayout, mode: mode }, child)))));\n }\n // If this is a subsequent render, deal with entering and exiting children\n childrenToRender = [...childrenToRender];\n // Diff the keys of the currently-present and target children to update our\n // exiting list.\n const presentKeys = presentChildren.current.map(getChildKey);\n const targetKeys = filteredChildren.map(getChildKey);\n // Diff the present children with our target children and mark those that are exiting\n const numPresent = presentKeys.length;\n for (let i = 0; i < numPresent; i++) {\n const key = presentKeys[i];\n if (targetKeys.indexOf(key) === -1 && !exitingChildren.has(key)) {\n exitingChildren.set(key, undefined);\n }\n }\n // If we currently have exiting children, and we're deferring rendering incoming children\n // until after all current children have exiting, empty the childrenToRender array\n if (mode === \"wait\" && exitingChildren.size) {\n childrenToRender = [];\n }\n // Loop through all currently exiting components and clone them to overwrite `animate`\n // with any `exit` prop they might have defined.\n exitingChildren.forEach((component, key) => {\n // If this component is actually entering again, early return\n if (targetKeys.indexOf(key) !== -1)\n return;\n const child = allChildren.get(key);\n if (!child)\n return;\n const insertionIndex = presentKeys.indexOf(key);\n let exitingComponent = component;\n if (!exitingComponent) {\n const onExit = () => {\n allChildren.delete(key);\n exitingChildren.delete(key);\n // Remove this child from the present children\n const removeIndex = presentChildren.current.findIndex((presentChild) => presentChild.key === key);\n presentChildren.current.splice(removeIndex, 1);\n // Defer re-rendering until all exiting children have indeed left\n if (!exitingChildren.size) {\n presentChildren.current = filteredChildren;\n if (isMounted.current === false)\n return;\n forceRender();\n onExitComplete && onExitComplete();\n }\n };\n exitingComponent = (React.createElement(PresenceChild, { key: getChildKey(child), isPresent: false, onExitComplete: onExit, custom: custom, presenceAffectsLayout: presenceAffectsLayout, mode: mode }, child));\n exitingChildren.set(key, exitingComponent);\n }\n childrenToRender.splice(insertionIndex, 0, exitingComponent);\n });\n // Add `MotionContext` even to children that don't need it to ensure we're rendering\n // the same tree between renders\n childrenToRender = childrenToRender.map((child) => {\n const key = child.key;\n return exitingChildren.has(key) ? (child) : (React.createElement(PresenceChild, { key: getChildKey(child), isPresent: true, presenceAffectsLayout: presenceAffectsLayout, mode: mode }, child));\n });\n if (process.env.NODE_ENV !== \"production\" &&\n mode === \"wait\" &&\n childrenToRender.length > 1) {\n console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to \"wait\". This will lead to odd visual behaviour.`);\n }\n return (React.createElement(React.Fragment, null, exitingChildren.size\n ? childrenToRender\n : childrenToRender.map((child) => cloneElement(child))));\n};\n\nexport { AnimatePresence };\n","import React from \"react\";\n\nimport { AnimatePresence, motion } from \"framer-motion\";\n\nconst Collapse = ({\n open = false,\n children,\n className = \"\",\n ...otherProps\n}) => (\n <AnimatePresence>\n {open && (\n <motion.div\n animate={{ opacity: 1, height: \"auto\" }}\n exit={{ opacity: 0, height: 0 }}\n initial={{ opacity: 0, height: 0, overflow: \"hidden\" }}\n transition={{ duration: 0.3 }}\n {...otherProps}\n >\n <div className={className}>{children}</div>\n </motion.div>\n )}\n </AnimatePresence>\n);\n\nexport default Collapse;\n","import React from \"react\";\n\nimport classnames from \"classnames\";\nimport { motion } from \"framer-motion\";\nimport { Right } from \"neetoicons\";\nimport PropTypes from \"prop-types\";\n\nimport Collapse from \"./Collapse\";\n\nconst Item = ({\n id,\n title = \"\",\n isOpen = false,\n onClick = () => {},\n children,\n className = \"\",\n titleProps = {},\n iconProps = {},\n}) => {\n const onKeyDown = e => {\n switch (e.key) {\n case \" \":\n case \"Enter\":\n onClick();\n break;\n default:\n }\n };\n\n return (\n <div\n className={classnames(\"neeto-ui-accordion__wrapper\", {\n [className]: className,\n })}\n >\n <div\n {...{ onClick, onKeyDown }}\n aria-controls={`neeto-ui-accordion-section-${id}`}\n aria-disabled={isOpen}\n aria-expanded={isOpen}\n id={`neeto-ui-accordion-item-${id}`}\n role=\"button\"\n tabIndex={0}\n className={classnames(\n \"neeto-ui-accordion__item neeto-ui-flex neeto-ui-justify-between neeto-ui-items-center\",\n { \"neeto-ui-accordion__item--open\": isOpen }\n )}\n >\n <div\n {...titleProps}\n className=\"neeto-ui-accordion__item-handle neeto-ui-flex neeto-ui-flex-grow neeto-ui-items-center neeto-ui-break-words\"\n >\n {title}\n </div>\n <motion.div\n animate={isOpen ? \"open\" : \"collapsed\"}\n className=\"neeto-ui-accordion__item-toggle-icon neeto-ui-flex-grow-0\"\n transition={{ duration: 0.3 }}\n variants={{ open: { rotate: 90 }, collapsed: { rotate: 0 } }}\n >\n <Right size={16} {...iconProps} />\n </motion.div>\n </div>\n <Collapse\n aria-labelledby={`neeto-ui-accordion-item-${id}`}\n className=\"neeto-ui-accordion__drop\"\n id={`neeto-ui-accordion-section-${id}`}\n open={isOpen}\n role=\"region\"\n >\n {children}\n </Collapse>\n </div>\n );\n};\n\nItem.displayName = \"Accordion.Item\";\n\nItem.propTypes = {\n /**\n * To specify a unique ID to the AccordionItem.\n */\n id: PropTypes.number,\n /**\n * To add title to the AccordionItem.\n */\n title: PropTypes.string,\n /**\n * To specify whether the Accordion item is open or not.\n */\n isOpen: PropTypes.bool,\n /**\n * To specify the action to be triggered on click of the AccordionItem.\n */\n onClick: PropTypes.func,\n /**\n * To specify the content to be rendered inside the AccordionItem.\n */\n children: PropTypes.node,\n /**\n * To pass props to Accordion title.\n */\n titleProps: PropTypes.object,\n /**\n * To pass props to Accordion toggle icon.\n */\n iconProps: PropTypes.object,\n /**\n * To provide external classnames to Accordion item.\n */\n className: PropTypes.string,\n};\n\nexport default Item;\n","import React, { useState, useEffect } from \"react\";\n\nimport classnames from \"classnames\";\nimport PropTypes from \"prop-types\";\nimport { isEmpty } from \"ramda\";\n\nimport Item from \"./Item\";\n\nconst ACCORDION_STYLES = {\n primary: \"primary\",\n secondary: \"secondary\",\n};\n\nconst Accordion = ({\n children,\n defaultActiveKey = null,\n padded = false,\n style = ACCORDION_STYLES.primary,\n className = \"\",\n ...otherProps\n}) => {\n const [openTab, setOpenTab] = useState(defaultActiveKey);\n\n useEffect(() => {\n setOpenTab(defaultActiveKey);\n }, [defaultActiveKey]);\n\n return (\n <div\n className={classnames(\"neeto-ui-accordions-outer-wrapper\", {\n \"neeto-ui-accordions-outer-wrapper--padded\": padded,\n \"neeto-ui-accordions-outer-wrapper--secondary\":\n style === ACCORDION_STYLES.secondary,\n [className]: className,\n })}\n {...otherProps}\n >\n {React.Children.map(children, (child, index) => {\n const isSingleOrLastChild =\n isEmpty(children) || index === children.length - 1;\n\n return React.cloneElement(child, {\n id: index,\n key: index,\n isOpen: openTab === index,\n className: classnames(child.props.className, {\n \"neeto-ui-accordion__wrapper--last-item\": isSingleOrLastChild,\n }),\n onClick: () => {\n setOpenTab(openTab === index ? null : index);\n child.props.onClick && child.props.onClick();\n },\n });\n })}\n </div>\n );\n};\n\nAccordion.propTypes = {\n /**\n * To specify the content to be rendered inside the Accordion.\n */\n children: PropTypes.node,\n /**\n * To set the style of the Accordion.\n */\n style: PropTypes.oneOf(Object.values(ACCORDION_STYLES)),\n /**\n * To add padding to the Accordion container.\n */\n padded: PropTypes.bool,\n /**\n * Index of the Accordion item to be opened initially.\n */\n defaultActiveKey: PropTypes.number,\n /**\n * To provide external classnames to Accordion container.\n */\n className: PropTypes.string,\n};\n\nAccordion.Item = Item;\n\nexport default Accordion;\n"],"names":["Collapse","_ref","_ref$open","open","children","_ref$className","className","otherProps","_objectWithoutProperties","_excluded","React","createElement","AnimatePresence","motion","div","_extends","animate","opacity","height","exit","initial","overflow","transition","duration","Item","id","_ref$title","title","_ref$isOpen","isOpen","_ref$onClick","onClick","_ref$titleProps","titleProps","_ref$iconProps","iconProps","onKeyDown","e","key","classnames","_defineProperty","concat","role","tabIndex","variants","rotate","collapsed","Right","size","displayName","ACCORDION_STYLES","primary","secondary","Accordion","_ref$defaultActiveKey","defaultActiveKey","_ref$padded","padded","_ref$style","style","_useState","useState","_useState2","_slicedToArray","openTab","setOpenTab","useEffect","Children","map","child","index","isSingleOrLastChild","isEmpty","length","cloneElement","props"],"mappings":";;;;;;;;;;;AAGA,SAAS,YAAY,GAAG;AACxB,IAAI,MAAM,SAAS,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;AACpC,IAAI,yBAAyB,CAAC,MAAM;AACpC,QAAQ,SAAS,CAAC,OAAO,GAAG,IAAI,CAAC;AACjC,QAAQ,OAAO,MAAM;AACrB,YAAY,SAAS,CAAC,OAAO,GAAG,KAAK,CAAC;AACtC,SAAS,CAAC;AACV,KAAK,EAAE,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,MAAM,GAAG,CAAC,CAAA;AAEpD,IAAA,oBAAO/D,cAAK,CAACgE,YAAY,CAACL,KAAK,EAAE;AAC/B5C,MAAAA,EAAE,EAAE6C,KAAK;AACThC,MAAAA,GAAG,EAAEgC,KAAK;MACVzC,MAAM,EAAEmC,OAAO,KAAKM,KAAK;MACzBhE,SAAS,EAAEiC,UAAU,CAAC8B,KAAK,CAACM,KAAK,CAACrE,SAAS,EAAE;AAC3C,QAAA,wCAAwC,EAAEiE,mBAAAA;AAC5C,OAAC,CAAC;MACFxC,OAAO,EAAE,SAAAA,OAAAA,GAAM;QACbkC,UAAU,CAACD,OAAO,KAAKM,KAAK,GAAG,IAAI,GAAGA,KAAK,CAAC,CAAA;QAC5CD,KAAK,CAACM,KAAK,CAAC5C,OAAO,IAAIsC,KAAK,CAACM,KAAK,CAAC5C,OAAO,EAAE,CAAA;AAC9C,OAAA;AACF,KAAC,CAAC,CAAA;AACJ,GAAC,CAAC,CACE,CAAA;AAEV,EAAC;AAyBDsB,SAAS,CAAC7B,IAAI,GAAGA,IAAI;;;;"}
|
package/dist/Input.js
CHANGED
|
@@ -121,6 +121,7 @@ var Input = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
121
121
|
"neeto-ui-input__max-length--error": maxLengthError
|
|
122
122
|
})
|
|
123
123
|
}, valueLength, "/", maxLength)), /*#__PURE__*/React__default.createElement("div", {
|
|
124
|
+
"data-cy": "".concat(hyphenize(label), "-input"),
|
|
124
125
|
className: classnames("neeto-ui-input", {
|
|
125
126
|
"neeto-ui-input--naked": !!nakedInput,
|
|
126
127
|
"neeto-ui-input--error": !!error,
|
package/dist/Input.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.js","sources":["../src/components/Input.jsx"],"sourcesContent":["import React, { useState, forwardRef } from \"react\";\n\nimport classnames from \"classnames\";\nimport PropTypes from \"prop-types\";\nimport { replace } from \"ramda\";\n\nimport { useId } from \"hooks\";\nimport { hyphenize } from \"utils\";\n\nimport Label from \"./Label\";\n\nconst SIZES = { small: \"small\", medium: \"medium\", large: \"large\" };\n\nconst Input = forwardRef(\n (\n {\n size = SIZES.medium,\n type = \"text\",\n label = \"\",\n error = \"\",\n suffix = null,\n prefix = null,\n disabled = false,\n helpText = \"\",\n className = \"\",\n nakedInput = false,\n contentSize = null,\n required = false,\n maxLength,\n unlimitedChars = false,\n labelProps,\n rejectCharsRegex,\n onBlur,\n disableTrimOnBlur = false,\n ...otherProps\n },\n ref\n ) => {\n const [valueInternal, setValueInternal] = useState(otherProps.value);\n const id = useId(otherProps.id);\n\n const errorId = `error_${id}`;\n const helpTextId = `helpText_${id}`;\n\n const value = otherProps.value ?? valueInternal ?? \"\";\n\n const valueLength = value?.toString().length || 0;\n const isCharacterLimitVisible = valueLength >= maxLength * 0.85;\n const maxLengthError = unlimitedChars && valueLength > maxLength;\n\n const onChange = e => {\n if (!otherProps.onChange || !otherProps.value) {\n setValueInternal(e.target.value);\n }\n otherProps.onChange?.(e);\n };\n\n const isMaxLengthPresent = !!maxLength || maxLength === 0;\n\n const handleRegexChange = e => {\n const globalRegex = new RegExp(rejectCharsRegex, \"g\");\n e.target.value = replace(globalRegex, \"\", e.target.value);\n onChange(e);\n };\n\n const handleChange = rejectCharsRegex ? handleRegexChange : onChange;\n\n const handleTrimmedChangeOnBlur = e => {\n if (disableTrimOnBlur || typeof value !== \"string\") return;\n\n const trimmedValue = value.trim();\n if (value === trimmedValue) return;\n\n e.target.value = trimmedValue;\n handleChange(e);\n };\n\n const handleOnBlur = e => {\n handleTrimmedChangeOnBlur(e);\n onBlur?.(e);\n };\n\n return (\n <div className={classnames([\"neeto-ui-input__wrapper\", className])}>\n <div className=\"neeto-ui-input__label-wrapper\">\n {label && (\n <Label\n {...{ required }}\n data-cy={`${hyphenize(label)}-input-label`}\n htmlFor={id}\n {...labelProps}\n >\n {label}\n </Label>\n )}\n {isCharacterLimitVisible && (\n <p\n className={classnames(\"neeto-ui-input__max-length\", {\n \"neeto-ui-input__max-length--error\": maxLengthError,\n })}\n >\n {valueLength}/{maxLength}\n </p>\n )}\n </div>\n <div\n className={classnames(\"neeto-ui-input\", {\n \"neeto-ui-input--naked\": !!nakedInput,\n \"neeto-ui-input--error\": !!error,\n \"neeto-ui-input--disabled\": !!disabled,\n \"neeto-ui-input--small\": size === \"small\",\n \"neeto-ui-input--medium\": size === \"medium\",\n \"neeto-ui-input--large\": size === \"large\",\n })}\n >\n {prefix && <div className=\"neeto-ui-input__prefix\">{prefix}</div>}\n <input\n aria-invalid={!!error}\n data-cy={`${hyphenize(label)}-input-field`}\n size={contentSize}\n aria-describedby={classnames({\n [errorId]: !!error,\n [helpTextId]: helpText,\n })}\n {...{\n disabled,\n id,\n ref,\n required,\n type,\n ...(isMaxLengthPresent && !unlimitedChars && { maxLength }),\n ...otherProps,\n value,\n }}\n onBlur={handleOnBlur}\n onChange={handleChange}\n />\n {suffix && <div className=\"neeto-ui-input__suffix\">{suffix}</div>}\n </div>\n {!!error && (\n <p\n className=\"neeto-ui-input__error\"\n data-cy={`${hyphenize(label)}-input-error`}\n id={errorId}\n >\n {error}\n </p>\n )}\n {helpText && (\n <p\n className=\"neeto-ui-input__help-text\"\n data-cy={`${hyphenize(label)}-input-help`}\n id={helpTextId}\n >\n {helpText}\n </p>\n )}\n </div>\n );\n }\n);\n\nInput.displayName = \"Input\";\n\nInput.propTypes = {\n /**\n * To specify a unique ID to the Input component.\n */\n id: PropTypes.string,\n /**\n * To specify the size of Input.\n */\n size: PropTypes.oneOf(Object.values(SIZES)),\n /**\n * To specify the type of Input field.\n */\n type: PropTypes.string,\n /**\n * To specify the label props to be passed to the Label component.\n */\n labelProps: PropTypes.object,\n /**\n * To specify a maximum character limit to the Input. Charater limit is visible only if the Input value is greater than or equal to 85% of the maximum character limit.\n */\n maxLength: PropTypes.number,\n /**\n * To be used along with maxLength prop. When set to true the character limit will not be enforced and character count will be shown in error state if the character limit is exceeded.\n */\n unlimitedChars: PropTypes.bool,\n /**\n * To specify the text to be displayed above the Input.\n */\n label: PropTypes.string,\n /**\n * To specify the error message to be shown in the Input field.\n */\n error: PropTypes.string,\n /**\n * To specify the content to be added at the end of the Input field.\n */\n suffix: PropTypes.node,\n /**\n * To specify the content to be added at the beginning of the Input field.\n */\n prefix: PropTypes.node,\n /**\n * To specify whether the Input field is disabled or not.\n */\n disabled: PropTypes.bool,\n /**\n * To specify the text that appears below the Input field.\n */\n helpText: PropTypes.string,\n /**\n * To specify external classNames that can be provided as overrides to the main wrapper.\n */\n className: PropTypes.string,\n /**\n * To create an Input field without any borders.\n */\n nakedInput: PropTypes.bool,\n /**\n * To specify the value to be passed as size attribute to the Input field.\n */\n contentSize: PropTypes.number,\n /**\n * To specify whether the Input field is required or not.\n */\n required: PropTypes.bool,\n /**\n * To specify a regex to be matched against the user input. Any character that matches it\n * cannot be input by the user. It will also prevent such characters from being pasted into the input.\n */\n rejectCharsRegex: PropTypes.instanceOf(RegExp),\n /**\n * To disable leading and trailing white spaces onBlur.\n */\n disableTrimOnBlur: PropTypes.bool,\n};\n\nexport default Input;\n"],"names":["SIZES","small","medium","large","Input","forwardRef","_ref","ref","_ref2","_otherProps$value","_ref$size","size","_ref$type","type","_ref$label","label","_ref$error","error","_ref$suffix","suffix","_ref$prefix","prefix","_ref$disabled","disabled","_ref$helpText","helpText","_ref$className","className","_ref$nakedInput","nakedInput","_ref$contentSize","contentSize","_ref$required","required","maxLength","_ref$unlimitedChars","unlimitedChars","labelProps","rejectCharsRegex","onBlur","_ref$disableTrimOnBlu","disableTrimOnBlur","otherProps","_objectWithoutProperties","_excluded","_useState","useState","value","_useState2","_slicedToArray","valueInternal","setValueInternal","id","useId","errorId","concat","helpTextId","valueLength","toString","length","isCharacterLimitVisible","maxLengthError","onChange","e","_otherProps$onChange","target","call","isMaxLengthPresent","handleRegexChange","globalRegex","RegExp","replace","handleChange","handleTrimmedChangeOnBlur","trimmedValue","trim","handleOnBlur","React","createElement","classnames","Label","_extends","hyphenize","htmlFor","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EnD,IAAAA,SAAS,EAAC,2BAA2B;AACrC,IAAA,SAAA,EAAA,EAAA,CAAA4B,MAAA,CAAY2B,SAAS,CAACnE,KAAK,CAAC,EAAc,aAAA,CAAA;AAC1CqC,IAAAA,EAAE,EAAEI,UAAAA;GAEH/B,EAAAA,QAAQ,CAEZ,CACG,CAAA;AAEV,CAAC,EACF;AAEDrB,KAAK,CAACkF,WAAW,GAAG,OAAO;;;;"}
|
|
1
|
+
{"version":3,"file":"Input.js","sources":["../src/components/Input.jsx"],"sourcesContent":["import React, { useState, forwardRef } from \"react\";\n\nimport classnames from \"classnames\";\nimport PropTypes from \"prop-types\";\nimport { replace } from \"ramda\";\n\nimport { useId } from \"hooks\";\nimport { hyphenize } from \"utils\";\n\nimport Label from \"./Label\";\n\nconst SIZES = { small: \"small\", medium: \"medium\", large: \"large\" };\n\nconst Input = forwardRef(\n (\n {\n size = SIZES.medium,\n type = \"text\",\n label = \"\",\n error = \"\",\n suffix = null,\n prefix = null,\n disabled = false,\n helpText = \"\",\n className = \"\",\n nakedInput = false,\n contentSize = null,\n required = false,\n maxLength,\n unlimitedChars = false,\n labelProps,\n rejectCharsRegex,\n onBlur,\n disableTrimOnBlur = false,\n ...otherProps\n },\n ref\n ) => {\n const [valueInternal, setValueInternal] = useState(otherProps.value);\n const id = useId(otherProps.id);\n\n const errorId = `error_${id}`;\n const helpTextId = `helpText_${id}`;\n\n const value = otherProps.value ?? valueInternal ?? \"\";\n\n const valueLength = value?.toString().length || 0;\n const isCharacterLimitVisible = valueLength >= maxLength * 0.85;\n const maxLengthError = unlimitedChars && valueLength > maxLength;\n\n const onChange = e => {\n if (!otherProps.onChange || !otherProps.value) {\n setValueInternal(e.target.value);\n }\n otherProps.onChange?.(e);\n };\n\n const isMaxLengthPresent = !!maxLength || maxLength === 0;\n\n const handleRegexChange = e => {\n const globalRegex = new RegExp(rejectCharsRegex, \"g\");\n e.target.value = replace(globalRegex, \"\", e.target.value);\n onChange(e);\n };\n\n const handleChange = rejectCharsRegex ? handleRegexChange : onChange;\n\n const handleTrimmedChangeOnBlur = e => {\n if (disableTrimOnBlur || typeof value !== \"string\") return;\n\n const trimmedValue = value.trim();\n if (value === trimmedValue) return;\n\n e.target.value = trimmedValue;\n handleChange(e);\n };\n\n const handleOnBlur = e => {\n handleTrimmedChangeOnBlur(e);\n onBlur?.(e);\n };\n\n return (\n <div className={classnames([\"neeto-ui-input__wrapper\", className])}>\n <div className=\"neeto-ui-input__label-wrapper\">\n {label && (\n <Label\n {...{ required }}\n data-cy={`${hyphenize(label)}-input-label`}\n htmlFor={id}\n {...labelProps}\n >\n {label}\n </Label>\n )}\n {isCharacterLimitVisible && (\n <p\n className={classnames(\"neeto-ui-input__max-length\", {\n \"neeto-ui-input__max-length--error\": maxLengthError,\n })}\n >\n {valueLength}/{maxLength}\n </p>\n )}\n </div>\n <div\n data-cy={`${hyphenize(label)}-input`}\n className={classnames(\"neeto-ui-input\", {\n \"neeto-ui-input--naked\": !!nakedInput,\n \"neeto-ui-input--error\": !!error,\n \"neeto-ui-input--disabled\": !!disabled,\n \"neeto-ui-input--small\": size === \"small\",\n \"neeto-ui-input--medium\": size === \"medium\",\n \"neeto-ui-input--large\": size === \"large\",\n })}\n >\n {prefix && <div className=\"neeto-ui-input__prefix\">{prefix}</div>}\n <input\n aria-invalid={!!error}\n data-cy={`${hyphenize(label)}-input-field`}\n size={contentSize}\n aria-describedby={classnames({\n [errorId]: !!error,\n [helpTextId]: helpText,\n })}\n {...{\n disabled,\n id,\n ref,\n required,\n type,\n ...(isMaxLengthPresent && !unlimitedChars && { maxLength }),\n ...otherProps,\n value,\n }}\n onBlur={handleOnBlur}\n onChange={handleChange}\n />\n {suffix && <div className=\"neeto-ui-input__suffix\">{suffix}</div>}\n </div>\n {!!error && (\n <p\n className=\"neeto-ui-input__error\"\n data-cy={`${hyphenize(label)}-input-error`}\n id={errorId}\n >\n {error}\n </p>\n )}\n {helpText && (\n <p\n className=\"neeto-ui-input__help-text\"\n data-cy={`${hyphenize(label)}-input-help`}\n id={helpTextId}\n >\n {helpText}\n </p>\n )}\n </div>\n );\n }\n);\n\nInput.displayName = \"Input\";\n\nInput.propTypes = {\n /**\n * To specify a unique ID to the Input component.\n */\n id: PropTypes.string,\n /**\n * To specify the size of Input.\n */\n size: PropTypes.oneOf(Object.values(SIZES)),\n /**\n * To specify the type of Input field.\n */\n type: PropTypes.string,\n /**\n * To specify the label props to be passed to the Label component.\n */\n labelProps: PropTypes.object,\n /**\n * To specify a maximum character limit to the Input. Charater limit is visible only if the Input value is greater than or equal to 85% of the maximum character limit.\n */\n maxLength: PropTypes.number,\n /**\n * To be used along with maxLength prop. When set to true the character limit will not be enforced and character count will be shown in error state if the character limit is exceeded.\n */\n unlimitedChars: PropTypes.bool,\n /**\n * To specify the text to be displayed above the Input.\n */\n label: PropTypes.string,\n /**\n * To specify the error message to be shown in the Input field.\n */\n error: PropTypes.string,\n /**\n * To specify the content to be added at the end of the Input field.\n */\n suffix: PropTypes.node,\n /**\n * To specify the content to be added at the beginning of the Input field.\n */\n prefix: PropTypes.node,\n /**\n * To specify whether the Input field is disabled or not.\n */\n disabled: PropTypes.bool,\n /**\n * To specify the text that appears below the Input field.\n */\n helpText: PropTypes.string,\n /**\n * To specify external classNames that can be provided as overrides to the main wrapper.\n */\n className: PropTypes.string,\n /**\n * To create an Input field without any borders.\n */\n nakedInput: PropTypes.bool,\n /**\n * To specify the value to be passed as size attribute to the Input field.\n */\n contentSize: PropTypes.number,\n /**\n * To specify whether the Input field is required or not.\n */\n required: PropTypes.bool,\n /**\n * To specify a regex to be matched against the user input. Any character that matches it\n * cannot be input by the user. It will also prevent such characters from being pasted into the input.\n */\n rejectCharsRegex: PropTypes.instanceOf(RegExp),\n /**\n * To disable leading and trailing white spaces onBlur.\n */\n disableTrimOnBlur: PropTypes.bool,\n};\n\nexport default Input;\n"],"names":["SIZES","small","medium","large","Input","forwardRef","_ref","ref","_ref2","_otherProps$value","_ref$size","size","_ref$type","type","_ref$label","label","_ref$error","error","_ref$suffix","suffix","_ref$prefix","prefix","_ref$disabled","disabled","_ref$helpText","helpText","_ref$className","className","_ref$nakedInput","nakedInput","_ref$contentSize","contentSize","_ref$required","required","maxLength","_ref$unlimitedChars","unlimitedChars","labelProps","rejectCharsRegex","onBlur","_ref$disableTrimOnBlu","disableTrimOnBlur","otherProps","_objectWithoutProperties","_excluded","_useState","useState","value","_useState2","_slicedToArray","valueInternal","setValueInternal","id","useId","errorId","concat","helpTextId","valueLength","toString","length","isCharacterLimitVisible","maxLengthError","onChange","e","_otherProps$onChange","target","call","isMaxLengthPresent","handleRegexChange","globalRegex","RegExp","replace","handleChange","handleTrimmedChangeOnBlur","trimmedValue","trim","handleOnBlur","React","createElement","classnames","Label","_extends","hyphenize","htmlFor","_defineProperty","_objectSpread","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,IAAMA,KAAK,GAAG;AAAEC,EAAAA,KAAK,EAAE,OAAO;AAAEC,EAAAA,MAAM,EAAE,QAAQ;AAAEC,EAAAA,KAAK,EAAE,OAAA;AAAQ,CAAC,CAAA;AAE5DC,IAAAA,KAAK,gBAAGC,UAAU,CACtB,UAAAC,IAAA,EAsBEC,GAAG,EACA;EAAA,IAAAC,KAAA,EAAAC,iBAAA,CAAA;AAAA,EAAA,IAAAC,SAAA,GAAAJ,IAAA,CArBDK,IAAI;AAAJA,IAAAA,IAAI,GAAAD,SAAA,KAAA,KAAA,CAAA,GAAGV,KAAK,CAACE,MAAM,GAAAQ,SAAA;IAAAE,SAAA,GAAAN,IAAA,CACnBO,IAAI;AAAJA,IAAAA,IAAI,GAAAD,SAAA,KAAG,KAAA,CAAA,GAAA,MAAM,GAAAA,SAAA;IAAAE,UAAA,GAAAR,IAAA,CACbS,KAAK;AAALA,IAAAA,KAAK,GAAAD,UAAA,KAAG,KAAA,CAAA,GAAA,EAAE,GAAAA,UAAA;IAAAE,UAAA,GAAAV,IAAA,CACVW,KAAK;AAALA,IAAAA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AAA,CAAA,EAAA;AAEPR,IAAAA,MAAM,EAAEqC,YAAa;AACrBd,IAAAA,QAAQ,EAAEU,YAAAA;AAAa,GAAA,CAAA,CACvB,EACDrD,MAAM,iBAAI0D,cAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;AAAKnD,IAAAA,SAAS,EAAC,wBAAA;GAA0BR,EAAAA,MAAM,CAAO,CAC7D,EACL,CAAC,CAACF,KAAK,iBACN4D,cAAA,CAAAC,aAAA,CAAA,GAAA,EAAA;AACEnD,IAAAA,SAAS,EAAC,uBAAuB;AACjC,IAAA,SAAA,EAAA,EAAA,CAAA4B,MAAA,CAAY2B,SAAS,CAACnE,KAAK,CAAC,EAAe,cAAA,CAAA;AAC3CqC,IAAAA,EAAE,EAAEE,OAAAA;AAAQ,GAAA,EAEXrC,KAAK,CAET,EACAQ,QAAQ,iBACPoD,cAAA,CAAAC,aAAA,CAAA,GAAA,EAAA;AACEnD,IAAAA,SAAS,EAAC,2BAA2B;AACrC,IAAA,SAAA,EAAA,EAAA,CAAA4B,MAAA,CAAY2B,SAAS,CAACnE,KAAK,CAAC,EAAc,aAAA,CAAA;AAC1CqC,IAAAA,EAAE,EAAEI,UAAAA;GAEH/B,EAAAA,QAAQ,CAEZ,CACG,CAAA;AAEV,CAAC,EACF;AAEDrB,KAAK,CAACkF,WAAW,GAAG,OAAO;;;;"}
|
package/dist/MultiEmailInput.js
CHANGED
|
@@ -184,10 +184,26 @@ var formatEmailInputOptions = function formatEmailInputOptions(label) {
|
|
|
184
184
|
};
|
|
185
185
|
var pruneDuplicates = function pruneDuplicates(inputValues) {
|
|
186
186
|
var values = pluck("value", inputValues);
|
|
187
|
-
var
|
|
188
|
-
|
|
187
|
+
var caseInsensitiveValues = values.map(function (value) {
|
|
188
|
+
return value.toLowerCase();
|
|
189
|
+
});
|
|
190
|
+
var uniqueValuesSet = new Set();
|
|
191
|
+
var duplicates = [];
|
|
192
|
+
caseInsensitiveValues.forEach(function (value, index) {
|
|
193
|
+
if (uniqueValuesSet.has(value)) {
|
|
194
|
+
duplicates.push(values[index]);
|
|
195
|
+
} else {
|
|
196
|
+
uniqueValuesSet.add(value);
|
|
197
|
+
}
|
|
198
|
+
});
|
|
199
|
+
var uniqueValues = Array.from(uniqueValuesSet);
|
|
200
|
+
var uniqueEmails = uniqueValues.map(function (email) {
|
|
189
201
|
return formatEmailInputOptions(email);
|
|
190
202
|
});
|
|
203
|
+
return {
|
|
204
|
+
uniqueEmails: uniqueEmails,
|
|
205
|
+
duplicates: duplicates
|
|
206
|
+
};
|
|
191
207
|
};
|
|
192
208
|
var renderValidEmails = function renderValidEmails(values) {
|
|
193
209
|
return values.filter(function (email) {
|
|
@@ -243,6 +259,10 @@ var MultiEmailInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
243
259
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
244
260
|
isFocused = _useState4[0],
|
|
245
261
|
setIsFocused = _useState4[1];
|
|
262
|
+
var _useState5 = useState([]),
|
|
263
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
264
|
+
duplicateEmails = _useState6[0],
|
|
265
|
+
setDuplicateEmails = _useState6[1];
|
|
246
266
|
var isCounterVisible = !!counter && (!counter.startsFrom || getValidEmailsCount(value) >= counter.startsFrom);
|
|
247
267
|
var isOptionsPresent = !!otherProps.options;
|
|
248
268
|
var handleFilterEmails = function handleFilterEmails() {
|
|
@@ -254,7 +274,11 @@ var MultiEmailInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
254
274
|
var emails = emailMatches.map(function (email) {
|
|
255
275
|
return formatEmailInputOptions(email);
|
|
256
276
|
});
|
|
257
|
-
|
|
277
|
+
var _pruneDuplicates = pruneDuplicates([].concat(_toConsumableArray(value), _toConsumableArray(emails))),
|
|
278
|
+
uniqueEmails = _pruneDuplicates.uniqueEmails,
|
|
279
|
+
duplicates = _pruneDuplicates.duplicates;
|
|
280
|
+
onChange(uniqueEmails);
|
|
281
|
+
setDuplicateEmails(duplicates);
|
|
258
282
|
setInputValue("");
|
|
259
283
|
};
|
|
260
284
|
var handleKeyDown = function handleKeyDown(event) {
|
|
@@ -280,12 +304,17 @@ var MultiEmailInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
280
304
|
var onCreateOption = function onCreateOption(input) {
|
|
281
305
|
var _otherProps$onCreateO;
|
|
282
306
|
var email = formatEmailInputOptions(input);
|
|
283
|
-
|
|
307
|
+
var _pruneDuplicates2 = pruneDuplicates([].concat(_toConsumableArray(value), [email])),
|
|
308
|
+
uniqueEmails = _pruneDuplicates2.uniqueEmails,
|
|
309
|
+
duplicates = _pruneDuplicates2.duplicates;
|
|
310
|
+
onChange(uniqueEmails);
|
|
311
|
+
setDuplicateEmails(duplicates);
|
|
284
312
|
otherProps === null || otherProps === void 0 || (_otherProps$onCreateO = otherProps.onCreateOption) === null || _otherProps$onCreateO === void 0 || _otherProps$onCreateO.call(otherProps, input);
|
|
285
313
|
};
|
|
286
314
|
var handleBlur = function handleBlur(event) {
|
|
287
315
|
inputValue ? handleEmailChange(inputValue) : onBlur(event);
|
|
288
316
|
setIsFocused(false);
|
|
317
|
+
setDuplicateEmails([]);
|
|
289
318
|
};
|
|
290
319
|
var overrideProps = {};
|
|
291
320
|
if (isOptionsPresent) {
|
|
@@ -359,7 +388,10 @@ var MultiEmailInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
359
388
|
}, "\xA0", filterInvalidEmails.label ? filterInvalidEmails.label : "Click here to remove invalid emails.")), !!helpText && /*#__PURE__*/React__default.createElement("p", {
|
|
360
389
|
className: "neeto-ui-input__help-text",
|
|
361
390
|
"data-cy": "".concat(hyphenize(label), "-input-help")
|
|
362
|
-
}, helpText)
|
|
391
|
+
}, helpText), !!duplicateEmails.length && /*#__PURE__*/React__default.createElement("p", {
|
|
392
|
+
className: "neeto-ui-input__warning",
|
|
393
|
+
"data-cy": "".concat(hyphenize(label), "-duplicate-emails-warning")
|
|
394
|
+
}, "Duplicate emails that were removed case insensitively:", " ", duplicateEmails.join(", ")));
|
|
363
395
|
});
|
|
364
396
|
MultiEmailInput.displayName = "MultiEmailInput";
|
|
365
397
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultiEmailInput.js","sources":["../src/components/MultiEmailInput/constants.jsx","../src/components/MultiEmailInput/utils.js","../src/components/MultiEmailInput/index.jsx"],"sourcesContent":["import React, { useEffect, useRef } from \"react\";\n\nimport { Close } from \"neetoicons\";\nimport { assoc } from \"ramda\";\nimport { components } from \"react-select\";\n\nimport Tag from \"components/Tag\";\nimport { hyphenize } from \"utils\";\n\nconst STYLES = {\n border: {\n default: \"1px solid rgb(var(--neeto-ui-gray-400))\",\n error: \"1px solid rgb(var(--neeto-ui-error-800)) !important\",\n },\n color: {\n default: \"rgb(var(--neeto-ui-gray-800))\",\n error: \"rgb(var(--neeto-ui-error-800)) !important\",\n },\n};\n\nconst CustomControl = ({ children, ...props }) => {\n const { getValue } = props;\n const { isFocused, prefix } = props.selectProps;\n\n const prevValue = useRef([]);\n const controlRef = useRef(null);\n\n const value = getValue();\n\n const scrollToBottom = () => {\n const scrollContainer = controlRef.current;\n if (!scrollContainer) return;\n\n const { scrollHeight, clientHeight } = scrollContainer;\n\n scrollContainer.scrollTo({ top: scrollHeight - clientHeight });\n };\n\n useEffect(() => {\n const isItemAdded = value.length > prevValue.current.length;\n const isItemDeleted = value.length < prevValue.current.length;\n\n if ((isFocused && !isItemDeleted) || isItemAdded) scrollToBottom();\n\n prevValue.current = value;\n }, [isFocused, value]);\n\n return (\n <components.Control\n {...props}\n innerProps={{ ...props.innerProps, ref: controlRef }}\n >\n {prefix && <div className=\"neeto-ui-email-input__prefix\">{prefix}</div>}\n {children}\n </components.Control>\n );\n};\n\nconst CustomDropdownIndicator = props => {\n const { suffix } = props.selectProps;\n\n return suffix ? (\n <components.DropdownIndicator {...props}>\n <div className=\"neeto-ui-email-input__suffix\">{suffix}</div>\n </components.DropdownIndicator>\n ) : null;\n};\n\nconst MultiValueRemove = props => (\n <components.MultiValueRemove\n {...props}\n innerProps={{\n ...props.innerProps,\n [\"data-cy\"]: `${hyphenize(props.data.label)}-remove-icon`,\n }}\n >\n <Close size={16} />\n </components.MultiValueRemove>\n);\n\nconst CustomValueContainer = ({ children, ...props }) => {\n const {\n getValue,\n selectProps: { isFocused, visibleEmailsCount, isAlwaysExpanded },\n } = props;\n const value = getValue();\n const [firstChild, ...rest] = children;\n\n const shouldCollapse =\n !isAlwaysExpanded && !isFocused && value.length > visibleEmailsCount;\n\n return (\n <components.ValueContainer\n {...props}\n innerProps={{\n ...props.innerProps,\n [\"data-cy\"]: \"multi-email-input-container\",\n }}\n >\n {shouldCollapse ? firstChild.slice(0, visibleEmailsCount) : firstChild}\n {shouldCollapse && (\n <Tag\n label={`${value.length - visibleEmailsCount} more`}\n style=\"secondary\"\n />\n )}\n {rest}\n </components.ValueContainer>\n );\n};\n\nconst CustomClearIndicator = props => (\n <components.ClearIndicator\n {...props}\n innerProps={{\n ...props.innerProps,\n [\"data-cy\"]: \"clear-all-button\",\n }}\n >\n <Close className=\"cursor-pointer\" size={16} />\n </components.ClearIndicator>\n);\n\nconst SelectContainer = props => (\n <components.SelectContainer\n {...props}\n innerProps={{\n ...props.innerProps,\n [\"data-cy\"]: \"multi-email-select-container\",\n }}\n />\n);\n\nconst Input = props => (\n <components.Input\n {...props}\n data-cy=\"email-select-input-field\"\n onPaste={e => {\n const clipboardData = e.clipboardData.getData(\"Text\");\n\n setTimeout(() => props.selectProps.handleEmailChange(clipboardData));\n }}\n />\n);\n\nexport const EMAIL_REGEX = new RegExp(\n \"^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\\\.[A-Z]{2,}$\",\n \"i\"\n);\n\nexport const UNSTRICT_EMAIL_REGEX =\n /(([^<>()[\\]\\\\.,;:\\s@\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))/g;\n\nexport const EMAIL_SEPARATION_REGEX = /[^\\s,]+/g;\n\nexport const CUSTOM_STYLES = {\n input: assoc(\"overflow\", \"hidden\"),\n multiValue: (styles, { data: { valid } }) => ({\n ...styles,\n border: valid ? STYLES.border.default : STYLES.border.error,\n color: valid ? STYLES.color.default : STYLES.color.error,\n }),\n};\n\nexport const CUSTOM_COMPONENTS = {\n DropdownIndicator: CustomDropdownIndicator,\n Control: CustomControl,\n MultiValueRemove,\n ValueContainer: CustomValueContainer,\n ClearIndicator: CustomClearIndicator,\n SelectContainer,\n Input,\n};\n","import { pluck } from \"ramda\";\n\nimport { EMAIL_REGEX } from \"./constants\";\n\nexport const formatEmailInputOptions = label => ({\n label,\n value: label,\n valid: EMAIL_REGEX.test(label),\n});\n\nexport const pruneDuplicates = inputValues => {\n const values = pluck(\"value\", inputValues);\n const uniqueValues = [...new Set(values)];\n\n return uniqueValues.map(email => formatEmailInputOptions(email));\n};\n\nexport const renderValidEmails = values =>\n values.filter(email => email.valid && email);\n\nexport const getValidEmailsCount = values => renderValidEmails(values).length;\n\nexport const renderDefaultText = count => (count === 1 ? \"email\" : \"emails\");\n","import React, { useState, forwardRef } from \"react\";\n\nimport classnames from \"classnames\";\nimport PropTypes from \"prop-types\";\nimport { mergeLeft, isEmpty } from \"ramda\";\nimport CreatableSelect from \"react-select/creatable\";\n\nimport { noop, hyphenize } from \"utils\";\n\nimport {\n EMAIL_SEPARATION_REGEX,\n CUSTOM_STYLES,\n UNSTRICT_EMAIL_REGEX,\n CUSTOM_COMPONENTS,\n} from \"./constants\";\nimport {\n formatEmailInputOptions,\n pruneDuplicates,\n renderValidEmails,\n renderDefaultText,\n getValidEmailsCount,\n} from \"./utils\";\n\nimport Label from \"../Label\";\n\nconst MultiEmailInput = forwardRef(\n (\n {\n label = \"Email(s)\",\n placeholder = \"\",\n helpText = \"\",\n value = [],\n onChange = noop,\n error = \"\",\n onBlur = noop,\n filterInvalidEmails,\n counter,\n disabled = false,\n maxHeight = 200,\n required = false,\n labelProps,\n visibleEmailsCount = 3,\n isCreateable = true,\n isAlwaysExpanded = false,\n ...otherProps\n },\n ref\n ) => {\n const [inputValue, setInputValue] = useState(\"\");\n const [isFocused, setIsFocused] = useState(false);\n\n const isCounterVisible =\n !!counter &&\n (!counter.startsFrom || getValidEmailsCount(value) >= counter.startsFrom);\n\n const isOptionsPresent = !!otherProps.options;\n\n const handleFilterEmails = () => onChange(renderValidEmails(value));\n\n const handleEmailChange = inputValue => {\n const inputValues = inputValue.match(EMAIL_SEPARATION_REGEX);\n const emailMatches =\n inputValue.match(UNSTRICT_EMAIL_REGEX) || inputValues || [];\n\n const emails = emailMatches.map(email => formatEmailInputOptions(email));\n onChange(pruneDuplicates([...value, ...emails]));\n setInputValue(\"\");\n };\n\n const handleKeyDown = event => {\n if (!inputValue) return;\n\n switch (event.key) {\n case \"Enter\": {\n handleEmailChange(inputValue);\n !isOptionsPresent && event.preventDefault();\n event.stopPropagation();\n\n return;\n }\n case \"Tab\":\n case \",\":\n case \" \": {\n handleEmailChange(inputValue);\n event.preventDefault();\n event.stopPropagation();\n }\n }\n };\n\n const onCreateOption = input => {\n const email = formatEmailInputOptions(input);\n onChange(pruneDuplicates([...value, email]));\n otherProps?.onCreateOption?.(input);\n };\n\n const handleBlur = event => {\n inputValue ? handleEmailChange(inputValue) : onBlur(event);\n setIsFocused(false);\n };\n\n let overrideProps = {};\n\n if (isOptionsPresent) {\n const isValidNewOption = (inputValue, _, selectOptions) => {\n if (!isCreateable) return false;\n\n const isInputEmpty = isEmpty(inputValue.trim());\n const doesInputContainSeparator =\n inputValue.includes(\",\") || inputValue.includes(\" \");\n\n const isInputPresentInOptions = selectOptions.find(\n option => option.value === inputValue.toLowerCase()\n );\n\n return !(\n isInputEmpty ||\n doesInputContainSeparator ||\n isInputPresentInOptions\n );\n };\n overrideProps = { onCreateOption, isValidNewOption };\n }\n\n const isFilterEmailsLinkVisible =\n !!filterInvalidEmails && value.length > getValidEmailsCount(value);\n\n return (\n <div className=\"neeto-ui-input__wrapper neeto-ui-email-input__wrapper\">\n <div className=\"neeto-ui-email-input__label-wrapper\">\n {label && (\n <Label\n {...{ required }}\n className=\"neeto-ui-email-input__label\"\n data-cy={`${hyphenize(label)}-input-label`}\n {...labelProps}\n >\n {label}\n </Label>\n )}\n {isCounterVisible && (\n <p\n className=\"neeto-ui-email-input__counter\"\n data-cy={`${hyphenize(label)}-email-counter`}\n >\n {getValidEmailsCount(value)}{\" \"}\n {counter.label\n ? counter.label\n : renderDefaultText(getValidEmailsCount(value))}\n </p>\n )}\n </div>\n <CreatableSelect\n isMulti\n required\n classNamePrefix=\"neeto-ui-react-select\"\n components={CUSTOM_COMPONENTS}\n isDisabled={disabled}\n className={classnames(\n \"neeto-ui-react-select__container neeto-ui-react-select__container--medium neeto-ui-email-input__select\",\n { \"neeto-ui-react-select__container--error\": !!error }\n )}\n styles={{\n ...CUSTOM_STYLES,\n control: mergeLeft({\n maxHeight: `${maxHeight}px`,\n overflowY: \"auto\",\n }),\n }}\n onBlur={handleBlur}\n onFocus={() => setIsFocused(true)}\n onInputChange={inputValue => setInputValue(inputValue)}\n onKeyDown={handleKeyDown}\n {...{\n handleEmailChange,\n inputValue,\n isAlwaysExpanded,\n isFocused,\n onChange,\n placeholder,\n ref,\n value,\n visibleEmailsCount,\n ...(!isOptionsPresent && { menuIsOpen: false }),\n ...otherProps,\n ...overrideProps,\n }}\n />\n {!!error && (\n <p\n className=\"neeto-ui-input__error\"\n data-cy={`${hyphenize(label)}-input-error`}\n >\n {error}\n {isFilterEmailsLinkVisible && (\n <span\n className=\"neeto-ui-font-semibold cursor-pointer\"\n onClick={handleFilterEmails}\n >\n \n {filterInvalidEmails.label\n ? filterInvalidEmails.label\n : \"Click here to remove invalid emails.\"}\n </span>\n )}\n </p>\n )}\n {!!helpText && (\n <p\n className=\"neeto-ui-input__help-text\"\n data-cy={`${hyphenize(label)}-input-help`}\n >\n {helpText}\n </p>\n )}\n </div>\n );\n }\n);\n\nMultiEmailInput.displayName = \"MultiEmailInput\";\n\nMultiEmailInput.propTypes = {\n /**\n * To specify the text to be displayed above the Input field.\n */\n label: PropTypes.string,\n /**\n * To specify the label props to be passed to the Label component.\n */\n labelProps: PropTypes.object,\n /**\n * To specify the text to be displayed inside the Input field.\n */\n placeholder: PropTypes.string,\n /**\n * To specify the helper text message to be displayed below the Input field.\n */\n helpText: PropTypes.string,\n /**\n * To specify the value to be displayed inside the Input field.\n */\n value: PropTypes.array,\n /**\n * To specify the error message to be shown below the Input field.\n */\n error: PropTypes.string,\n /**\n * To specify whether the Input field is disabled or not.\n */\n disabled: PropTypes.bool,\n /**\n * To specify whether the Input field is required or not.\n */\n required: PropTypes.bool,\n /**\n * To specify the message to be shown besides the error message to filter out the invalid emails.\n */\n filterInvalidEmails: PropTypes.shape({ label: PropTypes.string }),\n /**\n * To add an email counter next to the label.\n */\n counter: PropTypes.oneOfType([\n PropTypes.bool,\n PropTypes.shape({\n label: PropTypes.string,\n startsFrom: PropTypes.number,\n }),\n ]),\n /**\n * To specify the action to be triggered on modifying the Input field.\n */\n onChange: PropTypes.func,\n /**\n * To specify the action to be triggered on changing focus from the Input field.\n */\n onBlur: PropTypes.func,\n /**\n * To specify the maximum height (in pixels) of the container before it becomes scrollable.\n */\n maxHeight: PropTypes.number,\n /**\n * To specify the content to be added at the end of the Input field.\n */\n suffix: PropTypes.node,\n /**\n * To specify the content to be added at the beginning of the Input field.\n */\n prefix: PropTypes.node,\n /**\n * To specify the number of email to be displayed in the input field when not in focus.\n */\n visibleEmailsCount: PropTypes.number,\n /**\n * To specify whether a new email option can be created or not.\n */\n isCreateable: PropTypes.bool,\n /**\n * To specify whether the input field should always be shown in an expanded state or not.\n */\n isAlwaysExpanded: PropTypes.bool,\n};\n\nexport default MultiEmailInput;\n"],"names":["STYLES","border","error","color","CustomControl","_ref","children","props","_objectWithoutProperties","_excluded","getValue","_props$selectProps","selectProps","isFocused","prefix","prevValue","useRef","controlRef","value","scrollToBottom","scrollContainer","current","scrollHeight","clientHeight","scrollTo","top","useEffect","isItemAdded","length","isItemDeleted","React","createElement","components","Control","_extends","innerProps","_objectSpread","ref","className","CustomDropdownIndicator","suffix","DropdownIndicator","MultiValueRemove","_defineProperty","concat","hyphenize","data","label","Close","size","CustomValueContainer","_ref2","_excluded2","_props$selectProps2","visibleEmailsCount","isAlwaysExpanded","_children","_toArray","firstChild","rest","slice","shouldCollapse","ValueContainer","Tag","style","CustomClearIndicator","ClearIndicator","SelectContainer","Input","onPaste","e","clipboardData","getData","setTimeout","handleEmailChange","EMAIL_REGEX","RegExp","UNSTRICT_EMAIL_REGEX","EMAIL_SEPARATION_REGEX","CUSTOM_STYLES","input","assoc","multiValue","styles","_ref3","valid","CUSTOM_COMPONENTS","formatEmailInputOptions","test","pruneDuplicates","inputValues","values","pluck","uniqueValues","_toConsumableArray","Set","map","email","renderValidEmails","filter","getValidEmailsCount","renderDefaultText","count","MultiEmailInput","forwardRef","_ref$label","_ref$placeholder","placeholder","_ref$helpText","helpText","_ref$value","_ref$onChange","onChange","noop","_ref$error","_ref$onBlur","onBlur","filterInvalidEmails","counter","_ref$disabled","disabled","_ref$maxHeight","maxHeight","_ref$required","required","labelProps","_ref$visibleEmailsCou","_ref$isCreateable","isCreateable","_ref$isAlwaysExpanded","otherProps","_useState","useState","_useState2","_slicedToArray","inputValue","setInputValue","_useState3","_useState4","setIsFocused","isCounterVisible","startsFrom","isOptionsPresent","options","handleFilterEmails","match","emailMatches","emails","handleKeyDown","event","key","preventDefault","stopPropagation","onCreateOption","_otherProps$onCreateO","call","handleBlur","overrideProps","isValidNewOption","_","selectOptions","isInputEmpty","isEmpty","trim","doesInputContainSeparator","includes","isInputPresentInOptions","find","option","toLowerCase","isFilterEmailsLinkVisible","Label","CreatableSelect","isMulti","classNamePrefix","isDisabled","classnames","control","mergeLeft","overflowY","onFocus","onInputChange","onKeyDown","menuIsOpen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AC,uBAAuB;AACjC,IAAA,SAAA,EAAA,EAAA,CAAAM,MAAA,CAAYC,SAAS,CAACE,KAAK,CAAC,EAAA,cAAA,CAAA;AAAe,GAAA,EAE1C7C,KAAK,EACLwK,yBAAyB,iBACxB5I,cAAA,CAAAC,aAAA,CAAA,MAAA,EAAA;AACEO,IAAAA,SAAS,EAAC,uCAAuC;AACjDkJ,IAAAA,OAAO,EAAExC,kBAAAA;GACV,EAAA,MAEC,EAAC3B,mBAAmB,CAACtE,KAAK,GACtBsE,mBAAmB,CAACtE,KAAK,GACzB,sCAAsC,CAE7C,CAEJ,EACA,CAAC,CAAC8D,QAAQ,iBACT/E,cAAA,CAAAC,aAAA,CAAA,GAAA,EAAA;AACEO,IAAAA,SAAS,EAAC,2BAA2B;AACrC,IAAA,SAAA,EAAA,EAAA,CAAAM,MAAA,CAAYC,SAAS,CAACE,KAAK,CAAC,EAAA,aAAA,CAAA;GAE3B8D,EAAAA,QAAQ,CAEZ,CACG,CAAA;AAEV,CAAC,EACF;AAEDN,eAAe,CAACkF,WAAW,GAAG,iBAAiB;;;;"}
|
|
1
|
+
{"version":3,"file":"MultiEmailInput.js","sources":["../src/components/MultiEmailInput/constants.jsx","../src/components/MultiEmailInput/utils.js","../src/components/MultiEmailInput/index.jsx"],"sourcesContent":["import React, { useEffect, useRef } from \"react\";\n\nimport { Close } from \"neetoicons\";\nimport { assoc } from \"ramda\";\nimport { components } from \"react-select\";\n\nimport Tag from \"components/Tag\";\nimport { hyphenize } from \"utils\";\n\nconst STYLES = {\n border: {\n default: \"1px solid rgb(var(--neeto-ui-gray-400))\",\n error: \"1px solid rgb(var(--neeto-ui-error-800)) !important\",\n },\n color: {\n default: \"rgb(var(--neeto-ui-gray-800))\",\n error: \"rgb(var(--neeto-ui-error-800)) !important\",\n },\n};\n\nconst CustomControl = ({ children, ...props }) => {\n const { getValue } = props;\n const { isFocused, prefix } = props.selectProps;\n\n const prevValue = useRef([]);\n const controlRef = useRef(null);\n\n const value = getValue();\n\n const scrollToBottom = () => {\n const scrollContainer = controlRef.current;\n if (!scrollContainer) return;\n\n const { scrollHeight, clientHeight } = scrollContainer;\n\n scrollContainer.scrollTo({ top: scrollHeight - clientHeight });\n };\n\n useEffect(() => {\n const isItemAdded = value.length > prevValue.current.length;\n const isItemDeleted = value.length < prevValue.current.length;\n\n if ((isFocused && !isItemDeleted) || isItemAdded) scrollToBottom();\n\n prevValue.current = value;\n }, [isFocused, value]);\n\n return (\n <components.Control\n {...props}\n innerProps={{ ...props.innerProps, ref: controlRef }}\n >\n {prefix && <div className=\"neeto-ui-email-input__prefix\">{prefix}</div>}\n {children}\n </components.Control>\n );\n};\n\nconst CustomDropdownIndicator = props => {\n const { suffix } = props.selectProps;\n\n return suffix ? (\n <components.DropdownIndicator {...props}>\n <div className=\"neeto-ui-email-input__suffix\">{suffix}</div>\n </components.DropdownIndicator>\n ) : null;\n};\n\nconst MultiValueRemove = props => (\n <components.MultiValueRemove\n {...props}\n innerProps={{\n ...props.innerProps,\n [\"data-cy\"]: `${hyphenize(props.data.label)}-remove-icon`,\n }}\n >\n <Close size={16} />\n </components.MultiValueRemove>\n);\n\nconst CustomValueContainer = ({ children, ...props }) => {\n const {\n getValue,\n selectProps: { isFocused, visibleEmailsCount, isAlwaysExpanded },\n } = props;\n const value = getValue();\n const [firstChild, ...rest] = children;\n\n const shouldCollapse =\n !isAlwaysExpanded && !isFocused && value.length > visibleEmailsCount;\n\n return (\n <components.ValueContainer\n {...props}\n innerProps={{\n ...props.innerProps,\n [\"data-cy\"]: \"multi-email-input-container\",\n }}\n >\n {shouldCollapse ? firstChild.slice(0, visibleEmailsCount) : firstChild}\n {shouldCollapse && (\n <Tag\n label={`${value.length - visibleEmailsCount} more`}\n style=\"secondary\"\n />\n )}\n {rest}\n </components.ValueContainer>\n );\n};\n\nconst CustomClearIndicator = props => (\n <components.ClearIndicator\n {...props}\n innerProps={{\n ...props.innerProps,\n [\"data-cy\"]: \"clear-all-button\",\n }}\n >\n <Close className=\"cursor-pointer\" size={16} />\n </components.ClearIndicator>\n);\n\nconst SelectContainer = props => (\n <components.SelectContainer\n {...props}\n innerProps={{\n ...props.innerProps,\n [\"data-cy\"]: \"multi-email-select-container\",\n }}\n />\n);\n\nconst Input = props => (\n <components.Input\n {...props}\n data-cy=\"email-select-input-field\"\n onPaste={e => {\n const clipboardData = e.clipboardData.getData(\"Text\");\n\n setTimeout(() => props.selectProps.handleEmailChange(clipboardData));\n }}\n />\n);\n\nexport const EMAIL_REGEX = new RegExp(\n \"^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\\\.[A-Z]{2,}$\",\n \"i\"\n);\n\nexport const UNSTRICT_EMAIL_REGEX =\n /(([^<>()[\\]\\\\.,;:\\s@\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))/g;\n\nexport const EMAIL_SEPARATION_REGEX = /[^\\s,]+/g;\n\nexport const CUSTOM_STYLES = {\n input: assoc(\"overflow\", \"hidden\"),\n multiValue: (styles, { data: { valid } }) => ({\n ...styles,\n border: valid ? STYLES.border.default : STYLES.border.error,\n color: valid ? STYLES.color.default : STYLES.color.error,\n }),\n};\n\nexport const CUSTOM_COMPONENTS = {\n DropdownIndicator: CustomDropdownIndicator,\n Control: CustomControl,\n MultiValueRemove,\n ValueContainer: CustomValueContainer,\n ClearIndicator: CustomClearIndicator,\n SelectContainer,\n Input,\n};\n","import { pluck } from \"ramda\";\n\nimport { EMAIL_REGEX } from \"./constants\";\n\nexport const formatEmailInputOptions = label => ({\n label,\n value: label,\n valid: EMAIL_REGEX.test(label),\n});\n\nexport const pruneDuplicates = inputValues => {\n const values = pluck(\"value\", inputValues);\n const caseInsensitiveValues = values.map(value => value.toLowerCase());\n const uniqueValuesSet = new Set();\n const duplicates = [];\n\n caseInsensitiveValues.forEach((value, index) => {\n if (uniqueValuesSet.has(value)) {\n duplicates.push(values[index]);\n } else {\n uniqueValuesSet.add(value);\n }\n });\n\n const uniqueValues = Array.from(uniqueValuesSet);\n const uniqueEmails = uniqueValues.map(email =>\n formatEmailInputOptions(email)\n );\n\n return { uniqueEmails, duplicates };\n};\n\nexport const renderValidEmails = values =>\n values.filter(email => email.valid && email);\n\nexport const getValidEmailsCount = values => renderValidEmails(values).length;\n\nexport const renderDefaultText = count => (count === 1 ? \"email\" : \"emails\");\n","import React, { useState, forwardRef } from \"react\";\n\nimport classnames from \"classnames\";\nimport PropTypes from \"prop-types\";\nimport { mergeLeft, isEmpty } from \"ramda\";\nimport CreatableSelect from \"react-select/creatable\";\n\nimport { noop, hyphenize } from \"utils\";\n\nimport {\n EMAIL_SEPARATION_REGEX,\n CUSTOM_STYLES,\n UNSTRICT_EMAIL_REGEX,\n CUSTOM_COMPONENTS,\n} from \"./constants\";\nimport {\n formatEmailInputOptions,\n pruneDuplicates,\n renderValidEmails,\n renderDefaultText,\n getValidEmailsCount,\n} from \"./utils\";\n\nimport Label from \"../Label\";\n\nconst MultiEmailInput = forwardRef(\n (\n {\n label = \"Email(s)\",\n placeholder = \"\",\n helpText = \"\",\n value = [],\n onChange = noop,\n error = \"\",\n onBlur = noop,\n filterInvalidEmails,\n counter,\n disabled = false,\n maxHeight = 200,\n required = false,\n labelProps,\n visibleEmailsCount = 3,\n isCreateable = true,\n isAlwaysExpanded = false,\n ...otherProps\n },\n ref\n ) => {\n const [inputValue, setInputValue] = useState(\"\");\n const [isFocused, setIsFocused] = useState(false);\n const [duplicateEmails, setDuplicateEmails] = useState([]);\n\n const isCounterVisible =\n !!counter &&\n (!counter.startsFrom || getValidEmailsCount(value) >= counter.startsFrom);\n\n const isOptionsPresent = !!otherProps.options;\n\n const handleFilterEmails = () => onChange(renderValidEmails(value));\n\n const handleEmailChange = inputValue => {\n const inputValues = inputValue.match(EMAIL_SEPARATION_REGEX);\n const emailMatches =\n inputValue.match(UNSTRICT_EMAIL_REGEX) || inputValues || [];\n\n const emails = emailMatches.map(email => formatEmailInputOptions(email));\n const { uniqueEmails, duplicates } = pruneDuplicates([\n ...value,\n ...emails,\n ]);\n onChange(uniqueEmails);\n setDuplicateEmails(duplicates);\n setInputValue(\"\");\n };\n\n const handleKeyDown = event => {\n if (!inputValue) return;\n\n switch (event.key) {\n case \"Enter\": {\n handleEmailChange(inputValue);\n !isOptionsPresent && event.preventDefault();\n event.stopPropagation();\n\n return;\n }\n case \"Tab\":\n case \",\":\n case \" \": {\n handleEmailChange(inputValue);\n event.preventDefault();\n event.stopPropagation();\n }\n }\n };\n\n const onCreateOption = input => {\n const email = formatEmailInputOptions(input);\n const { uniqueEmails, duplicates } = pruneDuplicates([...value, email]);\n onChange(uniqueEmails);\n setDuplicateEmails(duplicates);\n otherProps?.onCreateOption?.(input);\n };\n\n const handleBlur = event => {\n inputValue ? handleEmailChange(inputValue) : onBlur(event);\n setIsFocused(false);\n setDuplicateEmails([]);\n };\n\n let overrideProps = {};\n\n if (isOptionsPresent) {\n const isValidNewOption = (inputValue, _, selectOptions) => {\n if (!isCreateable) return false;\n\n const isInputEmpty = isEmpty(inputValue.trim());\n const doesInputContainSeparator =\n inputValue.includes(\",\") || inputValue.includes(\" \");\n\n const isInputPresentInOptions = selectOptions.find(\n option => option.value === inputValue.toLowerCase()\n );\n\n return !(\n isInputEmpty ||\n doesInputContainSeparator ||\n isInputPresentInOptions\n );\n };\n overrideProps = { onCreateOption, isValidNewOption };\n }\n\n const isFilterEmailsLinkVisible =\n !!filterInvalidEmails && value.length > getValidEmailsCount(value);\n\n return (\n <div className=\"neeto-ui-input__wrapper neeto-ui-email-input__wrapper\">\n <div className=\"neeto-ui-email-input__label-wrapper\">\n {label && (\n <Label\n {...{ required }}\n className=\"neeto-ui-email-input__label\"\n data-cy={`${hyphenize(label)}-input-label`}\n {...labelProps}\n >\n {label}\n </Label>\n )}\n {isCounterVisible && (\n <p\n className=\"neeto-ui-email-input__counter\"\n data-cy={`${hyphenize(label)}-email-counter`}\n >\n {getValidEmailsCount(value)}{\" \"}\n {counter.label\n ? counter.label\n : renderDefaultText(getValidEmailsCount(value))}\n </p>\n )}\n </div>\n <CreatableSelect\n isMulti\n required\n classNamePrefix=\"neeto-ui-react-select\"\n components={CUSTOM_COMPONENTS}\n isDisabled={disabled}\n className={classnames(\n \"neeto-ui-react-select__container neeto-ui-react-select__container--medium neeto-ui-email-input__select\",\n { \"neeto-ui-react-select__container--error\": !!error }\n )}\n styles={{\n ...CUSTOM_STYLES,\n control: mergeLeft({\n maxHeight: `${maxHeight}px`,\n overflowY: \"auto\",\n }),\n }}\n onBlur={handleBlur}\n onFocus={() => setIsFocused(true)}\n onInputChange={inputValue => setInputValue(inputValue)}\n onKeyDown={handleKeyDown}\n {...{\n handleEmailChange,\n inputValue,\n isAlwaysExpanded,\n isFocused,\n onChange,\n placeholder,\n ref,\n value,\n visibleEmailsCount,\n ...(!isOptionsPresent && { menuIsOpen: false }),\n ...otherProps,\n ...overrideProps,\n }}\n />\n {!!error && (\n <p\n className=\"neeto-ui-input__error\"\n data-cy={`${hyphenize(label)}-input-error`}\n >\n {error}\n {isFilterEmailsLinkVisible && (\n <span\n className=\"neeto-ui-font-semibold cursor-pointer\"\n onClick={handleFilterEmails}\n >\n \n {filterInvalidEmails.label\n ? filterInvalidEmails.label\n : \"Click here to remove invalid emails.\"}\n </span>\n )}\n </p>\n )}\n {!!helpText && (\n <p\n className=\"neeto-ui-input__help-text\"\n data-cy={`${hyphenize(label)}-input-help`}\n >\n {helpText}\n </p>\n )}\n {!!duplicateEmails.length && (\n <p\n className=\"neeto-ui-input__warning\"\n data-cy={`${hyphenize(label)}-duplicate-emails-warning`}\n >\n Duplicate emails that were removed case insensitively:{\" \"}\n {duplicateEmails.join(\", \")}\n </p>\n )}\n </div>\n );\n }\n);\n\nMultiEmailInput.displayName = \"MultiEmailInput\";\n\nMultiEmailInput.propTypes = {\n /**\n * To specify the text to be displayed above the Input field.\n */\n label: PropTypes.string,\n /**\n * To specify the label props to be passed to the Label component.\n */\n labelProps: PropTypes.object,\n /**\n * To specify the text to be displayed inside the Input field.\n */\n placeholder: PropTypes.string,\n /**\n * To specify the helper text message to be displayed below the Input field.\n */\n helpText: PropTypes.string,\n /**\n * To specify the value to be displayed inside the Input field.\n */\n value: PropTypes.array,\n /**\n * To specify the error message to be shown below the Input field.\n */\n error: PropTypes.string,\n /**\n * To specify whether the Input field is disabled or not.\n */\n disabled: PropTypes.bool,\n /**\n * To specify whether the Input field is required or not.\n */\n required: PropTypes.bool,\n /**\n * To specify the message to be shown besides the error message to filter out the invalid emails.\n */\n filterInvalidEmails: PropTypes.shape({ label: PropTypes.string }),\n /**\n * To add an email counter next to the label.\n */\n counter: PropTypes.oneOfType([\n PropTypes.bool,\n PropTypes.shape({\n label: PropTypes.string,\n startsFrom: PropTypes.number,\n }),\n ]),\n /**\n * To specify the action to be triggered on modifying the Input field.\n */\n onChange: PropTypes.func,\n /**\n * To specify the action to be triggered on changing focus from the Input field.\n */\n onBlur: PropTypes.func,\n /**\n * To specify the maximum height (in pixels) of the container before it becomes scrollable.\n */\n maxHeight: PropTypes.number,\n /**\n * To specify the content to be added at the end of the Input field.\n */\n suffix: PropTypes.node,\n /**\n * To specify the content to be added at the beginning of the Input field.\n */\n prefix: PropTypes.node,\n /**\n * To specify the number of email to be displayed in the input field when not in focus.\n */\n visibleEmailsCount: PropTypes.number,\n /**\n * To specify whether a new email option can be created or not.\n */\n isCreateable: PropTypes.bool,\n /**\n * To specify whether the input field should always be shown in an expanded state or not.\n */\n isAlwaysExpanded: PropTypes.bool,\n};\n\nexport default MultiEmailInput;\n"],"names":["STYLES","border","error","color","CustomControl","_ref","children","props","_objectWithoutProperties","_excluded","getValue","_props$selectProps","selectProps","isFocused","prefix","prevValue","useRef","controlRef","value","scrollToBottom","scrollContainer","current","scrollHeight","clientHeight","scrollTo","top","useEffect","isItemAdded","length","isItemDeleted","React","createElement","components","Control","_extends","innerProps","_objectSpread","ref","className","CustomDropdownIndicator","suffix","DropdownIndicator","MultiValueRemove","_defineProperty","concat","hyphenize","data","label","Close","size","CustomValueContainer","_ref2","_excluded2","_props$selectProps2","visibleEmailsCount","isAlwaysExpanded","_children","_toArray","firstChild","rest","slice","shouldCollapse","ValueContainer","Tag","style","CustomClearIndicator","ClearIndicator","SelectContainer","Input","onPaste","e","clipboardData","getData","setTimeout","handleEmailChange","EMAIL_REGEX","RegExp","UNSTRICT_EMAIL_REGEX","EMAIL_SEPARATION_REGEX","CUSTOM_STYLES","input","assoc","multiValue","styles","_ref3","valid","CUSTOM_COMPONENTS","formatEmailInputOptions","test","pruneDuplicates","inputValues","values","pluck","caseInsensitiveValues","map","toLowerCase","uniqueValuesSet","Set","duplicates","forEach","index","has","push","add","uniqueValues","Array","from","uniqueEmails","email","renderValidEmails","filter","getValidEmailsCount","renderDefaultText","count","MultiEmailInput","forwardRef","_ref$label","_ref$placeholder","placeholder","_ref$helpText","helpText","_ref$value","_ref$onChange","onChange","noop","_ref$error","_ref$onBlur","onBlur","filterInvalidEmails","counter","_ref$disabled","disabled","_ref$maxHeight","maxHeight","_ref$required","required","labelProps","_ref$visibleEmailsCou","_ref$isCreateable","isCreateable","_ref$isAlwaysExpanded","otherProps","_useState","useState","_useState2","_slicedToArray","inputValue","setInputValue","_useState3","_useState4","setIsFocused","_useState5","_useState6","duplicateEmails","setDuplicateEmails","isCounterVisible","startsFrom","isOptionsPresent","options","handleFilterEmails","match","emailMatches","emails","_pruneDuplicates","_toConsumableArray","handleKeyDown","event","key","preventDefault","stopPropagation","onCreateOption","_otherProps$onCreateO","_pruneDuplicates2","call","handleBlur","overrideProps","isValidNewOption","_","selectOptions","isInputEmpty","isEmpty","trim","doesInputContainSeparator","includes","isInputPresentInOptions","find","option","isFilterEmailsLinkVisible","Label","CreatableSelect","isMulti","classNamePrefix","isDisabled","classnames","control","mergeLeft","overflowY","onFocus","onInputChange","onKeyDown","menuIsOpen","onClick","join","displayName"],"mappings":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