@carbon/styles 0.13.0 → 0.15.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 (62) hide show
  1. package/package.json +8 -8
  2. package/scss/_config.scss +6 -0
  3. package/scss/_grid.scss +3 -1
  4. package/scss/_motion.scss +7 -36
  5. package/scss/_reset.scss +1 -1
  6. package/scss/components/_index.scss +1 -0
  7. package/scss/components/accordion/_accordion.scss +4 -2
  8. package/scss/components/aspect-ratio/_aspect-ratio.scss +73 -0
  9. package/scss/components/aspect-ratio/_index.scss +11 -0
  10. package/scss/components/breadcrumb/_breadcrumb.scss +1 -1
  11. package/scss/components/button/_button.scss +4 -3
  12. package/scss/components/button/_mixins.scss +2 -1
  13. package/scss/components/button/_tokens.scss +2 -2
  14. package/scss/components/checkbox/_checkbox.scss +8 -1
  15. package/scss/components/code-snippet/_code-snippet.scss +3 -3
  16. package/scss/components/content-switcher/_content-switcher.scss +33 -2
  17. package/scss/components/copy-button/_copy-button.scss +1 -1
  18. package/scss/components/data-table/_data-table.scss +4 -4
  19. package/scss/components/data-table/action/_data-table-action.scss +99 -29
  20. package/scss/components/data-table/sort/_data-table-sort.scss +1 -1
  21. package/scss/components/date-picker/_flatpickr.scss +27 -20
  22. package/scss/components/dropdown/_dropdown.scss +3 -19
  23. package/scss/components/file-uploader/_file-uploader.scss +4 -4
  24. package/scss/components/form/_form.scss +2 -2
  25. package/scss/components/link/_link.scss +3 -3
  26. package/scss/components/list/_list.scss +2 -2
  27. package/scss/components/list-box/_list-box.scss +13 -29
  28. package/scss/components/loading/_loading.scss +3 -0
  29. package/scss/components/menu/_menu.scss +1 -1
  30. package/scss/components/modal/_modal.scss +90 -98
  31. package/scss/components/notification/_actionable-notification.scss +2 -2
  32. package/scss/components/notification/_inline-notification.scss +3 -3
  33. package/scss/components/notification/_toast-notification.scss +5 -5
  34. package/scss/components/number-input/_number-input.scss +29 -18
  35. package/scss/components/overflow-menu/_overflow-menu.scss +4 -1
  36. package/scss/components/pagination/_index.scss +3 -0
  37. package/scss/components/pagination/_pagination.scss +13 -6
  38. package/scss/components/pagination/_unstable_pagination.scss +173 -0
  39. package/scss/components/pagination-nav/_pagination-nav.scss +2 -2
  40. package/scss/components/popover/_popover.scss +27 -12
  41. package/scss/components/progress-bar/_progress-bar.scss +9 -1
  42. package/scss/components/progress-indicator/_progress-indicator.scss +12 -14
  43. package/scss/components/radio-button/_radio-button.scss +3 -2
  44. package/scss/components/search/_search.scss +14 -17
  45. package/scss/components/select/_select.scss +8 -2
  46. package/scss/components/slider/_slider.scss +6 -4
  47. package/scss/components/structured-list/_structured-list.scss +2 -3
  48. package/scss/components/tabs/_tabs.scss +3 -3
  49. package/scss/components/tag/_tag.scss +1 -0
  50. package/scss/components/text-area/_text-area.scss +8 -2
  51. package/scss/components/text-input/_text-input.scss +1 -1
  52. package/scss/components/tile/_tile.scss +2 -2
  53. package/scss/components/toggle/_toggle.scss +3 -3
  54. package/scss/components/toggletip/_toggletip.scss +1 -1
  55. package/scss/components/tooltip/_tooltip.scss +3 -3
  56. package/scss/components/treeview/_treeview.scss +1 -1
  57. package/scss/components/ui-shell/header/_header.scss +3 -3
  58. package/scss/components/ui-shell/side-nav/_side-nav.scss +7 -6
  59. package/scss/components/ui-shell/switcher/_switcher.scss +1 -1
  60. package/scss/fonts/_src.scss +1 -1
  61. package/scss/utilities/_keyframes.scss +10 -0
  62. package/scss/utilities/_tooltip.scss +3 -1
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.13.0",
4
+ "version": "0.15.0-rc.0",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
7
7
  "type": "git",
