@carbon/ibm-products 2.0.0-rc.3 → 2.0.0-rc.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (75) hide show
  1. package/css/index-full-carbon.css +63 -157
  2. package/css/index-full-carbon.css.map +1 -1
  3. package/css/index-full-carbon.min.css +3 -9
  4. package/css/index-full-carbon.min.css.map +1 -1
  5. package/css/index-without-carbon-released-only.css +8 -151
  6. package/css/index-without-carbon-released-only.css.map +1 -1
  7. package/css/index-without-carbon-released-only.min.css +3 -9
  8. package/css/index-without-carbon-released-only.min.css.map +1 -1
  9. package/css/index-without-carbon.css +63 -157
  10. package/css/index-without-carbon.css.map +1 -1
  11. package/css/index-without-carbon.min.css +3 -9
  12. package/css/index-without-carbon.min.css.map +1 -1
  13. package/css/index.css +63 -157
  14. package/css/index.css.map +1 -1
  15. package/css/index.min.css +3 -9
  16. package/css/index.min.css.map +1 -1
  17. package/es/components/AddSelect/AddSelectBody.js +2 -2
  18. package/es/components/CreateTearsheet/CreateTearsheet.js +8 -1
  19. package/es/components/CreateTearsheetNarrow/CreateTearsheetNarrow.js +2 -2
  20. package/es/components/Datagrid/Datagrid/DatagridContent.js +10 -5
  21. package/es/components/Datagrid/Datagrid/DatagridVirtualBody.js +2 -1
  22. package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/ButtonWrapper.js +3 -0
  23. package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/Columns.js +10 -9
  24. package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsModal.js +1 -2
  25. package/es/components/Datagrid/useInfiniteScroll.js +5 -2
  26. package/es/components/Datagrid/utils/getArgTypes.js +4 -0
  27. package/es/components/EditUpdateCards/EditUpdateCards.js +144 -0
  28. package/es/components/EditUpdateCards/index.js +7 -0
  29. package/es/components/PageHeader/PageHeader.js +3 -3
  30. package/es/components/PageHeader/PageHeaderTitle.js +3 -1
  31. package/es/components/SidePanel/SidePanel.js +44 -51
  32. package/es/components/SidePanel/motion/variants.js +45 -0
  33. package/es/components/index.js +2 -1
  34. package/es/global/js/hooks/useResetCreateComponent.js +6 -2
  35. package/es/global/js/package-settings.js +2 -1
  36. package/es/global/js/utils/getBezierValues.js +20 -0
  37. package/es/global/js/utils/getNumberOfHiddenSteps.js +19 -0
  38. package/es/global/js/utils/motionConstants.js +45 -0
  39. package/lib/components/AddSelect/AddSelectBody.js +2 -2
  40. package/lib/components/CreateTearsheet/CreateTearsheet.js +9 -1
  41. package/lib/components/CreateTearsheetNarrow/CreateTearsheetNarrow.js +2 -2
  42. package/lib/components/Datagrid/Datagrid/DatagridContent.js +9 -4
  43. package/lib/components/Datagrid/Datagrid/DatagridVirtualBody.js +2 -1
  44. package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/ButtonWrapper.js +3 -0
  45. package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/Columns.js +9 -8
  46. package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsModal.js +1 -2
  47. package/lib/components/Datagrid/useInfiniteScroll.js +5 -2
  48. package/lib/components/Datagrid/utils/getArgTypes.js +4 -0
  49. package/lib/components/EditUpdateCards/EditUpdateCards.js +152 -0
  50. package/lib/components/EditUpdateCards/index.js +13 -0
  51. package/lib/components/PageHeader/PageHeader.js +3 -3
  52. package/lib/components/PageHeader/PageHeaderTitle.js +3 -1
  53. package/lib/components/SidePanel/SidePanel.js +45 -50
  54. package/lib/components/SidePanel/motion/variants.js +55 -0
  55. package/lib/components/index.js +9 -1
  56. package/lib/global/js/hooks/useResetCreateComponent.js +7 -2
  57. package/lib/global/js/package-settings.js +2 -1
  58. package/lib/global/js/utils/getBezierValues.js +29 -0
  59. package/lib/global/js/utils/getNumberOfHiddenSteps.js +28 -0
  60. package/lib/global/js/utils/motionConstants.js +55 -0
  61. package/package.json +5 -3
  62. package/scss/components/AddSelect/_add-select.scss +2 -2
  63. package/scss/components/Datagrid/_storybook-styles.scss +4 -0
  64. package/scss/components/Datagrid/styles/_useInlineEdit.scss +20 -5
  65. package/scss/components/Datagrid/styles/addons/_CustomizeColumnsModal.scss +2 -0
  66. package/scss/components/EditUpdateCards/_carbon-imports.scss +9 -0
  67. package/scss/components/EditUpdateCards/_edit-update-cards.scss +85 -0
  68. package/scss/components/EditUpdateCards/_index-with-carbon.scss +9 -0
  69. package/scss/components/EditUpdateCards/_index.scss +8 -0
  70. package/scss/components/EditUpdateCards/_storybook-styles.scss +55 -0
  71. package/scss/components/PageHeader/_page-header.scss +4 -0
  72. package/scss/components/SidePanel/_side-panel.scss +2 -78
  73. package/scss/components/SidePanel/_storybook-styles.scss +6 -1
  74. package/scss/components/_index-with-carbon.scss +1 -0
  75. package/scss/components/_index.scss +1 -0
