@carbon/ibm-products 2.26.0 → 2.27.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (109) hide show
  1. package/css/index-full-carbon.css +517 -56
  2. package/css/index-full-carbon.css.map +1 -1
  3. package/css/index-full-carbon.min.css +1 -1
  4. package/css/index-full-carbon.min.css.map +1 -1
  5. package/css/index-without-carbon-released-only.css +32 -14
  6. package/css/index-without-carbon-released-only.css.map +1 -1
  7. package/css/index-without-carbon-released-only.min.css +1 -1
  8. package/css/index-without-carbon-released-only.min.css.map +1 -1
  9. package/css/index-without-carbon.css +517 -56
  10. package/css/index-without-carbon.css.map +1 -1
  11. package/css/index-without-carbon.min.css +1 -1
  12. package/css/index-without-carbon.min.css.map +1 -1
  13. package/css/index.css +488 -48
  14. package/css/index.css.map +1 -1
  15. package/css/index.min.css +1 -1
  16. package/css/index.min.css.map +1 -1
  17. package/es/components/BigNumbers/BigNumbers.d.ts +11 -0
  18. package/es/components/BigNumbers/BigNumbers.js +238 -0
  19. package/es/components/BigNumbers/constants.d.ts +13 -0
  20. package/es/components/BigNumbers/constants.js +67 -0
  21. package/es/components/BigNumbers/index.d.ts +1 -0
  22. package/es/components/DataSpreadsheet/DataSpreadsheetBody.js +4 -3
  23. package/es/components/DataSpreadsheet/DataSpreadsheetHeader.js +3 -2
  24. package/es/components/DataSpreadsheet/utils/checkForHoldingKey.d.ts +1 -0
  25. package/es/components/DataSpreadsheet/utils/checkForHoldingKey.js +17 -0
  26. package/es/components/Datagrid/Datagrid/Datagrid.js +9 -2
  27. package/es/components/Datagrid/Datagrid/DatagridContent.d.ts +3 -1
  28. package/es/components/Datagrid/Datagrid/DatagridContent.js +6 -2
  29. package/es/components/Datagrid/Datagrid/DatagridHeaderRow.js +8 -4
  30. package/es/components/Datagrid/Datagrid/DatagridToolbar.d.ts +10 -1
  31. package/es/components/Datagrid/Datagrid/DatagridToolbar.js +21 -4
  32. package/es/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.js +32 -9
  33. package/es/components/Datagrid/Datagrid/addons/Filtering/constants.d.ts +3 -1
  34. package/es/components/Datagrid/Datagrid/addons/Filtering/constants.js +4 -1
  35. package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.js +35 -3
  36. package/es/components/Datagrid/Datagrid/addons/stateReducer.js +1 -1
  37. package/es/components/Datagrid/useSelectAllToggle.js +5 -3
  38. package/es/components/SidePanel/SidePanel.js +13 -6
  39. package/es/components/SidePanel/motion/variants.d.ts +39 -12
  40. package/es/components/SidePanel/motion/variants.js +42 -11
  41. package/es/components/StringFormatter/StringFormatter.d.ts +6 -0
  42. package/es/components/StringFormatter/StringFormatter.js +79 -0
  43. package/es/components/StringFormatter/index.d.ts +1 -0
  44. package/es/components/StringFormatter/utils/enums.d.ts +14 -0
  45. package/es/components/StringFormatter/utils/enums.js +23 -0
  46. package/es/components/Tearsheet/TearsheetShell.js +10 -4
  47. package/es/components/UserAvatar/UserAvatar.js +58 -42
  48. package/es/components/index.d.ts +2 -0
  49. package/es/global/js/hooks/index.d.ts +1 -0
  50. package/es/global/js/hooks/useIsomorphicEffect.d.ts +2 -0
  51. package/es/global/js/hooks/useIsomorphicEffect.js +14 -0
  52. package/es/global/js/package-settings.d.ts +2 -0
  53. package/es/global/js/package-settings.js +2 -0
  54. package/es/index.js +2 -0
  55. package/es/settings.d.ts +2 -0
  56. package/lib/components/BigNumbers/BigNumbers.d.ts +11 -0
  57. package/lib/components/BigNumbers/BigNumbers.js +244 -0
  58. package/lib/components/BigNumbers/constants.d.ts +13 -0
  59. package/lib/components/BigNumbers/constants.js +76 -0
  60. package/lib/components/BigNumbers/index.d.ts +1 -0
  61. package/lib/components/DataSpreadsheet/DataSpreadsheetBody.js +4 -3
  62. package/lib/components/DataSpreadsheet/DataSpreadsheetHeader.js +3 -2
  63. package/lib/components/DataSpreadsheet/utils/checkForHoldingKey.d.ts +1 -0
  64. package/lib/components/DataSpreadsheet/utils/checkForHoldingKey.js +21 -0
  65. package/lib/components/Datagrid/Datagrid/Datagrid.js +9 -2
  66. package/lib/components/Datagrid/Datagrid/DatagridContent.d.ts +3 -1
  67. package/lib/components/Datagrid/Datagrid/DatagridContent.js +6 -2
  68. package/lib/components/Datagrid/Datagrid/DatagridHeaderRow.js +8 -4
  69. package/lib/components/Datagrid/Datagrid/DatagridToolbar.d.ts +10 -1
  70. package/lib/components/Datagrid/Datagrid/DatagridToolbar.js +20 -3
  71. package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.js +30 -7
  72. package/lib/components/Datagrid/Datagrid/addons/Filtering/constants.d.ts +3 -1
  73. package/lib/components/Datagrid/Datagrid/addons/Filtering/constants.js +4 -0
  74. package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.js +33 -1
  75. package/lib/components/Datagrid/Datagrid/addons/stateReducer.js +1 -1
  76. package/lib/components/Datagrid/useSelectAllToggle.js +4 -2
  77. package/lib/components/SidePanel/SidePanel.js +11 -4
  78. package/lib/components/SidePanel/motion/variants.d.ts +39 -12
  79. package/lib/components/SidePanel/motion/variants.js +42 -10
  80. package/lib/components/StringFormatter/StringFormatter.d.ts +6 -0
  81. package/lib/components/StringFormatter/StringFormatter.js +85 -0
  82. package/lib/components/StringFormatter/index.d.ts +1 -0
  83. package/lib/components/StringFormatter/utils/enums.d.ts +14 -0
  84. package/lib/components/StringFormatter/utils/enums.js +27 -0
  85. package/lib/components/Tearsheet/TearsheetShell.js +10 -4
  86. package/lib/components/UserAvatar/UserAvatar.js +58 -42
  87. package/lib/components/index.d.ts +2 -0
  88. package/lib/global/js/hooks/index.d.ts +1 -0
  89. package/lib/global/js/hooks/useIsomorphicEffect.d.ts +2 -0
  90. package/lib/global/js/hooks/useIsomorphicEffect.js +18 -0
  91. package/lib/global/js/package-settings.d.ts +2 -0
  92. package/lib/global/js/package-settings.js +2 -0
  93. package/lib/index.js +10 -0
  94. package/lib/settings.d.ts +2 -0
  95. package/package.json +7 -7
  96. package/scss/components/BigNumbers/_big-numbers.scss +151 -0
  97. package/scss/components/BigNumbers/_carbon-imports.scss +11 -0
  98. package/scss/components/BigNumbers/_index-with-carbon.scss +9 -0
  99. package/scss/components/BigNumbers/_index.scss +8 -0
  100. package/scss/components/FullPageError/_full-page-error.scss +2 -2
  101. package/scss/components/SidePanel/_side-panel.scss +1 -1
  102. package/scss/components/StringFormatter/_carbon-imports.scss +10 -0
  103. package/scss/components/StringFormatter/_index-with-carbon.scss +9 -0
  104. package/scss/components/StringFormatter/_index.scss +8 -0
  105. package/scss/components/StringFormatter/_string-formatter.scss +97 -0
  106. package/scss/components/Tearsheet/_tearsheet.scss +34 -2
  107. package/scss/components/UserAvatar/_user-avatar.scss +40 -0
  108. package/scss/components/_index-with-carbon.scss +2 -0
  109. package/scss/components/_index.scss +2 -0
