@carbon/styles 0.16.2 → 1.0.0-rc.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.
Files changed (54) hide show
  1. package/package.json +15 -10
  2. package/scss/__tests__/__snapshots__/config-test.js.snap +30 -1
  3. package/scss/__tests__/type-test.js +0 -1
  4. package/scss/_breakpoint.scss +2 -1
  5. package/scss/_config.scss +9 -2
  6. package/scss/_spacing.scss +1 -1
  7. package/scss/_theme.scss +4 -4
  8. package/scss/_themes.scss +2 -1
  9. package/scss/components/accordion/_accordion.scss +1 -1
  10. package/scss/components/aspect-ratio/_aspect-ratio.scss +2 -2
  11. package/scss/components/breadcrumb/_breadcrumb.scss +1 -1
  12. package/scss/components/button/_button.scss +1 -5
  13. package/scss/components/button/_tokens.scss +1 -0
  14. package/scss/components/code-snippet/_code-snippet.scss +32 -47
  15. package/scss/components/content-switcher/_content-switcher.scss +0 -2
  16. package/scss/components/copy-button/_copy-button.scss +0 -59
  17. package/scss/components/data-table/_data-table.scss +2 -164
  18. package/scss/components/data-table/action/_data-table-action.scss +2 -19
  19. package/scss/components/data-table/expandable/_data-table-expandable.scss +0 -2
  20. package/scss/components/data-table/sort/_data-table-sort.scss +1 -28
  21. package/scss/components/dropdown/_dropdown.scss +0 -1
  22. package/scss/components/file-uploader/_file-uploader.scss +3 -3
  23. package/scss/components/modal/_modal.scss +1 -1
  24. package/scss/components/notification/_actionable-notification.scss +58 -19
  25. package/scss/components/notification/_inline-notification.scss +9 -21
  26. package/scss/components/notification/_toast-notification.scss +29 -58
  27. package/scss/components/notification/_tokens.scss +2 -1
  28. package/scss/components/overflow-menu/_overflow-menu.scss +5 -5
  29. package/scss/components/pagination/_unstable_pagination.scss +1 -1
  30. package/scss/components/popover/_popover.scss +0 -8
  31. package/scss/components/progress-bar/_progress-bar.scss +21 -0
  32. package/scss/components/progress-indicator/_progress-indicator.scss +5 -5
  33. package/scss/components/radio-button/_radio-button.scss +2 -10
  34. package/scss/components/search/_search.scss +6 -0
  35. package/scss/components/tabs/_tabs.scss +1 -1
  36. package/scss/components/tag/_tokens.scss +1 -0
  37. package/scss/components/text-input/_text-input.scss +7 -22
  38. package/scss/components/tile/_tile.scss +60 -29
  39. package/scss/components/time-picker/_time-picker.scss +0 -3
  40. package/scss/components/toggletip/_toggletip.scss +1 -2
  41. package/scss/components/treeview/_treeview.scss +1 -1
  42. package/scss/components/ui-shell/content/_content.scss +0 -1
  43. package/scss/fonts/__tests__/__snapshots__/fonts-test.js.snap +269 -0
  44. package/scss/fonts/__tests__/fonts-test.js +55 -0
  45. package/scss/fonts/_src.scss +42 -31
  46. package/scss/grid/_css-grid.scss +11 -0
  47. package/scss/grid/_flexbox.scss +1 -1
  48. package/scss/grid/_index.scss +7 -2
  49. package/scss/grid/_mixins.scss +9 -0
  50. package/scss/type/_reset.scss +1 -1
  51. package/scss/utilities/_component-tokens.scss +2 -1
  52. package/scss/utilities/_convert.scss +2 -4
  53. package/scss/utilities/_high-contrast-mode.scss +2 -4
  54. package/scss/grid/_config.scss +0 -18
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@carbon/styles",
3
3
  "description": "Styles for the Carbon Design System",
4
- "version": "0.16.2",
4
+ "version": "1.0.0-rc.0",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
7
7
  "type": "git",
@@ -24,22 +24,27 @@
24
24
  "access": "public"
25
25
  },
26
26
  "peerDependencies": {
27
- "sass": "^1.32.12"
27
+ "sass": "^1.33.0"
28
28
  },