@@ -117,6 +117,12 @@ Object.defineProperty(exports, "EditTearsheetNarrow", {
117
117
  return _EditTearsheetNarrow.EditTearsheetNarrow;
118
118
  }
119
119
  });
120
+ Object.defineProperty(exports, "EditUpdateCards", {
121
+ enumerable: true,
122
+ get: function get() {
123
+ return _EditUpdateCards.EditUpdateCards;
124
+ }
125
+ });
120
126
  Object.defineProperty(exports, "EmptyState", {
121
127
  enumerable: true,
122
128
  get: function get() {
@@ -502,4 +508,6 @@ var _EditTearsheet = require("./EditTearsheet");
502
508
 
503
509
  var _EditTearsheetNarrow = require("./EditTearsheetNarrow");
504
510
 
505
- var _EditFullPage = require("./EditFullPage");
511
+ var _EditFullPage = require("./EditFullPage");
512
+
513
+ var _EditUpdateCards = require("./EditUpdateCards");
@@ -7,6 +7,8 @@ exports.useResetCreateComponent = void 0;
7
7
 
8
8
  var _react = require("react");
9
9
 
10
+ var _getNumberOfHiddenSteps = require("../utils/getNumberOfHiddenSteps");
11
+
10
12
  /**
11
13
  * Copyright IBM Corp. 2021, 2022
12
14
  *
@@ -21,6 +23,7 @@ var _react = require("react");
21
23
  * @param {object} useResetCreateComponent.previousState
22
24
  * @param {boolean} useResetCreateComponent.open
23
25
  * @param {Function} useResetCreateComponent.setCurrentStep
26
+ * @param {object} useResetCreateComponent.stepData
24
27
  * @param {number} useResetCreateComponent.initialStep
25
28
  * @param {number} useResetCreateComponent.totalSteps
26
29
  * @param {string} useResetCreateComponent.componentName
@@ -30,13 +33,15 @@ var useResetCreateComponent = function useResetCreateComponent(_ref) {
30
33
  previousState = _ref.previousState,
31
34
  open = _ref.open,
32
35
  setCurrentStep = _ref.setCurrentStep,
36
+ stepData = _ref.stepData,
33
37
  initialStep = _ref.initialStep,
34
38
  totalSteps = _ref.totalSteps,
35
39
  componentName = _ref.componentName;
36
40
  (0, _react.useEffect)(function () {
37
41
  if (!(previousState !== null && previousState !== void 0 && previousState.open) && open) {
38
42
  if (initialStep && totalSteps && Number(initialStep) <= Number(totalSteps) && Number(initialStep) > 0) {
39
- setCurrentStep(Number(initialStep));
43
+ var numberOfHiddenSteps = (0, _getNumberOfHiddenSteps.getNumberOfHiddenSteps)(stepData, initialStep);
44
+ setCurrentStep(Number(initialStep + numberOfHiddenSteps));
40
45
  } else {
41
46
  // default should be fist includedStep instead of just 1
42
47
  setCurrentStep(firstIncludedStep);
@@ -47,7 +52,7 @@ var useResetCreateComponent = function useResetCreateComponent(_ref) {
47
52
  console.warn("".concat(componentName, ": An invalid `initialStep` prop was supplied. The `initialStep` prop should be a number that is greater than 0 or less than or equal to the number of steps your ").concat(componentName, " has."));
48
53
  }
49
54
  }
50
- }, [firstIncludedStep, open, previousState, setCurrentStep, initialStep, totalSteps, componentName]);
55
+ }, [firstIncludedStep, open, previousState, setCurrentStep, stepData, initialStep, totalSteps, componentName]);
51
56
  };
52
57
 
53
58
  exports.useResetCreateComponent = useResetCreateComponent;
@@ -73,7 +73,8 @@ var defaults = {
73
73
  Datagrid: false,
74
74
  EditTearsheet: false,
75
75
  EditTearsheetNarrow: false,
76
- EditFullPage: false
76
+ EditFullPage: false,
77
+ EditUpdateCards: false
77
78
  /* new component flags here - comment used by generate CLI */
78
79
 
79
80
  },
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getBezierValues = void 0;
7
+
8
+ var _motion = require("@carbon/motion");
9
+
10
+ /**
11
+ * This function turns a cubic-bezier() string to an
12
+ * array of values that we can use with framer-motion
13
+ * @param {string} type - The carbon motion type, either 'standard', 'entrance', or 'exit'
14
+ * @param {string} mode - The carbon motion mode, either 'productive', or 'expressive'
15
+ */
16
+ var getBezierValues = function getBezierValues(type, mode) {
17
+ var cubicBezier = (0, _motion.motion)(type, mode);
18
+ var extractStringFromParens = /\(([^)]+)\)/;
19
+ var desiredBezierStrings = extractStringFromParens.exec(cubicBezier)[1];
20
+ var formattedDesiredBezierStrings = desiredBezierStrings.trim().split(',').map(Number);
21
+
22
+ if (Array.isArray(formattedDesiredBezierStrings)) {
23
+ return formattedDesiredBezierStrings;
24
+ }
25
+
26
+ return [];
27
+ };
28
+
29
+ exports.getBezierValues = getBezierValues;
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getNumberOfHiddenSteps = void 0;
7
+
8
+ /**
9
+ * Copyright IBM Corp. 2022, 2022
10
+ *
11
+ * This source code is licensed under the Apache-2.0 license found in the
12
+ * LICENSE file in the root directory of this source tree.
13
+ */
14
+ var getNumberOfHiddenSteps = function getNumberOfHiddenSteps(stepData, initialStep) {
15
+ var numberOfHiddenSteps = 0;
16
+ stepData.forEach(function (step, stepIndex) {
17
+ if (stepIndex + 1 > initialStep) {
18
+ return;
19
+ }
20
+
21
+ if (step.shouldIncludeStep === false) {
22
+ numberOfHiddenSteps += 1;
23
+ }
24
+ });
25
+ return numberOfHiddenSteps;
26
+ };
27
+
28
+ exports.getNumberOfHiddenSteps = getNumberOfHiddenSteps;
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.EASINGS = exports.DURATIONS = void 0;
7
+
8
+ var _getBezierValues = require("./getBezierValues");
9
+
10
+ var _motion = require("@carbon/motion");
11
+
12
+ /**
13
+ * Copyright IBM Corp. 2022, 2022
14
+ *
15
+ * This source code is licensed under the Apache-2.0 license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */
18
+ var cleanMotionValue = function cleanMotionValue(val) {
19
+ return parseInt(val) / 1000;
20
+ };
21
+
22
+ var DURATIONS = {
23
+ // Micro-interactions such as button and toggle
24
+ fast01: cleanMotionValue(_motion.fast01),
25
+ // '70ms'
26
+ // Micro-interactions such as fade
27
+ fast02: cleanMotionValue(_motion.fast02),
28
+ // '110ms'
29
+ // Micro-interactions, small expansion, short distance movements
30
+ moderate01: cleanMotionValue(_motion.moderate01),
31
+ // '150ms'
32
+ // Expansion, system communication, toast
33
+ moderate02: cleanMotionValue(_motion.moderate02),
34
+ // '240ms'
35
+ // Large expansion, important system notifications
36
+ slow01: cleanMotionValue(_motion.slow01),
37
+ // '400ms'
38
+ // Background dimming
39
+ slow02: cleanMotionValue(_motion.slow02) // '700ms'
40
+
41
+ };
42
+ exports.DURATIONS = DURATIONS;
43
+ var EASINGS = {
44
+ productive: {
45
+ entrance: (0, _getBezierValues.getBezierValues)('entrance', 'productive'),
46
+ standard: (0, _getBezierValues.getBezierValues)('standard', 'productive'),
47
+ exit: (0, _getBezierValues.getBezierValues)('exit', 'productive')
48
+ },
49
+ expressive: {
50
+ entrance: (0, _getBezierValues.getBezierValues)('entrance', 'expressive'),
51
+ standard: (0, _getBezierValues.getBezierValues)('standard', 'expressive'),
52
+ exit: (0, _getBezierValues.getBezierValues)('exit', 'expressive')
53
+ }
54
+ };
55
+ exports.EASINGS = EASINGS;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@carbon/ibm-products",
3
3
  "description": "Carbon for IBM Products",
4
- "version": "2.0.0-rc.3",
4
+ "version": "2.0.0-rc.5",
5
5
  "license": "Apache-2.0",
6
6
  "main": "lib/index.js",
7
7
  "module": "es/index.js",
@@ -36,11 +36,12 @@
36
36
  "access": "public"
37
37
  },
