carbon-addons-iot-react 5.13.1 → 5.15.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.
- package/css/carbon-addons-iot-react.css +45 -0
- package/css/carbon-addons-iot-react.css.map +1 -1
- package/es/components/Button/Button.js +4 -1
- package/es/components/Card/Card.js +27 -5
- package/es/constants/CardPropTypes.js +5 -1
- package/lib/components/Button/Button.js +4 -1
- package/lib/components/Card/Card.js +27 -5
- package/lib/constants/CardPropTypes.js +5 -1
- package/lib/css/carbon-addons-iot-react.css +45 -0
- package/lib/css/carbon-addons-iot-react.css.map +1 -1
- package/lib/scss/components/Button/_button.scss +18 -0
- package/lib/scss/components/Card/_card-title.scss +11 -0
- package/lib/scss/components/Card/_card-toolbar.scss +12 -0
- package/package.json +1 -1
- package/scss/components/Button/_button.scss +18 -0
- package/scss/components/Card/_card-title.scss +11 -0
- package/scss/components/Card/_card-toolbar.scss +12 -0
- package/umd/carbon-addons-iot-react.js +36 -7
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
@use '@carbon/react/scss/components/button' as *;
|
|
6
6
|
@use '@carbon/react/scss/utilities/convert';
|
|
7
7
|
@use '../../globals/vars' as *;
|
|
8
|
+
@use '@carbon/styles/scss/components/button/mixins' as *;
|
|
8
9
|
|
|
9
10
|
.#{$iot-prefix}--btn {
|
|
10
11
|
.#{$prefix}--loading {
|
|
@@ -95,3 +96,20 @@
|
|
|
95
96
|
box-shadow: convert.to-rem(1px) 0 0 0 $button-separator;
|
|
96
97
|
}
|
|
97
98
|
}
|
|
99
|
+
|
|
100
|
+
// light colored button, to be used on dark backgrounds
|
|
101
|
+
.cds--btn--tertiary--light {
|
|
102
|
+
@include button-theme(transparent, $white, $white, $background-hover, $white, $background-active);
|
|
103
|
+
|
|
104
|
+
&:focus {
|
|
105
|
+
border-color: $white;
|
|
106
|
+
box-shadow: inset 0 0 0 $button-outline-width $white,
|
|
107
|
+
inset 0 0 0 $button-border-width $background-active;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
&:hover,
|
|
111
|
+
&:active {
|
|
112
|
+
background-color: $background-active;
|
|
113
|
+
border-color: $white;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
@@ -111,3 +111,14 @@ p.#{$iot-prefix}--card-title__title-text-tooltip-full-title {
|
|
|
111
111
|
.#{$iot-prefix}--card-heading-clickable {
|
|
112
112
|
cursor: pointer;
|
|
113
113
|
}
|
|
114
|
+
|
|
115
|
+
// Dark mode styles - make title and subtitle white
|
|
116
|
+
.#{$iot-prefix}--card--dark {
|
|
117
|
+
.#{$iot-prefix}--card--title--text {
|
|
118
|
+
color: $text-on-color;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.#{$iot-prefix}--card--subtitle--text {
|
|
122
|
+
color: $text-on-color;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
@@ -88,3 +88,15 @@
|
|
|
88
88
|
outline-offset: -2px;
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
|
+
|
|
92
|
+
.#{$iot-prefix}--card--dark .#{$iot-prefix}--card--toolbar button.#{$prefix}--overflow-menu svg {
|
|
93
|
+
fill: white;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// When overflow menu is open in dark mode, icon should be black (background becomes white)
|
|
97
|
+
.#{$iot-prefix}--card--dark
|
|
98
|
+
.#{$iot-prefix}--card--toolbar
|
|
99
|
+
button.#{$prefix}--overflow-menu.#{$prefix}--overflow-menu--open
|
|
100
|
+
svg {
|
|
101
|
+
fill: $icon-primary;
|
|
102
|
+
}
|
package/package.json
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
@use '@carbon/react/scss/components/button' as *;
|
|
6
6
|
@use '@carbon/react/scss/utilities/convert';
|
|
7
7
|
@use '../../globals/vars' as *;
|
|
8
|
+
@use '@carbon/styles/scss/components/button/mixins' as *;
|
|
8
9
|
|
|
9
10
|
.#{$iot-prefix}--btn {
|
|
10
11
|
.#{$prefix}--loading {
|
|
@@ -95,3 +96,20 @@
|
|
|
95
96
|
box-shadow: convert.to-rem(1px) 0 0 0 $button-separator;
|
|
96
97
|
}
|
|
97
98
|
}
|
|
99
|
+
|
|
100
|
+
// light colored button, to be used on dark backgrounds
|
|
101
|
+
.cds--btn--tertiary--light {
|
|
102
|
+
@include button-theme(transparent, $white, $white, $background-hover, $white, $background-active);
|
|
103
|
+
|
|
104
|
+
&:focus {
|
|
105
|
+
border-color: $white;
|
|
106
|
+
box-shadow: inset 0 0 0 $button-outline-width $white,
|
|
107
|
+
inset 0 0 0 $button-border-width $background-active;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
&:hover,
|
|
111
|
+
&:active {
|
|
112
|
+
background-color: $background-active;
|
|
113
|
+
border-color: $white;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
@@ -111,3 +111,14 @@ p.#{$iot-prefix}--card-title__title-text-tooltip-full-title {
|
|
|
111
111
|
.#{$iot-prefix}--card-heading-clickable {
|
|
112
112
|
cursor: pointer;
|
|
113
113
|
}
|
|
114
|
+
|
|
115
|
+
// Dark mode styles - make title and subtitle white
|
|
116
|
+
.#{$iot-prefix}--card--dark {
|
|
117
|
+
.#{$iot-prefix}--card--title--text {
|
|
118
|
+
color: $text-on-color;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.#{$iot-prefix}--card--subtitle--text {
|
|
122
|
+
color: $text-on-color;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
@@ -88,3 +88,15 @@
|
|
|
88
88
|
outline-offset: -2px;
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
|
+
|
|
92
|
+
.#{$iot-prefix}--card--dark .#{$iot-prefix}--card--toolbar button.#{$prefix}--overflow-menu svg {
|
|
93
|
+
fill: white;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// When overflow menu is open in dark mode, icon should be black (background becomes white)
|
|
97
|
+
.#{$iot-prefix}--card--dark
|
|
98
|
+
.#{$iot-prefix}--card--toolbar
|
|
99
|
+
button.#{$prefix}--overflow-menu.#{$prefix}--overflow-menu--open
|
|
100
|
+
svg {
|
|
101
|
+
fill: $icon-primary;
|
|
102
|
+
}
|
|
@@ -2139,7 +2139,7 @@
|
|
|
2139
2139
|
}
|
|
2140
2140
|
|
|
2141
2141
|
var _excluded$15 = ["children", "loading", "disabled", "className", "onClick", "kind", "recommended", "hasIconOnly", "selected", "testID", "testId"];
|
|
2142
|
-
var ButtonKinds$1 = ['primary', 'secondary', 'tertiary', 'ghost', 'danger', 'danger--primary', 'danger--ghost', 'danger--tertiary'];
|
|
2142
|
+
var ButtonKinds$1 = ['primary', 'secondary', 'tertiary', 'tertiary--light', 'ghost', 'danger', 'danger--primary', 'danger--ghost', 'danger--tertiary'];
|
|
2143
2143
|
var iotPrefix$2t = settings.iotPrefix;
|
|
2144
2144
|
var propTypes$2q = {
|
|
2145
2145
|
/** Show loading spinner, only new prop */
|
|
@@ -2264,6 +2264,9 @@
|
|
|
2264
2264
|
}, {
|
|
2265
2265
|
"value": "'tertiary'",
|
|
2266
2266
|
"computed": false
|
|
2267
|
+
}, {
|
|
2268
|
+
"value": "'tertiary--light'",
|
|
2269
|
+
"computed": false
|
|
2267
2270
|
}, {
|
|
2268
2271
|
"value": "'ghost'",
|
|
2269
2272
|
"computed": false
|
|
@@ -281242,7 +281245,11 @@ ${formatRule(Codicon.menuSubmenu)}
|
|
|
281242
281245
|
}),
|
|
281243
281246
|
/** If set to true it will render outside of the current DOM in a portal, otherwise render as a child */
|
|
281244
281247
|
renderDateDropdownInPortal: PropTypes.bool,
|
|
281245
|
-
extraHeaderContent: PropTypes.element
|
|
281248
|
+
extraHeaderContent: PropTypes.element,
|
|
281249
|
+
/** CSS gradient value to apply as the card background. */
|
|
281250
|
+
backgroundGradient: PropTypes.string,
|
|
281251
|
+
/** Theme for the card. Can be 'light' or 'dark' */
|
|
281252
|
+
theme: PropTypes.oneOf(['light', 'dark'])
|
|
281246
281253
|
};
|
|
281247
281254
|
|
|
281248
281255
|
/**
|
|
@@ -284593,7 +284600,7 @@ ${formatRule(Codicon.menuSubmenu)}
|
|
|
284593
284600
|
};
|
|
284594
284601
|
|
|
284595
284602
|
var _excluded$F = ["isSelected", "children", "dimensions", "id", "style", "className", "onScroll", "onMouseDown", "onMouseUp", "onTouchEnd", "onTouchStart", "onFocus", "onBlur", "tabIndex", "testID", "testId"],
|
|
284596
|
-
_excluded2$4 = ["size", "children", "title", "subtitle", "hasTitleWrap", "layout", "isLoading", "isEmpty", "isEditable", "isExpanded", "isLazyLoading", "isResizable", "resizeHandles", "error", "hideHeader", "hideTitle", "id", "tooltip", "titleTextTooltip", "timeRange", "timeRangeOptions", "onCardAction", "availableActions", "renderExpandIcon", "renderDateDropdownInPortal", "breakpoint", "i18n", "style", "className", "values", "testID", "testId", "contentClassName", "footerContent", "dateTimeMask", "extraActions", "padding", "overrides", "type", "data", "content", "extraHeaderContent", "timeZone", "shouldUseTranslatedLabels"];
|
|
284603
|
+
_excluded2$4 = ["size", "children", "title", "subtitle", "hasTitleWrap", "layout", "isLoading", "isEmpty", "isEditable", "isExpanded", "isLazyLoading", "isResizable", "resizeHandles", "error", "hideHeader", "hideTitle", "id", "tooltip", "titleTextTooltip", "timeRange", "timeRangeOptions", "onCardAction", "availableActions", "renderExpandIcon", "renderDateDropdownInPortal", "breakpoint", "i18n", "style", "className", "values", "testID", "testId", "contentClassName", "footerContent", "dateTimeMask", "extraActions", "padding", "overrides", "type", "data", "content", "extraHeaderContent", "timeZone", "shouldUseTranslatedLabels", "backgroundGradient", "theme"];
|
|
284597
284604
|
function ownKeys$1p(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
284598
284605
|
function _objectSpread$1n(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1p(Object(t), !0).forEach(function (r) { _defineProperty$d(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1p(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
284599
284606
|
var prefix$l = settings.prefix,
|
|
@@ -284743,6 +284750,7 @@ ${formatRule(Codicon.menuSubmenu)}
|
|
|
284743
284750
|
isExpanded: false,
|
|
284744
284751
|
/** performance option: only render the content of the card to the ReactDOM if the card is visible on screen */
|
|
284745
284752
|
isLazyLoading: false,
|
|
284753
|
+
theme: 'light',
|
|
284746
284754
|
/** For now we will hide the per card actions when we're editing */
|
|
284747
284755
|
availableActions: {
|
|
284748
284756
|
edit: false,
|
|
@@ -284811,7 +284819,8 @@ ${formatRule(Codicon.menuSubmenu)}
|
|
|
284811
284819
|
type: null,
|
|
284812
284820
|
data: null,
|
|
284813
284821
|
content: null,
|
|
284814
|
-
shouldUseTranslatedLabels: false
|
|
284822
|
+
shouldUseTranslatedLabels: false,
|
|
284823
|
+
backgroundGradient: null
|
|
284815
284824
|
};
|
|
284816
284825
|
|
|
284817
284826
|
/** Dumb component that renders the card basics */
|
|
@@ -284861,6 +284870,8 @@ ${formatRule(Codicon.menuSubmenu)}
|
|
|
284861
284870
|
extraHeaderContent = props.extraHeaderContent,
|
|
284862
284871
|
timeZone = props.timeZone,
|
|
284863
284872
|
shouldUseTranslatedLabels = props.shouldUseTranslatedLabels,
|
|
284873
|
+
backgroundGradient = props.backgroundGradient,
|
|
284874
|
+
theme = props.theme,
|
|
284864
284875
|
others = _objectWithoutProperties$4(props, _excluded2$4);
|
|
284865
284876
|
var effectiveTimezone = timeZone || dayjs$1.tz.guess();
|
|
284866
284877
|
dayjs$1.tz.setDefault(effectiveTimezone);
|
|
@@ -284992,11 +285003,15 @@ ${formatRule(Codicon.menuSubmenu)}
|
|
|
284992
285003
|
id: id,
|
|
284993
285004
|
dimensions: dimensions,
|
|
284994
285005
|
isExpanded: isExpanded,
|
|
284995
|
-
style: !isExpanded ? style
|
|
285006
|
+
style: !isExpanded ? _objectSpread$1n(_objectSpread$1n({}, style), backgroundGradient && {
|
|
285007
|
+
background: backgroundGradient
|
|
285008
|
+
}) : _objectSpread$1n({
|
|
284996
285009
|
height: 'calc(100% - 50px)',
|
|
284997
285010
|
width: 'calc(100% - 50px)'
|
|
284998
|
-
},
|
|
284999
|
-
|
|
285011
|
+
}, backgroundGradient && {
|
|
285012
|
+
background: backgroundGradient
|
|
285013
|
+
}),
|
|
285014
|
+
className: classnames("".concat(iotPrefix$1k, "--card"), "".concat(iotPrefix$1k, "--card--").concat(theme), className, _defineProperty$d({}, "".concat(iotPrefix$1k, "--card--resizing"), isResizing))
|
|
285000
285015
|
}), !hideHeader && !hideTitle && /*#__PURE__*/React$1.createElement(CardHeader
|
|
285001
285016
|
// TODO: remove deprecated testID prop in v3
|
|
285002
285017
|
, {
|
|
@@ -285175,6 +285190,13 @@ ${formatRule(Codicon.menuSubmenu)}
|
|
|
285175
285190
|
},
|
|
285176
285191
|
"required": false
|
|
285177
285192
|
},
|
|
285193
|
+
"theme": {
|
|
285194
|
+
"defaultValue": {
|
|
285195
|
+
"value": "'light'",
|
|
285196
|
+
"computed": false
|
|
285197
|
+
},
|
|
285198
|
+
"required": false
|
|
285199
|
+
},
|
|
285178
285200
|
"availableActions": {
|
|
285179
285201
|
"defaultValue": {
|
|
285180
285202
|
"value": "{\n edit: false,\n clone: false,\n delete: false,\n range: false,\n expand: false,\n settings: false,\n extra: false,\n}",
|
|
@@ -285370,6 +285392,13 @@ ${formatRule(Codicon.menuSubmenu)}
|
|
|
285370
285392
|
"computed": false
|
|
285371
285393
|
},
|
|
285372
285394
|
"required": false
|
|
285395
|
+
},
|
|
285396
|
+
"backgroundGradient": {
|
|
285397
|
+
"defaultValue": {
|
|
285398
|
+
"value": "null",
|
|
285399
|
+
"computed": false
|
|
285400
|
+
},
|
|
285401
|
+
"required": false
|
|
285373
285402
|
}
|
|
285374
285403
|
},
|
|
285375
285404
|
"composes": ["../../constants/CardPropTypes"]
|