@@ -0,0 +1,11 @@
1
+ //
2
+ // Copyright IBM Corp. 2024, 2024
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 BigNumbers in this file.
9
+ // BigNumbers uses the following Carbon components:
10
+ @use '@carbon/react/scss/components/skeleton-styles';
11
+ @use '@carbon/react/scss/components/tooltip';
@@ -0,0 +1,9 @@
1
+ //
2
+ // Copyright IBM Corp. 2024, 2024
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 './big-numbers';
@@ -0,0 +1,8 @@
1
+ //
2
+ // Copyright IBM Corp. 2024, 2024
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 './big-numbers';
@@ -47,9 +47,9 @@ $block-class: #{c4p-settings.$pkg-prefix}--full-page-error;
47
47
  .#{$block-class}__error-svg-container {
48
48
  display: flex;
49
49
  height: 100%;
50
- margin: $spacing-03 $spacing-03 $spacing-11 $spacing-03;
50
+ padding: $spacing-03 $spacing-03 $spacing-11 $spacing-03;
51
51
  @include breakpoint(md) {
52
- margin: auto $spacing-03 $spacing-11 $spacing-03;
52
+ padding: auto $spacing-03 $spacing-11 $spacing-03;
53
53
  }
54
54
  }
55
55
 
@@ -353,7 +353,7 @@ $action-set-block-class: #{c4p-settings.$pkg-prefix}--action-set;
353
353
  }