38
38
  "scripts": {
39
- "build": "run-s clean build-first build-all",
39
+ "build": "run-s clean build-first build-all build-css-update-maps",
40
40
  "build-all": "run-p 'build:*'",
41
41
  "build-first": "copyfiles 'src/**/*.scss' scss -u 1",
42
42
  "build:css-dev": "sass --style=expanded --load-path node_modules --load-path ../../node_modules scss:css",
43
43
  "build:css-min": "sass --style=compressed --load-path node_modules --load-path ../../node_modules scss/index.scss:css/index.min.css scss/index-full-carbon.scss:css/index-full-carbon.min.css scss/index-without-carbon.scss:css/index-without-carbon.min.css scss/index-without-carbon-released-only.scss:css/index-without-carbon-released-only.min.css",
44
+ "build-css-update-maps": "node ../../scripts/updateSourceMaps.js",
44
45
  "build:js-esm": "cross-env BABEL_ENV=esm yarn build:js:modules -d es",
45
46
  "build:js-cjs": "cross-env BABEL_ENV=cjs yarn build:js:modules -d lib",
46
47
  "build:js:modules": "babel src --ignore '**/__tests__','**/*.test.js','**/*.stories.js','src/utils/**/*'",
@@ -75,6 +76,7 @@
75
76
  "dependencies": {
76
77
  "@babel/runtime": "^7.18.9",
77
78
  "@carbon/telemetry": "^0.1.0",
79
+ "framer-motion": "^6.5.1",
78
80
  "immutability-helper": "^3.1.1",
79
81
  "react-dnd": "^15.1.2",
80
82
  "react-dnd-html5-backend": "^15.1.3",
@@ -92,5 +94,5 @@
92
94
  "react": "^16.8.6 || ^17.0.1",
93
95
  "react-dom": "^16.8.6 || ^17.0.1"
94
96
  },
95
- "gitHead": "5bffa40c7782ff89a267cd2f2f727b223a12ba50"
97
+ "gitHead": "53c78f2c4c8144b4fbedd9ba12c119c8bc2b8bda"
96
98
  }