@@ -20,18 +20,18 @@
20
20
  "access": "public"
21
21
  },
22
22
  "dependencies": {
23
- "@carbon/colors": "^10.35.0",
23
+ "@carbon/colors": "^10.37.0-rc.0",
24
24
  "@carbon/feature-flags": "^0.7.0",
25
- "@carbon/grid": "^10.40.0",
26
- "@carbon/layout": "^10.35.0",
27
- "@carbon/motion": "^10.27.0",
28
- "@carbon/themes": "^10.50.0",
29
- "@carbon/type": "^10.40.0",
25
+ "@carbon/grid": "^10.42.0-rc.0",
26
+ "@carbon/layout": "^10.37.0-rc.0",
27
+ "@carbon/motion": "^10.29.0-rc.0",
28
+ "@carbon/themes": "^10.52.0-rc.0",
29
+ "@carbon/type": "^10.42.0-rc.0",
30
30
  "@ibm/plex": "6.0.0-next.6"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@carbon/test-utils": "^10.21.0",
34
34
  "css": "^3.0.0"
35
35
  },
36
- "gitHead": "e76c42ab78cbee043db643597b7b5d79bd387c9b"
36
+ "gitHead": "e41618f5aaa9a10ce93edd844f1a280dc29eaf50"
37
37
  }
package/scss/_config.scss CHANGED
@@ -48,3 +48,9 @@ $use-google-fonts: false !default;
48
48
  /// @type String
49
49
  /// @group config
50
50
  $prefix: 'cds' !default;
51
+
52
+ /// Total columns used in the flex grid
53
+ /// @type Number
54
+ /// @access public
55
+ /// @group @carbon/grid
56
+ $flex-grid-columns: 16 !default;
package/scss/_grid.scss CHANGED
@@ -10,11 +10,13 @@
10
10
  @forward '@carbon/grid'
11
11
  show css-grid,
12
12
  subgrid,
13
+ flex-grid,
13
14
  $grid-gutter,
14
15
  $grid-gutter-condensed,
15
16
  $grid-breakpoints
16
17
  with (
17
- $prefix: config.$prefix
18
+ $prefix: config.$prefix,
19
+ $flex-grid-columns: config.$flex-grid-columns,
18
20
  );
19
21
 
20
22
  @use '@carbon/grid';
package/scss/_motion.scss CHANGED
@@ -6,62 +6,33 @@
6
6
  //
7
7
 
8
8
  @forward '@carbon/motion';
9
- @use '@carbon/motion';
10
9
 
11
10
  /// Used primarily for removing elements from the screen
12
11
  /// @type Function
13
12
  /// @access public
14
- /// @group global-motion
13
+ /// @group motion
15
14
  $ease-in: cubic-bezier(0.25, 0, 1, 1);
16
15
 
17
16
  /// Used for adding elements to the screen or changing on-screen states at a user's input
18
17
  /// @type Function
19
18
  /// @access public
20
- /// @group global-motion
19
+ /// @group motion
21
20
  $ease-out: cubic-bezier(0, 0, 0.25, 1);
22
21
 
23
22
  /// Used for the majority of animations
24
23
  /// @type Function
25
24
  /// @access public
26
- /// @group global-motion
25
+ /// @group motion
27
26
  $standard-easing: cubic-bezier(0.5, 0, 0.1, 1);
28
27
 
29
28
  /// Base transition duration
30
29
  /// @type Number
31
30
  /// @access public
32
- /// @group global-motion
33
- $transition--base: 250ms;
31
+ /// @group motion
32
+ $transition-base: 250ms;
34
33
 
35
34
  /// Expansion duration
36
35
  /// @type Number
37
36
  /// @access public
