@activecollab/components 2.0.404 → 2.0.406

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.
@@ -7,9 +7,15 @@ exports.EditableContent = void 0;
7
7
  var _react = _interopRequireWildcard(require("react"));
8
8
  var _Styles = require("./Styles");
9
9
  var _utils = require("../../utils");
10
- var _excluded = ["className", "variant", "weight", "disabled", "inputProps", "wrapRef", "children", "invalid"];
10
+ var _excluded = ["className", "variant", "weight", "disabled", "inputProps", "wrapRef", "children", "invalid", "onMouseLeave"];
11
11
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
12
12
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
13
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
14
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
15
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
16
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
17
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
18
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
13
19
  function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
14
20
  function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
15
21
  var EditableContent = exports.EditableContent = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
@@ -23,19 +29,40 @@ var EditableContent = exports.EditableContent = /*#__PURE__*/(0, _react.forwardR
23
29
  wrapRef = _ref.wrapRef,
24
30
  children = _ref.children,
25
31
  invalid = _ref.invalid,
32
+ onMouseLeave = _ref.onMouseLeave,
26
33
  props = _objectWithoutProperties(_ref, _excluded);
27
34
  var intInputRef = (0, _react.useRef)(null);
28
35
  var handleRef = (0, _utils.useForkRef)(ref, intInputRef);
36
+ var _useState = (0, _react.useState)(false),
37
+ _useState2 = _slicedToArray(_useState, 2),
38
+ suppressHover = _useState2[0],
39
+ setSuppressHover = _useState2[1];
29
40
  var handleBlur = (0, _react.useCallback)(function (evt) {
30
41
  if (intInputRef !== null && intInputRef !== void 0 && intInputRef.current) {
31
42
  intInputRef.current.scrollLeft = 0;
32
43
  }
33
44
  typeof (inputProps === null || inputProps === void 0 ? void 0 : inputProps.onBlur) === "function" && (inputProps === null || inputProps === void 0 ? void 0 : inputProps.onBlur(evt));
34
45
  }, [inputProps]);
46
+ var handleKeyDown = (0, _react.useCallback)(function (evt) {
47
+ if (evt.key === "Enter" || evt.key === "Escape") {
48
+ setSuppressHover(true);
49
+ }
50
+ typeof (inputProps === null || inputProps === void 0 ? void 0 : inputProps.onKeyDown) === "function" && inputProps.onKeyDown(evt);
51
+ }, [inputProps]);
52
+ var handleFocus = (0, _react.useCallback)(function (evt) {
53
+ setSuppressHover(false);
54
+ typeof (inputProps === null || inputProps === void 0 ? void 0 : inputProps.onFocus) === "function" && inputProps.onFocus(evt);
55
+ }, [inputProps]);
56
+ var handleMouseLeave = (0, _react.useCallback)(function (evt) {
57
+ setSuppressHover(false);
58
+ typeof onMouseLeave === "function" && onMouseLeave(evt);
59
+ }, [onMouseLeave]);
35
60
  return /*#__PURE__*/_react.default.createElement(_Styles.StyledDiv, _extends({
36
61
  className: className,
37
62
  ref: wrapRef
38
- }, props), /*#__PURE__*/_react.default.createElement(_Styles.StyledSpan, {
63
+ }, props, {
64
+ onMouseLeave: handleMouseLeave
65
+ }), /*#__PURE__*/_react.default.createElement(_Styles.StyledSpan, {
39
66
  variant: variant,
40
67
  forwardedAs: "span",
41
68
  weight: weight,
@@ -48,8 +75,11 @@ var EditableContent = exports.EditableContent = /*#__PURE__*/(0, _react.forwardR
48
75
  weight: weight,
49
76
  value: inputProps === null || inputProps === void 0 ? void 0 : inputProps.value,
50
77
  onBlur: handleBlur,
78
+ onKeyDown: handleKeyDown,
79
+ onFocus: handleFocus,
51
80
  disabled: disabled,
52
81
  "data-form-type": "other",
82
+ "data-hover-suppressed": suppressHover ? "" : undefined,
53
83
  invalid: invalid
54
84
  })));
55
85
  });