@@ -484,7 +484,7 @@ button.#{$block-class}__global-filter-toggle {
484
484
  margin-top: $spacing-03;
485
485
  }
486
486
 
487
- .#{$carbon-prefix}--tooltip,
488
- .#{$carbon-prefix}--overflow-menu-options {
487
+ .#{$block-class} .#{$carbon-prefix}--tooltip,
488
+ .#{$block-class} .#{$carbon-prefix}--overflow-menu-options {
489
489
  z-index: 9000;
490
490
  }
@@ -93,3 +93,7 @@ $block-class: #{c4p-settings.$pkg-prefix}--datagrid;
93
93
  text-overflow: ellipsis;
94
94
  white-space: nowrap;
95
95
  }
96
+
97
+ .#{$block-class}-story__hidden-column-id-snippet {
98
+ padding-top: $spacing-07;
99
+ }
@@ -64,6 +64,10 @@ $row-heights: (
64
64
  }
65
65
  }
66
66
 
67
+ .#{variables.$block-class} {
68
+ --#{variables.$block-class}--grid-header-height: 0;
69
+ }
70
+
67
71
  .#{variables.$block-class}__inline-edit-cell {
68
72
  display: flex;
69
73
  height: 100%;
@@ -249,7 +253,9 @@ $row-heights: (
249
253
  bottom: 0;
250
254
  left: 0;
251
255
  width: 2px;
252
- height: calc(100% - 50px);
256
+ height: calc(
257
+ 100% - 50px - var(--#{variables.$block-class}--grid-header-height)
258
+ );
253
259
  background-color: $link-inverse;
254
260
  content: '';
255
261
  }
@@ -261,15 +267,16 @@ $row-heights: (
261
267
  right: 0;
262
268
  bottom: 0;
263
269
  width: 2px;
264
- height: calc(100% - 50px);
270
+ height: calc(
271
+ 100% - 50px - var(--#{variables.$block-class}--grid-header-height)
272
+ );
265
273
  background-color: $link-inverse;
266
274
  content: '';
267
275
  }
268
276
 
269
277
  .#{variables.$block-class}
270
278
  .#{variables.$block-class}__grid-container-grid-active
271
- .#{variables.$block-class}__table-grid-active
272
- thead::before {
279
+ .#{c4p-settings.$carbon-prefix}--data-table-content::before {
273
280
  position: absolute;
274
281
  z-index: 2;
275
282
  top: 0;
@@ -284,7 +291,9 @@ $row-heights: (
284
291
  .#{variables.$block-class}__grid-container-grid-active.#{variables.$block-class}__grid-container-grid-active--without-toolbar::before,
285
292
  .#{variables.$block-class}
286
293
  .#{variables.$block-class}__grid-container-grid-active.#{variables.$block-class}__grid-container-grid-active--without-toolbar::after {
287
- height: calc(100% - 2px);
294
+ height: calc(
295
+ 100% - 2px - var(--#{variables.$block-class}--grid-header-height)
296
+ );
288
297
  }
289
298
 
290
299
  .#{variables.$block-class}
@@ -294,6 +303,12 @@ $row-heights: (
294
303
  outline-offset: -2px;
295
304
  }
296
305
 
306
+ .#{variables.$block-class}
307
+ .#{variables.$block-class}__grid-container-inline-edit
308
+ .#{variables.$block-class}__table-container {
309
+ padding-top: $spacing-01;
310
+ }
311
+
297
312
  .#{variables.$block-class}
298
313
  .#{variables.$block-class}__inline-edit--outer-cell-button--invalid
299
314
  [data-invalid]
@@ -65,6 +65,7 @@
65
65
  .#{variables.$block-class}__customize-columns-select-all {
66
66
  display: flex;
67
67
  height: $spacing-09;
68
+ align-items: center;
68
69
  padding-left: $spacing-08;
69
70
  border-bottom: 1px solid $layer-active;
70
71
  background-color: $layer-01;
@@ -75,6 +76,7 @@
75
76
  .#{variables.$block-class}__customize-columns-select-all-selected {
76
77
  display: flex;
77
78
  height: $spacing-09;
79
+ align-items: center;
78
80
  padding-left: $spacing-08;
79
81
  border-bottom: 1px solid $layer-active;
80
82
  background-color: $layer-selected-01;
@@ -0,0 +1,9 @@
1
+ //
2
+ // Copyright IBM Corp. 2022, 2022
3
+ //
4
+ // This source code is licensed under the Apache-2.0 license found in the
5
+ // LICENSE file in the root directory of this source tree.
6
+ //
7
+
8
+ // Import any Carbon component styles used from EditUpdateCards in this file.
9
+ // EditUpdateCards uses the following Carbon components:
@@ -0,0 +1,85 @@
1
+ //
2
+ // Copyright IBM Corp. 2022, 2022
3
+ //
4
+ // This source code is licensed under the Apache-2.0 license found in the
5
+ // LICENSE file in the root directory of this source tree.
6
+ //
7
+
8
+ // Standard imports.
9
+
10
+ // Other Carbon settings.
11
+ // TODO: @import 'carbon-components/scss/globals/grid/grid'; if needed
12
+ @use '@carbon/colors/' as *;
13
+ @use '@carbon/motion/' as *;
14
+ @use '../../global/styles/project-settings' as c4p-settings;
15
+
16
+ // EditUpdateCards uses the following Carbon components:
17
+ // TODO: @import(s) of Carbon component styles used by EditUpdateCards
18
+
19
+ // EditUpdateCards uses the following Carbon for IBM Products components:
20
+ // TODO: @import(s) of IBM Products component styles used by EditUpdateCards
21
+
22
+ // Define all component styles in a mixin which is then exported using
23
+ // the Carbon import-once mechanism.
24
+ /* stylelint-disable max-nesting-depth */
25
+ $block-class: #{c4p-settings.$pkg-prefix}--edit-update-cards;
26
+
27
+ .#{$block-class} {
28
+ &##{$block-class}--edit {
29
+ /* Used id for overriding the SVG path fill */
30
+
31
+ .#{c4p-settings.$pkg-prefix}--card__header,
32
+ .#{c4p-settings.$pkg-prefix}--card__footer {
33
+ button {
34
+ &:hover {
35
+ // stylelint-disable-next-line carbon/theme-token-use
36
+ background-color: $blue-60-hover;
37
+ }
38
+
39
+ &:focus {
40
+ box-shadow: none;
41
+ }
42
+
43
+ svg {
44
+ path {
45
+ // stylelint-disable-next-line carbon/theme-token-use
46
+ fill: $white-0;
47
+ }
48
+ }
49
+
50
+ &.#{c4p-settings.$pkg-prefix}--loading {
51
+ &:hover {
52
+ background-color: transparent;
53
+ }
54
+ }
55
+ }
56
+ }
57
+ .#{c4p-settings.$pkg-prefix}--card__footer {
58
+ // stylelint-disable-next-line carbon/theme-token-use
59
+ background-color: $blue-60;
60
+ // stylelint-disable-next-line carbon/theme-token-use
61
+ color: $white-0;
62
+ }
63
+ .#{c4p-settings.$pkg-prefix}--loading {
64
+ animation-duration: $duration-slow-02;
65
+ animation-fill-mode: forwards;
66
+ animation-iteration-count: infinite;
67
+ animation-name: rotate;
68
+ animation-timing-function: motion(standard, productive);
69
+
70
+ &:hover {
71
+ background-color: transparent;
72
+ }
73
+ }
74
+ }
75
+ &:not(.#{$block-class}__actions-bottom) {
76
+ &##{$block-class}--edit {
77
+ .#{c4p-settings.$pkg-prefix}--card__header {
78
+ // stylelint-disable-next-line carbon/theme-token-use
79
+ background-color: $blue-60;
80
+ // stylelint-disable-next-line carbon/theme-token-use
81
+ color: $white-0;
82
+ }
83
+ }
84
+ }
85
+ }
@@ -0,0 +1,9 @@
1
+ //
2
+ // Copyright IBM Corp. 2022, 2022
3
+ //
4
+ // This source code is licensed under the Apache-2.0 license found in the
5
+ // LICENSE file in the root directory of this source tree.
6
+ //
7
+
8
+ @use './carbon-imports';
9
+ @use './edit-update-cards';
@@ -0,0 +1,8 @@
1
+ //
2
+ // Copyright IBM Corp. 2022, 2022
3
+ //
4
+ // This source code is licensed under the Apache-2.0 license found in the
5
+ // LICENSE file in the root directory of this source tree.
6
+ //
7
+
8
+ @use './edit-update-cards';
@@ -0,0 +1,55 @@
1
+ //
2
+ // Copyright IBM Corp. 2022, 2022
3
+ //
4
+ // This source code is licensed under the Apache-2.0 license found in the
5
+ // LICENSE file in the root directory of this source tree.
6
+ //
7
+
8
+ @use '@carbon/colors/' as *;
9
+ @use '@carbon/type/' as *;
10
+ @use '@carbon/styles/scss/spacing' as *;
11
+ @use '../../global/styles/project-settings' as c4p-settings;
12
+
13
+ // make the root full width to get a better idea of how the cards
14
+ // look in a real grid situation
15
+ /* stylelint-disable max-nesting-depth */
16
+ #root {
17
+ width: 100%;
18
+ }
19
+
20
+ $block-class: #{c4p-settings.$pkg-prefix}--edit-update-cards;
21
+
22
+ .#{$block-class} {
23
+ textarea,
24
+ input,
25
+ select {
26
+ width: 100%;
27
+ height: auto;
28
+ padding: 0;
29
+ // stylelint-disable-next-line
30
+ font-size: type-scale(3);
31
+ letter-spacing: 0;
32
+ // stylelint-disable-next-line carbon/type-token-use
33
+ line-height: 1.5;
34
+ }
35
+ }
36
+ .#{$block-class}--items {
37
+ margin-bottom: $spacing-06;
38
+
39
+ &:last-child {
40
+ margin-bottom: 0;
41
+ }
42
+ }
43
+ .#{$block-class}--icon-text {
44
+ display: flex;
45
+ align-items: center;
46
+
47
+ svg {
48
+ margin-right: $spacing-01;
49
+
50
+ path {
51
+ // stylelint-disable-next-line carbon/theme-token-use
52
+ fill: $green-50;
53
+ }
54
+ }
55
+ }
@@ -466,6 +466,10 @@ $right-section-alt-width: 100% - $left-section-alt-width;
466
466
  vertical-align: middle;