38
- /// @group global-motion
39
- $transition--expansion: 300ms;
40
-
41
- /// Default ease-in for components
42
- /// @access public
43
- /// @type Function
44
- /// @group global-motion
45
- $ease-in: cubic-bezier(0, 0, 0.38, 0.9);
46
-
47
- /// Default ease-out for components
48
- /// @access public
49
- /// @type Function
50
- /// @group global-motion
51
- $ease-out: cubic-bezier(0.2, 0, 1, 0.9);
52
-
53
- /// Default easing for components
54
- /// @access public
55
- /// @type Function
56
- /// @group global-motion
57
- $standard-easing: cubic-bezier(0.2, 0, 0.38, 0.9);
58
-
59
- /// @access public
60
- /// @group global-motion
61
- /// @alias duration--fast-02
62
- $transition--base: motion.$duration-fast-02;
63
-
64
- /// @access public
65
- /// @group global-motion
66
- /// @alias duration--moderate-02
67
- $transition--expansion: motion.$duration-moderate-02;
37
+ /// @group motion
38
+ $transition-expansion: 300ms;
package/scss/_reset.scss CHANGED
@@ -144,8 +144,8 @@
144
144
  border-collapse: collapse;
145
145
  border-spacing: 0;
146
146
  }
147
- /// End vendor reset
148
147
 
148
+ /// End vendor reset
149
149
  html {
150
150
  box-sizing: border-box;
151
151
  }
@@ -6,6 +6,7 @@
6
6
  //
7
7
 
8
8
  @use 'accordion';
9
+ @use 'aspect-ratio';
9
10
  @use 'breadcrumb';
10
11
  @use 'button';
11
12
  @use 'checkbox';
@@ -151,7 +151,7 @@ $content-padding: 0 0 0 $spacing-05 !default;
151
151
  }
152
152
 
153
153
  .#{$prefix}--accordion__title {
154
- @include type-style('body-long-01');
154
+ @include type-style('body-01');
155
155
 
156
156
  z-index: 1;
157
157
  width: 100%;
@@ -176,7 +176,7 @@ $content-padding: 0 0 0 $spacing-05 !default;
176
176
  }
177
177
 
178
178
  > p {
179
- @include type-style('body-long-01');
179
+ @include type-style('body-01');
180
180
  }
181
181
  }
182
182
 
@@ -207,6 +207,7 @@ $content-padding: 0 0 0 $spacing-05 !default;
207
207
  0% {
208
208
  @include -content-visible;
209
209
  }
210
+
210
211
  100% {
211
212
  @include -content-hidden;
212
213
  }
@@ -216,6 +217,7 @@ $content-padding: 0 0 0 $spacing-05 !default;
216
217
  0% {
217
218
  @include -content-hidden;
218
219
  }
220
+
219
221
  100% {
220
222
  @include -content-visible;
221
223
  }
@@ -0,0 +1,73 @@
1
+ //
2
+ // Copyright IBM Corp. 2018, 2018
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 'sass:list';
9
+ @use 'sass:math';
10
+ @use 'sass:meta';
11
+ @use '../../config' as *;
12
+
13
+ /// The aspect ratios that are used to generate corresponding aspect ratio
14
+ /// classes in code
15
+ /// @type List
16
+ /// @access public
17
+ /// @group @carbon/grid
18
+ $carbon--aspect-ratios: (
19
+ (16, 9),
20
+ (9, 16),
21
+ (2, 1),
22
+ (1, 2),
23
+ (4, 3),
24
+ (3, 4),
25
+ (3, 2),
26
+ (2, 3),
27
+ (1, 1)
28
+ );
29
+
30
+ /// Generates the CSS classname utilities for the aspect ratios
31
+ ///
32
+ /// CSS Tricks article on aspect ratios and all the different ways it can be done.
33
+ /// https://css-tricks.com/aspect-ratio-boxes/#article-header-id-6
34
+ ///
35
+ /// That article references an earlier article on the topic.
36
+ /// https://keithjgrant.com/posts/2017/03/aspect-ratios/
37
+ ///
38
+ /// @param {Number} $width width from an aspect ratio
39
+ /// @param {Number} $height height from an aspect ratio
40
+ /// @access private
41
+ /// @group @carbon/grid
42
+ @mixin aspect-ratio($aspect-ratios: $carbon--aspect-ratios) {
43
+ .#{$prefix}--aspect-ratio {
44
+ position: relative;
45
+ }
46
+
47
+ .#{$prefix}--aspect-ratio::before {
48
+ width: 1px;
49
+ height: 0;
50
+ margin-left: -1px;
51
+ content: '';
52
+ float: left;
53
+ }
54
+
55
+ .#{$prefix}--aspect-ratio::after {
56
+ display: table;
57
+ clear: both;
58
+ content: '';
59
+ }
60
+
61
+ @each $aspect-ratio in $aspect-ratios {
62
+ $width: list.nth($aspect-ratio, 1);
63
+ $height: list.nth($aspect-ratio, 2);
64
+
65
+ .#{$prefix}--aspect-ratio--#{$width}x#{$height}::before {
66
+ @if meta.function-exists('div', 'math') {
67
+ padding-top: math.percentage(math.div($height, $width));
68
+ } @else {
69
+ padding-top: math.percentage(($height / $width));
70
+ }
71
+ }
72
+ }
73
+ }
@@ -0,0 +1,11 @@
1
+ //
2
+ // Copyright IBM Corp. 2018, 2018
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
+ @forward 'aspect-ratio';
9
+ @use 'aspect-ratio';
10
+
11
+ @include aspect-ratio.aspect-ratio;
@@ -17,7 +17,7 @@
17
17
  @mixin breadcrumb {
18
18
  .#{$prefix}--breadcrumb {
19
19
  @include reset;
20
- @include type-style('body-short-01');
20
+ @include type-style('body-compact-01');
21
21
 
22
22
  display: inline;
23
23
 
@@ -102,9 +102,9 @@
102
102
  transparent,
103
103
  transparent,
104
104
  $link-primary,
105
- $background-hover,
105
+ $layer-hover,
106
106
  currentColor,
107
- $background-active
107
+ $layer-active
108
108
  );