354
354
 
355
355
  .#{$block-class}__slug-and-close {
356
- position: fixed;
356
+ position: absolute;
357
357
  z-index: 10; /* must be higher than title container border bottom */
358
358
  top: 0;
359
359
  right: 0;
@@ -0,0 +1,10 @@
1
+ //
2
+ // Copyright IBM Corp. 2024, 2024
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 StringFormatter in this file.
9
+ // StringFormatter uses the following Carbon components:
10
+ @use '@carbon/react/scss/components/tooltip';
@@ -0,0 +1,9 @@
1
+ //
2
+ // Copyright IBM Corp. 2024, 2024
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 './string-formatter';
@@ -0,0 +1,8 @@
1
+ //
2
+ // Copyright IBM Corp. 2024, 2024
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 './string-formatter';
@@ -0,0 +1,97 @@
1
+ //
2
+ // Copyright IBM Corp. 2024, 2024
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
+ @use '../../global/styles/project-settings' as c4p-settings;
10
+ @use '../../global/styles/mixins';
11
+ @use '@carbon/styles/scss/type';
12
+ @use '@carbon/styles/scss/spacing' as *;
13
+ // Other Carbon settings if needed
14
+ // TODO: @use '@carbon/styles/scss/grid';
15
+ // or
16
+ // TODO: @use '@carbon/react/scss/grid';
17
+
18
+ // StringFormatter uses the following Carbon for IBM Products components:
19
+ // TODO: @use(s) of IBM Products component styles used by StringFormatter
20
+
21
+ // The block part of our conventional BEM class names (blockClass__E--M).
22
+ $block-class: #{c4p-settings.$pkg-prefix}--string-formatter;
23
+ $popover-block-class: #{c4p-settings.$carbon-prefix}--popover;
24
+
25
+ .#{$block-class} {
26
+ display: inline-block;
27
+ text-align: left;
28
+ }
29
+
30
+ .#{$block-class}--content {
31
+ display: inline-block;
32
+ text-align: left;
33
+ }
34
+
35
+ .#{$block-class}--truncate {
36
+ display: -webkit-box;
37
+ overflow: hidden;
38
+ max-width: 80ch;
39
+ -webkit-box-orient: vertical;
40
+ -webkit-line-clamp: 1;
41
+ }
42
+
43
+ .#{$block-class}__tooltip > button {
44
+ border-width: 0;
45
+ color: currentColor;
46
+ font-size: inherit;
47
+ font-weight: inherit;
48
+ line-height: inherit;
49
+ }
50
+
51
+ .#{$popover-block-class} {
52
+ max-width: $spacing-05;
53
+ margin: 0 auto;
54
+ }
55
+
56
+ .#{$block-class} .#{$popover-block-class}-content {
57
+ max-inline-size: 20rem;
58
+ }
59
+
60
+ .#{$block-class} .#{$popover-block-class}--left .#{$popover-block-class},
61
+ .#{$block-class} .#{$popover-block-class}--left-bottom .#{$popover-block-class},
62
+ .#{$block-class} .#{$popover-block-class}--left-top .#{$popover-block-class} {
63
+ margin: 0;
64
+ }
65
+
66
+ .#{$block-class} .#{$popover-block-class}--right .#{$popover-block-class},
67
+ .#{$block-class}
68
+ .#{$popover-block-class}--right-bottom
69
+ .#{$popover-block-class},
70
+ .#{$block-class} .#{$popover-block-class}--right-top .#{$popover-block-class} {
71
+ margin-right: 0;
72
+ margin-left: auto;
73
+ }
74
+
75
+ .#{$block-class} .#{$popover-block-class}--top .#{$popover-block-class}-caret,
76
+ .#{$block-class}
77
+ .#{$popover-block-class}--top-left
78
+ .#{$popover-block-class}-caret,
79
+ .#{$block-class}
80
+ .#{$popover-block-class}--top-right
81
+ .#{$popover-block-class}-caret {
82
+ /* stylelint-disable-next-line declaration-no-important */
83
+ inset-block-start: -1px !important;
84
+ }
85
+
86
+ .#{$block-class}
87
+ .#{$popover-block-class}--bottom
88
+ .#{$popover-block-class}-caret,
89
+ .#{$block-class}
90
+ .#{$popover-block-class}--bottom-left
91
+ .#{$popover-block-class}-caret,
92
+ .#{$block-class}
93
+ .#{$popover-block-class}--bottom-right
94
+ .#{$popover-block-class}-caret {
95
+ /* stylelint-disable-next-line declaration-no-important */
96
+ inset-block-end: -1px !important;
97
+ }
@@ -93,6 +93,22 @@ $motion-duration: $duration-moderate-02;
93
93
  transform: translate3d(0, calc(min(95vh, 500px)), 0);