29
29
  "dependencies": {
30
- "@carbon/colors": "^10.37.1",
30
+ "@carbon/colors": "^11.0.0-rc.0",
31
31
  "@carbon/feature-flags": "^0.7.0",
32
- "@carbon/grid": "^10.43.1",
33
- "@carbon/layout": "^10.37.1",
34
- "@carbon/motion": "^10.29.0",
35
- "@carbon/themes": "^10.53.2",
36
- "@carbon/type": "^10.43.2",
32
+ "@carbon/grid": "^11.0.0-rc.0",
33
+ "@carbon/layout": "^11.0.0-rc.0",
34
+ "@carbon/motion": "^11.0.0-rc.0",
35
+ "@carbon/themes": "^11.0.0-rc.0",
36
+ "@carbon/type": "^11.0.0-rc.0",
37
37
  "@ibm/plex": "6.0.0-next.6"
38
38
  },
39
39
  "devDependencies": {
40
- "@carbon/test-utils": "^10.21.1",
40
+ "@carbon/test-utils": "^10.22.0-rc.0",
41
41
  "css": "^3.0.0",
42
42
  "sass": "^1.45.0"
43
43
  },
44
- "gitHead": "9b11eecab91c41ae4ffda711c5e1f631f2fb33db"
44
+ "sideEffects": [
45
+ "index.scss",
46
+ "scss/**/*.scss",
47
+ "scss/**/*.css"
48
+ ],
49
+ "gitHead": "e4894776a4996c10bfc8f9a724532a25966aa622"
45
50
  }
@@ -8,8 +8,37 @@ Object {
8
8
  "flex-grid-columns": 16,
9
9
  "font-display": "swap",
10
10
  "font-path": "~@ibm/plex",
11
+ "grid-breakpoints": Object {
12
+ "lg": Object {
13
+ "columns": 16,
14
+ "margin": "1rem",
15
+ "width": "66rem",
16
+ },
17
+ "max": Object {
18
+ "columns": 16,
19
+ "margin": "1.5rem",
20
+ "width": "99rem",
21
+ },
22
+ "md": Object {
23
+ "columns": 8,
24
+ "margin": "1rem",
25
+ "width": "42rem",
26
+ },
27
+ "sm": Object {
28
+ "columns": 4,
29
+ "margin": 0,
30
+ "width": "20rem",
31
+ },
32
+ "xlg": Object {
33
+ "columns": 16,
34
+ "margin": "1rem",
35
+ "width": "82rem",
36
+ },
37
+ },
38
+ "grid-gutter": "2rem",
39
+ "grid-gutter-condensed": "0.0625rem",
11
40
  "prefix": "cds",
41
+ "use-akamai-cdn": false,
12
42
  "use-flexbox-grid": false,
13
- "use-google-fonts": false,
14
43
  }
15
44
  `;
@@ -40,7 +40,6 @@ describe('@carbon/styles/scss/type', () => {
40
40
  });
41
41
  expect(api.variables).toMatchInlineSnapshot(`
