@commercetools-uikit/localized-rich-text-input 15.13.2 → 15.14.0

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.
@@ -75,11 +75,27 @@ var getEditorLanguageLabelBorderColor = function getEditorLanguageLabelBorderCol
75
75
  return "1px solid ".concat(props.isReadOnly ? designSystem.designTokens.borderColorForInputWhenReadonly : designSystem.designTokens.borderColorForInputWhenDisabled);
76
76
  };
77
77
 
78
+ var getBackgroundColor = function getBackgroundColor(props) {
79
+ if (props.isDisabled) {
80
+ return designSystem.designTokens.backgroundColorForInputWhenDisabled;
81
+ }
82
+
83
+ if (props.isReadOnly) {
84
+ return designSystem.designTokens.backgroundColorForInputWhenDisabled;
85
+ }
86
+
87
+ return designSystem.designTokens.backgroundColorForInput;
88
+ };
89
+
78
90
  var EditorLanguageLabel = /*#__PURE__*/_styled__default["default"]("label", {
79
91
  target: "ew063c2"
80
- } )("white-space:nowrap;flex:0;color:", designSystem.designTokens.fontColorForInputWhenDisabled, ";line-height:calc(\n ", designSystem.designTokens.sizeHeightInput, " - 2 * ", designSystem.designTokens.borderRadius1, "\n );background-color:", designSystem.designTokens.backgroundColorForInputWhenDisabled, ";border-top-left-radius:", designSystem.designTokens.borderRadiusForInput, ";border-bottom-left-radius:", designSystem.designTokens.borderRadiusForInput, ";border:", function (props) {
92
+ } )("white-space:nowrap;flex:0;color:", designSystem.designTokens.fontColorForInputWhenDisabled, ";line-height:calc(\n ", designSystem.designTokens.sizeHeightInput, " - 2 * ", designSystem.designTokens.borderRadius1, "\n );background-color:", function (props) {
93
+ return getBackgroundColor(props);
94
+ }, ";border-top-left-radius:", designSystem.designTokens.borderRadiusForInput, ";border-bottom-left-radius:", designSystem.designTokens.borderRadiusForInput, ";border:", function (props) {
81
95
  return getEditorLanguageLabelBorderColor(props);
82
- }, ";padding:", designSystem.designTokens.paddingForLocalizedRichTextInputLabel, ";transition:border-color ", designSystem.designTokens.transitionStandard, ",background-color ", designSystem.designTokens.transitionStandard, ",color ", designSystem.designTokens.transitionStandard, ";border-right:0;box-shadow:none;appearance:none;cursor:inherit;" + ("" ));
96
+ }, ";padding:", designSystem.designTokens.paddingForLocalizedRichTextInputLabel, ";transition:border-color ", designSystem.designTokens.transitionStandard, ",background-color ", designSystem.designTokens.transitionStandard, ",color ", designSystem.designTokens.transitionStandard, ";border-right:0;box-shadow:none;appearance:none;display:", function (props) {
97
+ return props.isNewTheme && 'flex';
98
+ }, ";align-items:center;cursor:inherit;" + ("" ));
83
99
 
84
100
  var EditorWrapper = /*#__PURE__*/_styled__default["default"]("div", {
85
101
  target: "ew063c1"
@@ -142,6 +158,10 @@ var _ref = {
142
158
  var Editor = /*#__PURE__*/react.forwardRef(function (props, forwardedRef) {
143
159
  var intl = reactIntl.useIntl();
144
160
  var ref = react.useRef();
161
+
162
+ var _useTheme = designSystem.useTheme(),
163
+ isNewTheme = _useTheme.isNewTheme;
164
+
145
165
  var createEditorWithPlugins = pipe__default["default"](slateReact.withReact, slateHistory.withHistory); // eslint-disable-next-line react-hooks/exhaustive-deps
146
166
 
147
167
  var editor = react.useMemo(function () {
@@ -229,7 +249,9 @@ var Editor = /*#__PURE__*/react.forwardRef(function (props, forwardedRef) {
229
249
  onChange: props.onChange,
230
250
  children: [jsxRuntime.jsx(EditorLanguageLabel, {
231
251
  htmlFor: props.id,
252
+ isDisabled: props.isDisabled,
232
253
  isReadOnly: props.isReadOnly,
254
+ isNewTheme: isNewTheme,
233
255
  children: jsxRuntime.jsx(Text__default["default"].Detail, {
234
256
  tone: "secondary",
235
257
  children: props.language.toUpperCase()
@@ -623,7 +645,7 @@ LocalizedRichTextInput.isTouched = localizedUtils.isTouched;
623
645
  var LocalizedRichTextInput$1 = LocalizedRichTextInput;
624
646
 
625
647
  // NOTE: This string will be replaced on build time with the package version.
626
- var version = "15.13.2";
648
+ var version = "15.14.0";
627
649
 
628
650
  exports["default"] = LocalizedRichTextInput$1;
629
651
  exports.version = version;