carbon-addons-iot-react 4.1.21 → 4.1.22

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.
@@ -23,7 +23,7 @@ import React__default, { useMemo, useEffect } from 'react';
23
23
  import PropTypes from 'prop-types';
24
24
  import { ContentSwitcher, Switch, InlineNotification, InlineLoading, Tabs, TabList, Tab, TabPanels, TabPanel } from '@carbon/react';
25
25
  import update from 'immutability-helper';
26
- import { gray50, red50, green50, blue50 } from '@carbon/colors';
26
+ import { gray50, red50, green50, blue50, cyan50, magenta50, purple50, teal50, yellow50, orange50 } from '@carbon/colors';
27
27
  import warning from 'warning';
28
28
  import { ColorPropType, HotspotIconPropType } from '../../constants/SharedPropTypes.js';
29
29
  import ImageHotspots from '../ImageCard/ImageHotspots.js';
@@ -54,6 +54,24 @@ var selectableColors = [{
54
54
  }, {
55
55
  carbonColor: blue50,
56
56
  name: 'blue'
57
+ }, {
58
+ carbonColor: cyan50,
59
+ name: 'cyan'
60
+ }, {
61
+ carbonColor: magenta50,
62
+ name: 'magenta'
63
+ }, {
64
+ carbonColor: purple50,
65
+ name: 'purple'
66
+ }, {
67
+ carbonColor: teal50,
68
+ name: 'teal'
69
+ }, {
70
+ carbonColor: yellow50,
71
+ name: 'yellow'
72
+ }, {
73
+ carbonColor: orange50,
74
+ name: 'orange'
57
75
  }];
