@carbon/charts 0.41.49 → 0.41.50
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.
- package/CHANGELOG.md +8 -0
- package/build/demo/data/index.d.ts +9 -3
- package/build/demo/data/wordcloud.d.ts +14 -0
- package/build/src/charts/index.d.ts +1 -0
- package/build/src/charts/wordcloud.d.ts +6 -0
- package/build/src/components/graphs/wordcloud.d.ts +10 -0
- package/build/src/components/index.d.ts +1 -0
- package/build/src/configuration.d.ts +2 -1
- package/build/src/interfaces/charts.d.ts +23 -0
- package/build/src/interfaces/events.d.ts +9 -0
- package/bundle.js +1 -1
- package/charts/index.d.ts +1 -0
- package/charts/index.js +1 -0
- package/charts/index.js.map +1 -1
- package/charts/wordcloud.d.ts +6 -0
- package/charts/wordcloud.js +46 -0
- package/charts/wordcloud.js.map +1 -0
- package/components/essentials/tooltip-axis.js +1 -1
- package/components/essentials/tooltip-axis.js.map +1 -1
- package/components/graphs/boxplot.js +2 -2
- package/components/graphs/boxplot.js.map +1 -1
- package/components/graphs/wordcloud.d.ts +10 -0
- package/components/graphs/wordcloud.js +229 -0
- package/components/graphs/wordcloud.js.map +1 -0
- package/components/index.d.ts +1 -0
- package/components/index.js +1 -0
- package/components/index.js.map +1 -1
- package/configuration.d.ts +2 -1
- package/configuration.js +22 -0
- package/configuration.js.map +1 -1
- package/demo/data/bundle.js +1 -1
- package/demo/data/index.d.ts +9 -3
- package/demo/data/index.js +25 -8
- package/demo/data/index.js.map +1 -1
- package/demo/data/wordcloud.d.ts +14 -0
- package/demo/data/wordcloud.js +105 -0
- package/demo/data/wordcloud.js.map +1 -0
- package/demo/styles.css +2824 -28
- package/demo/styles.css.map +1 -1
- package/demo/styles.min.css +1 -1
- package/demo/styles.min.css.map +1 -1
- package/demo/tsconfig.tsbuildinfo +29 -15
- package/interfaces/charts.d.ts +23 -0
- package/interfaces/charts.js.map +1 -1
- package/interfaces/events.d.ts +9 -0
- package/interfaces/events.js +10 -0
- package/interfaces/events.js.map +1 -1
- package/package.json +8 -7
- package/styles/_type.scss +4 -2
- package/styles/graphs/_wordcloud.scss +7 -0
- package/styles/graphs/index.scss +1 -0
- package/styles/vendor/@carbon/colors/README.md +4 -3
- package/styles/vendor/@carbon/colors/es/index.js +13 -12
- package/styles/vendor/@carbon/colors/lib/index.js +98 -93
- package/styles/vendor/@carbon/colors/package.json +14 -10
- package/styles/vendor/@carbon/colors/scss/colors.scss +1 -1
- package/styles/vendor/@carbon/colors/scss/index.scss +1 -1
- package/styles/vendor/@carbon/colors/scss/mixins.scss +33 -13
- package/styles/vendor/@carbon/colors/umd/index.js +99 -94
- package/styles/vendor/@carbon/elements/README.md +0 -6
- package/styles/vendor/@carbon/elements/es/index.js +4 -11
- package/styles/vendor/@carbon/elements/lib/index.js +959 -13
- package/styles/vendor/@carbon/elements/package.json +17 -13
- package/styles/vendor/@carbon/elements/scss/colors/colors.scss +1 -1
- package/styles/vendor/@carbon/elements/scss/colors/index.scss +1 -1
- package/styles/vendor/@carbon/elements/scss/colors/mixins.scss +33 -13
- package/styles/vendor/@carbon/elements/scss/grid/_inlined/_mixins.scss +82 -22
- package/styles/vendor/@carbon/elements/scss/grid/_mixins.scss +82 -22
- package/styles/vendor/@carbon/elements/scss/grid/modules/_breakpoint.scss +266 -0
- package/styles/vendor/@carbon/{themes/node_modules/@carbon/colors/scss/colors.scss → elements/scss/grid/modules/_config.scss} +6 -6
- package/styles/vendor/@carbon/elements/scss/grid/modules/_css-grid.scss +350 -0
- package/styles/vendor/@carbon/elements/scss/grid/modules/_mixins.scss +323 -0
- package/styles/vendor/@carbon/elements/scss/grid/vendor/@carbon/layout/_breakpoint.scss +8 -3
- package/styles/vendor/@carbon/elements/scss/grid/vendor/@carbon/layout/modules/_breakpoint.scss +232 -0
- package/styles/vendor/@carbon/elements/scss/grid/vendor/@carbon/layout/modules/_convert.scss +40 -0
- package/styles/vendor/@carbon/elements/scss/grid/vendor/@carbon/layout/modules/_spacing.scss +9 -0
- package/styles/vendor/@carbon/elements/scss/grid/vendor/@carbon/layout/modules/_utilities.scss +41 -0
- package/styles/vendor/@carbon/elements/scss/grid/vendor/@carbon/layout/modules/generated/_fluid-spacing.scss +37 -0
- package/styles/vendor/@carbon/elements/scss/grid/vendor/@carbon/layout/modules/generated/_spacing.scss +85 -0
- package/styles/vendor/@carbon/elements/scss/layout/_breakpoint.scss +8 -3
- package/styles/vendor/@carbon/elements/scss/layout/modules/_breakpoint.scss +232 -0
- package/styles/vendor/@carbon/elements/scss/layout/modules/_convert.scss +40 -0
- package/styles/vendor/@carbon/elements/scss/layout/modules/_spacing.scss +9 -0
- package/styles/vendor/@carbon/elements/scss/layout/modules/_utilities.scss +41 -0
- package/styles/vendor/@carbon/elements/scss/layout/modules/generated/_fluid-spacing.scss +37 -0
- package/styles/vendor/@carbon/elements/scss/layout/modules/generated/_spacing.scss +85 -0
- package/styles/vendor/@carbon/elements/scss/motion/motion.scss +24 -0
- package/styles/vendor/@carbon/elements/scss/themes/generated/_mixins.scss +643 -138
- package/styles/vendor/@carbon/elements/scss/themes/generated/_themes.scss +154 -77
- package/styles/vendor/@carbon/elements/scss/themes/generated/_tokens.scss +157 -75
- package/styles/vendor/@carbon/elements/scss/themes/modules/_theme.scss +50 -0
- package/styles/vendor/@carbon/elements/scss/themes/modules/_themes.scss +8 -0
- package/styles/vendor/@carbon/elements/scss/themes/modules/_utilities.scss +18 -0
- package/styles/vendor/@carbon/elements/scss/themes/modules/generated/_themes.scss +247 -0
- package/styles/vendor/@carbon/elements/scss/type/_font-family.scss +2 -2
- package/styles/vendor/@carbon/elements/scss/type/_inlined/_font-family.scss +2 -2
- package/styles/vendor/@carbon/elements/scss/type/_inlined/_reset.scss +9 -3
- package/styles/vendor/@carbon/elements/scss/type/_inlined/_scale.scss +2 -2
- package/styles/vendor/@carbon/elements/scss/type/_inlined/_styles.scss +60 -57
- package/styles/vendor/@carbon/elements/scss/type/_inlined/font-face/_mono.scss +72 -72
- package/styles/vendor/@carbon/elements/scss/type/_inlined/font-face/_sans-condensed.scss +302 -0
- package/styles/vendor/@carbon/elements/scss/type/_inlined/font-face/_sans.scss +84 -84
- package/styles/vendor/@carbon/elements/scss/type/_inlined/font-face/_serif.scss +72 -72
- package/styles/vendor/@carbon/elements/scss/type/_reset.scss +9 -3
- package/styles/vendor/@carbon/elements/scss/type/_scale.scss +2 -2
- package/styles/vendor/@carbon/elements/scss/type/_styles.scss +60 -57
- package/styles/vendor/@carbon/elements/scss/type/font-face/_mono.scss +72 -72
- package/styles/vendor/@carbon/elements/scss/type/font-face/_sans-condensed.scss +302 -0
- package/styles/vendor/@carbon/elements/scss/type/font-face/_sans.scss +84 -84
- package/styles/vendor/@carbon/elements/scss/type/font-face/_serif.scss +72 -72
- package/styles/vendor/@carbon/elements/scss/type/modules/_classes.scss +42 -0
- package/styles/vendor/@carbon/elements/scss/type/modules/_font-family.scss +70 -0
- package/styles/vendor/@carbon/elements/scss/type/modules/_prefix.scss +11 -0
- package/styles/vendor/@carbon/elements/scss/type/modules/_reset.scss +92 -0
- package/styles/vendor/@carbon/elements/scss/type/modules/_scale.scss +56 -0
- package/styles/vendor/@carbon/elements/scss/type/modules/_styles.scss +713 -0
- package/styles/vendor/@carbon/elements/scss/type/vendor/@carbon/layout/_breakpoint.scss +8 -3
- package/styles/vendor/@carbon/elements/scss/type/vendor/@carbon/layout/modules/_breakpoint.scss +232 -0
- package/styles/vendor/@carbon/elements/scss/type/vendor/@carbon/layout/modules/_convert.scss +40 -0
- package/styles/vendor/@carbon/elements/scss/type/vendor/@carbon/layout/modules/_spacing.scss +9 -0
- package/styles/vendor/@carbon/elements/scss/type/vendor/@carbon/layout/modules/_utilities.scss +41 -0
- package/styles/vendor/@carbon/elements/scss/type/vendor/@carbon/layout/modules/generated/_fluid-spacing.scss +37 -0
- package/styles/vendor/@carbon/elements/scss/type/vendor/@carbon/layout/modules/generated/_spacing.scss +85 -0
- package/styles/vendor/@carbon/elements/src/__tests__/PublicAPI-test.js +12 -0
- package/styles/vendor/@carbon/elements/src/__tests__/__snapshots__/PublicAPI-test.js.snap +306 -0
- package/styles/vendor/@carbon/elements/src/index.js +166 -4
- package/styles/vendor/@carbon/elements/umd/index.js +961 -17
- package/styles/vendor/@carbon/layout/README.md +0 -6
- package/styles/vendor/@carbon/layout/es/index.js +1 -1
- package/styles/vendor/@carbon/{themes/node_modules/@carbon/colors/scss → layout}/index.scss +5 -6
- package/styles/vendor/@carbon/layout/lib/index.js +30 -30
- package/styles/vendor/@carbon/layout/package.json +14 -10
- package/styles/vendor/@carbon/layout/scss/_breakpoint.scss +8 -3
- package/styles/vendor/@carbon/layout/scss/modules/_breakpoint.scss +232 -0
- package/styles/vendor/@carbon/layout/scss/modules/_convert.scss +40 -0
- package/styles/vendor/@carbon/layout/scss/modules/_spacing.scss +9 -0
- package/styles/vendor/@carbon/layout/scss/modules/_utilities.scss +41 -0
- package/styles/vendor/@carbon/layout/scss/modules/generated/_fluid-spacing.scss +37 -0
- package/styles/vendor/@carbon/layout/scss/modules/generated/_spacing.scss +85 -0
- package/styles/vendor/@carbon/layout/umd/index.js +31 -31
- package/styles/vendor/@carbon/motion/README.md +0 -6
- package/styles/vendor/@carbon/motion/es/index.js +8 -1
- package/styles/vendor/@carbon/motion/index.scss +56 -0
- package/styles/vendor/@carbon/motion/lib/index.js +14 -0
- package/styles/vendor/@carbon/motion/package.json +10 -6
- package/styles/vendor/@carbon/motion/scss/motion.scss +24 -0
- package/styles/vendor/@carbon/motion/src/index.js +16 -0
- package/styles/vendor/@carbon/motion/umd/index.js +15 -1
- package/styles/vendor/@carbon/themes/README.md +5 -4
- package/styles/vendor/@carbon/themes/es/index.js +719 -57
- package/styles/vendor/@carbon/themes/index.scss +9 -0
- package/styles/vendor/@carbon/themes/lib/index.js +1297 -251
- package/styles/vendor/@carbon/themes/metadata.yml +3 -0
- package/styles/vendor/@carbon/themes/package.json +23 -14
- package/styles/vendor/@carbon/themes/scss/_mixins.scss +27 -146
- package/styles/vendor/@carbon/themes/scss/_theme-maps.scss +3 -263
- package/styles/vendor/@carbon/themes/scss/_tokens.scss +2 -297
- package/styles/vendor/@carbon/themes/scss/generated/_mixins.scss +1851 -0
- package/styles/vendor/@carbon/themes/scss/generated/_themes.scss +1534 -0
- package/styles/vendor/@carbon/themes/scss/generated/_tokens.scss +1757 -0
- package/styles/vendor/@carbon/themes/scss/modules/_theme.scss +50 -0
- package/styles/vendor/@carbon/themes/scss/modules/_themes.scss +8 -0
- package/styles/vendor/@carbon/themes/scss/modules/_utilities.scss +18 -0
- package/styles/vendor/@carbon/themes/scss/modules/generated/_themes.scss +247 -0
- package/styles/vendor/@carbon/themes/scss/themes.scss +3 -2
- package/styles/vendor/@carbon/themes/src/g10.js +97 -5
- package/styles/vendor/@carbon/themes/src/g100.js +96 -4
- package/styles/vendor/@carbon/themes/src/g90.js +98 -6
- package/styles/vendor/@carbon/themes/src/index.js +5 -3
- package/styles/vendor/@carbon/themes/src/tokens.js +112 -2
- package/styles/vendor/@carbon/themes/src/tools.js +25 -0
- package/styles/vendor/@carbon/themes/src/v9.js +181 -0
- package/styles/vendor/@carbon/themes/src/white.js +98 -3
- package/styles/vendor/@carbon/themes/umd/index.js +1297 -254
- package/styles/vendor/@carbon/type/README.md +0 -6
- package/styles/vendor/@carbon/type/es/index.js +111 -82
- package/styles/vendor/@carbon/type/lib/index.js +132 -103
- package/styles/vendor/@carbon/type/package.json +12 -8
- package/styles/vendor/@carbon/type/scss/_font-family.scss +2 -2
- package/styles/vendor/@carbon/type/scss/_inlined/_font-family.scss +2 -2
- package/styles/vendor/@carbon/type/scss/_inlined/_reset.scss +9 -3
- package/styles/vendor/@carbon/type/scss/_inlined/_scale.scss +2 -2
- package/styles/vendor/@carbon/type/scss/_inlined/_styles.scss +60 -57
- package/styles/vendor/@carbon/type/scss/_inlined/font-face/_mono.scss +72 -72
- package/styles/vendor/@carbon/type/scss/_inlined/font-face/_sans-condensed.scss +302 -0
- package/styles/vendor/@carbon/type/scss/_inlined/font-face/_sans.scss +84 -84
- package/styles/vendor/@carbon/type/scss/_inlined/font-face/_serif.scss +72 -72
- package/styles/vendor/@carbon/type/scss/_reset.scss +9 -3
- package/styles/vendor/@carbon/type/scss/_scale.scss +2 -2
- package/styles/vendor/@carbon/type/scss/_styles.scss +60 -57
- package/styles/vendor/@carbon/type/scss/font-face/_mono.scss +72 -72
- package/styles/vendor/@carbon/type/scss/font-face/_sans-condensed.scss +302 -0
- package/styles/vendor/@carbon/type/scss/font-face/_sans.scss +84 -84
- package/styles/vendor/@carbon/type/scss/font-face/_serif.scss +72 -72
- package/styles/vendor/@carbon/type/scss/modules/_classes.scss +42 -0
- package/styles/vendor/@carbon/type/scss/modules/_font-family.scss +70 -0
- package/styles/vendor/@carbon/type/scss/modules/_prefix.scss +11 -0
- package/styles/vendor/@carbon/type/scss/modules/_reset.scss +92 -0
- package/styles/vendor/@carbon/type/scss/modules/_scale.scss +56 -0
- package/styles/vendor/@carbon/type/scss/modules/_styles.scss +713 -0
- package/styles/vendor/@carbon/type/scss/vendor/@carbon/layout/_breakpoint.scss +8 -3
- package/styles/vendor/@carbon/type/scss/vendor/@carbon/layout/modules/_breakpoint.scss +232 -0
- package/styles/vendor/@carbon/type/scss/vendor/@carbon/layout/modules/_convert.scss +40 -0
- package/styles/vendor/@carbon/type/scss/vendor/@carbon/layout/modules/_spacing.scss +9 -0
- package/styles/vendor/@carbon/type/scss/vendor/@carbon/layout/modules/_utilities.scss +41 -0
- package/styles/vendor/@carbon/type/scss/vendor/@carbon/layout/modules/generated/_fluid-spacing.scss +37 -0
- package/styles/vendor/@carbon/type/scss/vendor/@carbon/layout/modules/generated/_spacing.scss +85 -0
- package/styles/vendor/@carbon/type/src/__tests__/__snapshots__/styles-test.js.snap +32 -34
- package/styles/vendor/@carbon/type/src/__tests__/exports-test.js +1 -1
- package/styles/vendor/@carbon/type/src/__tests__/fluid-test.js +26 -26
- package/styles/vendor/@carbon/type/src/__tests__/styles-test.js +1 -1
- package/styles/vendor/@carbon/type/src/__tests__/tokens-test.js +2 -2
- package/styles/vendor/@carbon/type/src/fluid.js +1 -1
- package/styles/vendor/@carbon/type/src/index.js +1 -1
- package/styles/vendor/@carbon/type/src/styles.js +65 -64
- package/styles/vendor/@carbon/type/src/tokens.js +64 -31
- package/styles/vendor/@carbon/type/umd/index.js +134 -105
- package/styles-g10.css +570 -2
- package/styles-g10.css.map +1 -1
- package/styles-g10.min.css +1 -1
- package/styles-g10.min.css.map +1 -1
- package/styles-g100.css +574 -6
- package/styles-g100.css.map +1 -1
- package/styles-g100.min.css +1 -1
- package/styles-g100.min.css.map +1 -1
- package/styles-g90.css +574 -6
- package/styles-g90.css.map +1 -1
- package/styles-g90.min.css +1 -1
- package/styles-g90.min.css.map +1 -1
- package/styles.css +570 -2
- package/styles.css.map +1 -1
- package/styles.min.css +1 -1
- package/styles.min.css.map +1 -1
- package/tsconfig.tsbuildinfo +64 -14
- package/styles/vendor/@carbon/layout/docs/sass.md +0 -1899
- package/styles/vendor/@carbon/themes/node_modules/@carbon/colors/LICENSE +0 -201
- package/styles/vendor/@carbon/themes/node_modules/@carbon/colors/README.md +0 -154
- package/styles/vendor/@carbon/themes/node_modules/@carbon/colors/es/index.js +0 -287
- package/styles/vendor/@carbon/themes/node_modules/@carbon/colors/lib/index.js +0 -410
- package/styles/vendor/@carbon/themes/node_modules/@carbon/colors/package.json +0 -51
- package/styles/vendor/@carbon/themes/node_modules/@carbon/colors/scss/mixins.scss +0 -646
- package/styles/vendor/@carbon/themes/node_modules/@carbon/colors/umd/index.js +0 -416
|
@@ -19,7 +19,7 @@ $carbon--grid-gutter: carbon--rem(32px);
|
|
|
19
19
|
/// @type Number
|
|
20
20
|
/// @access public
|
|
21
21
|
/// @group @carbon/layout
|
|
22
|
-
$carbon--grid-gutter--condensed: carbon--rem(
|
|
22
|
+
$carbon--grid-gutter--condensed: carbon--rem(1px);
|
|
23
23
|
|
|
24
24
|
// Initial map of our breakpoints and their values
|
|
25
25
|
/// @type Map
|
|
@@ -125,7 +125,7 @@ $carbon--grid-breakpoints: (
|
|
|
125
125
|
@return '-#{$name}';
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
-
/// Generate a media query
|
|
128
|
+
/// Generate a media query from the width of the given breakpoint to infinity
|
|
129
129
|
/// @param {String | Number} $name
|
|
130
130
|
/// @param {Map} $breakpoints [$carbon--grid-breakpoints] - A map of breakpoints where the key is the name
|
|
131
131
|
/// @content
|
|
@@ -163,8 +163,13 @@ $carbon--grid-breakpoints: (
|
|
|
163
163
|
@content;
|
|
164
164
|
}
|
|
165
165
|
} @else if map-has-key($breakpoints, $name) {
|
|
166
|
+
// We borrow this logic from bootstrap for specifying the value of the
|
|
167
|
+
// max-width. The maximum width is calculated by finding the breakpoint and
|
|
168
|
+
// subtracting .02 from its value. This value is used instead of .01 to
|
|
169
|
+
// avoid rounding issues in Safari
|
|
170
|
+
// https://github.com/twbs/bootstrap/blob/c5b1919deaf5393fcca9e9b9d7ce9c338160d99d/scss/mixins/_breakpoints.scss#L34-L46
|
|
166
171
|
$breakpoint: map-get($breakpoints, $name);
|
|
167
|
-
$width: map-get($breakpoint, width);
|
|
172
|
+
$width: map-get($breakpoint, width) - 0.02;
|
|
168
173
|
@media (max-width: $width) {
|
|
169
174
|
@content;
|
|
170
175
|
}
|
package/styles/vendor/@carbon/elements/scss/type/vendor/@carbon/layout/modules/_breakpoint.scss
ADDED
|
@@ -0,0 +1,232 @@
|
|
|
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
|
+
// https://github.com/twbs/bootstrap/blob/v4-dev/scss/mixins/_breakpoints.scss
|
|
9
|
+
@use 'sass:list';
|
|
10
|
+
@use 'sass:map';
|
|
11
|
+
@use 'sass:meta';
|
|
12
|
+
@use 'convert';
|
|
13
|
+
@use 'utilities';
|
|
14
|
+
|
|
15
|
+
/// Carbon gutter size in rem
|
|
16
|
+
/// @type Number
|
|
17
|
+
/// @access public
|
|
18
|
+
/// @group @carbon/layout
|
|
19
|
+
$grid-gutter: convert.rem(32px);
|
|
20
|
+
|
|
21
|
+
/// Carbon condensed gutter size in rem
|
|
22
|
+
/// @type Number
|
|
23
|
+
/// @access public
|
|
24
|
+
/// @group @carbon/layout
|
|
25
|
+
$grid-gutter--condensed: convert.rem(1px);
|
|
26
|
+
|
|
27
|
+
// Initial map of our breakpoints and their values
|
|
28
|
+
/// @type Map
|
|
29
|
+
/// @access public
|
|
30
|
+
/// @group @carbon/layout
|
|
31
|
+
$grid-breakpoints: (
|
|
32
|
+
sm: (
|
|
33
|
+
columns: 4,
|
|
34
|
+
margin: 0,
|
|
35
|
+
width: convert.rem(320px),
|
|
36
|
+
),
|
|
37
|
+
md: (
|
|
38
|
+
columns: 8,
|
|
39
|
+
margin: convert.rem(16px),
|
|
40
|
+
width: convert.rem(672px),
|
|
41
|
+
),
|
|
42
|
+
lg: (
|
|
43
|
+
columns: 16,
|
|
44
|
+
margin: convert.rem(16px),
|
|
45
|
+
width: convert.rem(1056px),
|
|
46
|
+
),
|
|
47
|
+
xlg: (
|
|
48
|
+
columns: 16,
|
|
49
|
+
margin: convert.rem(16px),
|
|
50
|
+
width: convert.rem(1312px),
|
|
51
|
+
),
|
|
52
|
+
max: (
|
|
53
|
+
columns: 16,
|
|
54
|
+
margin: convert.rem(24px),
|
|
55
|
+
width: convert.rem(1584px),
|
|
56
|
+
),
|
|
57
|
+
) !default;
|
|
58
|
+
|
|
59
|
+
/// Get the value of the next breakpoint, or null for the last breakpoint
|
|
60
|
+
/// @param {String} $name - The name of the brekapoint
|
|
61
|
+
/// @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
|
|
62
|
+
/// @param {List} $breakpoint-names [map-keys($breakpoints)] - A list of names from the `$breakpoints` map
|
|
63
|
+
/// @return {String}
|
|
64
|
+
/// @access public
|
|
65
|
+
/// @group @carbon/layout
|
|
66
|
+
@function breakpoint-next(
|
|
67
|
+
$name,
|
|
68
|
+
$breakpoints: $grid-breakpoints,
|
|
69
|
+
$breakpoint-names: map.keys($breakpoints)
|
|
70
|
+
) {
|
|
71
|
+
$n: list.index($breakpoint-names, $name);
|
|
72
|
+
@if $n != null and $n < list.length($breakpoint-names) {
|
|
73
|
+
@return list.nth($breakpoint-names, $n + 1);
|
|
74
|
+
}
|
|
75
|
+
@return null;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/// Get the value of the previous breakpoint, or null for the first breakpoint
|
|
79
|
+
/// @param {String} $name - The name of the brekapoint
|
|
80
|
+
/// @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
|
|
81
|
+
/// @param {List} $breakpoint-names [map-keys($breakpoints)] - A list of names from the `$breakpoints` map
|
|
82
|
+
/// @return {String}
|
|
83
|
+
/// @access public
|
|
84
|
+
/// @group @carbon/layout
|
|
85
|
+
@function breakpoint-prev(
|
|
86
|
+
$name,
|
|
87
|
+
$breakpoints: $grid-breakpoints,
|
|
88
|
+
$breakpoint-names: map.keys($breakpoints)
|
|
89
|
+
) {
|
|
90
|
+
$n: list.index($breakpoint-names, $name);
|
|
91
|
+
@if $n != null and $n > 1 {
|
|
92
|
+
@return list.nth($breakpoint-names, $n - 1);
|
|
93
|
+
}
|
|
94
|
+
@return null;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/// Check to see if the given breakpoint name
|
|
98
|
+
/// @param {String} $name - The name of the brekapoint
|
|
99
|
+
/// @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
|
|
100
|
+
/// @return {Bool}
|
|
101
|
+
/// @access public
|
|
102
|
+
/// @group @carbon/layout
|
|
103
|
+
@function is-smallest-breakpoint($name, $breakpoints: $grid-breakpoints) {
|
|
104
|
+
@return list.index(map.keys($breakpoints), $name) == 1;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/// Returns the largest breakpoint name
|
|
108
|
+
/// @param {Map} $breakpoints [$grid-breakpoints] - A map of breakpoints where the key is the name
|
|
109
|
+
/// @return {String}
|
|
110
|
+
/// @access public
|
|
111
|
+
/// @group @carbon/layout
|
|
112
|
+
@function largest-breakpoint-name($breakpoints: $grid-breakpoints) {
|
|
113
|
+
$total-breakpoints: list.length($breakpoints);
|
|
114
|
+
@return key-by-index($breakpoints, $total-breakpoints);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/// Get the infix for a given breakpoint in a list of breakpoints. Usesful for generate the size part in a selector, for example: `.prefix--col-sm-2`.
|
|
118
|
+
/// @param {String} $name - The name of the breakpoint
|
|
119
|
+
/// @return {String}
|
|
120
|
+
/// @access public
|
|
121
|
+
/// @group @carbon/layout
|
|
122
|
+
@function breakpoint-infix($name) {
|
|
123
|
+
@return '-#{$name}';
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/// Generate a media query from the width of the given breakpoint to infinity
|
|
127
|
+
/// @param {String | Number} $name
|
|
128
|
+
/// @param {Map} $breakpoints [$grid-breakpoints] - A map of breakpoints where the key is the name
|
|
129
|
+
/// @content
|
|
130
|
+
/// @access public
|
|
131
|
+
/// @group @carbon/layout
|
|
132
|
+
@mixin breakpoint-up($name, $breakpoints: $grid-breakpoints) {
|
|
133
|
+
@if meta.type-of($name) == 'number' {
|
|
134
|
+
@media (min-width: $name) {
|
|
135
|
+
@content;
|
|
136
|
+
}
|
|
137
|
+
} @else if map.has-key($breakpoints, $name) {
|
|
138
|
+
$breakpoint: map.get($breakpoints, $name);
|
|
139
|
+
$width: map.get($breakpoint, width);
|
|
140
|
+
@if is-smallest-breakpoint($name, $breakpoints) {
|
|
141
|
+
@content;
|
|
142
|
+
} @else {
|
|
143
|
+
@media (min-width: $width) {
|
|
144
|
+
@content;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
} @else {
|
|
148
|
+
@error 'Unable to find a breakpoint with name `#{$name}`. Expected one of: (#{map.keys($breakpoints)})';
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/// Generate a media query for the maximum width of the given styles
|
|
153
|
+
/// @param {String | Number} $name
|
|
154
|
+
/// @param {Map} $breakpoints [$grid-breakpoints] - A map of breakpoints where the key is the name
|
|
155
|
+
/// @content
|
|
156
|
+
/// @access public
|
|
157
|
+
/// @group @carbon/layout
|
|
158
|
+
@mixin breakpoint-down($name, $breakpoints: $grid-breakpoints) {
|
|
159
|
+
@if meta.type-of($name) == 'number' {
|
|
160
|
+
@media (max-width: $name) {
|
|
161
|
+
@content;
|
|
162
|
+
}
|
|
163
|
+
} @else if map.has-key($breakpoints, $name) {
|
|
164
|
+
// We borrow this logic from bootstrap for specifying the value of the
|
|
165
|
+
// max-width. The maximum width is calculated by finding the breakpoint and
|
|
166
|
+
// subtracting .02 from its value. This value is used instead of .01 to
|
|
167
|
+
// avoid rounding issues in Safari
|
|
168
|
+
// https://github.com/twbs/bootstrap/blob/c5b1919deaf5393fcca9e9b9d7ce9c338160d99d/scss/mixins/_breakpoints.scss#L34-L46
|
|
169
|
+
$breakpoint: map.get($breakpoints, $name);
|
|
170
|
+
$width: map.get($breakpoint, width) - 0.02;
|
|
171
|
+
@media (max-width: $width) {
|
|
172
|
+
@content;
|
|
173
|
+
}
|
|
174
|
+
} @else {
|
|
175
|
+
@error 'Unable to find a breakpoint with name `#{$name}`. Expected one of: (#{map.keys($breakpoints)})';
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/// Generate a media query for the range between the lower and upper breakpoints
|
|
180
|
+
/// @param {String | Number} $lower
|
|
181
|
+
/// @param {String | Number} $upper
|
|
182
|
+
/// @param {Map} $breakpoints [$grid-breakpoints] - A map of breakpoints where the key is the name
|
|
183
|
+
/// @content
|
|
184
|
+
/// @access public
|
|
185
|
+
/// @group @carbon/layout
|
|
186
|
+
@mixin breakpoint-between($lower, $upper, $breakpoints: $grid-breakpoints) {
|
|
187
|
+
$is-number-lower: meta.type-of($lower) == 'number';
|
|
188
|
+
$is-number-upper: meta.type-of($upper) == 'number';
|
|
189
|
+
$min: if($is-number-lower, $lower, map.get($breakpoints, $lower));
|
|
190
|
+
$max: if($is-number-upper, $upper, map.get($breakpoints, $upper));
|
|
191
|
+
|
|
192
|
+
@if $min and $max {
|
|
193
|
+
$min-width: if(not $is-number-lower and $min, map.get($min, width), $min);
|
|
194
|
+
$max-width: if(not $is-number-upper and $max, map.get($max, width), $max);
|
|
195
|
+
@media (min-width: $min-width) and (max-width: $max-width) {
|
|
196
|
+
@content;
|
|
197
|
+
}
|
|
198
|
+
} @else if $min != null and $max == null {
|
|
199
|
+
@include breakpoint-up($lower) {
|
|
200
|
+
@content;
|
|
201
|
+
}
|
|
202
|
+
} @else if $min == null and $max != null {
|
|
203
|
+
@include breakpoint-down($upper) {
|
|
204
|
+
@content;
|
|
205
|
+
}
|
|
206
|
+
} @else {
|
|
207
|
+
@error 'Unable to find a breakpoint to satisfy: (#{$lower},#{$upper}). Expected both to be one of (#{map.keys($breakpoints)}).';
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/// Generate media query for the largest breakpoint
|
|
212
|
+
/// @param {Map} $breakpoints [$grid-breakpoints] - A map of breakpoints where the key is the name
|
|
213
|
+
/// @content
|
|
214
|
+
/// @access public
|
|
215
|
+
/// @group @carbon/layout
|
|
216
|
+
@mixin largest-breakpoint($breakpoints: $grid-breakpoints) {
|
|
217
|
+
@include breakpoint(largest-breakpoint-name()) {
|
|
218
|
+
@content;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/// Generate a media query for a given breakpoint
|
|
223
|
+
/// @param {String | Number} $name
|
|
224
|
+
/// @param {Map} $breakpoints [$grid-breakpoints] - A map of breakpoints where the key is the name
|
|
225
|
+
/// @content
|
|
226
|
+
/// @access public
|
|
227
|
+
/// @group @carbon/layout
|
|
228
|
+
@mixin breakpoint($name, $breakpoints: $grid-breakpoints) {
|
|
229
|
+
@include breakpoint-up($name, $breakpoints) {
|
|
230
|
+
@content;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
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
|
+
/// Default font size
|
|
9
|
+
/// @type Number
|
|
10
|
+
/// @access public
|
|
11
|
+
/// @group @carbon/layout
|
|
12
|
+
$base-font-size: 16px !default;
|
|
13
|
+
|
|
14
|
+
/// Convert a given px unit to a rem unit
|
|
15
|
+
/// @param {Number} $px - Number with px unit
|
|
16
|
+
/// @return {Number} Number with rem unit
|
|
17
|
+
/// @access public
|
|
18
|
+
/// @group @carbon/layout
|
|
19
|
+
@function rem($px) {
|
|
20
|
+
@if unit($px) != 'px' {
|
|
21
|
+
// TODO: update to @error in v11
|
|
22
|
+
@warn "Expected argument $px to be of type `px`, instead received: `#{unit($px)}`";
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@return ($px / $base-font-size) * 1rem;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/// Convert a given px unit to a em unit
|
|
29
|
+
/// @param {Number} $px - Number with px unit
|
|
30
|
+
/// @return {Number} Number with em unit
|
|
31
|
+
/// @access public
|
|
32
|
+
/// @group @carbon/layout
|
|
33
|
+
@function em($px) {
|
|
34
|
+
@if unit($px) != 'px' {
|
|
35
|
+
// TODO: update to @error in v11
|
|
36
|
+
@warn "Expected argument $px to be of type `px`, instead received: `#{unit($px)}`";
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
@return ($px / $base-font-size) * 1em;
|
|
40
|
+
}
|
package/styles/vendor/@carbon/elements/scss/type/vendor/@carbon/layout/modules/_utilities.scss
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
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
|
+
/// Map deep get
|
|
9
|
+
/// @author Hugo Giraudel
|
|
10
|
+
/// @access public
|
|
11
|
+
/// @param {Map} $map - Map
|
|
12
|
+
/// @param {Arglist} $keys - Key chain
|
|
13
|
+
/// @return {*} Desired value
|
|
14
|
+
/// @group @carbon/layout
|
|
15
|
+
@function map-deep-get($map, $keys...) {
|
|
16
|
+
@each $key in $keys {
|
|
17
|
+
$map: map-get($map, $key);
|
|
18
|
+
}
|
|
19
|
+
@return $map;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/// Provide a map and index, and get back the relevant key value
|
|
23
|
+
/// @access public
|
|
24
|
+
/// @param {Map} $map - Map
|
|
25
|
+
/// @param {Integer} $index - Key chain
|
|
26
|
+
/// @return {String} Desired value
|
|
27
|
+
/// @group @carbon/layout
|
|
28
|
+
@function key-by-index($map, $index) {
|
|
29
|
+
$keys: map-keys($map);
|
|
30
|
+
@return nth($keys, $index);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/// Pass in a map, and get the last one in the list back
|
|
34
|
+
/// @access public
|
|
35
|
+
/// @param {Map} $map - Map
|
|
36
|
+
/// @return {*} Desired value
|
|
37
|
+
/// @group @carbon/layout
|
|
38
|
+
@function last-map-item($map) {
|
|
39
|
+
$total-length: length($map);
|
|
40
|
+
@return map-get($map, carbon--key-by-index($map, $total-length));
|
|
41
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// Code generated by @carbon/layout. DO NOT EDIT.
|
|
2
|
+
//
|
|
3
|
+
// Copyright IBM Corp. 2018, 2019
|
|
4
|
+
//
|
|
5
|
+
// This source code is licensed under the Apache-2.0 license found in the
|
|
6
|
+
// LICENSE file in the root directory of this source tree.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
/// @type Number
|
|
10
|
+
/// @access public
|
|
11
|
+
/// @group @carbon/layout
|
|
12
|
+
$fluid-spacing-01: 0 !default;
|
|
13
|
+
|
|
14
|
+
/// @type Number
|
|
15
|
+
/// @access public
|
|
16
|
+
/// @group @carbon/layout
|
|
17
|
+
$fluid-spacing-02: 2vw !default;
|
|
18
|
+
|
|
19
|
+
/// @type Number
|
|
20
|
+
/// @access public
|
|
21
|
+
/// @group @carbon/layout
|
|
22
|
+
$fluid-spacing-03: 5vw !default;
|
|
23
|
+
|
|
24
|
+
/// @type Number
|
|
25
|
+
/// @access public
|
|
26
|
+
/// @group @carbon/layout
|
|
27
|
+
$fluid-spacing-04: 10vw !default;
|
|
28
|
+
|
|
29
|
+
/// @type Map
|
|
30
|
+
/// @access public
|
|
31
|
+
/// @group @carbon/layout
|
|
32
|
+
$fluid-spacing: (
|
|
33
|
+
fluid-spacing-01: $fluid-spacing-01,
|
|
34
|
+
fluid-spacing-02: $fluid-spacing-02,
|
|
35
|
+
fluid-spacing-03: $fluid-spacing-03,
|
|
36
|
+
fluid-spacing-04: $fluid-spacing-04,
|
|
37
|
+
);
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
// Code generated by @carbon/layout. DO NOT EDIT.
|
|
2
|
+
//
|
|
3
|
+
// Copyright IBM Corp. 2018, 2019
|
|
4
|
+
//
|
|
5
|
+
// This source code is licensed under the Apache-2.0 license found in the
|
|
6
|
+
// LICENSE file in the root directory of this source tree.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
/// @type Number
|
|
10
|
+
/// @access public
|
|
11
|
+
/// @group @carbon/layout
|
|
12
|
+
$spacing-01: 0.125rem !default;
|
|
13
|
+
|
|
14
|
+
/// @type Number
|
|
15
|
+
/// @access public
|
|
16
|
+
/// @group @carbon/layout
|
|
17
|
+
$spacing-02: 0.25rem !default;
|
|
18
|
+
|
|
19
|
+
/// @type Number
|
|
20
|
+
/// @access public
|
|
21
|
+
/// @group @carbon/layout
|
|
22
|
+
$spacing-03: 0.5rem !default;
|
|
23
|
+
|
|
24
|
+
/// @type Number
|
|
25
|
+
/// @access public
|
|
26
|
+
/// @group @carbon/layout
|
|
27
|
+
$spacing-04: 0.75rem !default;
|
|
28
|
+
|
|
29
|
+
/// @type Number
|
|
30
|
+
/// @access public
|
|
31
|
+
/// @group @carbon/layout
|
|
32
|
+
$spacing-05: 1rem !default;
|
|
33
|
+
|
|
34
|
+
/// @type Number
|
|
35
|
+
/// @access public
|
|
36
|
+
/// @group @carbon/layout
|
|
37
|
+
$spacing-06: 1.5rem !default;
|
|
38
|
+
|
|
39
|
+
/// @type Number
|
|
40
|
+
/// @access public
|
|
41
|
+
/// @group @carbon/layout
|
|
42
|
+
$spacing-07: 2rem !default;
|
|
43
|
+
|
|
44
|
+
/// @type Number
|
|
45
|
+
/// @access public
|
|
46
|
+
/// @group @carbon/layout
|
|
47
|
+
$spacing-08: 2.5rem !default;
|
|
48
|
+
|
|
49
|
+
/// @type Number
|
|
50
|
+
/// @access public
|
|
51
|
+
/// @group @carbon/layout
|
|
52
|
+
$spacing-09: 3rem !default;
|
|
53
|
+
|
|
54
|
+
/// @type Number
|
|
55
|
+
/// @access public
|
|
56
|
+
/// @group @carbon/layout
|
|
57
|
+
$spacing-10: 4rem !default;
|
|
58
|
+
|
|
59
|
+
/// @type Number
|
|
60
|
+
/// @access public
|
|
61
|
+
/// @group @carbon/layout
|
|
62
|
+
$spacing-11: 5rem !default;
|
|
63
|
+
|
|
64
|
+
/// @type Number
|
|
65
|
+
/// @access public
|
|
66
|
+
/// @group @carbon/layout
|
|
67
|
+
$spacing-12: 6rem !default;
|
|
68
|
+
|
|
69
|
+
/// @type Map
|
|
70
|
+
/// @access public
|
|
71
|
+
/// @group @carbon/layout
|
|
72
|
+
$spacing: (
|
|
73
|
+
spacing-01: $spacing-01,
|
|
74
|
+
spacing-02: $spacing-02,
|
|
75
|
+
spacing-03: $spacing-03,
|
|
76
|
+
spacing-04: $spacing-04,
|
|
77
|
+
spacing-05: $spacing-05,
|
|
78
|
+
spacing-06: $spacing-06,
|
|
79
|
+
spacing-07: $spacing-07,
|
|
80
|
+
spacing-08: $spacing-08,
|
|
81
|
+
spacing-09: $spacing-09,
|
|
82
|
+
spacing-10: $spacing-10,
|
|
83
|
+
spacing-11: $spacing-11,
|
|
84
|
+
spacing-12: $spacing-12,
|
|
85
|
+
);
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
import * as CarbonElements from '../';
|
|
9
|
+
|
|
10
|
+
test('Public API should only change with a semver change', () => {
|
|
11
|
+
expect(Object.keys(CarbonElements).sort()).toMatchSnapshot();
|
|
12
|
+
});
|