@bigbinary/neeto-molecules 5.2.34 → 5.2.36
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/cjs/v2/OptionFields.js +4 -5
- package/dist/cjs/v2/OptionFields.js.map +1 -1
- package/dist/cjs/v2/ToggleFeatureCard.js +1 -1
- package/dist/cjs/v2/ToggleFeatureCard.js.map +1 -1
- package/dist/v2/OptionFields.js +4 -5
- package/dist/v2/OptionFields.js.map +1 -1
- package/dist/v2/ToggleFeatureCard.js +1 -1
- package/dist/v2/ToggleFeatureCard.js.map +1 -1
- package/package.json +1 -1
- package/src/translations/ar.json +4 -2
- package/src/translations/bg.json +4 -2
- package/src/translations/ca.json +4 -2
- package/src/translations/cs.json +4 -2
- package/src/translations/da.json +4 -2
- package/src/translations/de.json +4 -2
- package/src/translations/es-MX.json +4 -2
- package/src/translations/es.json +4 -2
- package/src/translations/et.json +4 -2
- package/src/translations/fi.json +4 -2
- package/src/translations/fil.json +4 -2
- package/src/translations/fr.json +4 -2
- package/src/translations/he.json +4 -2
- package/src/translations/hi.json +4 -2
- package/src/translations/hr.json +4 -2
- package/src/translations/hu.json +4 -2
- package/src/translations/id.json +4 -2
- package/src/translations/it.json +4 -2
- package/src/translations/ja.json +4 -2
- package/src/translations/ko.json +4 -2
- package/src/translations/nl.json +4 -2
- package/src/translations/pl.json +4 -2
- package/src/translations/pt-BR.json +4 -2
- package/src/translations/pt.json +4 -2
- package/src/translations/ro.json +4 -2
- package/src/translations/ru.json +4 -2
- package/src/translations/sk.json +4 -2
- package/src/translations/sl.json +4 -2
- package/src/translations/sv.json +4 -2
- package/src/translations/th.json +4 -2
- package/src/translations/tr.json +4 -2
- package/src/translations/uk.json +4 -2
- package/src/translations/vi.json +4 -2
- package/src/translations/zh-CN.json +4 -2
- package/src/translations/zh-TW.json +4 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToggleFeatureCard.js","sources":["../../../src/v2/components/ToggleFeatureCard/hooks/useScrollIntoView.js","../../../src/v2/components/ToggleFeatureCard/ToolTipSwitch.jsx","../../../src/v2/components/ToggleFeatureCard/index.jsx"],"sourcesContent":["import { useEffect } from \"react\";\n\nconst useScrollIntoView = ({ elementId, trigger }) => {\n useEffect(() => {\n if (!trigger) return;\n document.getElementById(elementId)?.scrollIntoView();\n }, [trigger]);\n};\n\nexport default useScrollIntoView;\n","import { Tooltip } from \"@bigbinary/neeto-atoms\";\nimport { Switch as FormikSwitch } from \"@bigbinary/neeto-atoms/formik\";\nimport { isPresent } from \"neetocist\";\n\nconst TooltipSwitch = ({\n enabledCondition,\n name = \"\",\n isDisabled = false,\n switchDataTestid,\n tooltipProps = {},\n ...otherProps\n}) => {\n const { enabledSwitchText, disabledSwitchText, ...neetoAtomsTooltipProps } =\n tooltipProps;\n\n const tooltipContent = enabledCondition\n ? enabledSwitchText\n : disabledSwitchText;\n\n return (\n <Tooltip\n content={tooltipContent}\n disabled={!tooltipContent}\n position=\"top\"\n {...neetoAtomsTooltipProps}\n >\n <span>\n <FormikSwitch\n disabled={isDisabled}\n data-testid={\n isPresent(switchDataTestid)\n ? switchDataTestid\n : \"toggle-feature-card-switch\"\n }\n {...{ name, ...otherProps }}\n />\n </span>\n </Tooltip>\n );\n};\n\nexport default TooltipSwitch;\n","import { useRef, useState, useEffect } from \"react\";\n\nimport { Button, Label, Typography } from \"@bigbinary/neeto-atoms\";\nimport { Input } from \"@bigbinary/neeto-atoms/formik\";\nimport classnames from \"classnames\";\nimport { useFormikContext } from \"formik\";\nimport { X } from \"lucide-react\";\nimport { isPresent, slugify } from \"neetocist\";\nimport useOnClickOutside from \"neetocommons/v2/react-utils/useOnClickOutside\";\nimport useHotkeys from \"neetohotkeys\";\nimport PropTypes from \"prop-types\";\nimport { isEmpty } from \"ramda\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { SIZES } from \"./constants\";\nimport useScrollIntoView from \"./hooks/useScrollIntoView\";\nimport TooltipSwitch from \"./ToolTipSwitch\";\n\nconst ToggleFeatureCard = ({\n isCardStyleEnabled = true,\n title = \"\",\n description = null,\n switchName = \"switch\",\n titleDataTestid = \"\",\n switchDataTestid = \"\",\n descriptionDataTestid = \"\",\n isDisabled = false,\n children = null,\n inputProps,\n switchProps = {},\n editButtonProps = {},\n titleProps = {},\n descriptionProps = {},\n className = \"\",\n}) => {\n const { t } = useTranslation();\n const cardRef = useRef();\n const id = slugify(title);\n const { className: titleClassName, ...otherTitleProps } = titleProps;\n const { className: descriptionClassName, ...otherDescriptionProps } =\n descriptionProps;\n\n const [isEditing, setIsEditing] = useState(false);\n\n const { setFieldValue, values, submitCount, errors, initialValues } =\n useFormikContext();\n\n useEffect(() => {\n if (!(submitCount >= 1 && isEmpty(errors))) return;\n setIsEditing(false);\n }, [submitCount]);\n\n useEffect(() => {\n if (isEmpty(errors)) return;\n setIsEditing(true);\n }, [values, errors]);\n\n const [shouldHighlight, setShouldHighlight] = useState(\n location.hash.split(\"#\")[1] === id\n );\n\n const hasInput = values?.[switchName] && inputProps?.name;\n const enabledCondition = values?.[switchName];\n\n const handleInputReset = () => {\n setIsEditing(false);\n hasInput &&\n setFieldValue(inputProps?.name, initialValues?.[inputProps?.name]);\n };\n\n useOnClickOutside(cardRef, () => setShouldHighlight(false));\n\n useScrollIntoView({ elementId: id, trigger: shouldHighlight });\n\n const inputRef = useHotkeys(\"enter\", () => setIsEditing(false), {\n mode: \"scoped\",\n });\n\n return (\n <div\n {...{ id }}\n data-testid=\"feature-card-container\"\n ref={cardRef}\n className={classnames(\n \"flex flex-col gap-y-2 rounded-lg\",\n { \"bg-card text-card-foreground border p-4\": isCardStyleEnabled },\n { \"border-border\": isCardStyleEnabled && !shouldHighlight },\n { \"border-primary ring-primary ring-1\": shouldHighlight },\n className\n )}\n >\n <Label className=\"flex flex-row items-center gap-2\">\n <TooltipSwitch\n {...{\n enabledCondition,\n isDisabled,\n switchDataTestid,\n ...switchProps,\n }}\n name={switchName}\n />\n <Typography\n variant=\"h5\"\n {...otherTitleProps}\n as=\"span\"\n className={classnames(\"leading-snug\", titleClassName)}\n data-testid={\n isPresent(titleDataTestid)\n ? titleDataTestid\n : \"toggle-feature-card-title\"\n }\n >\n {title}\n </Typography>\n </Label>\n <Typography\n variant=\"body2\"\n {...otherDescriptionProps}\n className={classnames(\"mb-4 whitespace-pre-line\", descriptionClassName)}\n data-testid={\n isPresent(descriptionDataTestid)\n ? descriptionDataTestid\n : \"toggle-feature-card-description\"\n }\n >\n {description}\n </Typography>\n {hasInput && !isEditing && (\n <div className=\"m-0 flex flex-row items-center gap-x-2\">\n {inputProps?.display}\n <Button\n label={t(\"neetoMolecules.common.actions.edit\")}\n size=\"sm\"\n type=\"button\"\n variant=\"link\"\n data-testid={\n isPresent(inputProps?.editButtonDataTestid)\n ? inputProps?.editButtonDataTestid\n : \"toggle-feature-card-input-display-edit\"\n }\n onClick={() => setIsEditing(true)}\n {...editButtonProps}\n />\n </div>\n )}\n {hasInput && isEditing && (\n <Input\n autoFocus\n label={inputProps?.label}\n name={inputProps?.name}\n placeholder={inputProps?.placeholder}\n ref={inputRef}\n size=\"medium\"\n data-testid={\n isPresent(inputProps?.dataTestid)\n ? inputProps?.dataTestid\n : \"toggle-feature-card-input-field\"\n }\n suffix={\n <Button\n data-testid=\"toggle-feature-card-input-reset\"\n icon={X}\n size=\"sm\"\n type=\"button\"\n variant=\"ghost\"\n onClick={handleInputReset}\n />\n }\n {...inputProps}\n />\n )}\n {children}\n </div>\n );\n};\n\nToggleFeatureCard.propTypes = {\n /**\n * The title that will be displayed for the card.\n */\n title: PropTypes.string,\n /**\n * The descripton text for the particular feature or setting.\n */\n description: PropTypes.string,\n /**\n * The formik name of the feature or setting to be toggled. eg:\n {switchName: \"enableEmails\"}.\n */\n switchName: PropTypes.string,\n /**\n * Can be used to disable the toggle switch conditionally.\n */\n isDisabled: PropTypes.bool,\n /**\n * Can be used to enable the card appearance.\n */\n isCardStyleEnabled: PropTypes.bool,\n /**\n * Custom child components to be displayed in the card.\n */\n children: PropTypes.node,\n /**\n * Can be used to add an input field for a setting or a feature.\n For example, `Enable email notifications` card can have an email input field.\n */\n inputProps: PropTypes.shape({\n name: PropTypes.string,\n display: PropTypes.node,\n label: PropTypes.string,\n editButtonTooltip: PropTypes.string,\n editButtonDataTestid: PropTypes.string,\n placeholder: PropTypes.string,\n dataTestid: PropTypes.string,\n onChange: PropTypes.func,\n suffix: PropTypes.node,\n prefix: PropTypes.node,\n className: PropTypes.string,\n nakedInput: PropTypes.bool,\n size: PropTypes.oneOf(Object.values(SIZES)),\n type: PropTypes.string,\n maxLength: PropTypes.number,\n contentSize: PropTypes.number,\n unlimitedChars: PropTypes.bool,\n }),\n /**\n * Can be used to add props to the switch component.\n */\n switchProps: PropTypes.shape({\n onChange: PropTypes.func,\n className: PropTypes.string,\n checked: PropTypes.bool,\n tooltipProps: PropTypes.shape({\n enabledSwitchText: PropTypes.string,\n disabledSwitchText: PropTypes.string,\n }),\n }),\n /**\n * Can be used to add props to the edit button component.\n */\n editButtonProps: PropTypes.shape({\n onClick: PropTypes.func,\n className: PropTypes.string,\n style: PropTypes.string,\n size: PropTypes.string,\n type: PropTypes.string,\n tooltipProps: PropTypes.object,\n }),\n /**\n * Can be used to add props to the title Typography component. eg:\n {titleProps: {variant: \"h6\"}}.\n */\n titleProps: PropTypes.shape({\n variant: PropTypes.string,\n weight: PropTypes.string,\n color: PropTypes.string,\n className: PropTypes.string,\n }),\n /**\n * Can be used to add props to the description Typography component. eg:\n {descriptionProps: {color: \"muted\"}}.\n */\n descriptionProps: PropTypes.shape({\n variant: PropTypes.string,\n weight: PropTypes.string,\n color: PropTypes.string,\n className: PropTypes.string,\n }),\n /**\n * To specify external classnames as overrides to the ToggleFeatureCard wrapper.\n */\n className: PropTypes.string,\n};\n\nexport default ToggleFeatureCard;\n"],"names":["useScrollIntoView","_ref","elementId","trigger","useEffect","_document$getElementB","document","getElementById","scrollIntoView","TooltipSwitch","enabledCondition","_ref$name","name","_ref$isDisabled","isDisabled","switchDataTestid","_ref$tooltipProps","tooltipProps","otherProps","_objectWithoutProperties","_excluded","enabledSwitchText","disabledSwitchText","neetoAtomsTooltipProps","_excluded2","tooltipContent","_jsx","Tooltip","_objectSpread","content","disabled","position","children","FormikSwitch","isPresent","ToggleFeatureCard","_ref$isCardStyleEnabl","isCardStyleEnabled","_ref$title","title","_ref$description","description","_ref$switchName","switchName","_ref$titleDataTestid","titleDataTestid","_ref$switchDataTestid","_ref$descriptionDataT","descriptionDataTestid","_ref$children","inputProps","_ref$switchProps","switchProps","_ref$editButtonProps","editButtonProps","_ref$titleProps","titleProps","_ref$descriptionProps","descriptionProps","_ref$className","className","_useTranslation","useTranslation","t","cardRef","useRef","id","slugify","titleClassName","otherTitleProps","descriptionClassName","otherDescriptionProps","_useState","useState","_useState2","_slicedToArray","isEditing","setIsEditing","_useFormikContext","useFormikContext","setFieldValue","values","submitCount","errors","initialValues","isEmpty","_useState3","location","hash","split","_useState4","shouldHighlight","setShouldHighlight","hasInput","handleInputReset","useOnClickOutside","inputRef","useHotkeys","mode","_jsxs","ref","classnames","Label","Typography","variant","as","display","Button","label","size","type","editButtonDataTestid","onClick","Input","autoFocus","placeholder","dataTestid","suffix","icon","X"],"mappings":";;;;;;;;;;;;;;;;;;;AAEA,IAAMA,iBAAiB,GAAG,SAApBA,iBAAiBA,CAAAC,IAAA,EAA+B;AAAA,EAAA,IAAzBC,SAAS,GAAAD,IAAA,CAATC,SAAS;IAAEC,OAAO,GAAAF,IAAA,CAAPE,OAAO;AAC7CC,EAAAA,eAAS,CAAC,YAAM;AAAA,IAAA,IAAAC,qBAAA;IACd,IAAI,CAACF,OAAO,EAAE;AACd,IAAA,CAAAE,qBAAA,GAAAC,QAAQ,CAACC,cAAc,CAACL,SAAS,CAAC,MAAA,IAAA,IAAAG,qBAAA,KAAA,MAAA,IAAlCA,qBAAA,CAAoCG,cAAc,EAAE;AACtD,EAAA,CAAC,EAAE,CAACL,OAAO,CAAC,CAAC;AAC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AC,QAAQ;AACb,MAAA,aAAA,EACE3E,mBAAS,CAACgB,UAAU,aAAVA,UAAU,KAAA,MAAA,GAAA,MAAA,GAAVA,UAAU,CAAEkE,UAAU,CAAC,GAC7BlE,UAAU,aAAVA,UAAU,KAAA,MAAA,GAAA,MAAA,GAAVA,UAAU,CAAEkE,UAAU,GACtB,iCACL;MACDC,MAAM,eACJ3F,cAAA,CAACiF,iBAAM,EAAA;AACL,QAAA,aAAA,EAAY,iCAAiC;AAC7CW,QAAAA,IAAI,EAAEC,GAAE;AACRV,QAAAA,IAAI,EAAC,IAAI;AACTC,QAAAA,IAAI,EAAC,QAAQ;AACbN,QAAAA,OAAO,EAAC,OAAO;AACfQ,QAAAA,OAAO,EAAElB;OACV;AACF,KAAA,EACG5C,UAAU,CACf,CACF,EACAlB,QAAQ;AAAA,GACN,CAAC;AAEV;;;;"}
|
|
1
|
+
{"version":3,"file":"ToggleFeatureCard.js","sources":["../../../src/v2/components/ToggleFeatureCard/hooks/useScrollIntoView.js","../../../src/v2/components/ToggleFeatureCard/ToolTipSwitch.jsx","../../../src/v2/components/ToggleFeatureCard/index.jsx"],"sourcesContent":["import { useEffect } from \"react\";\n\nconst useScrollIntoView = ({ elementId, trigger }) => {\n useEffect(() => {\n if (!trigger) return;\n document.getElementById(elementId)?.scrollIntoView();\n }, [trigger]);\n};\n\nexport default useScrollIntoView;\n","import { Tooltip } from \"@bigbinary/neeto-atoms\";\nimport { Switch as FormikSwitch } from \"@bigbinary/neeto-atoms/formik\";\nimport { isPresent } from \"neetocist\";\n\nconst TooltipSwitch = ({\n enabledCondition,\n name = \"\",\n isDisabled = false,\n switchDataTestid,\n tooltipProps = {},\n ...otherProps\n}) => {\n const { enabledSwitchText, disabledSwitchText, ...neetoAtomsTooltipProps } =\n tooltipProps;\n\n const tooltipContent = enabledCondition\n ? enabledSwitchText\n : disabledSwitchText;\n\n return (\n <Tooltip\n content={tooltipContent}\n disabled={!tooltipContent}\n position=\"top\"\n {...neetoAtomsTooltipProps}\n >\n <span>\n <FormikSwitch\n disabled={isDisabled}\n data-testid={\n isPresent(switchDataTestid)\n ? switchDataTestid\n : \"toggle-feature-card-switch\"\n }\n {...{ name, ...otherProps }}\n />\n </span>\n </Tooltip>\n );\n};\n\nexport default TooltipSwitch;\n","import { useRef, useState, useEffect } from \"react\";\n\nimport { Button, Label, Typography } from \"@bigbinary/neeto-atoms\";\nimport { Input } from \"@bigbinary/neeto-atoms/formik\";\nimport classnames from \"classnames\";\nimport { useFormikContext } from \"formik\";\nimport { X } from \"lucide-react\";\nimport { isPresent, slugify } from \"neetocist\";\nimport useOnClickOutside from \"neetocommons/v2/react-utils/useOnClickOutside\";\nimport useHotkeys from \"neetohotkeys\";\nimport PropTypes from \"prop-types\";\nimport { isEmpty } from \"ramda\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { SIZES } from \"./constants\";\nimport useScrollIntoView from \"./hooks/useScrollIntoView\";\nimport TooltipSwitch from \"./ToolTipSwitch\";\n\nconst ToggleFeatureCard = ({\n isCardStyleEnabled = true,\n title = \"\",\n description = null,\n switchName = \"switch\",\n titleDataTestid = \"\",\n switchDataTestid = \"\",\n descriptionDataTestid = \"\",\n isDisabled = false,\n children = null,\n inputProps,\n switchProps = {},\n editButtonProps = {},\n titleProps = {},\n descriptionProps = {},\n className = \"\",\n}) => {\n const { t } = useTranslation();\n const cardRef = useRef();\n const id = slugify(title);\n const { className: titleClassName, ...otherTitleProps } = titleProps;\n const { className: descriptionClassName, ...otherDescriptionProps } =\n descriptionProps;\n\n const [isEditing, setIsEditing] = useState(false);\n\n const { setFieldValue, values, submitCount, errors, initialValues } =\n useFormikContext();\n\n useEffect(() => {\n if (!(submitCount >= 1 && isEmpty(errors))) return;\n setIsEditing(false);\n }, [submitCount]);\n\n useEffect(() => {\n if (isEmpty(errors)) return;\n setIsEditing(true);\n }, [values, errors]);\n\n const [shouldHighlight, setShouldHighlight] = useState(\n location.hash.split(\"#\")[1] === id\n );\n\n const hasInput = values?.[switchName] && inputProps?.name;\n const enabledCondition = values?.[switchName];\n\n const handleInputReset = () => {\n setIsEditing(false);\n hasInput &&\n setFieldValue(inputProps?.name, initialValues?.[inputProps?.name]);\n };\n\n useOnClickOutside(cardRef, () => setShouldHighlight(false));\n\n useScrollIntoView({ elementId: id, trigger: shouldHighlight });\n\n const inputRef = useHotkeys(\"enter\", () => setIsEditing(false), {\n mode: \"scoped\",\n });\n\n return (\n <div\n {...{ id }}\n data-testid=\"feature-card-container\"\n ref={cardRef}\n className={classnames(\n \"flex flex-col gap-y-2 rounded-lg\",\n { \"bg-card text-card-foreground border p-4\": isCardStyleEnabled },\n { \"border-border\": isCardStyleEnabled && !shouldHighlight },\n { \"border-primary ring-primary ring-1\": shouldHighlight },\n className\n )}\n >\n <Label className=\"flex flex-row items-center gap-2\">\n <TooltipSwitch\n {...{\n enabledCondition,\n isDisabled,\n switchDataTestid,\n ...switchProps,\n }}\n name={switchName}\n />\n <Typography\n variant=\"h6\"\n {...otherTitleProps}\n as=\"span\"\n className={classnames(\"leading-snug\", titleClassName)}\n data-testid={\n isPresent(titleDataTestid)\n ? titleDataTestid\n : \"toggle-feature-card-title\"\n }\n >\n {title}\n </Typography>\n </Label>\n <Typography\n variant=\"body2\"\n {...otherDescriptionProps}\n className={classnames(\"mb-4 whitespace-pre-line\", descriptionClassName)}\n data-testid={\n isPresent(descriptionDataTestid)\n ? descriptionDataTestid\n : \"toggle-feature-card-description\"\n }\n >\n {description}\n </Typography>\n {hasInput && !isEditing && (\n <div className=\"m-0 flex flex-row items-center gap-x-2\">\n {inputProps?.display}\n <Button\n label={t(\"neetoMolecules.common.actions.edit\")}\n size=\"sm\"\n type=\"button\"\n variant=\"link\"\n data-testid={\n isPresent(inputProps?.editButtonDataTestid)\n ? inputProps?.editButtonDataTestid\n : \"toggle-feature-card-input-display-edit\"\n }\n onClick={() => setIsEditing(true)}\n {...editButtonProps}\n />\n </div>\n )}\n {hasInput && isEditing && (\n <Input\n autoFocus\n label={inputProps?.label}\n name={inputProps?.name}\n placeholder={inputProps?.placeholder}\n ref={inputRef}\n size=\"medium\"\n data-testid={\n isPresent(inputProps?.dataTestid)\n ? inputProps?.dataTestid\n : \"toggle-feature-card-input-field\"\n }\n suffix={\n <Button\n data-testid=\"toggle-feature-card-input-reset\"\n icon={X}\n size=\"sm\"\n type=\"button\"\n variant=\"ghost\"\n onClick={handleInputReset}\n />\n }\n {...inputProps}\n />\n )}\n {children}\n </div>\n );\n};\n\nToggleFeatureCard.propTypes = {\n /**\n * The title that will be displayed for the card.\n */\n title: PropTypes.string,\n /**\n * The descripton text for the particular feature or setting.\n */\n description: PropTypes.string,\n /**\n * The formik name of the feature or setting to be toggled. eg:\n {switchName: \"enableEmails\"}.\n */\n switchName: PropTypes.string,\n /**\n * Can be used to disable the toggle switch conditionally.\n */\n isDisabled: PropTypes.bool,\n /**\n * Can be used to enable the card appearance.\n */\n isCardStyleEnabled: PropTypes.bool,\n /**\n * Custom child components to be displayed in the card.\n */\n children: PropTypes.node,\n /**\n * Can be used to add an input field for a setting or a feature.\n For example, `Enable email notifications` card can have an email input field.\n */\n inputProps: PropTypes.shape({\n name: PropTypes.string,\n display: PropTypes.node,\n label: PropTypes.string,\n editButtonTooltip: PropTypes.string,\n editButtonDataTestid: PropTypes.string,\n placeholder: PropTypes.string,\n dataTestid: PropTypes.string,\n onChange: PropTypes.func,\n suffix: PropTypes.node,\n prefix: PropTypes.node,\n className: PropTypes.string,\n nakedInput: PropTypes.bool,\n size: PropTypes.oneOf(Object.values(SIZES)),\n type: PropTypes.string,\n maxLength: PropTypes.number,\n contentSize: PropTypes.number,\n unlimitedChars: PropTypes.bool,\n }),\n /**\n * Can be used to add props to the switch component.\n */\n switchProps: PropTypes.shape({\n onChange: PropTypes.func,\n className: PropTypes.string,\n checked: PropTypes.bool,\n tooltipProps: PropTypes.shape({\n enabledSwitchText: PropTypes.string,\n disabledSwitchText: PropTypes.string,\n }),\n }),\n /**\n * Can be used to add props to the edit button component.\n */\n editButtonProps: PropTypes.shape({\n onClick: PropTypes.func,\n className: PropTypes.string,\n style: PropTypes.string,\n size: PropTypes.string,\n type: PropTypes.string,\n tooltipProps: PropTypes.object,\n }),\n /**\n * Can be used to add props to the title Typography component. The title\n * defaults to the \"h6\" variant. eg: {titleProps: {variant: \"h5\"}}.\n */\n titleProps: PropTypes.shape({\n variant: PropTypes.string,\n weight: PropTypes.string,\n color: PropTypes.string,\n className: PropTypes.string,\n }),\n /**\n * Can be used to add props to the description Typography component. eg:\n {descriptionProps: {color: \"muted\"}}.\n */\n descriptionProps: PropTypes.shape({\n variant: PropTypes.string,\n weight: PropTypes.string,\n color: PropTypes.string,\n className: PropTypes.string,\n }),\n /**\n * To specify external classnames as overrides to the ToggleFeatureCard wrapper.\n */\n className: PropTypes.string,\n};\n\nexport default ToggleFeatureCard;\n"],"names":["useScrollIntoView","_ref","elementId","trigger","useEffect","_document$getElementB","document","getElementById","scrollIntoView","TooltipSwitch","enabledCondition","_ref$name","name","_ref$isDisabled","isDisabled","switchDataTestid","_ref$tooltipProps","tooltipProps","otherProps","_objectWithoutProperties","_excluded","enabledSwitchText","disabledSwitchText","neetoAtomsTooltipProps","_excluded2","tooltipContent","_jsx","Tooltip","_objectSpread","content","disabled","position","children","FormikSwitch","isPresent","ToggleFeatureCard","_ref$isCardStyleEnabl","isCardStyleEnabled","_ref$title","title","_ref$description","description","_ref$switchName","switchName","_ref$titleDataTestid","titleDataTestid","_ref$switchDataTestid","_ref$descriptionDataT","descriptionDataTestid","_ref$children","inputProps","_ref$switchProps","switchProps","_ref$editButtonProps","editButtonProps","_ref$titleProps","titleProps","_ref$descriptionProps","descriptionProps","_ref$className","className","_useTranslation","useTranslation","t","cardRef","useRef","id","slugify","titleClassName","otherTitleProps","descriptionClassName","otherDescriptionProps","_useState","useState","_useState2","_slicedToArray","isEditing","setIsEditing","_useFormikContext","useFormikContext","setFieldValue","values","submitCount","errors","initialValues","isEmpty","_useState3","location","hash","split","_useState4","shouldHighlight","setShouldHighlight","hasInput","handleInputReset","useOnClickOutside","inputRef","useHotkeys","mode","_jsxs","ref","classnames","Label","Typography","variant","as","display","Button","label","size","type","editButtonDataTestid","onClick","Input","autoFocus","placeholder","dataTestid","suffix","icon","X"],"mappings":";;;;;;;;;;;;;;;;;;;AAEA,IAAMA,iBAAiB,GAAG,SAApBA,iBAAiBA,CAAAC,IAAA,EAA+B;AAAA,EAAA,IAAzBC,SAAS,GAAAD,IAAA,CAATC,SAAS;IAAEC,OAAO,GAAAF,IAAA,CAAPE,OAAO;AAC7CC,EAAAA,eAAS,CAAC,YAAM;AAAA,IAAA,IAAAC,qBAAA;IACd,IAAI,CAACF,OAAO,EAAE;AACd,IAAA,CAAAE,qBAAA,GAAAC,QAAQ,CAACC,cAAc,CAACL,SAAS,CAAC,MAAA,IAAA,IAAAG,qBAAA,KAAA,MAAA,IAAlCA,qBAAA,CAAoCG,cAAc,EAAE;AACtD,EAAA,CAAC,EAAE,CAACL,OAAO,CAAC,CAAC;AACf,CAAC;;;;;;ACHD,IAAMM,aAAa,GAAG,SAAhBA,aAAaA,CAAAR,IAAA,EAOb;AAAA,EAAA,IANJS,gBAAgB,GAAAT,IAAA,CAAhBS,gBAAgB;IAAAC,SAAA,GAAAV,IAAA,CAChBW,IAAI;AAAJA,IAAAA,IAAI,GAAAD,SAAA,KAAA,MAAA,GAAG,EAAE,GAAAA,SAAA;IAAAE,eAAA,GAAAZ,IAAA,CACTa,UAAU;AAAVA,IAAAA,UAAU,GAAAD,eAAA,KAAA,MAAA,GAAG,KAAK,GAAAA,eAAA;IAClBE,gBAAgB,GAAAd,IAAA,CAAhBc,gBAAgB;IAAAC,iBAAA,GAAAf,IAAA,CAChBgB,YAAY;AAAZA,IAAAA,YAAY,GAAAD,iBAAA,KAAA,MAAA,GAAG,EAAE,GAAAA,iBAAA;AACdE,IAAAA,UAAU,GAAAC,wBAAA,CAAAlB,IAAA,EAAAmB,WAAA,CAAA;AAEb,EAAA,IAAQC,iBAAiB,GACvBJ,Y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|
|
|
79
79
|
i18nKey: "neetoMolecules.optionFields.bulkOption.helpText",
|
|
80
80
|
components: {
|
|
81
81
|
Link: /*#__PURE__*/jsx(Button, {
|
|
82
|
-
className: "text-xs",
|
|
83
82
|
href: bulkAddHelpDocUrl,
|
|
84
83
|
rel: "noreferrer",
|
|
85
84
|
target: "_blank",
|
|
@@ -94,14 +93,14 @@ var BulkOptionModal = function BulkOptionModal(_ref) {
|
|
|
94
93
|
}), /*#__PURE__*/jsxs(Dialog.Footer, {
|
|
95
94
|
className: "flex items-center gap-x-2",
|
|
96
95
|
children: [/*#__PURE__*/jsx(Button, {
|
|
97
|
-
"data-testid": "bulk-add-options-done-button",
|
|
98
|
-
label: t("neetoMolecules.common.actions.submit"),
|
|
99
|
-
onClick: handleSave
|
|
100
|
-
}), /*#__PURE__*/jsx(Button, {
|
|
101
96
|
"data-testid": "bulk-add-options-cancel-button",
|
|
102
97
|
label: t("neetoMolecules.common.actions.cancel"),
|
|
103
98
|
variant: "ghost",
|
|
104
99
|
onClick: handleClose
|
|
100
|
+
}), /*#__PURE__*/jsx(Button, {
|
|
101
|
+
"data-testid": "bulk-add-options-done-button",
|
|
102
|
+
label: t("neetoMolecules.common.actions.submit"),
|
|
103
|
+
onClick: handleSave
|
|
105
104
|
})]
|
|
106
105
|
})]
|
|
107
106
|
});
|