42
42
  Array [
43
- "caption-01",
44
43
  "label-01",
45
44
  "helper-text-01",
46
45
  "body-short-01",
@@ -5,5 +5,6 @@
5
5
  // LICENSE file in the root directory of this source tree.
6
6
  //
7
7
 
8
- @forward '@carbon/grid/scss/modules/breakpoint'
8
+ @use './config';
9
+ @forward '@carbon/grid/scss/breakpoint'
9
10
  show breakpoint, breakpoint-between, breakpoint-down, breakpoint-up;
package/scss/_config.scss CHANGED
@@ -36,11 +36,11 @@ $font-display: 'swap' !default;
36
36
  /// @group config
37
37
  $font-path: '~@ibm/plex' !default;
38
38
 
39
- /// Specify if IBM Plex should be provided by Google Fonts
39
+ /// Specify if IBM Plex should be provided by the IBM Akamai CDN
40
40
  /// @access public
41
41
  /// @type String
42
42
  /// @group config
43
- $use-google-fonts: false !default;
43
+ $use-akamai-cdn: false !default;
44
44
 
45
45
  /// The value used to prefix selectors and CSS Custom Properties across the
46
46
  /// codebase
@@ -59,3 +59,10 @@ $flex-grid-columns: 16 !default;
59
59
  /// @type Boolean
60
60
  /// @group config
61
61
  $use-flexbox-grid: false !default;
62
+
63
+ @forward '@carbon/grid/scss/config'
64
+ hide $prefix, $flex-grid-columns
65
+ with (
66
+ $prefix: $prefix,
67
+ $flex-grid-columns: $flex-grid-columns,
68
+ );
@@ -5,7 +5,7 @@
5
5
  // LICENSE file in the root directory of this source tree.
6
6
  //
7
7
 
8
- @forward '@carbon/layout/scss/modules/spacing'
8
+ @forward '@carbon/layout/scss/spacing'
9
9
  show
10
10
  $spacing,
11
11
  $spacing-01,
package/scss/_theme.scss CHANGED
@@ -6,18 +6,18 @@
6
6
  //
7
7
 
8
8
  @use './config' as *;
9
- @use '@carbon/themes/scss/modules/config' with (
9
+ @use '@carbon/themes/scss/config' with (
10
10
  $prefix: $prefix,
11
11
  );
12
12
  @use './compat/themes' as compat;
13
13
  @use './themes';
14
14
 
15
- @forward '@carbon/themes/scss/modules/theme' with (
15
+ @forward '@carbon/themes/scss/theme' with (
16
16
  $fallback: themes.$white !default,
17
17
  $theme: compat.$white !default,
18
18
  );
19
- @forward '@carbon/themes/scss/modules/tokens';
20
- @use '@carbon/themes/scss/modules/tokens';
19
+ @forward '@carbon/themes/scss/tokens';
20
+ @use '@carbon/themes/scss/tokens';
21
21
  @use './utilities/custom-property';
22
22
 
23
23
  // Layer sets
package/scss/_themes.scss CHANGED
@@ -5,4 +5,5 @@
5
5
  // LICENSE file in the root directory of this source tree.
6
6
  //
7
7
 
8
- @forward '@carbon/themes/scss/modules/themes' show $white, $g10, $g90, $g100;
8
+ @use './config';
9
+ @forward '@carbon/themes/scss/themes' show $white, $g10, $g90, $g100;
@@ -5,8 +5,8 @@
5
5
  // LICENSE file in the root directory of this source tree.
6
6
  //
7
7
 
8
- @use '../../breakpoint' as *;
9
8
  @use '../../config' as *;
9
+ @use '../../breakpoint' as *;
10
10
  @use '../../motion' as *;
11
11
  @use '../../theme' as *;
12
12
  @use '../../spacing' as *;
@@ -15,7 +15,7 @@
15
15
  /// @type List
16
16
  /// @access public
17
17
  /// @group @carbon/grid
18
- $carbon--aspect-ratios: (
18
+ $aspect-ratios: (
19
19
  (16, 9),
20
20
  (9, 16),
21
21
  (2, 1),
@@ -39,7 +39,7 @@ $carbon--aspect-ratios: (
39
39
  /// @param {Number} $height height from an aspect ratio
40
40
  /// @access private
41
41
  /// @group @carbon/grid
42
- @mixin aspect-ratio($aspect-ratios: $carbon--aspect-ratios) {
42
+ @mixin aspect-ratio($aspect-ratios: $aspect-ratios) {
43
43
  .#{$prefix}--aspect-ratio {
44
44
  position: relative;
45
45
  }
@@ -5,8 +5,8 @@
5
5
  // LICENSE file in the root directory of this source tree.
6
6
  //
7
7
 
8
- @use '../../breakpoint' as *;
9
8
  @use '../../config' as *;
9
+ @use '../../breakpoint' as *;
10
10
  @use '../../motion' as *;
11
11
  @use '../../spacing' as *;
12
12
  @use '../../theme' as *;
@@ -5,9 +5,9 @@
5
5
  // LICENSE file in the root directory of this source tree.
6
6
  //
7
7
 
8
+ @use '../../config' as *;
8
9
  @use 'vars' as *;
9
10
  @use 'mixins' as *;
10
- @use '../../config' as *;
11
11
  @use '../../spacing' as *;
12
12
  @use '../../theme' as *;
13
13
  @use '../../type' as *;
@@ -219,8 +219,6 @@
219
219
  color: $text-on-color;
220
220
  }
221
221
 
222
- // TODO: deprecate single dash tertiary
223
- &-tertiary,
224
222
  &--tertiary {
225
223
  @include button-theme(
226
224
  transparent,
@@ -259,8 +257,6 @@
259
257
  }
260
258
  }
261
259
 
262
- // TODO: deprecate single dash ghost
263
- &-ghost,
264
260
  &--ghost {
265
261
  @include button-theme(
266
262
  transparent,
@@ -6,6 +6,7 @@
6
6
  //
7
7
 
8
8
  @use 'sass:map';
9
+ @use '../../config';
9
10
  @use '../../themes';
10
11
  @use '../../utilities/component-tokens';
11
12
 
@@ -67,7 +67,7 @@ $copy-btn-feedback: $background-inverse !default;
67
67
  position: relative;
68
68
  display: inline;
69
69
  padding: 0;
70
- border: 2px solid transparent;
70
+ border: 1px solid transparent;
71
71
  background-color: $layer;
72
72
  border-radius: 4px;
73
73
  color: $text-primary;
@@ -82,7 +82,7 @@ $copy-btn-feedback: $background-inverse !default;
82
82
  }
83
83
 
84
84
  &:focus {
85
- border: 2px solid $focus;
85
+ border: 1px solid $focus;
86
86
  outline: none;
87
87
  }
88
88
 
@@ -90,6 +90,8 @@ $copy-btn-feedback: $background-inverse !default;
90
90
  @include tooltip--caret;
91
91
 
92
92
  display: none;
93
+
94
+ border: none;
93
95
  }
94
96
 
95
97
  .#{$prefix}--copy-btn__feedback {
@@ -101,8 +103,6 @@ $copy-btn-feedback: $background-inverse !default;
101
103
  margin: auto;
102
104
  clip: auto;
103
105
  }
104
-
105
- @include tooltip--placement('icon', 'bottom', 'center');
106
106
  }
107
107
 
108
108
  .#{$prefix}--snippet--inline.#{$prefix}--copy-btn--animating::before,
@@ -257,12 +257,9 @@ $copy-btn-feedback: $background-inverse !default;
257
257
  transition: all $duration-fast-01 motion(standard, productive);
258
258
  }
259
259
 
260
- .#{$prefix}--snippet-button {
260
+ .#{$prefix}--copy-btn {
261
261
  @include reset;
262
262
 
263
- position: absolute;
264
- top: 0;
265
- right: 0;
266
263
  display: flex;
267
264
  overflow: visible;
268
265
  width: $spacing-08;
@@ -282,48 +279,44 @@ $copy-btn-feedback: $background-inverse !default;
282
279
  }
283
280
  }
284
281
 
285
- .#{$prefix}--snippet--multi .#{$prefix}--snippet-button {
286
- top: $spacing-03;
287
- right: $spacing-03;
288
- width: $spacing-07;
289
- height: $spacing-07;
290
- }
282
+ // TODO: remove copy button styles above
283
+ .#{$prefix}--snippet .#{$prefix}--popover-container {
284
+ @include font-family('sans');
291
285
 