94
94
  }
95
95
 
96
+ &.#{$block-class}.#{$block-class}.#{$block-class}.#{$block-class}--has-slug
97
+ .#{$block-class}__container {
98
+ border: 1px solid transparent;
99
+ /* override carbon ai removing background gradient */
100
+ background: linear-gradient(to top, var(--cds-layer), var(--cds-layer))
101
+ padding-box,
102
+ linear-gradient(
103
+ to bottom,
104
+ var(--cds-ai-border-start, #78a9ff),
105
+ var(--cds-ai-border-end, #d0e2ff)
106
+ )
107
+ border-box,
108
+ linear-gradient(to top, var(--cds-layer), var(--cds-layer)) border-box;
109
+ box-shadow: 0 4px 10px 2px $ai-drop-shadow;
110
+ }
111
+
96
112
  // extra specificity to ensure this transition overrides the carbon default
97
113
  &.#{$block-class}.#{$block-class} .#{$block-class}__container {
98
114
  transition: transform $motion-duration motion(entrance, expressive),
@@ -223,8 +239,14 @@ $motion-duration: $duration-moderate-02;
223
239
  }
224
240
 
225
241
  &.#{$block-class}--wide
242
+ .#{$block-class}__header.#{$block-class}__header--with-close-icon,
243
+ &.#{$block-class}--has-slug .#{$block-class}__header.#{$block-class}__header {
244
+ padding-right: $spacing-11;
245
+ }
246
+
247
+ &.#{$block-class}--wide.#{$block-class}--has-slug
226
248
  .#{$block-class}__header.#{$block-class}__header--with-close-icon {
227
- padding-right: $spacing-10;
249
+ margin-right: $spacing-09;
228
250
  }
229
251
 
230
252
  &.#{$block-class}--narrow .#{$block-class}__header-description {
@@ -292,6 +314,10 @@ $motion-duration: $duration-moderate-02;
292
314
  flex-grow: 1;
293
315
  }
294
316
 
317
+ &.#{$block-class}--has-slug .#{$block-class}__main {
318
+ @include utilities.callout-gradient('default', 0);
319
+ }
320
+
295
321
  &.#{$block-class}--wide .#{$block-class}__content {
296
322
  // Revert background color overridden by Carbon's modal - https://github.com/carbon-design-system/carbon/blob/main/packages/styles/scss/components/modal/_modal.scss#L54
297
323
  .#{$carbon-prefix}--pagination,
@@ -320,7 +346,8 @@ $motion-duration: $duration-moderate-02;
320
346
  .#{$carbon-prefix}--dropdown--light .#{$carbon-prefix}--dropdown-list,
321
347
  /* stylelint-disable-next-line prettier/prettier */
322
348
  .#{$carbon-prefix}--number--light input[type='number'],
323
- .#{$carbon-prefix}--date-picker--light .#{$carbon-prefix}--date-picker__input {
349
+ .#{$carbon-prefix}--date-picker--light
350
+ .#{$carbon-prefix}--date-picker__input {
324
351
  background-color: $field-02;
325
352
  }
326
353
  }