467
467
  }
468
468
 
469
+ .#{$block-class}__title-wrapper {
470
+ @include type.type-style('productive-heading-04');
471
+ }
472
+
469
473
  .#{$block-class}__page-actions {
470
474
  flex: 0 0 100%;
471
475
  margin-top: $spacing-05;
@@ -26,49 +26,6 @@
26
26
  $block-class: #{c4p-settings.$pkg-prefix}--side-panel;
27
27
  $action-set-block-class: #{c4p-settings.$pkg-prefix}--action-set;
28
28
 
29
- @mixin sidePanelEntranceRight($size: map-get($side-panel-sizes, md)) {
30
- @keyframes side-panel-entrance-right {
31
- 0% {
32
- opacity: 0;
33
- // stylelint-disable-next-line carbon/layout-token-use
34
- transform: translateX(#{$size}); // the size width of the side panel
35
- }
36
-
37
- 100% {
38
- opacity: 1;
39
- transform: translateX(0);
40
- }
41
- }
42
- }
43
-
44
- @mixin sidePanelEntranceLeft($size: map-get($side-panel-sizes, md)) {
45
- @keyframes side-panel-entrance-left {
46
- 0% {
47
- opacity: 0;
48
- // stylelint-disable-next-line carbon/layout-token-use
49
- transform: translateX(-#{$size}); // the size width of the side panel
50
- }
51
-
52
- 100% {
53
- opacity: 1;
54
- transform: translateX(0);
55
- }
56
- }
57
- }
58
-
59
- @mixin sidePanelEntrance(
60
- $placement: 'right',
61
- $size: map-get($side-panel-sizes, md)
62
- ) {
63
- width: $size;
64
- max-width: 100%;
65
- @if $placement == right {
66
- @include sidePanelEntranceRight($size);
67
- } @else {
68
- @include sidePanelEntranceLeft($size);
69
- }
70
- }
71
-
72
29
  @mixin setPanelSize($size: map-get($side-panel-sizes, md)) {
73
30
  width: $size;
74
31
  max-width: 100%;
@@ -93,32 +50,6 @@ $action-set-block-class: #{c4p-settings.$pkg-prefix}--action-set;
93
50
  -webkit-line-clamp: 2;
94
51
  }
95
52
 
96
- @keyframes side-panel-exit-left {
97
- 0% {
98
- opacity: 1;
99
- transform: translateX(0);
100
- }
101
-
102
- 100% {
103
- opacity: 0;
104
- // stylelint-disable-next-line carbon/layout-token-use
105
- transform: translateX(calc(-1 * #{map-get($side-panel-sizes, md)}));
106
- }
107
- }
108
-
109
- @keyframes side-panel-exit-right {
110
- 0% {
111
- opacity: 1;
112
- transform: translateX(0);
113
- }
114
-
115
- 100% {
116
- opacity: 0;
117
- // stylelint-disable-next-line carbon/layout-token-use
118
- transform: translateX(map-get($side-panel-sizes, md));
119
- }
120
- }
121
-
122
53
  .#{$block-class}__container {
123
54
  --#{$block-class}--subtitle-opacity: 1;
124
55
  --#{$block-class}--title-container-height: 0;
@@ -140,7 +71,6 @@ $action-set-block-class: #{c4p-settings.$pkg-prefix}--action-set;
140
71
  box-sizing: border-box;
141
72
  background-color: $layer-01;
142
73
  color: $text-primary;
143
- transition: transform $duration-moderate-02 motion(standard);
144
74
  @each $size, $size_value in $side-panel-sizes {
145
75
  &.#{$block-class}__container--#{$size} {
146
76
  @include setPanelSize($size_value);
@@ -152,14 +82,10 @@ $action-set-block-class: #{c4p-settings.$pkg-prefix}--action-set;
152
82
  }
153
83
  }
154
84
  &.#{$block-class}__container-right-placement.#{$block-class}__container--#{$size} {
155
- @include sidePanelEntrance(right, $size_value);
156
-
157
85
  right: 0;
158
86
  border-left: 1px solid $border-subtle-02;
159
87
  }
160
88
  &.#{$block-class}__container-left-placement.#{$block-class}__container--#{$size} {
161
- @include sidePanelEntrance(left, $size_value);
162
-
163
89
  left: 0;
164
90
  border-right: 1px solid $border-subtle-02;
165
91
  }
@@ -283,7 +209,7 @@ $action-set-block-class: #{c4p-settings.$pkg-prefix}--action-set;
283
209
  // stylelint-disable-next-line carbon/layout-token-use
284
210
  top: calc(
285
211
  var(--#{$block-class}--title-text-height) +
286
- var(--#{$block-class}--label-text-height) + #{$spacing-09}
212
+ var(--#{$block-class}--label-text-height)
287
213
  );
288
214
  background-color: $layer-01;
289
215
  }
@@ -303,7 +229,6 @@ $action-set-block-class: #{c4p-settings.$pkg-prefix}--action-set;
303
229
 
304
230
  .#{$block-class}__title-container.#{$block-class}__title-container--no-title-animation {
305
231
  position: fixed;
306
- top: $spacing-09;
307
232
  height: calc(
308
233
  var(--#{$block-class}--title-text-height) +
309
234
  var(--#{$block-class}--label-text-height)
@@ -358,7 +283,7 @@ $action-set-block-class: #{c4p-settings.$pkg-prefix}--action-set;
358
283
  // stylelint-disable-next-line carbon/layout-token-use
359
284
  top: calc(
360
285
  var(--#{$block-class}--title-text-height) +
361
- var(--#{$block-class}--subtitle-container-height) + #{$spacing-09}
286
+ var(--#{$block-class}--subtitle-container-height)
362
287
  );
363
288
  width: 100%;
364
289
  border-bottom: 1px solid $layer-active-01;
@@ -533,5 +458,4 @@ $action-set-block-class: #{c4p-settings.$pkg-prefix}--action-set;
533
458
  width: 100%;
534
459
  height: 100%;
535
460
  background-color: $overlay;
536
- transition: background-color $duration-moderate-02 motion(standard);
537
461
  }
@@ -1,5 +1,5 @@
1
1
  //
2
- // Copyright IBM Corp. 2020, 2021
2
+ // Copyright IBM Corp. 2020, 2022
3
3
  //
4
4
  // This source code is licensed under the Apache-2.0 license found in the
5
5
  // LICENSE file in the root directory of this source tree.
@@ -7,6 +7,7 @@
7
7
 
8
8
  @use '@carbon/styles/scss/theme' as *;
9
9
  @use '@carbon/styles/scss/spacing' as *;
10
+ @use '@carbon/themes/scss/themes';
10
11
  @use '@carbon/styles/scss/type';
11
12
 
12
13
  $story-prefix: side-panel-stories__;
@@ -38,3 +39,7 @@ $story-prefix: side-panel-stories__;
38
39
  margin: $spacing-05 0 $spacing-04;
39
40
  }
40
41
  }
42
+
43
+ .#{$story-prefix}header {
44
+ @include theme(themes.$g100);
45
+ }
@@ -45,3 +45,4 @@
45
45
  @use './InlineEdit/index-with-carbon' as *;
46
46
  @use './DataSpreadsheet/index-with-carbon' as *;
47
47
  @use './Datagrid/index-with-carbon' as *;
48
+ @use './EditUpdateCards/index-with-carbon' as *;