292
- .#{$prefix}--snippet-button:hover {
293
- background: $layer-hover;
286
+ position: absolute;
287
+ top: 0;
288
+ right: 0;
294
289
  }
295
290
 
296
- .#{$prefix}--snippet-button:active {
297
- background-color: $copy-active;
291
+ // Overrides for codesnippet copy btn
292
+ // TLDR: Copy/CopyButton now uses IconButton, which uses Carbon buttons under the hood
293
+ // v10 opy just used native html button so it didn't have extra carbon styles that needed overriding
294
+ .#{$prefix}--snippet--inline.#{$prefix}--btn--md.#{$prefix}--btn--icon-only {
295
+ padding-right: 0;
296
+ padding-left: 0;
298
297
  }
299
298
 
300
- .#{$prefix}--btn--copy__feedback {
301
- @include type-style('body-compact-01');
302
- @include font-family('sans');
303
-
304
- z-index: z('overlay');
305
- top: 0.75rem;
306
- right: 1.25rem;
307
- left: inherit;
308
- font-weight: 400;
299
+ .#{$prefix}--snippet--inline.#{$prefix}--btn--md {
300
+ min-height: 1.25rem;
309
301
  }
310
302
 
311
- .#{$prefix}--btn--copy__feedback::before,
312
- .#{$prefix}--btn--copy__feedback::after {
313
- background: $copy-btn-feedback;
303
+ .#{$prefix}--snippet--inline.#{$prefix}--btn--primary:hover {
304
+ color: $text-primary;
314
305
  }