@@ -340,4 +367,9 @@ $motion-duration: $duration-moderate-02;
340
367
  &.#{$block-class}--wide .#{$block-class}__buttons {
341
368
  background: $background;
342
369
  }
370
+
371
+ &.#{$block-class}--has-slug:not(.#{$block-class}--has-close)
372
+ .#{$carbon-prefix}--slug {
373
+ inset-inline-end: 0;
374
+ }
343
375
  }
@@ -10,6 +10,8 @@
10
10
  @use '../../global/styles/mixins';
11
11
  @use '@carbon/colors' as *;
12
12
  @use '@carbon/styles/scss/theme' as *;
13
+ @use '@carbon/styles/scss/spacing' as *;
14
+ @use '@carbon/styles/scss/type';
13
15
 
14
16
  // Other Carbon settings if needed
15
17
  // TODO: @use '@carbon/styles/scss/grid';
@@ -23,6 +25,20 @@
23
25
 
24
26
  $block-class: #{$pkg-prefix}--user-avatar;
25
27
 
28
+ $sizes: (
29
+ xl: $spacing-10,
30
+ lg: $spacing-09,
31
+ md: $spacing-07,
32
+ sm: $spacing-06,
33
+ );
34
+
35
+ @mixin size($size) {
36
+ $_size: map-get($sizes, $size);
37
+
38
+ width: $_size;
39
+ height: $_size;
40
+ }
41
+
26
42
  .#{$block-class} {
27
43
  position: relative;
28
44
  display: flex;
@@ -32,10 +48,15 @@ $block-class: #{$pkg-prefix}--user-avatar;
32
48
  justify-content: center;
33
49
  border: 0.5px solid transparent;
34
50
  border-radius: 100%;
51
+ color: $text-inverse;
35
52
  outline: none;
36
53
  outline-offset: 3px;
37
54
  }
38
55
 
56
+ .#{$block-class} svg {
57
+ color: $icon-inverse;
58
+ }
59
+
39
60
  .#{$block-class}__tooltip {
40
61
  &:focus-within .#{$block-class} {
41
62
  // stylelint-disable-next-line carbon/theme-token-use
@@ -55,3 +76,22 @@ $block-class: #{$pkg-prefix}--user-avatar;
55
76
  .#{$block-class}--dark-cyan {
56
77
  @include setBgColor($cyan-60);
57
78
  }
79
+ .#{$block-class}--xl {
80
+ @include size('xl');
81
+ @include type.type-style('heading-04');
82
+ }
83
+
84
+ .#{$block-class}--lg {
85
+ @include size('lg');
86
+ @include type.type-style('heading-03');
87
+ }
88
+
89
+ .#{$block-class}--md {
90
+ @include size('md');
91
+ @include type.type-style('body-compact-01');
92
+ }
93
+
94
+ .#{$block-class}--sm {
95
+ @include size('sm');
96
+ @include type.type-style('label-01');
97
+ }
@@ -47,6 +47,7 @@
47
47
  @use './Datagrid/index-with-carbon' as *;
48
48
  @use './EditUpdateCards/index-with-carbon' as *;
49
49
  @use './SimpleHeader/index-with-carbon' as *;
50
+ @use './BigNumbers/index-with-carbon' as *;
50
51
  @use './TruncatedList/index-with-carbon' as *;
51
52
  @use './InterstitialScreen/index-with-carbon' as *;
52
53
  @use './InterstitialScreenView/index-with-carbon' as *;
@@ -61,4 +62,5 @@
61
62
  @use './DelimitedList/index-with-carbon' as *;
62
63
  @use './FullPageError/index-with-carbon' as *;
63
64
  @use './SearchBar/index-with-carbon' as *;
65
+ @use './StringFormatter/index-with-carbon' as *;
64
66
  @use './UserAvatar/index-with-carbon' as *;
@@ -62,6 +62,7 @@
62
62
  @use './Guidebanner';
63
63
  @use './InlineTip';
64
64
  @use './NonLinearReading';
65
+ @use './BigNumbers';
65
66
  @use './TruncatedList';
66
67
  @use './InterstitialScreen';
67
68
  @use './InterstitialScreenView';
@@ -69,4 +70,5 @@
69
70
  @use './DelimitedList';
70
71
  @use './FullPageError';
71
72
  @use './SearchBar';
73
+ @use './StringFormatter';
72
74
  @use './UserAvatar';