@carbon/type 10.44.0 → 11.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 (78) hide show
  1. package/README.md +2 -6
  2. package/index.scss +7 -7
  3. package/package.json +6 -6
  4. package/scss/_classes.scss +8 -7
  5. package/scss/{modules/_default-type.scss → _default-type.scss} +0 -0
  6. package/scss/_font-family.scss +51 -17
  7. package/scss/_inlined/_classes.scss +8 -7
  8. package/scss/_inlined/_default-type.scss +55 -0
  9. package/scss/_inlined/_font-family.scss +51 -17
  10. package/scss/_inlined/_reset.scss +11 -59
  11. package/scss/_inlined/_scale.scss +13 -15
  12. package/scss/_inlined/_styles.scss +146 -214
  13. package/scss/_reset.scss +11 -59
  14. package/scss/_scale.scss +13 -15
  15. package/scss/_styles.scss +146 -214
  16. package/scss/vendor/@carbon/grid/{modules/_breakpoint.scss → _breakpoint.scss} +1 -1
  17. package/scss/vendor/@carbon/grid/{modules/_config.scss → _config.scss} +1 -1
  18. package/scss/vendor/@carbon/grid/{modules/_css-grid.scss → _css-grid.scss} +0 -0
  19. package/scss/vendor/@carbon/grid/{modules/_flex-grid.scss → _flex-grid.scss} +0 -20
  20. package/scss/vendor/@carbon/grid/_inlined/_breakpoint.scss +198 -0
  21. package/scss/vendor/@carbon/grid/_inlined/_config.scss +94 -0
  22. package/scss/vendor/@carbon/grid/_inlined/_css-grid.scss +470 -0
  23. package/scss/vendor/@carbon/grid/{modules/_mixins.scss → _inlined/_flex-grid.scss} +45 -38
  24. package/scss/vendor/@carbon/grid/_inlined/_mixins.scss +89 -188
  25. package/scss/vendor/@carbon/grid/_mixins.scss +89 -188
  26. package/scss/vendor/@carbon/grid/vendor/@carbon/layout/_convert.import.scss +2 -4
  27. package/scss/vendor/@carbon/grid/vendor/@carbon/layout/_convert.scss +18 -23
  28. package/scss/vendor/@carbon/grid/vendor/@carbon/layout/_spacing.scss +2 -5
  29. package/scss/vendor/@carbon/grid/vendor/@carbon/layout/_utilities.scss +4 -4
  30. package/scss/vendor/@carbon/grid/vendor/@carbon/layout/generated/_container.scss +13 -43
  31. package/scss/vendor/@carbon/grid/vendor/@carbon/layout/generated/_fluid-spacing.scss +11 -35
  32. package/scss/vendor/@carbon/grid/vendor/@carbon/layout/generated/_icon-size.scss +8 -17
  33. package/scss/vendor/@carbon/grid/vendor/@carbon/layout/generated/_size.scss +1 -1
  34. package/scss/vendor/@carbon/grid/vendor/@carbon/layout/generated/_spacing.scss +29 -107
  35. package/scss/vendor/@carbon/grid/vendor/@carbon/layout/modules/_convert.scss +2 -4
  36. package/scss/_inlined/_styles.import.scss +0 -766
  37. package/scss/_inlined/font-face/_mono.scss +0 -1166
  38. package/scss/_inlined/font-face/_sans-condensed.scss +0 -1009
  39. package/scss/_inlined/font-face/_sans.scss +0 -1326
  40. package/scss/_inlined/font-face/_serif.scss +0 -1166
  41. package/scss/_inlined/font-face/_settings.scss +0 -12
  42. package/scss/_styles.import.scss +0 -766
  43. package/scss/font-face/_mono.scss +0 -1166
  44. package/scss/font-face/_sans-condensed.scss +0 -1009
  45. package/scss/font-face/_sans.scss +0 -1326
  46. package/scss/font-face/_serif.scss +0 -1166
  47. package/scss/font-face/_settings.scss +0 -12
  48. package/scss/index.scss +0 -8
  49. package/scss/modules/_classes.scss +0 -42
  50. package/scss/modules/_font-family.scss +0 -104
  51. package/scss/modules/_prefix.scss +0 -11
  52. package/scss/modules/_reset.scss +0 -44
  53. package/scss/modules/_scale.scss +0 -57
  54. package/scss/modules/_styles.scss +0 -876
  55. package/scss/type.scss +0 -8
  56. package/scss/vendor/@carbon/grid/12.scss +0 -41
  57. package/scss/vendor/@carbon/grid/_inlined/12.scss +0 -41
  58. package/scss/vendor/@carbon/grid/_inlined/_mixins.import.scss +0 -431
  59. package/scss/vendor/@carbon/grid/_inlined/_prefix.scss +0 -12
  60. package/scss/vendor/@carbon/grid/_mixins.import.scss +0 -431
  61. package/scss/vendor/@carbon/grid/_prefix.scss +0 -12
  62. package/scss/vendor/@carbon/grid/grid.scss +0 -10
  63. package/scss/vendor/@carbon/grid/index.scss +0 -10
  64. package/scss/vendor/@carbon/grid/vendor/@carbon/import-once/import-once.scss +0 -27
  65. package/scss/vendor/@carbon/grid/vendor/@carbon/import-once/index.scss +0 -8
  66. package/scss/vendor/@carbon/grid/vendor/@carbon/layout/_breakpoint.scss +0 -246
  67. package/scss/vendor/@carbon/grid/vendor/@carbon/layout/_key-height.import.scss +0 -117
  68. package/scss/vendor/@carbon/grid/vendor/@carbon/layout/_key-height.scss +0 -111
  69. package/scss/vendor/@carbon/grid/vendor/@carbon/layout/_mini-unit.scss +0 -23
  70. package/scss/vendor/@carbon/grid/vendor/@carbon/layout/generated/_layout.scss +0 -97
  71. package/scss/vendor/@carbon/grid/vendor/@carbon/layout/index.scss +0 -8
  72. package/scss/vendor/@carbon/grid/vendor/@carbon/layout/layout.scss +0 -12
  73. package/scss/vendor/@carbon/grid/vendor/@carbon/layout/modules/_spacing.scss +0 -9
  74. package/scss/vendor/@carbon/grid/vendor/@carbon/layout/modules/_utilities.scss +0 -41
  75. package/scss/vendor/@carbon/grid/vendor/@carbon/layout/modules/generated/_fluid-spacing.scss +0 -37
  76. package/scss/vendor/@carbon/grid/vendor/@carbon/layout/modules/generated/_spacing.scss +0 -91
  77. package/scss/vendor/@carbon/import-once/import-once.scss +0 -27
  78. package/scss/vendor/@carbon/import-once/index.scss +0 -8