315
306
 
316
- .#{$prefix}--btn--copy__feedback::after {
317
- border: none;
307
+ // override multi copy btn styles
308
+ .#{$prefix}--snippet.#{$prefix}--snippet--multi
309
+ .#{$prefix}--popover-container {
310
+ top: 0.5rem;
311
+ right: 0.5rem;
318
312
  }
319
313
 
320
- // TODO: remove copy button styles above
321
- .#{$prefix}--snippet .#{$prefix}--copy-btn {
322
- @include font-family('sans');
323
-
324
- position: absolute;
325
- top: 0;
326
- right: 0;
314
+ .#{$prefix}--snippet--multi .#{$prefix}--copy-btn.#{$prefix}--btn--md {
315
+ z-index: 10;
316
+ width: $spacing-07;
317
+ height: $spacing-07;
318
+ min-height: $spacing-07;
319
+ padding: 0;
327
320
  }
328
321
 
329
322
  // Show more / less button
@@ -435,14 +428,6 @@ $copy-btn-feedback: $background-inverse !default;
435
428
  }
436
429
  }
437
430
 
438
- .#{$prefix}--snippet--multi .#{$prefix}--copy-btn {
439
- z-index: 10;
440
- top: $spacing-03;
441
- right: $spacing-03;
442
- width: $spacing-07;
443
- height: $spacing-07;
444
- }
445
-
446
431
  .#{$prefix}--snippet--multi
447
432
  .#{$prefix}--snippet-button
448
433
  .#{$prefix}--btn--copy__feedback {
@@ -26,8 +26,6 @@
26
26
  height: rem(32px);
27
27
  }
28
28
 
29
- // TODO V11: Remove xl selector
30
- .#{$prefix}--content-switcher--xl,
31
29
  .#{$prefix}--content-switcher--lg {
32
30
  height: rem(48px);
33
31
  }
@@ -18,63 +18,6 @@
18
18
  @use '../../utilities/visually-hidden' as *;
19
19
 
20
20
  @mixin copy-button {
21
- .#{$prefix}--btn--copy {
22
- position: relative;
23
- overflow: visible;
24
-
25
- .#{$prefix}--btn__icon {
26
- margin-left: rem(5px);
27
- }
28
- }
29
-
30
- .#{$prefix}--btn--copy__feedback {
31
- position: absolute;
32
- top: 1.2rem;
33
- left: 50%;
34
- display: none;
35
-
36
- &::before {
37
- @include box-shadow;
38
- @include type-style('body-compact-01');
39
-
40
- z-index: 2;
41
- top: 1.1rem;
42
- padding: $spacing-02;
43
- border-radius: 4px;
44
- color: $text-inverse;
45
- content: attr(data-feedback);
46
- font-weight: 400;
47
- pointer-events: none;
48
- transform: translateX(-50%);
49
- white-space: nowrap;
50
- }
51
-
52
- &::after {
53
- z-index: 1;
54
- top: 0.85rem;
55
- left: -0.3rem;
56
- width: 0.6rem;
57
- height: 0.6rem;
58
- border-right: 1px solid $background-inverse;
59
- border-bottom: 1px solid $background-inverse;
60
- content: '';
61
- transform: rotate(-135deg);
62
- }
63
-
64
- &::before,
65
- &::after {
66
- position: absolute;
67
- display: block;
68
- background: $background-inverse;
69
- }
70
-
71
- &--displayed {
72
- display: inline-flex;
73
- }
74
- }
75
-
76
- // TODO: deprecate above styles
77
-
78
21
  .#{$prefix}--copy-btn {
79
22
  @include reset;
80
23
 
@@ -113,8 +56,6 @@
113
56
  clip: auto;
114
57
  }
115
58
 
116
- @include tooltip--placement('icon', 'bottom', 'center');
117
-
118
59
  &:focus {
119
60
  @include focus-outline('outline');
120
61