109
109
 
110
110
  padding: $button-padding-ghost;
@@ -243,6 +243,7 @@
243
243
 
244
244
  &:active {
245
245
  border-color: $button-danger-active;
246
+ background-color: $button-danger-active;
246
247
  color: $text-on-color;
247
248
  }
248
249
 
@@ -334,7 +335,7 @@
334
335
 
335
336
  //expressive styles
336
337
  .#{$prefix}--btn--expressive {
337
- @include type-style('body-short-02');
338
+ @include type-style('body-compact-02');
338
339
 
339
340
  min-height: 3rem;
340
341
  }
@@ -20,10 +20,11 @@ $button-focus-color: custom-property.get-var('button-focus-color', $focus);
20
20
 
21
21
  @mixin button-base {
22
22
  @include component-reset.reset;
23
- @include type-style('body-short-01');
23
+ @include type-style('body-compact-01');
24
24
 
25
25
  position: relative;
26
26
  display: inline-flex;
27
+ width: max-content;
27
28
  max-width: rem(320px);
28
29
  min-height: $button-height;
29
30
  flex-shrink: 0;
@@ -330,11 +330,11 @@ $button-disabled: (
330
330
  ),
331
331
  (
332
332
  theme: themes.$g90,
333
- value: rgba(141, 141, 141, 0.3),
333
+ value: rgb(141 141 141 / 30%),
334
334
  ),
335
335
  (
336
336
  theme: themes.$g100,
337
- value: rgba(141, 141, 141, 0.3),
337
+ value: rgb(141 141 141 / 30%),
338
338
  ),
339
339
  ),
340
340
  ) !default;
@@ -51,7 +51,7 @@
51
51
  // accommodate the spacing needed for the checkbox.
52
52
  .#{$prefix}--checkbox-label {
53
53
  @include reset;
54
- @include type-style('body-short-01');
54
+ @include type-style('body-compact-01');
55
55
 
56
56
  position: relative;
57
57
  display: flex;
@@ -197,4 +197,11 @@
197
197
  // Add extra spacing when label is present
198
198
  margin: rem(1px) 0 0 rem(6px);
199
199
  }
200
+
201
+ //-----------------------------------------------
202
+ // InlineCheckbox
203
+ //-----------------------------------------------
204
+ .#{$prefix}--checkbox--inline {
205
+ position: relative;
206
+ }
200
207
  }
@@ -298,7 +298,7 @@ $copy-btn-feedback: $background-inverse !default;
298
298
  }
299
299
 
300
300
  .#{$prefix}--btn--copy__feedback {
301
- @include type-style('body-short-01');
301
+ @include type-style('body-compact-01');
302
302
  @include font-family('sans');
303
303
 
304
304
  z-index: z('overlay');
@@ -328,7 +328,7 @@ $copy-btn-feedback: $background-inverse !default;
328
328
 
329
329
  // Show more / less button