@@ -1 +1 @@
1
- {"version":3,"file":"EditableContent.js","names":["_react","_interopRequireWildcard","require","_Styles","_utils","_excluded","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","_extends","assign","bind","arguments","length","apply","_objectWithoutProperties","_objectWithoutPropertiesLoose","getOwnPropertySymbols","indexOf","propertyIsEnumerable","EditableContent","exports","forwardRef","_ref","ref","className","_ref$variant","variant","weight","_ref$disabled","disabled","inputProps","wrapRef","children","invalid","props","intInputRef","useRef","handleRef","useForkRef","handleBlur","useCallback","evt","current","scrollLeft","onBlur","createElement","StyledDiv","StyledSpan","forwardedAs","$disabled","value","StyledInput","displayName"],"sources":["../../../../src/components/EditableContent/EditableContent.tsx"],"sourcesContent":["import React, { forwardRef, Ref, useCallback, useRef } from \"react\";\n\nimport { StyledDiv, StyledInput, StyledSpan } from \"./Styles\";\nimport { useForkRef } from \"../../utils\";\nimport { Variant } from \"../Typography/Typography\";\n\nexport interface EditableContentInterface {\n /** Typography variant. */\n variant?: Variant;\n /** Typography weight. */\n weight?: \"light\" | \"regular\" | \"bold\" | \"medium\";\n /** Input props. */\n inputProps?: Partial<React.ComponentPropsWithoutRef<\"input\">>;\n /** Disable edit mode. */\n disabled?: boolean;\n invalid?: boolean;\n /** Wrapper reference. */\n wrapRef?: Ref<HTMLDivElement>;\n}\n\nexport const EditableContent = forwardRef<\n HTMLDivElement,\n EditableContentInterface &\n Omit<React.ComponentPropsWithoutRef<\"div\">, keyof EditableContentInterface>\n>(\n (\n {\n className,\n variant = \"Body 2\",\n weight,\n disabled = false,\n inputProps,\n wrapRef,\n children,\n invalid,\n ...props\n },\n ref\n ) => {\n const intInputRef = useRef<HTMLInputElement>(null);\n const handleRef = useForkRef(ref, intInputRef);\n\n const handleBlur = useCallback(\n (evt) => {\n if (intInputRef?.current) {\n intInputRef.current.scrollLeft = 0;\n }\n typeof inputProps?.onBlur === `function` && inputProps?.onBlur(evt);\n },\n [inputProps]\n );\n\n return (\n <StyledDiv className={className} ref={wrapRef} {...props}>\n <StyledSpan\n variant={variant}\n forwardedAs=\"span\"\n weight={weight}\n $disabled={disabled}\n className=\"presentation\"\n >\n {children ? children : inputProps?.value}\n </StyledSpan>\n <StyledInput\n {...inputProps}\n ref={handleRef}\n forwardedAs=\"input\"\n variant={variant}\n weight={weight}\n value={inputProps?.value}\n onBlur={handleBlur}\n disabled={disabled}\n data-form-type=\"other\"\n invalid={invalid}\n />\n </StyledDiv>\n );\n }\n);\n\nEditableContent.displayName = \"EditableContent\";\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAAyC,IAAAG,SAAA;AAAA,SAAAJ,wBAAAK,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAP,uBAAA,YAAAA,wBAAAK,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,cAAAM,EAAA,IAAAd,CAAA,gBAAAc,EAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,EAAA,OAAAP,CA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AU,uBAAVA,UAAU,CAAEc,MAAM,CAACH,GAAG,CAAC;EACrE,CAAC,EACD,CAACX,UAAU,CACb,CAAC;EAED,oBACEhD,MAAA,CAAAgB,OAAA,CAAA+C,aAAA,CAAC5D,OAAA,CAAA6D,SAAS,EAAAtC,QAAA;IAACgB,SAAS,EAAEA,SAAU;IAACD,GAAG,EAAEQ;EAAQ,GAAKG,KAAK,gBACtDpD,MAAA,CAAAgB,OAAA,CAAA+C,aAAA,CAAC5D,OAAA,CAAA8D,UAAU;IACTrB,OAAO,EAAEA,OAAQ;IACjBsB,WAAW,EAAC,MAAM;IAClBrB,MAAM,EAAEA,MAAO;IACfsB,SAAS,EAAEpB,QAAS;IACpBL,SAAS,EAAC;EAAc,GAEvBQ,QAAQ,GAAGA,QAAQ,GAAGF,UAAU,aAAVA,UAAU,uBAAVA,UAAU,CAAEoB,KACzB,CAAC,eACbpE,MAAA,CAAAgB,OAAA,CAAA+C,aAAA,CAAC5D,OAAA,CAAAkE,WAAW,EAAA3C,QAAA,KACNsB,UAAU;IACdP,GAAG,EAAEc,SAAU;IACfW,WAAW,EAAC,OAAO;IACnBtB,OAAO,EAAEA,OAAQ;IACjBC,MAAM,EAAEA,MAAO;IACfuB,KAAK,EAAEpB,UAAU,aAAVA,UAAU,uBAAVA,UAAU,CAAEoB,KAAM;IACzBN,MAAM,EAAEL,UAAW;IACnBV,QAAQ,EAAEA,QAAS;IACnB,kBAAe,OAAO;IACtBI,OAAO,EAAEA;EAAQ,EAClB,CACQ,CAAC;AAEhB,CACF,CAAC;AAEDd,eAAe,CAACiC,WAAW,GAAG,iBAAiB","ignoreList":[]}
1
+ {"version":3,"file":"EditableContent.js","names":["_react","_interopRequireWildcard","require","_Styles","_utils","_excluded","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","_extends","assign","bind","arguments","length","apply","_slicedToArray","_arrayWithHoles","_iterableToArrayLimit","_unsupportedIterableToArray","_nonIterableRest","TypeError","a","_arrayLikeToArray","toString","slice","constructor","name","Array","from","test","l","Symbol","iterator","u","next","done","push","value","return","isArray","_objectWithoutProperties","_objectWithoutPropertiesLoose","getOwnPropertySymbols","indexOf","propertyIsEnumerable","EditableContent","exports","forwardRef","_ref","ref","className","_ref$variant","variant","weight","_ref$disabled","disabled","inputProps","wrapRef","children","invalid","onMouseLeave","props","intInputRef","useRef","handleRef","useForkRef","_useState","useState","_useState2","suppressHover","setSuppressHover","handleBlur","useCallback","evt","current","scrollLeft","onBlur","handleKeyDown","key","onKeyDown","handleFocus","onFocus","handleMouseLeave","createElement","StyledDiv","StyledSpan","forwardedAs","$disabled","StyledInput","undefined","displayName"],"sources":["../../../../src/components/EditableContent/EditableContent.tsx"],"sourcesContent":["import React, { forwardRef, Ref, useCallback, useRef, useState } from \"react\";\n\nimport { StyledDiv, StyledInput, StyledSpan } from \"./Styles\";\nimport { useForkRef } from \"../../utils\";\nimport { Variant } from \"../Typography/Typography\";\n\nexport interface EditableContentInterface {\n /** Typography variant. */\n variant?: Variant;\n /** Typography weight. */\n weight?: \"light\" | \"regular\" | \"bold\" | \"medium\";\n /** Input props. */\n inputProps?: Partial<React.ComponentPropsWithoutRef<\"input\">>;\n /** Disable edit mode. */\n disabled?: boolean;\n invalid?: boolean;\n /** Wrapper reference. */\n wrapRef?: Ref<HTMLDivElement>;\n}\n\nexport const EditableContent = forwardRef<\n HTMLDivElement,\n EditableContentInterface &\n Omit<React.ComponentPropsWithoutRef<\"div\">, keyof EditableContentInterface>\n>(\n (\n {\n className,\n variant = \"Body 2\",\n weight,\n disabled = false,\n inputProps,\n wrapRef,\n children,\n invalid,\n onMouseLeave,\n ...props\n },\n ref\n ) => {\n const intInputRef = useRef<HTMLInputElement>(null);\n const handleRef = useForkRef(ref, intInputRef);\n const [suppressHover, setSuppressHover] = useState(false);\n\n const handleBlur = useCallback(\n (evt) => {\n if (intInputRef?.current) {\n intInputRef.current.scrollLeft = 0;\n }\n typeof inputProps?.onBlur === `function` && inputProps?.onBlur(evt);\n },\n [inputProps]\n );\n\n const handleKeyDown = useCallback(\n (evt) => {\n if (evt.key === \"Enter\" || evt.key === \"Escape\") {\n setSuppressHover(true);\n }\n typeof inputProps?.onKeyDown === \"function\" &&\n inputProps.onKeyDown(evt);\n },\n [inputProps]\n );\n\n const handleFocus = useCallback(\n (evt) => {\n setSuppressHover(false);\n typeof inputProps?.onFocus === \"function\" && inputProps.onFocus(evt);\n },\n [inputProps]\n );\n\n const handleMouseLeave = useCallback(\n (evt) => {\n setSuppressHover(false);\n typeof onMouseLeave === \"function\" && onMouseLeave(evt);\n },\n [onMouseLeave]\n );\n\n return (\n <StyledDiv\n className={className}\n ref={wrapRef}\n {...props}\n onMouseLeave={handleMouseLeave}\n >\n <StyledSpan\n variant={variant}\n forwardedAs=\"span\"\n weight={weight}\n $disabled={disabled}\n className=\"presentation\"\n >\n {children ? children : inputProps?.value}\n </StyledSpan>\n <StyledInput\n {...inputProps}\n ref={handleRef}\n forwardedAs=\"input\"\n variant={variant}\n weight={weight}\n value={inputProps?.value}\n onBlur={handleBlur}\n onKeyDown={handleKeyDown}\n onFocus={handleFocus}\n disabled={disabled}\n data-form-type=\"other\"\n data-hover-suppressed={suppressHover ? \"\" : undefined}\n invalid={invalid}\n />\n </StyledDiv>\n );\n }\n);\n\nEditableContent.displayName = \"EditableContent\";\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAAyC,IAAAG,SAAA;AAAA,SAAAJ,wBAAAK,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAP,uBAAA,YAAAA,wBAAAK,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAA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BkC,WAAW,EAAC,MAAM;IAClBjC,MAAM,EAAEA,MAAO;IACfkC,SAAS,EAAEhC,QAAS;IACpBL,SAAS,EAAC;EAAc,GAEvBQ,QAAQ,GAAGA,QAAQ,GAAGF,UAAU,aAAVA,UAAU,uBAAVA,UAAU,CAAEnB,KACzB,CAAC,eACbtD,MAAA,CAAAgB,OAAA,CAAAoF,aAAA,CAACjG,OAAA,CAAAsG,WAAW,EAAA/E,QAAA,KACN+C,UAAU;IACdP,GAAG,EAAEe,SAAU;IACfsB,WAAW,EAAC,OAAO;IACnBlC,OAAO,EAAEA,OAAQ;IACjBC,MAAM,EAAEA,MAAO;IACfhB,KAAK,EAAEmB,UAAU,aAAVA,UAAU,uBAAVA,UAAU,CAAEnB,KAAM;IACzBuC,MAAM,EAAEL,UAAW;IACnBQ,SAAS,EAAEF,aAAc;IACzBI,OAAO,EAAED,WAAY;IACrBzB,QAAQ,EAAEA,QAAS;IACnB,kBAAe,OAAO;IACtB,yBAAuBc,aAAa,GAAG,EAAE,GAAGoB,SAAU;IACtD9B,OAAO,EAAEA;EAAQ,EAClB,CACQ,CAAC;AAEhB,CACF,CAAC;AAEDd,eAAe,CAAC6C,WAAW,GAAG,iBAAiB","ignoreList":[]}
@@ -34,7 +34,7 @@ StyledSpan.displayName = "StyledSpan";
34
34
  var StyledInput = exports.StyledInput = (0, _styledComponents.default)(_Typography.Typography).withConfig({
35
35
  displayName: "Styles__StyledInput",
36
36
  componentId: "sc-1wapx2a-2"
37
- })(["", " background-color:inherit;padding-left:4px;padding-right:4px;padding-top:1px;padding-bottom:1px;text-overflow:ellipsis;font-variant-numeric:tabular-nums;&:focus-whitin{text-overflow:clip;}outline-width:0px;outline:none;&:disabled{opacity:0;}", ""], {
37
+ })(["", " background-color:inherit;padding-left:4px;padding-right:4px;padding-top:1px;padding-bottom:1px;text-overflow:ellipsis;font-variant-numeric:tabular-nums;&:focus-whitin{text-overflow:clip;}outline-width:0px;outline:none;&:disabled{opacity:0;}&:not([data-hover-suppressed]):hover{border-color:var(--color-theme-700);}", ""], {
38
38
  "position": "absolute",
39
39
  "inset": "0px",
40
40
  "boxSizing": "border-box",
@@ -48,9 +48,6 @@ var StyledInput = exports.StyledInput = (0, _styledComponents.default)(_Typograp
48
48
  ":focus-within": {
49
49
  "overflow": "scroll",
50
50
  "borderColor": "var(--color-theme-700)"
51
- },
52
- ":hover": {
53
- "borderColor": "var(--color-theme-700)"
54
51
  }
55
52
  }, function (_ref4) {
56
53
  var invalid = _ref4.invalid;
@@ -1 +1 @@
1
- {"version":3,"file":"Styles.js","names":["_styledComponents","_interopRequireWildcard","require","_BoxSizingStyle","_FontStyle","_Typography","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","StyledDiv","exports","styled","div","withConfig","displayName","componentId","FontStyle","BoxSizingStyle","_ref","$multiline","css","StyledSpan","Typography","_ref2","$disabled","_ref3","invalid","StyledInput","_ref4","StyledMultilineSpan","_ref5","_ref6","StyledTextareaSpan","_ref7"],"sources":["../../../../src/components/EditableContent/Styles.ts"],"sourcesContent":["import styled, { css } from \"styled-components\";\nimport tw from \"twin.macro\";\n\nimport { BoxSizingStyle } from \"../BoxSizingStyle\";\nimport { FontStyle } from \"../FontStyle\";\nimport { Typography } from \"../Typography/Typography\";\n\nexport const StyledDiv = styled.div<{ $multiline?: boolean }>`\n ${FontStyle}\n ${BoxSizingStyle}\n\n\n\n ${tw`tw-relative tw-inline-block tw-max-w-full`}\n ${({ $multiline }) =>\n $multiline &&\n css`\n position: relative;\n display: flex;\n `}\n`;\n\nexport const StyledSpan = styled(Typography)<{ $disabled?: boolean }>`\n visibility: hidden;\n display: block;\n padding-left: 4px;\n padding-right: 4px;\n padding-top: 1px;\n padding-bottom: 1px;\n position: relative;\n border: 1px solid transparent;\n border-radius: 6px;\n max-width: 100%;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: pre;\n font-variant-numeric: tabular-nums;\n\n ${({ $disabled }) =>\n $disabled &&\n css`\n visibility: visible;\n cursor: default !important;\n `}\n\n ${({ invalid }) =>\n invalid &&\n css`\n border: 1px solid var(--red-alert);\n `}\n\n &:empty:before {\n content: \" \";\n }\n`;\n\nStyledSpan.displayName = \"StyledSpan\";\n\nexport const StyledInput = styled(Typography)`\n ${tw`\n tw-absolute\n tw-inset-0\n tw-border\n tw-border-transparent\n tw-border-solid\n hover:tw-border-theme-700\n focus-within:tw-border-theme-700\n tw-rounded-md\n tw-box-border\n tw-overflow-hidden\n tw-whitespace-nowrap\n focus-within:tw-overflow-scroll\n tw-w-full`}\n\n background-color: inherit;\n padding-left: 4px;\n padding-right: 4px;\n padding-top: 1px;\n padding-bottom: 1px;\n text-overflow: ellipsis;\n font-variant-numeric: tabular-nums;\n &:focus-whitin {\n text-overflow: clip;\n }\n outline-width: 0px;\n outline: none;\n &:disabled {\n opacity: 0;\n }\n\n ${({ invalid }) =>\n invalid &&\n css`\n border-color: var(--red-alert) !important;\n `}\n`;\n\nStyledInput.displayName = \"StyledInput\";\n\nexport const StyledMultilineSpan = styled(StyledSpan)`\n cursor: ${({ $disabled }) => ($disabled ? \"default\" : \"text !important\")};\n z-index: 2;\n width: 100%;\n visibility: visible !important;\n\n &:hover {\n border-color: ${({ invalid, $disabled }) =>\n invalid\n ? \"var(--red-alert)\"\n : $disabled\n ? \"transparent\"\n : \"var(--border-primary)\"};\n }\n`;\n\nStyledMultilineSpan.displayName = \"StyledMultilineSpan\";\n\nexport const StyledTextareaSpan = styled(Typography)`\n ${tw`\n tw-absolute\n tw-inset-0\n tw-border\n tw-border-solid\n tw-rounded-md\n tw-box-border\n tw-w-full`}\n\n background-color: var(--input-background-color);\n border-color: var(--color-theme-500);\n padding-left: 4px;\n padding-right: 4px;\n padding-top: 1px;\n padding-bottom: 1px;\n font-variant-numeric: tabular-nums;\n outline-width: 0px;\n outline: none;\n resize: none;\n white-space: pre-wrap;\n overflow-wrap: break-word;\n height: calc(1.5em * 3 + 2px); /* 3 rows height: line-height * 3 + padding */\n min-height: calc(1.5em * 3 + 2px);\n opacity: 0;\n pointer-events: none;\n z-index: 1;\n\n &:focus {\n opacity: 1;\n pointer-events: auto;\n background-color: var(--input-background-color);\n border-color: var(--color-primary);\n outline: none;\n z-index: 3;\n }\n\n &:disabled {\n opacity: 0;\n pointer-events: none;\n }\n\n ${({ invalid }) =>\n invalid &&\n css`\n border-color: var(--red-alert) !important;\n `}\n`;\n\nStyledTextareaSpan.displayName = \"StyledTextareaSpan\";\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,uBAAA,CAAAC,OAAA;AAGA,IAAAC,eAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AAAsD,SAAAD,wBAAAK,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAP,uBAAA,YAAAA,wBAAAK,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,cAAAM,EAAA,IAAAd,CAAA,gBAAAc,EAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,EAAA,OAAAP,CAAA,IAAAD,CAAA,GAAAW,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAnB,CAAA,EAAAc,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EAAA,OACVA,OAAO,QACPN,qBAAG,gDAEF;AAAA,EACJ;AAEDO,WAAW,CAACb,WAAW,GAAG,aAAa;AAEhC,IAAMe,mBAAmB,GAAAnB,OAAA,CAAAmB,mBAAA,GAAG,IAAAlB,yBAAM,EAACU,UAAU,CAAC,CAAAR,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,mGACzC,UAAAe,KAAA;EAAA,IAAGN,SAAS,GAAAM,KAAA,CAATN,SAAS;EAAA,OAAQA,SAAS,GAAG,SAAS,GAAG,iBAAiB;AAAA,CAAC,EAMtD,UAAAO,KAAA;EAAA,IAAGL,OAAO,GAAAK,KAAA,CAAPL,OAAO;IAAEF,SAAS,GAAAO,KAAA,CAATP,SAAS;EAAA,OACnCE,OAAO,GACH,kBAAkB,GAClBF,SAAS,GACT,aAAa,GACb,uBAAuB;AAAA,EAEhC;AAEDK,mBAAmB,CAACf,WAAW,GAAG,qBAAqB;AAEhD,IAAMkB,kBAAkB,GAAAtB,OAAA,CAAAsB,kBAAA,GAAG,IAAArB,yBAAM,EAACW,sBAAU,CAAC,CAAAT,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,qkBAC9C;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;AAOO,CAAC,EAkCV,UAAAkB,KAAA;EAAA,IAAGP,OAAO,GAAAO,KAAA,CAAPP,OAAO;EAAA,OACVA,OAAO,QACPN,qBAAG,gDAEF;AAAA,EACJ;AAEDY,kBAAkB,CAAClB,WAAW,GAAG,oBAAoB","ignoreList":[]}
1
+ {"version":3,"file":"Styles.js","names":["_styledComponents","_interopRequireWildcard","require","_BoxSizingStyle","_FontStyle","_Typography","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","StyledDiv","exports","styled","div","withConfig","displayName","componentId","FontStyle","BoxSizingStyle","_ref","$multiline","css","StyledSpan","Typography","_ref2","$disabled","_ref3","invalid","StyledInput","_ref4","StyledMultilineSpan","_ref5","_ref6","StyledTextareaSpan","_ref7"],"sources":["../../../../src/components/EditableContent/Styles.ts"],"sourcesContent":["import styled, { css } from \"styled-components\";\nimport tw from \"twin.macro\";\n\nimport { BoxSizingStyle } from \"../BoxSizingStyle\";\nimport { FontStyle } from \"../FontStyle\";\nimport { Typography } from \"../Typography/Typography\";\n\nexport const StyledDiv = styled.div<{ $multiline?: boolean }>`\n ${FontStyle}\n ${BoxSizingStyle}\n\n\n\n ${tw`tw-relative tw-inline-block tw-max-w-full`}\n ${({ $multiline }) =>\n $multiline &&\n css`\n position: relative;\n display: flex;\n `}\n`;\n\nexport const StyledSpan = styled(Typography)<{ $disabled?: boolean }>`\n visibility: hidden;\n display: block;\n padding-left: 4px;\n padding-right: 4px;\n padding-top: 1px;\n padding-bottom: 1px;\n position: relative;\n border: 1px solid transparent;\n border-radius: 6px;\n max-width: 100%;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: pre;\n font-variant-numeric: tabular-nums;\n\n ${({ $disabled }) =>\n $disabled &&\n css`\n visibility: visible;\n cursor: default !important;\n `}\n\n ${({ invalid }) =>\n invalid &&\n css`\n border: 1px solid var(--red-alert);\n `}\n\n &:empty:before {\n content: \" \";\n }\n`;\n\nStyledSpan.displayName = \"StyledSpan\";\n\nexport const StyledInput = styled(Typography)`\n ${tw`\n tw-absolute\n tw-inset-0\n tw-border\n tw-border-transparent\n tw-border-solid\n focus-within:tw-border-theme-700\n tw-rounded-md\n tw-box-border\n tw-overflow-hidden\n tw-whitespace-nowrap\n focus-within:tw-overflow-scroll\n tw-w-full`}\n\n background-color: inherit;\n padding-left: 4px;\n padding-right: 4px;\n padding-top: 1px;\n padding-bottom: 1px;\n text-overflow: ellipsis;\n font-variant-numeric: tabular-nums;\n &:focus-whitin {\n text-overflow: clip;\n }\n outline-width: 0px;\n outline: none;\n &:disabled {\n opacity: 0;\n }\n\n &:not([data-hover-suppressed]):hover {\n border-color: var(--color-theme-700);\n }\n\n ${({ invalid }) =>\n invalid &&\n css`\n border-color: var(--red-alert) !important;\n `}\n`;\n\nStyledInput.displayName = \"StyledInput\";\n\nexport const StyledMultilineSpan = styled(StyledSpan)`\n cursor: ${({ $disabled }) => ($disabled ? \"default\" : \"text !important\")};\n z-index: 2;\n width: 100%;\n visibility: visible !important;\n\n &:hover {\n border-color: ${({ invalid, $disabled }) =>\n invalid\n ? \"var(--red-alert)\"\n : $disabled\n ? \"transparent\"\n : \"var(--border-primary)\"};\n }\n`;\n\nStyledMultilineSpan.displayName = \"StyledMultilineSpan\";\n\nexport const StyledTextareaSpan = styled(Typography)`\n ${tw`\n tw-absolute\n tw-inset-0\n tw-border\n tw-border-solid\n tw-rounded-md\n tw-box-border\n tw-w-full`}\n\n background-color: var(--input-background-color);\n border-color: var(--color-theme-500);\n padding-left: 4px;\n padding-right: 4px;\n padding-top: 1px;\n padding-bottom: 1px;\n font-variant-numeric: tabular-nums;\n outline-width: 0px;\n outline: none;\n resize: none;\n white-space: pre-wrap;\n overflow-wrap: break-word;\n height: calc(1.5em * 3 + 2px); /* 3 rows height: line-height * 3 + padding */\n min-height: calc(1.5em * 3 + 2px);\n opacity: 0;\n pointer-events: none;\n z-index: 1;\n\n &:focus {\n opacity: 1;\n pointer-events: auto;\n background-color: var(--input-background-color);\n border-color: var(--color-primary);\n outline: none;\n z-index: 3;\n }\n\n &:disabled {\n opacity: 0;\n pointer-events: none;\n }\n\n ${({ invalid }) =>\n invalid &&\n css`\n border-color: var(--red-alert) !important;\n `}\n`;\n\nStyledTextareaSpan.displayName = \"StyledTextareaSpan\";\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,uBAAA,CAAAC,OAAA;AAGA,IAAAC,eAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AAAsD,SAAAD,wBAAAK,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,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,kBAAkB,GAAAtB,OAAA,CAAAsB,kBAAA,GAAG,IAAArB,yBAAM,EAACW,sBAAU,CAAC,CAAAT,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,qkBAC9C;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;AAOO,CAAC,EAkCV,UAAAkB,KAAA;EAAA,IAAGP,OAAO,GAAAO,KAAA,CAAPP,OAAO;EAAA,OACVA,OAAO,QACPN,qBAAG,gDAEF;AAAA,EACJ;AAEDY,kBAAkB,CAAClB,WAAW,GAAG,oBAAoB","ignoreList":[]}
@@ -9,5 +9,5 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
9
9
  var StyledToolbar = exports.StyledToolbar = _styledComponents.default.div.withConfig({
10
10
  displayName: "Toolbarstyles__StyledToolbar",
11
11
  componentId: "sc-n5xxbc-0"
12
- })(["box-sizing:border-box;background-color:var(--page-paper-main);border-radius:8px;border:1px solid var(--color-theme-300);box-shadow:0px 64px 64px rgba(0,0,0,0.06),0px 32px 32px rgba(0,0,0,0.03),0px 16px 16px rgba(0,0,0,0.02),0px 4px 4px rgba(0,0,0,0.02),0px 2px 2px rgba(0,0,0,0.02);bottom:24px;display:flex;left:50%;padding:12px 16px;position:fixed;transform:translateX(-50%);width:100%;max-width:800px;"]);
12
+ })(["box-sizing:border-box;background-color:var(--page-paper-main);background-image:linear-gradient( var(--color-primary-300),var(--color-primary-300) );border-radius:8px;border:1px solid var(--color-primary);box-shadow:0px 64px 64px rgba(0,0,0,0.06),0px 32px 32px rgba(0,0,0,0.03),0px 16px 16px rgba(0,0,0,0.02),0px 4px 4px rgba(0,0,0,0.02),0px 2px 2px rgba(0,0,0,0.02);bottom:24px;display:flex;left:calc(50% + var(--toolbar-inline-offset,0px));padding:12px 16px;position:fixed;transform:translateX(-50%);width:100%;max-width:800px;"]);
13
13
  //# sourceMappingURL=Toolbar.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Toolbar.styles.js","names":["_styledComponents","_interopRequireDefault","require","e","__esModule","default","StyledToolbar","exports","styled","div","withConfig","displayName","componentId"],"sources":["../../../../src/components/Toolbar/Toolbar.styles.ts"],"sourcesContent":["import styled from \"styled-components\";\n\nimport type { ToolbarProps } from \"./Toolbar\";\n\nexport const StyledToolbar = styled.div<Partial<ToolbarProps>>`\n box-sizing: border-box;\n background-color: var(--page-paper-main);\n border-radius: 8px;\n border: 1px solid var(--color-theme-300);\n box-shadow: 0px 64px 64px rgba(0, 0, 0, 0.06),\n 0px 32px 32px rgba(0, 0, 0, 0.03), 0px 16px 16px rgba(0, 0, 0, 0.02),\n 0px 4px 4px rgba(0, 0, 0, 0.02), 0px 2px 2px rgba(0, 0, 0, 0.02);\n bottom: 24px;\n display: flex;\n left: 50%;\n padding: 12px 16px;\n position: fixed;\n transform: translateX(-50%);\n width: 100%;\n max-width: 800px;\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAuC,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAIhC,IAAMG,aAAa,GAAAC,OAAA,CAAAD,aAAA,GAAGE,yBAAM,CAACC,GAAG,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,2ZAgBtC","ignoreList":[]}
1
+ {"version":3,"file":"Toolbar.styles.js","names":["_styledComponents","_interopRequireDefault","require","e","__esModule","default","StyledToolbar","exports","styled","div","withConfig","displayName","componentId"],"sources":["../../../../src/components/Toolbar/Toolbar.styles.ts"],"sourcesContent":["import styled from \"styled-components\";\n\nimport type { ToolbarProps } from \"./Toolbar\";\n\nexport const StyledToolbar = styled.div<Partial<ToolbarProps>>`\n box-sizing: border-box;\n background-color: var(--page-paper-main);\n background-image: linear-gradient(\n var(--color-primary-300),\n var(--color-primary-300)\n );\n border-radius: 8px;\n border: 1px solid var(--color-primary);\n box-shadow: 0px 64px 64px rgba(0, 0, 0, 0.06),\n 0px 32px 32px rgba(0, 0, 0, 0.03), 0px 16px 16px rgba(0, 0, 0, 0.02),\n 0px 4px 4px rgba(0, 0, 0, 0.02), 0px 2px 2px rgba(0, 0, 0, 0.02);\n bottom: 24px;\n display: flex;\n left: calc(50% + var(--toolbar-inline-offset, 0px));\n padding: 12px 16px;\n position: fixed;\n transform: translateX(-50%);\n width: 100%;\n max-width: 800px;\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAuC,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAIhC,IAAMG,aAAa,GAAAC,OAAA,CAAAD,aAAA,GAAGE,yBAAM,CAACC,GAAG,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,whBAoBtC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"EditableContent.d.ts","sourceRoot":"","sources":["../../../../src/components/EditableContent/EditableContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAc,GAAG,EAAuB,MAAM,OAAO,CAAC;AAIpE,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAEnD,MAAM,WAAW,wBAAwB;IACvC,0BAA0B;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,yBAAyB;IACzB,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,QAAQ,CAAC;IACjD,mBAAmB;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,wBAAwB,CAAC,OAAO,CAAC,CAAC,CAAC;IAC9D,yBAAyB;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,yBAAyB;IACzB,OAAO,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC/B;AAED,eAAO,MAAM,eAAe,oOA0D3B,CAAC"}
1
+ {"version":3,"file":"EditableContent.d.ts","sourceRoot":"","sources":["../../../../src/components/EditableContent/EditableContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAc,GAAG,EAAiC,MAAM,OAAO,CAAC;AAI9E,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAEnD,MAAM,WAAW,wBAAwB;IACvC,0BAA0B;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,yBAAyB;IACzB,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,QAAQ,CAAC;IACjD,mBAAmB;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,wBAAwB,CAAC,OAAO,CAAC,CAAC,CAAC;IAC9D,yBAAyB;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,yBAAyB;IACzB,OAAO,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC/B;AAED,eAAO,MAAM,eAAe,oOA+F3B,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
- const _excluded = ["className", "variant", "weight", "disabled", "inputProps", "wrapRef", "children", "invalid"];
4
- import React, { forwardRef, useCallback, useRef } from "react";
3
+ const _excluded = ["className", "variant", "weight", "disabled", "inputProps", "wrapRef", "children", "invalid", "onMouseLeave"];
4
+ import React, { forwardRef, useCallback, useRef, useState } from "react";
5
5
  import { StyledDiv, StyledInput, StyledSpan } from "./Styles";
6
6
  import { useForkRef } from "../../utils";
7
7
  export const EditableContent = /*#__PURE__*/forwardRef((_ref, ref) => {
@@ -15,19 +15,39 @@ export const EditableContent = /*#__PURE__*/forwardRef((_ref, ref) => {
15
15
  wrapRef = _ref.wrapRef,
16
16
  children = _ref.children,
17
17
  invalid = _ref.invalid,
18
+ onMouseLeave = _ref.onMouseLeave,
18
19
  props = _objectWithoutPropertiesLoose(_ref, _excluded);
19
20
  const intInputRef = useRef(null);
20
21
  const handleRef = useForkRef(ref, intInputRef);
22
+ const _useState = useState(false),
23
+ suppressHover = _useState[0],
24
+ setSuppressHover = _useState[1];
21
25
  const handleBlur = useCallback(evt => {
22
26
  if (intInputRef != null && intInputRef.current) {
23
27
  intInputRef.current.scrollLeft = 0;
24
28
  }
25
29
  typeof (inputProps == null ? void 0 : inputProps.onBlur) === "function" && (inputProps == null ? void 0 : inputProps.onBlur(evt));
26
30
  }, [inputProps]);
31
+ const handleKeyDown = useCallback(evt => {
32
+ if (evt.key === "Enter" || evt.key === "Escape") {
33
+ setSuppressHover(true);
34
+ }
35
+ typeof (inputProps == null ? void 0 : inputProps.onKeyDown) === "function" && inputProps.onKeyDown(evt);
36
+ }, [inputProps]);
37
+ const handleFocus = useCallback(evt => {
38
+ setSuppressHover(false);
39
+ typeof (inputProps == null ? void 0 : inputProps.onFocus) === "function" && inputProps.onFocus(evt);
40
+ }, [inputProps]);
41
+ const handleMouseLeave = useCallback(evt => {
42
+ setSuppressHover(false);
43
+ typeof onMouseLeave === "function" && onMouseLeave(evt);
44
+ }, [onMouseLeave]);
27
45
  return /*#__PURE__*/React.createElement(StyledDiv, _extends({
28
46
  className: className,
29
47
  ref: wrapRef
30
- }, props), /*#__PURE__*/React.createElement(StyledSpan, {
48
+ }, props, {
49
+ onMouseLeave: handleMouseLeave
50
+ }), /*#__PURE__*/React.createElement(StyledSpan, {
31
51
  variant: variant,
32
52
  forwardedAs: "span",
33
53
  weight: weight,
@@ -40,8 +60,11 @@ export const EditableContent = /*#__PURE__*/forwardRef((_ref, ref) => {
40
60
  weight: weight,
41
61
  value: inputProps == null ? void 0 : inputProps.value,
42
62
  onBlur: handleBlur,
63
+ onKeyDown: handleKeyDown,
64
+ onFocus: handleFocus,
43
65
  disabled: disabled,
44
66
  "data-form-type": "other",
67
+ "data-hover-suppressed": suppressHover ? "" : undefined,
45
68
  invalid: invalid
46
69
  })));
47
70
  });
@@ -1 +1 @@
1
- {"version":3,"file":"EditableContent.js","names":["React","forwardRef","useCallback","useRef","StyledDiv","StyledInput","StyledSpan","useForkRef","EditableContent","_ref","ref","className","_ref$variant","variant","weight","_ref$disabled","disabled","inputProps","wrapRef","children","invalid","props","_objectWithoutPropertiesLoose","_excluded","intInputRef","handleRef","handleBlur","evt","current","scrollLeft","onBlur","createElement","_extends","forwardedAs","$disabled","value","displayName"],"sources":["../../../../src/components/EditableContent/EditableContent.tsx"],"sourcesContent":["import React, { forwardRef, Ref, useCallback, useRef } from \"react\";\n\nimport { StyledDiv, StyledInput, StyledSpan } from \"./Styles\";\nimport { useForkRef } from \"../../utils\";\nimport { Variant } from \"../Typography/Typography\";\n\nexport interface EditableContentInterface {\n /** Typography variant. */\n variant?: Variant;\n /** Typography weight. */\n weight?: \"light\" | \"regular\" | \"bold\" | \"medium\";\n /** Input props. */\n inputProps?: Partial<React.ComponentPropsWithoutRef<\"input\">>;\n /** Disable edit mode. */\n disabled?: boolean;\n invalid?: boolean;\n /** Wrapper reference. */\n wrapRef?: Ref<HTMLDivElement>;\n}\n\nexport const EditableContent = forwardRef<\n HTMLDivElement,\n EditableContentInterface &\n Omit<React.ComponentPropsWithoutRef<\"div\">, keyof EditableContentInterface>\n>(\n (\n {\n className,\n variant = \"Body 2\",\n weight,\n disabled = false,\n inputProps,\n wrapRef,\n children,\n invalid,\n ...props\n },\n ref\n ) => {\n const intInputRef = useRef<HTMLInputElement>(null);\n const handleRef = useForkRef(ref, intInputRef);\n\n const handleBlur = useCallback(\n (evt) => {\n if (intInputRef?.current) {\n intInputRef.current.scrollLeft = 0;\n }\n typeof inputProps?.onBlur === `function` && inputProps?.onBlur(evt);\n },\n [inputProps]\n );\n\n return (\n <StyledDiv className={className} ref={wrapRef} {...props}>\n <StyledSpan\n variant={variant}\n forwardedAs=\"span\"\n weight={weight}\n $disabled={disabled}\n className=\"presentation\"\n >\n {children ? children : inputProps?.value}\n </StyledSpan>\n <StyledInput\n {...inputProps}\n ref={handleRef}\n forwardedAs=\"input\"\n variant={variant}\n weight={weight}\n value={inputProps?.value}\n onBlur={handleBlur}\n disabled={disabled}\n data-form-type=\"other\"\n invalid={invalid}\n />\n </StyledDiv>\n );\n }\n);\n\nEditableContent.displayName = \"EditableContent\";\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAAIC,UAAU,EAAOC,WAAW,EAAEC,MAAM,QAAQ,OAAO;AAEnE,SAASC,SAAS,EAAEC,WAAW,EAAEC,UAAU,QAAQ,UAAU;AAC7D,SAASC,UAAU,QAAQ,aAAa;AAiBxC,OAAO,MAAMC,eAAe,gBAAGP,UAAU,CAKvC,CAAAQ,IAAA,EAYEC,GAAG,KACA;EAAA,IAXDC,SAAS,GAAAF,IAAA,CAATE,SAAS;IAAAC,YAAA,GAAAH,IAAA,CACTI,OAAO;IAAPA,OAAO,GAAAD,YAAA,cAAG,QAAQ,GAAAA,YAAA;IAClBE,MAAM,GAAAL,IAAA,CAANK,MAAM;IAAAC,aAAA,GAAAN,IAAA,CACNO,QAAQ;IAARA,QAAQ,GAAAD,aAAA,cAAG,KAAK,GAAAA,aAAA;IAChBE,UAAU,GAAAR,IAAA,CAAVQ,UAAU;IACVC,OAAO,GAAAT,IAAA,CAAPS,OAAO;IACPC,QAAQ,GAAAV,IAAA,CAARU,QAAQ;IACRC,OAAO,GAAAX,IAAA,CAAPW,OAAO;IACJC,KAAK,GAAAC,6BAAA,CAAAb,IAAA,EAAAc,SAAA;EAIV,MAAMC,WAAW,GAAGrB,MAAM,CAAmB,IAAI,CAAC;EAClD,MAAMsB,SAAS,GAAGlB,UAAU,CAACG,GAAG,EAAEc,WAAW,CAAC;EAE9C,MAAME,UAAU,GAAGxB,WAAW,CAC3ByB,GAAG,IAAK;IACP,IAAIH,WAAW,YAAXA,WAAW,CAAEI,OAAO,EAAE;MACxBJ,WAAW,CAACI,OAAO,CAACC,UAAU,GAAG,CAAC;IACpC;IACA,QAAOZ,UAAU,oBAAVA,UAAU,CAAEa,MAAM,gBAAe,KAAIb,UAAU,oBAAVA,UAAU,CAAEa,MAAM,CAACH,GAAG,CAAC;EACrE,CAAC,EACD,CAACV,UAAU,CACb,CAAC;EAED,oBACEjB,KAAA,CAAA+B,aAAA,CAAC3B,SAAS,EAAA4B,QAAA;IAACrB,SAAS,EAAEA,SAAU;IAACD,GAAG,EAAEQ;EAAQ,GAAKG,KAAK,gBACtDrB,KAAA,CAAA+B,aAAA,CAACzB,UAAU;IACTO,OAAO,EAAEA,OAAQ;IACjBoB,WAAW,EAAC,MAAM;IAClBnB,MAAM,EAAEA,MAAO;IACfoB,SAAS,EAAElB,QAAS;IACpBL,SAAS,EAAC;EAAc,GAEvBQ,QAAQ,GAAGA,QAAQ,GAAGF,UAAU,oBAAVA,UAAU,CAAEkB,KACzB,CAAC,eACbnC,KAAA,CAAA+B,aAAA,CAAC1B,WAAW,EAAA2B,QAAA,KACNf,UAAU;IACdP,GAAG,EAAEe,SAAU;IACfQ,WAAW,EAAC,OAAO;IACnBpB,OAAO,EAAEA,OAAQ;IACjBC,MAAM,EAAEA,MAAO;IACfqB,KAAK,EAAElB,UAAU,oBAAVA,UAAU,CAAEkB,KAAM;IACzBL,MAAM,EAAEJ,UAAW;IACnBV,QAAQ,EAAEA,QAAS;IACnB,kBAAe,OAAO;IACtBI,OAAO,EAAEA;EAAQ,EAClB,CACQ,CAAC;AAEhB,CACF,CAAC;AAEDZ,eAAe,CAAC4B,WAAW,GAAG,iBAAiB","ignoreList":[]}
1
+ {"version":3,"file":"EditableContent.js","names":["React","forwardRef","useCallback","useRef","useState","StyledDiv","StyledInput","StyledSpan","useForkRef","EditableContent","_ref","ref","className","_ref$variant","variant","weight","_ref$disabled","disabled","inputProps","wrapRef","children","invalid","onMouseLeave","props","_objectWithoutPropertiesLoose","_excluded","intInputRef","handleRef","_useState","suppressHover","setSuppressHover","handleBlur","evt","current","scrollLeft","onBlur","handleKeyDown","key","onKeyDown","handleFocus","onFocus","handleMouseLeave","createElement","_extends","forwardedAs","$disabled","value","undefined","displayName"],"sources":["../../../../src/components/EditableContent/EditableContent.tsx"],"sourcesContent":["import React, { forwardRef, Ref, useCallback, useRef, useState } from \"react\";\n\nimport { StyledDiv, StyledInput, StyledSpan } from \"./Styles\";\nimport { useForkRef } from \"../../utils\";\nimport { Variant } from \"../Typography/Typography\";\n\nexport interface EditableContentInterface {\n /** Typography variant. */\n variant?: Variant;\n /** Typography weight. */\n weight?: \"light\" | \"regular\" | \"bold\" | \"medium\";\n /** Input props. */\n inputProps?: Partial<React.ComponentPropsWithoutRef<\"input\">>;\n /** Disable edit mode. */\n disabled?: boolean;\n invalid?: boolean;\n /** Wrapper reference. */\n wrapRef?: Ref<HTMLDivElement>;\n}\n\nexport const EditableContent = forwardRef<\n HTMLDivElement,\n EditableContentInterface &\n Omit<React.ComponentPropsWithoutRef<\"div\">, keyof EditableContentInterface>\n>(\n (\n {\n className,\n variant = \"Body 2\",\n weight,\n disabled = false,\n inputProps,\n wrapRef,\n children,\n invalid,\n onMouseLeave,\n ...props\n },\n ref\n ) => {\n const intInputRef = useRef<HTMLInputElement>(null);\n const handleRef = useForkRef(ref, intInputRef);\n const [suppressHover, setSuppressHover] = useState(false);\n\n const handleBlur = useCallback(\n (evt) => {\n if (intInputRef?.current) {\n intInputRef.current.scrollLeft = 0;\n }\n typeof inputProps?.onBlur === `function` && inputProps?.onBlur(evt);\n },\n [inputProps]\n );\n\n const handleKeyDown = useCallback(\n (evt) => {\n if (evt.key === \"Enter\" || evt.key === \"Escape\") {\n setSuppressHover(true);\n }\n typeof inputProps?.onKeyDown === \"function\" &&\n inputProps.onKeyDown(evt);\n },\n [inputProps]\n );\n\n const handleFocus = useCallback(\n (evt) => {\n setSuppressHover(false);\n typeof inputProps?.onFocus === \"function\" && inputProps.onFocus(evt);\n },\n [inputProps]\n );\n\n const handleMouseLeave = useCallback(\n (evt) => {\n setSuppressHover(false);\n typeof onMouseLeave === \"function\" && onMouseLeave(evt);\n },\n [onMouseLeave]\n );\n\n return (\n <StyledDiv\n className={className}\n ref={wrapRef}\n {...props}\n onMouseLeave={handleMouseLeave}\n >\n <StyledSpan\n variant={variant}\n forwardedAs=\"span\"\n weight={weight}\n $disabled={disabled}\n className=\"presentation\"\n >\n {children ? children : inputProps?.value}\n </StyledSpan>\n <StyledInput\n {...inputProps}\n ref={handleRef}\n forwardedAs=\"input\"\n variant={variant}\n weight={weight}\n value={inputProps?.value}\n onBlur={handleBlur}\n onKeyDown={handleKeyDown}\n onFocus={handleFocus}\n disabled={disabled}\n data-form-type=\"other\"\n data-hover-suppressed={suppressHover ? \"\" : undefined}\n invalid={invalid}\n />\n </StyledDiv>\n );\n }\n);\n\nEditableContent.displayName = \"EditableContent\";\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAAIC,UAAU,EAAOC,WAAW,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAE7E,SAASC,SAAS,EAAEC,WAAW,EAAEC,UAAU,QAAQ,UAAU;AAC7D,SAASC,UAAU,QAAQ,aAAa;AAiBxC,OAAO,MAAMC,eAAe,gBAAGR,UAAU,CAKvC,CAAAS,IAAA,EAaEC,GAAG,KACA;EAAA,IAZDC,SAAS,GAAAF,IAAA,CAATE,SAAS;IAAAC,YAAA,GAAAH,IAAA,CACTI,OAAO;IAAPA,OAAO,GAAAD,YAAA,cAAG,QAAQ,GAAAA,YAAA;IAClBE,MAAM,GAAAL,IAAA,CAANK,MAAM;IAAAC,aAAA,GAAAN,IAAA,CACNO,QAAQ;IAARA,QAAQ,GAAAD,aAAA,cAAG,KAAK,GAAAA,aAAA;IAChBE,UAAU,GAAAR,IAAA,CAAVQ,UAAU;IACVC,OAAO,GAAAT,IAAA,CAAPS,OAAO;IACPC,QAAQ,GAAAV,IAAA,CAARU,QAAQ;IACRC,OAAO,GAAAX,IAAA,CAAPW,OAAO;I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vC,WAAW,CACjC8B,GAAG,IAAK;IACPF,gBAAgB,CAAC,KAAK,CAAC;IACvB,OAAOR,YAAY,KAAK,UAAU,IAAIA,YAAY,CAACU,GAAG,CAAC;EACzD,CAAC,EACD,CAACV,YAAY,CACf,CAAC;EAED,oBACEtB,KAAA,CAAA0C,aAAA,CAACrC,SAAS,EAAAsC,QAAA;IACR/B,SAAS,EAAEA,SAAU;IACrBD,GAAG,EAAEQ;EAAQ,GACTI,KAAK;IACTD,YAAY,EAAEmB;EAAiB,iBAE/BzC,KAAA,CAAA0C,aAAA,CAACnC,UAAU;IACTO,OAAO,EAAEA,OAAQ;IACjB8B,WAAW,EAAC,MAAM;IAClB7B,MAAM,EAAEA,MAAO;IACf8B,SAAS,EAAE5B,QAAS;IACpBL,SAAS,EAAC;EAAc,GAEvBQ,QAAQ,GAAGA,QAAQ,GAAGF,UAAU,oBAAVA,UAAU,CAAE4B,KACzB,CAAC,eACb9C,KAAA,CAAA0C,aAAA,CAACpC,WAAW,EAAAqC,QAAA,KACNzB,UAAU;IACdP,GAAG,EAAEgB,SAAU;IACfiB,WAAW,EAAC,OAAO;IACnB9B,OAAO,EAAEA,OAAQ;IACjBC,MAAM,EAAEA,MAAO;IACf+B,KAAK,EAAE5B,UAAU,oBAAVA,UAAU,CAAE4B,KAAM;IACzBX,MAAM,EAAEJ,UAAW;IACnBO,SAAS,EAAEF,aAAc;IACzBI,OAAO,EAAED,WAAY;IACrBtB,QAAQ,EAAEA,QAAS;IACnB,kBAAe,OAAO;IACtB,yBAAuBY,aAAa,GAAG,EAAE,GAAGkB,SAAU;IACtD1B,OAAO,EAAEA;EAAQ,EAClB,CACQ,CAAC;AAEhB,CACF,CAAC;AAEDZ,eAAe,CAACuC,WAAW,GAAG,iBAAiB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"Styles.d.ts","sourceRoot":"","sources":["../../../../src/components/EditableContent/Styles.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,SAAS;iBAA6B,OAAO;SAazD,CAAC;AAEF,eAAO,MAAM,UAAU;;;gBAAoC,OAAO;SAgCjE,CAAC;AAIF,eAAO,MAAM,WAAW;;kBAqCvB,CAAC;AAIF,eAAO,MAAM,mBAAmB;;;gBA7E2B,OAAO;SA2FjE,CAAC;AAIF,eAAO,MAAM,kBAAkB;;kBA+C9B,CAAC"}
1
+ {"version":3,"file":"Styles.d.ts","sourceRoot":"","sources":["../../../../src/components/EditableContent/Styles.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,SAAS;iBAA6B,OAAO;SAazD,CAAC;AAEF,eAAO,MAAM,UAAU;;;gBAAoC,OAAO;SAgCjE,CAAC;AAIF,eAAO,MAAM,WAAW;;kBAwCvB,CAAC;AAIF,eAAO,MAAM,mBAAmB;;;gBAhF2B,OAAO;SA8FjE,CAAC;AAIF,eAAO,MAAM,kBAAkB;;kBA+C9B,CAAC"}
@@ -27,7 +27,7 @@ StyledSpan.displayName = "StyledSpan";
27
27
  export const StyledInput = styled(Typography).withConfig({
28
28
  displayName: "Styles__StyledInput",
29
29
  componentId: "sc-1wapx2a-2"
30
- })(["", " background-color:inherit;padding-left:4px;padding-right:4px;padding-top:1px;padding-bottom:1px;text-overflow:ellipsis;font-variant-numeric:tabular-nums;&:focus-whitin{text-overflow:clip;}outline-width:0px;outline:none;&:disabled{opacity:0;}", ""], {
30
+ })(["", " background-color:inherit;padding-left:4px;padding-right:4px;padding-top:1px;padding-bottom:1px;text-overflow:ellipsis;font-variant-numeric:tabular-nums;&:focus-whitin{text-overflow:clip;}outline-width:0px;outline:none;&:disabled{opacity:0;}&:not([data-hover-suppressed]):hover{border-color:var(--color-theme-700);}", ""], {
31
31
  "position": "absolute",
32
32
  "inset": "0px",
33
33
  "boxSizing": "border-box",
@@ -41,9 +41,6 @@ export const StyledInput = styled(Typography).withConfig({
41
41
  ":focus-within": {
42
42
  "overflow": "scroll",
43
43
  "borderColor": "var(--color-theme-700)"
44
- },
45
- ":hover": {
46
- "borderColor": "var(--color-theme-700)"
47
44
  }
48
45
  }, _ref4 => {
49
46
  let invalid = _ref4.invalid;
@@ -1 +1 @@
1
- {"version":3,"file":"Styles.js","names":["styled","css","BoxSizingStyle","FontStyle","Typography","StyledDiv","div","withConfig","displayName","componentId","_ref","$multiline","StyledSpan","_ref2","$disabled","_ref3","invalid","StyledInput","_ref4","StyledMultilineSpan","_ref5","_ref6","StyledTextareaSpan","_ref7"],"sources":["../../../../src/components/EditableContent/Styles.ts"],"sourcesContent":["import styled, { css } from \"styled-components\";\nimport tw from \"twin.macro\";\n\nimport { BoxSizingStyle } from \"../BoxSizingStyle\";\nimport { FontStyle } from \"../FontStyle\";\nimport { Typography } from \"../Typography/Typography\";\n\nexport const StyledDiv = styled.div<{ $multiline?: boolean }>`\n ${FontStyle}\n ${BoxSizingStyle}\n\n\n\n ${tw`tw-relative tw-inline-block tw-max-w-full`}\n ${({ $multiline }) =>\n $multiline &&\n css`\n position: relative;\n display: flex;\n `}\n`;\n\nexport const StyledSpan = styled(Typography)<{ $disabled?: boolean }>`\n visibility: hidden;\n display: block;\n padding-left: 4px;\n padding-right: 4px;\n padding-top: 1px;\n padding-bottom: 1px;\n position: relative;\n border: 1px solid transparent;\n border-radius: 6px;\n max-width: 100%;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: pre;\n font-variant-numeric: tabular-nums;\n\n ${({ $disabled }) =>\n $disabled &&\n css`\n visibility: visible;\n cursor: default !important;\n `}\n\n ${({ invalid }) =>\n invalid &&\n css`\n border: 1px solid var(--red-alert);\n `}\n\n &:empty:before {\n content: \" \";\n }\n`;\n\nStyledSpan.displayName = \"StyledSpan\";\n\nexport const StyledInput = styled(Typography)`\n ${tw`\n tw-absolute\n tw-inset-0\n tw-border\n tw-border-transparent\n tw-border-solid\n hover:tw-border-theme-700\n focus-within:tw-border-theme-700\n tw-rounded-md\n tw-box-border\n tw-overflow-hidden\n tw-whitespace-nowrap\n focus-within:tw-overflow-scroll\n tw-w-full`}\n\n background-color: inherit;\n padding-left: 4px;\n padding-right: 4px;\n padding-top: 1px;\n padding-bottom: 1px;\n text-overflow: ellipsis;\n font-variant-numeric: tabular-nums;\n &:focus-whitin {\n text-overflow: clip;\n }\n outline-width: 0px;\n outline: none;\n &:disabled {\n opacity: 0;\n }\n\n ${({ invalid }) =>\n invalid &&\n css`\n border-color: var(--red-alert) !important;\n `}\n`;\n\nStyledInput.displayName = \"StyledInput\";\n\nexport const StyledMultilineSpan = styled(StyledSpan)`\n cursor: ${({ $disabled }) => ($disabled ? \"default\" : \"text !important\")};\n z-index: 2;\n width: 100%;\n visibility: visible !important;\n\n &:hover {\n border-color: ${({ invalid, $disabled }) =>\n invalid\n ? \"var(--red-alert)\"\n : $disabled\n ? \"transparent\"\n : \"var(--border-primary)\"};\n }\n`;\n\nStyledMultilineSpan.displayName = \"StyledMultilineSpan\";\n\nexport const StyledTextareaSpan = styled(Typography)`\n ${tw`\n tw-absolute\n tw-inset-0\n tw-border\n tw-border-solid\n tw-rounded-md\n tw-box-border\n tw-w-full`}\n\n background-color: var(--input-background-color);\n border-color: var(--color-theme-500);\n padding-left: 4px;\n padding-right: 4px;\n padding-top: 1px;\n padding-bottom: 1px;\n font-variant-numeric: tabular-nums;\n outline-width: 0px;\n outline: none;\n resize: none;\n white-space: pre-wrap;\n overflow-wrap: break-word;\n height: calc(1.5em * 3 + 2px); /* 3 rows height: line-height * 3 + padding */\n min-height: calc(1.5em * 3 + 2px);\n opacity: 0;\n pointer-events: none;\n z-index: 1;\n\n &:focus {\n opacity: 1;\n pointer-events: auto;\n background-color: var(--input-background-color);\n border-color: var(--color-primary);\n outline: none;\n z-index: 3;\n }\n\n &:disabled {\n opacity: 0;\n pointer-events: none;\n }\n\n ${({ invalid }) =>\n invalid &&\n css`\n border-color: var(--red-alert) !important;\n `}\n`;\n\nStyledTextareaSpan.displayName = \"StyledTextareaSpan\";\n"],"mappings":"AAAA,OAAOA,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAG/C,SAASC,cAA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KAAA,CAATN,SAAS;EAAA,OAAQA,SAAS,GAAG,SAAS,GAAG,iBAAiB;AAAA,CAAC,EAMtDO,KAAA;EAAA,IAAGL,OAAO,GAAAK,KAAA,CAAPL,OAAO;IAAEF,SAAS,GAAAO,KAAA,CAATP,SAAS;EAAA,OACnCE,OAAO,GACH,kBAAkB,GAClBF,SAAS,GACT,aAAa,GACb,uBAAuB;AAAA,EAEhC;AAEDK,mBAAmB,CAACX,WAAW,GAAG,qBAAqB;AAEvD,OAAO,MAAMc,kBAAkB,GAAGtB,MAAM,CAACI,UAAU,CAAC,CAAAG,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,qkBAC9C;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;AAOO,CAAC,EAkCVc,KAAA;EAAA,IAAGP,OAAO,GAAAO,KAAA,CAAPP,OAAO;EAAA,OACVA,OAAO,IACPf,GAAG,+CAEF;AAAA,EACJ;AAEDqB,kBAAkB,CAACd,WAAW,GAAG,oBAAoB","ignoreList":[]}
1
+ {"version":3,"file":"Styles.js","names":["styled","css","BoxSizingStyle","FontStyle","Typography","StyledDiv","div","withConfig","displayName","componentId","_ref","$multiline","StyledSpan","_ref2","$disabled","_ref3","invalid","StyledInput","_ref4","StyledMultilineSpan","_ref5","_ref6","StyledTextareaSpan","_ref7"],"sources":["../../../../src/components/EditableContent/Styles.ts"],"sourcesContent":["import styled, { css } from \"styled-components\";\nimport tw from \"twin.macro\";\n\nimport { BoxSizingStyle } from \"../BoxSizingStyle\";\nimport { FontStyle } from \"../FontStyle\";\nimport { Typography } from \"../Typography/Typography\";\n\nexport const StyledDiv = styled.div<{ $multiline?: boolean }>`\n ${FontStyle}\n ${BoxSizingStyle}\n\n\n\n ${tw`tw-relative tw-inline-block tw-max-w-full`}\n ${({ $multiline }) =>\n $multiline &&\n css`\n position: relative;\n display: flex;\n `}\n`;\n\nexport const StyledSpan = styled(Typography)<{ $disabled?: boolean }>`\n visibility: hidden;\n display: block;\n padding-left: 4px;\n padding-right: 4px;\n padding-top: 1px;\n padding-bottom: 1px;\n position: relative;\n border: 1px solid transparent;\n border-radius: 6px;\n max-width: 100%;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: pre;\n font-variant-numeric: tabular-nums;\n\n ${({ $disabled }) =>\n $disabled &&\n css`\n visibility: visible;\n cursor: default !important;\n `}\n\n ${({ invalid }) =>\n invalid &&\n css`\n border: 1px solid var(--red-alert);\n `}\n\n &:empty:before {\n content: \" \";\n }\n`;\n\nStyledSpan.displayName = \"StyledSpan\";\n\nexport const StyledInput = styled(Typography)`\n ${tw`\n tw-absolute\n tw-inset-0\n tw-border\n tw-border-transparent\n tw-border-solid\n focus-within:tw-border-theme-700\n tw-rounded-md\n tw-box-border\n tw-overflow-hidden\n tw-whitespace-nowrap\n focus-within:tw-overflow-scroll\n tw-w-full`}\n\n background-color: inherit;\n padding-left: 4px;\n padding-right: 4px;\n padding-top: 1px;\n padding-bottom: 1px;\n text-overflow: ellipsis;\n font-variant-numeric: tabular-nums;\n &:focus-whitin {\n text-overflow: clip;\n }\n outline-width: 0px;\n outline: none;\n &:disabled {\n opacity: 0;\n }\n\n &:not([data-hover-suppressed]):hover {\n border-color: var(--color-theme-700);\n }\n\n ${({ invalid }) =>\n invalid &&\n css`\n border-color: var(--red-alert) !important;\n `}\n`;\n\nStyledInput.displayName = \"StyledInput\";\n\nexport const StyledMultilineSpan = styled(StyledSpan)`\n cursor: ${({ $disabled }) => ($disabled ? \"default\" : \"text !important\")};\n z-index: 2;\n width: 100%;\n visibility: visible !important;\n\n &:hover {\n border-color: ${({ invalid, $disabled }) =>\n invalid\n ? \"var(--red-alert)\"\n : $disabled\n ? \"transparent\"\n : \"var(--border-primary)\"};\n }\n`;\n\nStyledMultilineSpan.displayName = \"StyledMultilineSpan\";\n\nexport const StyledTextareaSpan = styled(Typography)`\n ${tw`\n tw-absolute\n tw-inset-0\n tw-border\n tw-border-solid\n tw-rounded-md\n tw-box-border\n tw-w-full`}\n\n background-color: var(--input-background-color);\n border-color: var(--color-theme-500);\n padding-left: 4px;\n padding-right: 4px;\n padding-top: 1px;\n padding-bottom: 1px;\n font-variant-numeric: tabular-nums;\n outline-width: 0px;\n outline: none;\n resize: none;\n white-space: pre-wrap;\n overflow-wrap: break-word;\n height: calc(1.5em * 3 + 2px); /* 3 rows height: line-height * 3 + padding */\n min-height: calc(1.5em * 3 + 2px);\n opacity: 0;\n pointer-events: none;\n z-index: 1;\n\n &:focus {\n opacity: 1;\n pointer-events: auto;\n background-color: var(--input-background-color);\n border-color: var(--color-primary);\n outline: none;\n z-index: 3;\n }\n\n &:disabled {\n opacity: 0;\n pointer-events: none;\n }\n\n ${({ invalid }) =>\n invalid &&\n css`\n border-color: var(--red-alert) !important;\n `}\n`;\n\nStyledTextareaSpan.displayName = \"StyledTextareaSpan\";\n"],"mappings":"AAAA,OAAOA,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAG/C,SAASC,cAAc,QAAQ,mBAAmB;AAClD,SAASC,SAAS,QAAQ,cAAc;AACxC,SAASC,UAAU,QAAQ,0BAA0B;AAErD,OAAO,MAAMC,SAAS,GAAGL,MAAM,CAACM,GAAG,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,4BAC/BN,SAAS,EACTD,cAAc,EAIZ;EAAA;EAAA;EAAA;AAA0C,CAAC,EAC7CQ,IAAA;EAAA,IAAGC,UAAU,GAAAD,IAAA,CAAVC,UAAU;EAAA,OACbA,UAAU,IACVV,GAAG,qCAGF;AAAA,EACJ;AAED,OAAO,MAAMW,UAAU,GAAGZ,MAAM,CAACI,UAAU,CAAC,CAAAG,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,gUAgBxCI,KAAA;EAAA,IAAGC,SAAS,GAAAD,KAAA,CAATC,SAAS;EAAA,OACZA,SAAS,IACTb,GAAG,mDAGF;AAAA,GAEDc,KAAA;EAAA,IAAGC,OAAO,GAAAD,KAAA,CAAPC,OAAO;EAAA,OACVA,OAAO,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3,"file":"Toolbar.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/Toolbar/Toolbar.styles.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAE9C,eAAO,MAAM,aAAa,uFAgBzB,CAAC"}
1
+ {"version":3,"file":"Toolbar.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/Toolbar/Toolbar.styles.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAE9C,eAAO,MAAM,aAAa,uFAoBzB,CAAC"}
@@ -2,5 +2,5 @@ import styled from "styled-components";
2
2
  export const StyledToolbar = styled.div.withConfig({
3
3
  displayName: "Toolbarstyles__StyledToolbar",
4
4
  componentId: "sc-n5xxbc-0"
5
- })(["box-sizing:border-box;background-color:var(--page-paper-main);border-radius:8px;border:1px solid var(--color-theme-300);box-shadow:0px 64px 64px rgba(0,0,0,0.06),0px 32px 32px rgba(0,0,0,0.03),0px 16px 16px rgba(0,0,0,0.02),0px 4px 4px rgba(0,0,0,0.02),0px 2px 2px rgba(0,0,0,0.02);bottom:24px;display:flex;left:50%;padding:12px 16px;position:fixed;transform:translateX(-50%);width:100%;max-width:800px;"]);
5
+ })(["box-sizing:border-box;background-color:var(--page-paper-main);background-image:linear-gradient( var(--color-primary-300),var(--color-primary-300) );border-radius:8px;border:1px solid var(--color-primary);box-shadow:0px 64px 64px rgba(0,0,0,0.06),0px 32px 32px rgba(0,0,0,0.03),0px 16px 16px rgba(0,0,0,0.02),0px 4px 4px rgba(0,0,0,0.02),0px 2px 2px rgba(0,0,0,0.02);bottom:24px;display:flex;left:calc(50% + var(--toolbar-inline-offset,0px));padding:12px 16px;position:fixed;transform:translateX(-50%);width:100%;max-width:800px;"]);
6
6
  //# sourceMappingURL=Toolbar.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Toolbar.styles.js","names":["styled","StyledToolbar","div","withConfig","displayName","componentId"],"sources":["../../../../src/components/Toolbar/Toolbar.styles.ts"],"sourcesContent":["import styled from \"styled-components\";\n\nimport type { ToolbarProps } from \"./Toolbar\";\n\nexport const StyledToolbar = styled.div<Partial<ToolbarProps>>`\n box-sizing: border-box;\n background-color: var(--page-paper-main);\n border-radius: 8px;\n border: 1px solid var(--color-theme-300);\n box-shadow: 0px 64px 64px rgba(0, 0, 0, 0.06),\n 0px 32px 32px rgba(0, 0, 0, 0.03), 0px 16px 16px rgba(0, 0, 0, 0.02),\n 0px 4px 4px rgba(0, 0, 0, 0.02), 0px 2px 2px rgba(0, 0, 0, 0.02);\n bottom: 24px;\n display: flex;\n left: 50%;\n padding: 12px 16px;\n position: fixed;\n transform: translateX(-50%);\n width: 100%;\n max-width: 800px;\n`;\n"],"mappings":"AAAA,OAAOA,MAAM,MAAM,mBAAmB;AAItC,OAAO,MAAMC,aAAa,GAAGD,MAAM,CAACE,GAAG,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,2ZAgBtC","ignoreList":[]}
1
+ {"version":3,"file":"Toolbar.styles.js","names":["styled","StyledToolbar","div","withConfig","displayName","componentId"],"sources":["../../../../src/components/Toolbar/Toolbar.styles.ts"],"sourcesContent":["import styled from \"styled-components\";\n\nimport type { ToolbarProps } from \"./Toolbar\";\n\nexport const StyledToolbar = styled.div<Partial<ToolbarProps>>`\n box-sizing: border-box;\n background-color: var(--page-paper-main);\n background-image: linear-gradient(\n var(--color-primary-300),\n var(--color-primary-300)\n );\n border-radius: 8px;\n border: 1px solid var(--color-primary);\n box-shadow: 0px 64px 64px rgba(0, 0, 0, 0.06),\n 0px 32px 32px rgba(0, 0, 0, 0.03), 0px 16px 16px rgba(0, 0, 0, 0.02),\n 0px 4px 4px rgba(0, 0, 0, 0.02), 0px 2px 2px rgba(0, 0, 0, 0.02);\n bottom: 24px;\n display: flex;\n left: calc(50% + var(--toolbar-inline-offset, 0px));\n padding: 12px 16px;\n position: fixed;\n transform: translateX(-50%);\n width: 100%;\n max-width: 800px;\n`;\n"],"mappings":"AAAA,OAAOA,MAAM,MAAM,mBAAmB;AAItC,OAAO,MAAMC,aAAa,GAAGD,MAAM,CAACE,GAAG,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,whBAoBtC","ignoreList":[]}
package/dist/index.js CHANGED
@@ -25671,7 +25671,7 @@
25671
25671
  var StyledInput$2 = styled__default["default"](Typography).withConfig({
25672
25672
  displayName: "Styles__StyledInput",
25673
25673
  componentId: "sc-1wapx2a-2"
25674
- })(["", " background-color:inherit;padding-left:4px;padding-right:4px;padding-top:1px;padding-bottom:1px;text-overflow:ellipsis;font-variant-numeric:tabular-nums;&:focus-whitin{text-overflow:clip;}outline-width:0px;outline:none;&:disabled{opacity:0;}", ""], {
25674
+ })(["", " background-color:inherit;padding-left:4px;padding-right:4px;padding-top:1px;padding-bottom:1px;text-overflow:ellipsis;font-variant-numeric:tabular-nums;&:focus-whitin{text-overflow:clip;}outline-width:0px;outline:none;&:disabled{opacity:0;}&:not([data-hover-suppressed]):hover{border-color:var(--color-theme-700);}", ""], {
25675
25675
  "position": "absolute",
25676
25676
  "inset": "0px",
25677
25677
  "boxSizing": "border-box",
@@ -25685,9 +25685,6 @@
25685
25685
  ":focus-within": {
25686
25686
  "overflow": "scroll",
25687
25687
  "borderColor": "var(--color-theme-700)"
25688
- },
25689
- ":hover": {
25690
- "borderColor": "var(--color-theme-700)"
25691
25688
  }
25692
25689
  }, function (_ref4) {
25693
25690
  var invalid = _ref4.invalid;
@@ -25723,7 +25720,7 @@
25723
25720
  });
25724
25721
  StyledTextareaSpan.displayName = "StyledTextareaSpan";
25725
25722
 
25726
- var _excluded$i = ["className", "variant", "weight", "disabled", "inputProps", "wrapRef", "children", "invalid"];
25723
+ var _excluded$i = ["className", "variant", "weight", "disabled", "inputProps", "wrapRef", "children", "invalid", "onMouseLeave"];
25727
25724
  var EditableContent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
25728
25725
  var className = _ref.className,
25729
25726
  _ref$variant = _ref.variant,
@@ -25735,19 +25732,40 @@
25735
25732
  wrapRef = _ref.wrapRef,
25736
25733
  children = _ref.children,
25737
25734
  invalid = _ref.invalid,
25735
+ onMouseLeave = _ref.onMouseLeave,
25738
25736
  props = _objectWithoutProperties(_ref, _excluded$i);
25739
25737
  var intInputRef = React.useRef(null);
25740
25738
  var handleRef = useForkRef(ref, intInputRef);
25739
+ var _useState = React.useState(false),
25740
+ _useState2 = _slicedToArray(_useState, 2),
25741
+ suppressHover = _useState2[0],
25742
+ setSuppressHover = _useState2[1];
25741
25743
  var handleBlur = React.useCallback(function (evt) {
25742
25744
  if (intInputRef !== null && intInputRef !== void 0 && intInputRef.current) {
25743
25745
  intInputRef.current.scrollLeft = 0;
25744
25746
  }
25745
25747
  typeof (inputProps === null || inputProps === void 0 ? void 0 : inputProps.onBlur) === "function" && (inputProps === null || inputProps === void 0 ? void 0 : inputProps.onBlur(evt));
25746
25748
  }, [inputProps]);
25749
+ var handleKeyDown = React.useCallback(function (evt) {
25750
+ if (evt.key === "Enter" || evt.key === "Escape") {
25751
+ setSuppressHover(true);
25752
+ }
25753
+ typeof (inputProps === null || inputProps === void 0 ? void 0 : inputProps.onKeyDown) === "function" && inputProps.onKeyDown(evt);
25754
+ }, [inputProps]);
25755
+ var handleFocus = React.useCallback(function (evt) {
25756
+ setSuppressHover(false);
25757
+ typeof (inputProps === null || inputProps === void 0 ? void 0 : inputProps.onFocus) === "function" && inputProps.onFocus(evt);
25758
+ }, [inputProps]);
25759
+ var handleMouseLeave = React.useCallback(function (evt) {
25760
+ setSuppressHover(false);
25761
+ typeof onMouseLeave === "function" && onMouseLeave(evt);
25762
+ }, [onMouseLeave]);
25747
25763
  return /*#__PURE__*/React__default["default"].createElement(StyledDiv, _extends({
25748
25764
  className: className,
25749
25765
  ref: wrapRef
25750
- }, props), /*#__PURE__*/React__default["default"].createElement(StyledSpan, {
25766
+ }, props, {
25767
+ onMouseLeave: handleMouseLeave
25768
+ }), /*#__PURE__*/React__default["default"].createElement(StyledSpan, {
25751
25769
  variant: variant,
25752
25770
  forwardedAs: "span",
25753
25771
  weight: weight,
@@ -25760,8 +25778,11 @@
25760
25778
  weight: weight,
25761
25779
  value: inputProps === null || inputProps === void 0 ? void 0 : inputProps.value,
25762
25780
  onBlur: handleBlur,
25781
+ onKeyDown: handleKeyDown,
25782
+ onFocus: handleFocus,
25763
25783
  disabled: disabled,
25764
25784
  "data-form-type": "other",
25785
+ "data-hover-suppressed": suppressHover ? "" : undefined,
25765
25786
  invalid: invalid
25766
25787
  })));
25767
25788
  });
@@ -27747,7 +27768,7 @@
27747
27768
  var StyledToolbar = styled__default["default"].div.withConfig({
27748
27769
  displayName: "Toolbarstyles__StyledToolbar",
27749
27770
  componentId: "sc-n5xxbc-0"
27750
- })(["box-sizing:border-box;background-color:var(--page-paper-main);border-radius:8px;border:1px solid var(--color-theme-300);box-shadow:0px 64px 64px rgba(0,0,0,0.06),0px 32px 32px rgba(0,0,0,0.03),0px 16px 16px rgba(0,0,0,0.02),0px 4px 4px rgba(0,0,0,0.02),0px 2px 2px rgba(0,0,0,0.02);bottom:24px;display:flex;left:50%;padding:12px 16px;position:fixed;transform:translateX(-50%);width:100%;max-width:800px;"]);
27771
+ })(["box-sizing:border-box;background-color:var(--page-paper-main);background-image:linear-gradient( var(--color-primary-300),var(--color-primary-300) );border-radius:8px;border:1px solid var(--color-primary);box-shadow:0px 64px 64px rgba(0,0,0,0.06),0px 32px 32px rgba(0,0,0,0.03),0px 16px 16px rgba(0,0,0,0.02),0px 4px 4px rgba(0,0,0,0.02),0px 2px 2px rgba(0,0,0,0.02);bottom:24px;display:flex;left:calc(50% + var(--toolbar-inline-offset,0px));padding:12px 16px;position:fixed;transform:translateX(-50%);width:100%;max-width:800px;"]);
27751
27772
 
27752
27773
  function Toolbar(_ref) {
27753
27774
  var _ref$open = _ref.open,