@@ -8,7 +8,7 @@
8
8
  @use 'sass:list';
9
9
  @use 'sass:map';
10
10
  @use 'sass:meta';
11
- @use '@carbon/layout/scss/modules/convert';
11
+ @use '@carbon/layout/scss/convert';
12
12
  @use 'config' as *;
13
13
 
14
14
  /// Provide a map and index, and get back the relevant key value
@@ -6,7 +6,7 @@
6
6
  //
7
7
 
8
8
  @use 'sass:map';
9
- @use '@carbon/layout/scss/modules/convert';
9
+ @use '@carbon/layout/scss/convert';
10
10
 
11
11
  /// Namespace prefix
12
12
  /// @type String
@@ -201,17 +201,6 @@
201
201
  .#{$prefix}--row.#{$prefix}--no-gutter--end [class*='#{$prefix}--col'] {
202
202
  padding-right: 0;
203
203
  }
204
-
205
- // Deprecated ☠️
206
- .#{$prefix}--no-gutter--left,
207
- .#{$prefix}--row.#{$prefix}--no-gutter--left [class*='#{$prefix}--col'] {
208
- padding-left: 0;
209
- }
210
-
211
- .#{$prefix}--no-gutter--right,
212
- .#{$prefix}--row.#{$prefix}--no-gutter--right [class*='#{$prefix}--col'] {
213
- padding-right: 0;
214
- }
215
204
  }
216
205
 