330
330
  .#{$prefix}--snippet-btn--expand {
331
- @include type-style('body-short-01');
331
+ @include type-style('body-compact-01');
332
332
  @include font-family('sans');
333
333
 
334
334
  position: absolute;
@@ -379,7 +379,7 @@ $copy-btn-feedback: $background-inverse !default;
379
379
  .#{$prefix}--snippet-btn--expand
380
380
  .#{$prefix}--icon-chevron--down {
381
381
  transform: rotate(180deg);
382
- transition: transform $transition--expansion;
382
+ transition: transform $transition-expansion;
383
383
  }
384
384
 
385
385
  // Light version
@@ -36,7 +36,7 @@
36
36
  @include reset;
37
37
  @include font-family('sans');
38
38
  @include focus-outline('reset');
39
- @include type-style('body-short-01');
39
+ @include type-style('body-compact-01');
40
40
 
41
41
  position: relative;
42
42
  display: inline-flex;
@@ -52,15 +52,41 @@
52
52
  color: $text-secondary;
53
53
  text-align: left;
54
54
  text-decoration: none;
55
- transition: all $duration-fast-01 motion(standard, productive);
55
+ transition: all $duration-moderate-01 motion(standard, productive);
56
56
  white-space: nowrap;
57
57
 
58
+ &::after {
59
+ position: absolute;
60
+ top: 0;
61
+ left: 0;
62
+ display: block;
63
+ width: 100%;
64
+ height: 100%;
65
+ background-color: $layer-selected-inverse;
66
+ content: '';
67
+ transform: scaleY(0);
68
+ transform-origin: bottom;
69
+ transition: all $duration-moderate-01 motion(standard, productive);
70
+
71
+ @media (prefers-reduced-motion: reduce) {
72
+ transition: none;
73
+ }
74
+ }
75
+
76
+ &:disabled::after {
77
+ display: none;
78
+ }
79
+
58
80
  &:focus {
59
81
  z-index: 3;
60
82
  border-color: $focus;
61
83
  box-shadow: inset 0 0 0 2px $focus, inset 0 0 0 3px $focus-inset;
62
84
  }
63
85
 
86
+ &:focus::after {
87
+ clip-path: inset(3px 3px 3px 3px);
88
+ }
89
+
64
90
  &:hover {
65
91
  color: $text-primary;
66
92
  cursor: pointer;
@@ -157,6 +183,7 @@
157
183
  }
158
184
 
159
185
  .#{$prefix}--content-switcher__label {
186
+ z-index: 1;
160
187
  overflow: hidden;
161
188
  max-width: 100%;
162
189
  text-overflow: ellipsis;
@@ -177,6 +204,10 @@
177
204
  background-color: $layer-selected-disabled;
178
205
  color: $text-disabled;
179
206
  }
207
+
208
+ &::after {
209
+ transform: scaleY(1);
210
+ }
180
211
  }
181
212
 
182
213
  .#{$prefix}--content-switcher-btn.#{$prefix}--content-switcher--selected
@@ -35,7 +35,7 @@
35
35
 
36
36
  &::before {
37
37
  @include box-shadow;
38
- @include type-style('body-short-01');
38
+ @include type-style('body-compact-01');
39
39
 
40
40
  z-index: 2;
41
41
  top: 1.1rem;
@@ -43,13 +43,13 @@
43
43
  }
44
44
 
45
45
  .#{$prefix}--data-table-header__title {
46
- @include type-style('productive-heading-03');
46
+ @include type-style('heading-03');
47
47
 
48
48
  color: $text-primary;
49
49
  }
50
50
 
51
51
  .#{$prefix}--data-table-header__description {
52
- @include type-style('body-short-01');
52
+ @include type-style('body-compact-01');
53
53
 
54
54
  color: $text-secondary;
55
55
  }
@@ -64,13 +64,13 @@
64
64
  }
65
65
 
66
66
  .#{$prefix}--data-table thead {
67
- @include type-style('productive-heading-01');
67
+ @include type-style('heading-compact-01');
68
68
 
69
69
  background-color: $layer-accent;
70
70
  }
71
71
 
72
72
  .#{$prefix}--data-table tbody {
73
- @include type-style('body-short-01');
73
+ @include type-style('body-compact-01');
74
74
 
75
75
  width: 100%;
76
76
  background-color: $layer;