58
76
  var propTypes = {
59
77
  /** an object where the keys are available dimensions and the values are the values available for those dimensions
@@ -655,7 +673,7 @@ HotspotEditorModal.__docgenInfo = {
655
673
  },
656
674
  "backgroundColors": {
657
675
  "defaultValue": {
658
- "value": "[\n { carbonColor: gray50, name: 'gray' },\n { carbonColor: red50, name: 'red' },\n { carbonColor: green50, name: 'green' },\n { carbonColor: blue50, name: 'blue' },\n]",
676
+ "value": "[\n { carbonColor: gray50, name: 'gray' },\n { carbonColor: red50, name: 'red' },\n { carbonColor: green50, name: 'green' },\n { carbonColor: blue50, name: 'blue' },\n { carbonColor: cyan50, name: 'cyan' },\n { carbonColor: magenta50, name: 'magenta' },\n { carbonColor: purple50, name: 'purple' },\n { carbonColor: teal50, name: 'teal' },\n { carbonColor: yellow50, name: 'yellow' },\n { carbonColor: orange50, name: 'orange' },\n]",
659
677
  "computed": false
660
678
  },
661
679
  "description": "Array of selectable color objects for text hotspot background",
@@ -670,7 +688,7 @@ HotspotEditorModal.__docgenInfo = {
670
688
  },
671
689
  "borderColors": {
672
690
  "defaultValue": {
673
- "value": "[\n { carbonColor: gray50, name: 'gray' },\n { carbonColor: red50, name: 'red' },\n { carbonColor: green50, name: 'green' },\n { carbonColor: blue50, name: 'blue' },\n]",
691
+ "value": "[\n { carbonColor: gray50, name: 'gray' },\n { carbonColor: red50, name: 'red' },\n { carbonColor: green50, name: 'green' },\n { carbonColor: blue50, name: 'blue' },\n { carbonColor: cyan50, name: 'cyan' },\n { carbonColor: magenta50, name: 'magenta' },\n { carbonColor: purple50, name: 'purple' },\n { carbonColor: teal50, name: 'teal' },\n { carbonColor: yellow50, name: 'yellow' },\n { carbonColor: orange50, name: 'orange' },\n]",
674
692
  "computed": false
675
693
  },
676
694
  "description": "Array of selectable color objects for text hotspot border",
@@ -778,7 +796,7 @@ HotspotEditorModal.__docgenInfo = {
778
796
  },
779
797
  "fontColors": {
780
798
  "defaultValue": {
781
- "value": "[\n { carbonColor: gray50, name: 'gray' },\n { carbonColor: red50, name: 'red' },\n { carbonColor: green50, name: 'green' },\n { carbonColor: blue50, name: 'blue' },\n]",
799
+ "value": "[\n { carbonColor: gray50, name: 'gray' },\n { carbonColor: red50, name: 'red' },\n { carbonColor: green50, name: 'green' },\n { carbonColor: blue50, name: 'blue' },\n { carbonColor: cyan50, name: 'cyan' },\n { carbonColor: magenta50, name: 'magenta' },\n { carbonColor: purple50, name: 'purple' },\n { carbonColor: teal50, name: 'teal' },\n { carbonColor: yellow50, name: 'yellow' },\n { carbonColor: orange50, name: 'orange' },\n]",
782
800
  "computed": false
783
801
  },
784
802
  "description": "Array of selectable color objects for text hotspot font",
@@ -1183,4 +1201,4 @@ HotspotEditorModal.__docgenInfo = {
1183
1201
  };
1184
1202
  var HotspotEditorModal$1 = HotspotEditorModal;
1185
1203
 
1186
- export { HotspotEditorModal$1 as default };
1204
+ export { HotspotEditorModal$1 as default, selectableColors };
@@ -1,4 +1,5 @@
1
1
  import _merge from '../../../node_modules/lodash-es/merge.js';
2
+ import 'core-js/modules/es.array.concat.js';
2
3
  import 'core-js/modules/es.array.find.js';
3
4
  import 'core-js/modules/es.number.constructor.js';
4
5
  import 'core-js/modules/es.object.to-string.js';
@@ -6,14 +7,15 @@ import 'core-js/modules/es.string.bold.js';
6
7
  import 'core-js/modules/es.string.italics.js';
7
8
  import React__default from 'react';
8
9
  import PropTypes from 'prop-types';
9
- import { IconSwitch, NumberInput } from '@carbon/react';
10
+ import { unstable_FeatureFlags, IconSwitch, NumberInput } from '@carbon/react';
10
11
  import { settings } from '../../../constants/Settings.js';
11
12
  import ColorDropdown from '../../ColorDropdown/ColorDropdown.js';
12
13
  import Button from '../../Button/Button.js';
13
14
  import { isNumberValidForMinMax } from '../../../utils/componentUtilityFunctions.js';
14
15
  import { TextBold, TextItalic, TextUnderline, TrashCan, InformationFilled } from '@carbon/icons-react';
15
16
 
16
- var iotPrefix = settings.iotPrefix;
17
+ var iotPrefix = settings.iotPrefix,
18
+ prefix = settings.prefix;
17
19
  var colorPropType = PropTypes.shape({
18
20
  carbonColor: PropTypes.string,
19
21
  name: PropTypes.string
@@ -204,7 +206,11 @@ var HotspotTextStyleTab = function HotspotTextStyleTab(_ref) {
204
206
  onSubmit: preventFormSubmission,
205
207
  className: "".concat(iotPrefix, "--hotspot-text-style-tab__form")
206
208
  }, /*#__PURE__*/React__default.createElement("div", {
207
- className: "".concat(iotPrefix, "--hotspot-text-style-tab__text-style")
209
+ className: "".concat(iotPrefix, "--hotspot-text-style-tab__row")
210
+ }, /*#__PURE__*/React__default.createElement("div", {
211
+ className: "".concat(prefix, "--content-switcher ").concat(prefix, "--content-switcher--icon-only")
212
+ }, /*#__PURE__*/React__default.createElement(unstable_FeatureFlags, {
213
+ enableV12DynamicFloatingStyles: true
208
214
  }, /*#__PURE__*/React__default.createElement(IconSwitch, {
209
215
  disabled: hasNonEditableContent,
210
216
  onClick: function onClick() {
@@ -246,7 +252,7 @@ var HotspotTextStyleTab = function HotspotTextStyleTab(_ref) {
246
252
  renderIcon: TextUnderline,
247
253
  index: 2,
248
254
  light: light
249
- })), /*#__PURE__*/React__default.createElement("div", {
255
+ })))), /*#__PURE__*/React__default.createElement("div", {
250
256
  className: "".concat(iotPrefix, "--hotspot-text-style-tab__row")
251
257
  }, /*#__PURE__*/React__default.createElement(ColorDropdown, {
252
258
  disabled: hasNonEditableContent,
@@ -134,7 +134,7 @@ var ImageCardFormItems = function ImageCardFormItems(_ref) {
134
134
  handleCloseHotspotEditor();
135
135
  onChange(cardConfigWithHotspots);
136
136
  }, [handleCloseHotspotEditor, onChange]);
137
- return /*#__PURE__*/React__default.default.createElement(React__default.default.Fragment, null, isHotspotModalShowing ? /*#__PURE__*/React__default.default.createElement(HotspotEditorModal, {
137
+ return /*#__PURE__*/React__default.default.createElement(React__default.default.Fragment, null, isHotspotModalShowing ? /*#__PURE__*/React__default.default.createElement(HotspotEditorModal.default, {
138
138
  cardConfig: cardConfig,
139
139
  displayOption: (_cardConfig$content = cardConfig.content) === null || _cardConfig$content === void 0 ? void 0 : _cardConfig$content.displayOption,
140
140
  getValidDataItems: getValidDataItems,
@@ -1,5 +1,7 @@
1
1
  'use strict';
2
2
 
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
3
5
  var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
4
6
  var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
5
7
  var _asyncToGenerator = require('@babel/runtime/helpers/asyncToGenerator');
@@ -69,6 +71,24 @@ var selectableColors = [{
69
71
  }, {
70
72
  carbonColor: colors.blue50,
71
73
  name: 'blue'
74
+ }, {
75
+ carbonColor: colors.cyan50,
76
+ name: 'cyan'
77
+ }, {
78
+ carbonColor: colors.magenta50,
79
+ name: 'magenta'
80
+ }, {
81
+ carbonColor: colors.purple50,
82
+ name: 'purple'
83
+ }, {
84
+ carbonColor: colors.teal50,
85
+ name: 'teal'
86
+ }, {
87
+ carbonColor: colors.yellow50,
88
+ name: 'yellow'
89
+ }, {
90
+ carbonColor: colors.orange50,
91
+ name: 'orange'
72
92
  }];
73
93
  var propTypes = {
74
94
  /** an object where the keys are available dimensions and the values are the values available for those dimensions
@@ -670,7 +690,7 @@ HotspotEditorModal.__docgenInfo = {
670
690
  },
671
691
  "backgroundColors": {
672
692
  "defaultValue": {
673
- "value": "[\n { carbonColor: gray50, name: 'gray' },\n { carbonColor: red50, name: 'red' },\n { carbonColor: green50, name: 'green' },\n { carbonColor: blue50, name: 'blue' },\n]",
693
+ "value": "[\n { carbonColor: gray50, name: 'gray' },\n { carbonColor: red50, name: 'red' },\n { carbonColor: green50, name: 'green' },\n { carbonColor: blue50, name: 'blue' },\n { carbonColor: cyan50, name: 'cyan' },\n { carbonColor: magenta50, name: 'magenta' },\n { carbonColor: purple50, name: 'purple' },\n { carbonColor: teal50, name: 'teal' },\n { carbonColor: yellow50, name: 'yellow' },\n { carbonColor: orange50, name: 'orange' },\n]",
674
694
  "computed": false
675
695
  },
676
696
  "description": "Array of selectable color objects for text hotspot background",
@@ -685,7 +705,7 @@ HotspotEditorModal.__docgenInfo = {
685
705
  },
686
706
  "borderColors": {
687
707
  "defaultValue": {
688
- "value": "[\n { carbonColor: gray50, name: 'gray' },\n { carbonColor: red50, name: 'red' },\n { carbonColor: green50, name: 'green' },\n { carbonColor: blue50, name: 'blue' },\n]",
708
+ "value": "[\n { carbonColor: gray50, name: 'gray' },\n { carbonColor: red50, name: 'red' },\n { carbonColor: green50, name: 'green' },\n { carbonColor: blue50, name: 'blue' },\n { carbonColor: cyan50, name: 'cyan' },\n { carbonColor: magenta50, name: 'magenta' },\n { carbonColor: purple50, name: 'purple' },\n { carbonColor: teal50, name: 'teal' },\n { carbonColor: yellow50, name: 'yellow' },\n { carbonColor: orange50, name: 'orange' },\n]",
689
709
  "computed": false
690
710
  },
691
711
  "description": "Array of selectable color objects for text hotspot border",
@@ -793,7 +813,7 @@ HotspotEditorModal.__docgenInfo = {
793
813
  },
794
814
  "fontColors": {
795
815
  "defaultValue": {
796
- "value": "[\n { carbonColor: gray50, name: 'gray' },\n { carbonColor: red50, name: 'red' },\n { carbonColor: green50, name: 'green' },\n { carbonColor: blue50, name: 'blue' },\n]",
816
+ "value": "[\n { carbonColor: gray50, name: 'gray' },\n { carbonColor: red50, name: 'red' },\n { carbonColor: green50, name: 'green' },\n { carbonColor: blue50, name: 'blue' },\n { carbonColor: cyan50, name: 'cyan' },\n { carbonColor: magenta50, name: 'magenta' },\n { carbonColor: purple50, name: 'purple' },\n { carbonColor: teal50, name: 'teal' },\n { carbonColor: yellow50, name: 'yellow' },\n { carbonColor: orange50, name: 'orange' },\n]",
797
817
  "computed": false
798
818
  },
799
819
  "description": "Array of selectable color objects for text hotspot font",
@@ -1198,4 +1218,5 @@ HotspotEditorModal.__docgenInfo = {
1198
1218
  };
1199
1219
  var HotspotEditorModal$1 = HotspotEditorModal;
1200
1220
 
1201
- module.exports = HotspotEditorModal$1;
1221
+ exports.default = HotspotEditorModal$1;
1222
+ exports.selectableColors = selectableColors;
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var merge = require('../../../node_modules/lodash-es/merge.js');
4
+ require('core-js/modules/es.array.concat.js');
4
5
  require('core-js/modules/es.array.find.js');
5
6
  require('core-js/modules/es.number.constructor.js');
6
7
  require('core-js/modules/es.object.to-string.js');
@@ -20,7 +21,8 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
20
21
  var React__default = /*#__PURE__*/_interopDefault(React);
21
22
  var PropTypes__default = /*#__PURE__*/_interopDefault(PropTypes);
22
23
 
23
- var iotPrefix = Settings.settings.iotPrefix;
24
+ var iotPrefix = Settings.settings.iotPrefix,
25
+ prefix = Settings.settings.prefix;
24
26
  var colorPropType = PropTypes__default.default.shape({
25
27
  carbonColor: PropTypes__default.default.string,
26
28
  name: PropTypes__default.default.string
@@ -211,7 +213,11 @@ var HotspotTextStyleTab = function HotspotTextStyleTab(_ref) {
211
213
  onSubmit: preventFormSubmission,
212
214
  className: "".concat(iotPrefix, "--hotspot-text-style-tab__form")
213
215
  }, /*#__PURE__*/React__default.default.createElement("div", {
214
- className: "".concat(iotPrefix, "--hotspot-text-style-tab__text-style")
216
+ className: "".concat(iotPrefix, "--hotspot-text-style-tab__row")
217
+ }, /*#__PURE__*/React__default.default.createElement("div", {
218
+ className: "".concat(prefix, "--content-switcher ").concat(prefix, "--content-switcher--icon-only")
219
+ }, /*#__PURE__*/React__default.default.createElement(react.unstable_FeatureFlags, {
220
+ enableV12DynamicFloatingStyles: true
215
221
  }, /*#__PURE__*/React__default.default.createElement(react.IconSwitch, {
216
222
  disabled: hasNonEditableContent,
217
223
  onClick: function onClick() {
@@ -253,7 +259,7 @@ var HotspotTextStyleTab = function HotspotTextStyleTab(_ref) {
253
259
  renderIcon: iconsReact.TextUnderline,
254
260
  index: 2,
255
261
  light: light
256
- })), /*#__PURE__*/React__default.default.createElement("div", {
262
+ })))), /*#__PURE__*/React__default.default.createElement("div", {
257
263
  className: "".concat(iotPrefix, "--hotspot-text-style-tab__row")
258
264
  }, /*#__PURE__*/React__default.default.createElement(ColorDropdown, {
259
265
  disabled: hasNonEditableContent,
@@ -7274,30 +7274,6 @@ html[dir=rtl] .cds--list-box__label .iot--color-dropdown__item {
7274
7274
  padding-right: 5rem;
7275
7275
  background: var(--cds-field-02, #f4f4f4);
7276
7276
  }
7277
- .iot--hotspot-text-style-tab__text-style button:first-of-type,
7278
- .iot--hotspot-text-style-tab__text-style button:last-of-type {
7279
- border-radius: 0;
7280
- }
7281
- .iot--hotspot-text-style-tab__text-style button:first-of-type {
7282
- border-top-left-radius: 5px;
7283
- border-bottom-left-radius: 5px;
7284
- }
7285
- .iot--hotspot-text-style-tab__text-style button:last-of-type {
7286
- border-top-right-radius: 5px;
7287
- border-bottom-right-radius: 5px;
7288
- }
7289
- html[dir=rtl] .iot--hotspot-text-style-tab__text-style button:first-of-type,
7290
- html[dir=rtl] .iot--hotspot-text-style-tab__text-style button:last-of-type {
7291
- border-radius: 0;
7292
- }
7293
- html[dir=rtl] .iot--hotspot-text-style-tab__text-style button:first-of-type {
7294
- border-top-right-radius: 5px;
7295
- border-bottom-right-radius: 5px;
7296
- }
7297
- html[dir=rtl] .iot--hotspot-text-style-tab__text-style button:last-of-type {
7298
- border-top-left-radius: 5px;
7299
- border-bottom-left-radius: 5px;
7300
- }
7301
7277
  .iot--hotspot-text-style-tab__dropdown {
7302
7278
  width: 100%;
7303
7279
  }