217
206
  // -----------------------------------------------------------------------------
@@ -231,15 +220,6 @@
231
220
  .#{$prefix}--hang--end {
232
221
  padding-right: $gutter * 0.5;
233
222
  }
234
-
235
- // Deprecated ☠️
236
- .#{$prefix}--hang--left {
237
- padding-left: $gutter * 0.5;
238
- }
239
-
240
- .#{$prefix}--hang--right {
241
- padding-right: $gutter * 0.5;
242
- }
243
223
  }
244
224
 
245
225
  // -----------------------------------------------------------------------------
@@ -0,0 +1,198 @@
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:map';
10
+ @use 'sass:meta';
11
+ @use '@carbon/layout/scss/convert';
12
+ @use 'config' as *;
13
+
14
+ /// Provide a map and index, and get back the relevant key value
15
+ /// @access public
16
+ /// @param {Map} $map - Map
17
+ /// @param {Integer} $index - Key chain
18
+ /// @return {String} Desired value
19
+ /// @group @carbon/layout
20
+ @function -key-by-index($map, $index) {
21
+ $keys: map.keys($map);
22
+ @return nth($keys, $index);
23
+ }
24
+
25
+ /// Get the value of the next breakpoint, or null for the last breakpoint
26
+ /// @param {String} $name - The name of the breakpoint
27
+ /// @param {Map} $breakpoints [$grid-breakpoints] - A map of breakpoints where the key is the name of the breakpoint and the value is the values for the breakpoint
28
+ /// @param {List} $breakpoint-names [map-keys($breakpoints)] - A list of names from the `$breakpoints` map
29
+ /// @return {String}
30
+ /// @access public
31
+ /// @group @carbon/layout
32
+ @function breakpoint-next(
33
+ $name,
34
+ $breakpoints: $grid-breakpoints,
35
+ $breakpoint-names: map.keys($breakpoints)
36
+ ) {
37
+ $n: list.index($breakpoint-names, $name);
38
+ @if $n != null and $n < list.length($breakpoint-names) {
39
+ @return list.nth($breakpoint-names, $n + 1);
40
+ }
41
+ @return null;
42
+ }
43
+
44
+ /// Get the value of the previous breakpoint, or null for the first breakpoint
45
+ /// @param {String} $name - The name of the breakpoint
46
+ /// @param {Map} $breakpoints [$grid-breakpoints] - A map of breakpoints where the key is the name of the breakpoint and the value is the values for the breakpoint
47
+ /// @param {List} $breakpoint-names [map-keys($breakpoints)] - A list of names from the `$breakpoints` map
48
+ /// @return {String}
49
+ /// @access public
50
+ /// @group @carbon/layout
51
+ @function breakpoint-prev(
52
+ $name,
53
+ $breakpoints: $grid-breakpoints,
54
+ $breakpoint-names: map.keys($breakpoints)
55
+ ) {
56
+ $n: list.index($breakpoint-names, $name);
57
+ @if $n != null and $n > 1 {
58
+ @return list.nth($breakpoint-names, $n - 1);
59
+ }
60
+ @return null;
61
+ }
62
+
63
+ /// Check to see if the given breakpoint name
64
+ /// @param {String} $name - The name of the breakpoint
65
+ /// @param {Map} $breakpoints [$grid-breakpoints] - A map of breakpoints where the key is the name of the breakpoint and the value is the values for the breakpoint
66
+ /// @return {Bool}
67
+ /// @access public
68
+ /// @group @carbon/layout
69
+ @function is-smallest-breakpoint($name, $breakpoints: $grid-breakpoints) {
70
+ @return list.index(map.keys($breakpoints), $name) == 1;
71
+ }
72
+
73
+ /// Returns the largest breakpoint name
74
+ /// @param {Map} $breakpoints [$grid-breakpoints] - A map of breakpoints where the key is the name
75
+ /// @return {String}
76
+ /// @access public
77
+ /// @group @carbon/layout
78
+ @function largest-breakpoint-name($breakpoints: $grid-breakpoints) {
79
+ $total-breakpoints: list.length($breakpoints);
80
+ @return -key-by-index($breakpoints, $total-breakpoints);
81
+ }
82
+
83
+ /// Get the infix for a given breakpoint in a list of breakpoints. Useful for generating the size part in a selector, for example: `.prefix--col-sm-2`.
84
+ /// @param {String} $name - The name of the breakpoint
85
+ /// @return {String}
86
+ /// @access public
87
+ /// @group @carbon/layout
88
+ @function breakpoint-infix($name) {
89
+ @return '-#{$name}';
90
+ }
91
+
92
+ /// Generate a media query from the width of the given breakpoint to infinity
93
+ /// @param {String | Number} $name
94
+ /// @param {Map} $breakpoints [$grid-breakpoints] - A map of breakpoints where the key is the name
95
+ /// @content
96
+ /// @access public
97
+ /// @group @carbon/layout
98
+ @mixin breakpoint-up($name, $breakpoints: $grid-breakpoints) {
99
+ @if meta.type-of($name) == 'number' {
100
+ @media (min-width: $name) {
101
+ @content;
102
+ }
103
+ } @else if map.has-key($breakpoints, $name) {
104
+ $breakpoint: map.get($breakpoints, $name);
105
+ $width: map.get($breakpoint, width);
106
+ @if is-smallest-breakpoint($name, $breakpoints) {
107
+ @content;
108
+ } @else {
109
+ @media (min-width: $width) {
110
+ @content;
111
+ }
112
+ }
113
+ } @else {
114
+ @error 'Unable to find a breakpoint with name `#{$name}`. Expected one of: (#{map.keys($breakpoints)})';
115
+ }
116
+ }
117
+
118
+ /// Generate a media query for the maximum width of the given styles
119
+ /// @param {String | Number} $name
120
+ /// @param {Map} $breakpoints [$grid-breakpoints] - A map of breakpoints where the key is the name
121
+ /// @content
122
+ /// @access public
123
+ /// @group @carbon/layout
124
+ @mixin breakpoint-down($name, $breakpoints: $grid-breakpoints) {
125
+ @if meta.type-of($name) == 'number' {
126
+ @media (max-width: $name) {
127
+ @content;
128
+ }
129
+ } @else if map.has-key($breakpoints, $name) {
130
+ // We borrow this logic from bootstrap for specifying the value of the
131
+ // max-width. The maximum width is calculated by finding the breakpoint and
132
+ // subtracting .02 from its value. This value is used instead of .01 to
133
+ // avoid rounding issues in Safari
134
+ // https://github.com/twbs/bootstrap/blob/c5b1919deaf5393fcca9e9b9d7ce9c338160d99d/scss/mixins/_breakpoints.scss#L34-L46
135
+ $breakpoint: map.get($breakpoints, $name);
136
+ $width: map.get($breakpoint, width) - 0.02;
137
+ @media (max-width: $width) {
138
+ @content;
139
+ }
140
+ } @else {
141
+ @error 'Unable to find a breakpoint with name `#{$name}`. Expected one of: (#{map.keys($breakpoints)})';
142
+ }
143
+ }
144
+
145
+ /// Generate a media query for the range between the lower and upper breakpoints
146
+ /// @param {String | Number} $lower
147
+ /// @param {String | Number} $upper
148
+ /// @param {Map} $breakpoints [$grid-breakpoints] - A map of breakpoints where the key is the name
149
+ /// @content
150
+ /// @access public
151
+ /// @group @carbon/layout
152
+ @mixin breakpoint-between($lower, $upper, $breakpoints: $grid-breakpoints) {
153
+ $is-number-lower: meta.type-of($lower) == 'number';
154
+ $is-number-upper: meta.type-of($upper) == 'number';
155
+ $min: if($is-number-lower, $lower, map.get($breakpoints, $lower));
156
+ $max: if($is-number-upper, $upper, map.get($breakpoints, $upper));
157
+
158
+ @if $min and $max {
159
+ $min-width: if(not $is-number-lower and $min, map.get($min, width), $min);
160
+ $max-width: if(not $is-number-upper and $max, map.get($max, width), $max);
161
+ @media (min-width: $min-width) and (max-width: $max-width) {
162
+ @content;
163
+ }
164
+ } @else if $min != null and $max == null {
165
+ @include breakpoint-up($lower) {
166
+ @content;
167
+ }
168
+ } @else if $min == null and $max != null {
169
+ @include breakpoint-down($upper) {
170
+ @content;
171
+ }
172
+ } @else {
173
+ @error 'Unable to find a breakpoint to satisfy: (#{$lower},#{$upper}). Expected both to be one of (#{map.keys($breakpoints)}).';
174
+ }
175
+ }
176
+
177
+ /// Generate media query for the largest breakpoint
178
+ /// @param {Map} $breakpoints [$grid-breakpoints] - A map of breakpoints where the key is the name
179
+ /// @content
180
+ /// @access public
181
+ /// @group @carbon/layout
182
+ @mixin largest-breakpoint($breakpoints: $grid-breakpoints) {
183
+ @include breakpoint(largest-breakpoint-name()) {
184
+ @content;
185
+ }
186
+ }
187
+
188
+ /// Generate a media query for a given breakpoint
189
+ /// @param {String | Number} $name
190
+ /// @param {Map} $breakpoints [$grid-breakpoints] - A map of breakpoints where the key is the name
191
+ /// @content
192
+ /// @access public
193
+ /// @group @carbon/layout
194
+ @mixin breakpoint($name, $breakpoints: $grid-breakpoints) {
195
+ @include breakpoint-up($name, $breakpoints) {
196
+ @content;
197
+ }
198
+ }
@@ -0,0 +1,94 @@
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:map';
9
+ @use '@carbon/layout/scss/convert';
10
+
11
+ /// Namespace prefix
12
+ /// @type String
13
+ /// @access public
14
+ /// @group @carbon/grid
15
+ $prefix: 'cds' !default;
16
+
17
+ /// Total columns used in the flex grid
18
+ /// @type Number
19
+ /// @access public
20
+ /// @group @carbon/grid
21
+ $flex-grid-columns: 16 !default;
22
+
23
+ /// Carbon gutter size in rem
24
+ /// @type Number
25
+ /// @access public
26
+ /// @group @carbon/layout
27
+ $grid-gutter: convert.rem(32px) !default;
28
+
29
+ /// Carbon condensed gutter size in rem
30
+ /// @type Number
31
+ /// @access public
32
+ /// @group @carbon/layout
33
+ $grid-gutter-condensed: convert.rem(1px) !default;
34
+
35
+ // Initial map of our breakpoints and their values
36
+ /// @type Map
37
+ /// @access public
38
+ /// @group @carbon/layout
39
+ $grid-breakpoints: (
40
+ sm: (
41
+ columns: 4,
42
+ margin: 0,
43
+ width: convert.rem(320px),
44
+ ),
45
+ md: (
46
+ columns: 8,
47
+ margin: convert.rem(16px),
48
+ width: convert.rem(672px),
49
+ ),
50
+ lg: (
51
+ columns: 16,
52
+ margin: convert.rem(16px),
53
+ width: convert.rem(1056px),
54
+ ),
55
+ xlg: (
56
+ columns: 16,
57
+ margin: convert.rem(16px),
58
+ width: convert.rem(1312px),
59
+ ),
60
+ max: (
61
+ columns: 16,
62
+ margin: convert.rem(24px),
63
+ width: convert.rem(1584px),
64
+ ),
65
+ ) !default;
66
+
67
+ @if $flex-grid-columns == 12 {
68
+ $grid-breakpoints: map.merge(
69
+ $grid-breakpoints,
70
+ (
71
+ lg:
72
+ map.merge(
73
+ map.get($grid-breakpoints, lg),
74
+ (
75
+ columns: 12,
76
+ )
77
+ ),
78
+ xlg:
79
+ map.merge(
80
+ map.get($grid-breakpoints, xlg),
81
+ (
82
+ columns: 12,
83
+ )
84
+ ),
85
+ max:
86
+ map.merge(
87
+ map.get($grid-breakpoints, max),
88
+ (
89
+ columns: 12,
90
+ )
91
+ ),
92
+ )
93
+ );
94
+ }