@carbon/styles 0.16.2 → 0.17.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.
- package/docs/sass.md +462 -0
- package/package.json +9 -17
- package/scss/components/data-table/_data-table.scss +2 -164
- package/scss/components/data-table/action/_data-table-action.scss +2 -19
- package/scss/components/data-table/expandable/_data-table-expandable.scss +0 -2
- package/scss/components/data-table/sort/_data-table-sort.scss +1 -28
- package/scss/components/file-uploader/_file-uploader.scss +3 -3
- package/scss/components/overflow-menu/_overflow-menu.scss +5 -5
- package/scss/components/popover/_popover.scss +0 -8
- package/scss/components/progress-bar/_progress-bar.scss +21 -0
- package/scss/components/search/_search.scss +6 -0
- package/scss/components/time-picker/_time-picker.scss +0 -3
- package/scss/components/treeview/_treeview.scss +1 -1
- package/scss/__tests__/__snapshots__/colors-test.js.snap +0 -404
- package/scss/__tests__/__snapshots__/config-test.js.snap +0 -15
- package/scss/__tests__/__snapshots__/motion-test.js.snap +0 -39
- package/scss/__tests__/breakpoint-test.js +0 -42
- package/scss/__tests__/colors-test.js +0 -28
- package/scss/__tests__/config-test.js +0 -53
- package/scss/__tests__/grid-test.js +0 -48
- package/scss/__tests__/layer-test.js +0 -82
- package/scss/__tests__/motion-test.js +0 -37
- package/scss/__tests__/reset-test.js +0 -28
- package/scss/__tests__/theme-test.js +0 -151
- package/scss/__tests__/themes-test.js +0 -36
- package/scss/__tests__/type-test.js +0 -78
- package/scss/components/__tests__/accordion-test.js +0 -47
- package/scss/components/__tests__/breadcrumb-test.js +0 -27
- package/scss/components/__tests__/button-test.js +0 -71
- package/scss/components/__tests__/checkbox-test.js +0 -27
- package/scss/components/__tests__/code-snippet-test.js +0 -44
- package/scss/components/__tests__/combo-box-test.js +0 -27
- package/scss/components/__tests__/content-switcher-test.js +0 -27
- package/scss/components/__tests__/copy-button-test.js +0 -27
- package/scss/components/__tests__/data-table-test.js +0 -85
- package/scss/components/__tests__/date-picker-test.js +0 -26
- package/scss/components/__tests__/dropdown-test.js +0 -27
- package/scss/components/__tests__/file-uploader.js +0 -27
- package/scss/components/__tests__/form-test.js +0 -43
- package/scss/components/__tests__/inline-loading-test.js +0 -26
- package/scss/components/__tests__/link-test.js +0 -26
- package/scss/components/__tests__/list-box-test.js +0 -36
- package/scss/components/__tests__/list-test.js +0 -26
- package/scss/components/__tests__/loading-test.js +0 -26
- package/scss/components/__tests__/menu-test.js +0 -27
- package/scss/components/__tests__/modal-test.js +0 -27
- package/scss/components/__tests__/multiselect-test.js +0 -27
- package/scss/components/__tests__/notification-test.js +0 -49
- package/scss/components/__tests__/number-input-test.js +0 -27
- package/scss/components/__tests__/overflow-menu-test.js +0 -27
- package/scss/components/__tests__/pagination-nav-test.js +0 -26
- package/scss/components/__tests__/pagination-test.js +0 -26
- package/scss/components/__tests__/progress-bar-test.js +0 -26
- package/scss/components/__tests__/progress-indicator-test.js +0 -26
- package/scss/components/__tests__/radio-button-test.js +0 -25
- package/scss/components/__tests__/search-test.js +0 -25
- package/scss/components/__tests__/select-test.js +0 -26
- package/scss/components/__tests__/skeleton-test.js +0 -26
- package/scss/components/__tests__/slider-test.js +0 -26
- package/scss/components/__tests__/structured-list-test.js +0 -27
- package/scss/components/__tests__/tabs-test.js +0 -27
- package/scss/components/__tests__/tag-test.js +0 -25
- package/scss/components/__tests__/text-area-test.js +0 -26
- package/scss/components/__tests__/text-input-test.js +0 -26
- package/scss/components/__tests__/tile-test.js +0 -26
- package/scss/components/__tests__/time-picker-test.js +0 -26
- package/scss/components/__tests__/toggle-test.js +0 -27
- package/scss/components/__tests__/tooltip-test.js +0 -25
- package/scss/components/__tests__/treeview-test.js +0 -25
- package/scss/components/__tests__/ui-shell-test.js +0 -27
- package/scss/fonts/__tests__/fonts-test.js +0 -142
- package/scss/utilities/__tests__/custom-property-test.js +0 -50
|
@@ -1,25 +0,0 @@
|
|
|
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
|
-
* @jest-environment node
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
'use strict';
|
|
11
|
-
|
|
12
|
-
const { SassRenderer } = require('@carbon/test-utils/scss');
|
|
13
|
-
|
|
14
|
-
const { render } = SassRenderer.create(__dirname);
|
|
15
|
-
|
|
16
|
-
describe('scss/components/radio-button', () => {
|
|
17
|
-
test('Public API', async () => {
|
|
18
|
-
const { unwrap } = await render(`
|
|
19
|
-
@use 'sass:meta';
|
|
20
|
-
@use '../radio-button/radio-button';
|
|
21
|
-
$_: get('mixin', meta.mixin-exists('radio-button', 'radio-button'));
|
|
22
|
-
`);
|
|
23
|
-
expect(unwrap('mixin')).toBe(true);
|
|
24
|
-
});
|
|
25
|
-
});
|
|
@@ -1,25 +0,0 @@
|
|
|
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
|
-
* @jest-environment node
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
'use strict';
|
|
11
|
-
|
|
12
|
-
const { SassRenderer } = require('@carbon/test-utils/scss');
|
|
13
|
-
|
|
14
|
-
const { render } = SassRenderer.create(__dirname);
|
|
15
|
-
|
|
16
|
-
describe('scss/components/search', () => {
|
|
17
|
-
test('Public API', async () => {
|
|
18
|
-
const { unwrap } = await render(`
|
|
19
|
-
@use 'sass:meta';
|
|
20
|
-
@use '../search';
|
|
21
|
-
$_: get('mixin', meta.mixin-exists('search', 'search'));
|
|
22
|
-
`);
|
|
23
|
-
expect(unwrap('mixin')).toBe(true);
|
|
24
|
-
});
|
|
25
|
-
});
|
|
@@ -1,26 +0,0 @@
|
|
|
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
|
-
* @jest-environment node
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
'use strict';
|
|
11
|
-
|
|
12
|
-
const { SassRenderer } = require('@carbon/test-utils/scss');
|
|
13
|
-
|
|
14
|
-
const { render } = SassRenderer.create(__dirname);
|
|
15
|
-
|
|
16
|
-
describe('scss/components/select', () => {
|
|
17
|
-
test('Public API', async () => {
|
|
18
|
-
const { unwrap } = await render(`
|
|
19
|
-
@use 'sass:meta';
|
|
20
|
-
@use '../select';
|
|
21
|
-
|
|
22
|
-
$_: get('mixin', meta.mixin-exists('select', 'select'));
|
|
23
|
-
`);
|
|
24
|
-
expect(unwrap('mixin')).toBe(true);
|
|
25
|
-
});
|
|
26
|
-
});
|
|
@@ -1,26 +0,0 @@
|
|
|
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
|
-
* @jest-environment node
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
'use strict';
|
|
11
|
-
|
|
12
|
-
const { SassRenderer } = require('@carbon/test-utils/scss');
|
|
13
|
-
|
|
14
|
-
const { render } = SassRenderer.create(__dirname);
|
|
15
|
-
|
|
16
|
-
describe('scss/components/skeleton-styles', () => {
|
|
17
|
-
test('Public API', async () => {
|
|
18
|
-
const { unwrap } = await render(`
|
|
19
|
-
@use 'sass:meta';
|
|
20
|
-
@use '../skeleton-styles';
|
|
21
|
-
|
|
22
|
-
$_: get('mixin', meta.mixin-exists('skeleton-styles', 'skeleton-styles'));
|
|
23
|
-
`);
|
|
24
|
-
expect(unwrap('mixin')).toBe(true);
|
|
25
|
-
});
|
|
26
|
-
});
|
|
@@ -1,26 +0,0 @@
|
|
|
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
|
-
* @jest-environment node
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
'use strict';
|
|
11
|
-
|
|
12
|
-
const { SassRenderer } = require('@carbon/test-utils/scss');
|
|
13
|
-
|
|
14
|
-
const { render } = SassRenderer.create(__dirname);
|
|
15
|
-
|
|
16
|
-
describe('scss/components/slider', () => {
|
|
17
|
-
test('Public API', async () => {
|
|
18
|
-
const { unwrap } = await render(`
|
|
19
|
-
@use 'sass:meta';
|
|
20
|
-
@use '../slider';
|
|
21
|
-
|
|
22
|
-
$_: get('mixin', meta.mixin-exists('slider', 'slider'));
|
|
23
|
-
`);
|
|
24
|
-
expect(unwrap('mixin')).toBe(true);
|
|
25
|
-
});
|
|
26
|
-
});
|
|
@@ -1,27 +0,0 @@
|
|
|
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
|
-
* @jest-environment node
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
'use strict';
|
|
11
|
-
|
|
12
|
-
const { SassRenderer } = require('@carbon/test-utils/scss');
|
|
13
|
-
|
|
14
|
-
const { render } = SassRenderer.create(__dirname);
|
|
15
|
-
|
|
16
|
-
describe('scss/components/structured-list', () => {
|
|
17
|
-
test('Public API', async () => {
|
|
18
|
-
const { unwrap } = await render(`
|
|
19
|
-
@use 'sass:map';
|
|
20
|
-
@use 'sass:meta';
|
|
21
|
-
@use '../structured-list';
|
|
22
|
-
|
|
23
|
-
$_: get('mixin', meta.mixin-exists('structured-list', 'structured-list'));
|
|
24
|
-
`);
|
|
25
|
-
expect(unwrap('mixin')).toBe(true);
|
|
26
|
-
});
|
|
27
|
-
});
|
|
@@ -1,27 +0,0 @@
|
|
|
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
|
-
* @jest-environment node
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
'use strict';
|
|
11
|
-
|
|
12
|
-
const { SassRenderer } = require('@carbon/test-utils/scss');
|
|
13
|
-
|
|
14
|
-
const { render } = SassRenderer.create(__dirname);
|
|
15
|
-
|
|
16
|
-
describe('scss/components/tabs', () => {
|
|
17
|
-
test('Public API', async () => {
|
|
18
|
-
const { unwrap } = await render(`
|
|
19
|
-
@use 'sass:map';
|
|
20
|
-
@use 'sass:meta';
|
|
21
|
-
@use '../tabs';
|
|
22
|
-
|
|
23
|
-
$_: get('mixin', meta.mixin-exists('tabs', 'tabs'));
|
|
24
|
-
`);
|
|
25
|
-
expect(unwrap('mixin')).toBe(true);
|
|
26
|
-
});
|
|
27
|
-
});
|
|
@@ -1,25 +0,0 @@
|
|
|
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
|
-
* @jest-environment node
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
'use strict';
|
|
11
|
-
|
|
12
|
-
const { SassRenderer } = require('@carbon/test-utils/scss');
|
|
13
|
-
|
|
14
|
-
const { render } = SassRenderer.create(__dirname);
|
|
15
|
-
|
|
16
|
-
describe('scss/components/tag', () => {
|
|
17
|
-
test('Public API', async () => {
|
|
18
|
-
const { unwrap } = await render(`
|
|
19
|
-
@use 'sass:meta';
|
|
20
|
-
@use '../tag/tag';
|
|
21
|
-
$_: get('mixin', meta.mixin-exists('tag', 'tag'));
|
|
22
|
-
`);
|
|
23
|
-
expect(unwrap('mixin')).toBe(true);
|
|
24
|
-
});
|
|
25
|
-
});
|
|
@@ -1,26 +0,0 @@
|
|
|
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
|
-
* @jest-environment node
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
'use strict';
|
|
11
|
-
|
|
12
|
-
const { SassRenderer } = require('@carbon/test-utils/scss');
|
|
13
|
-
|
|
14
|
-
const { render } = SassRenderer.create(__dirname);
|
|
15
|
-
|
|
16
|
-
describe('scss/components/text-area', () => {
|
|
17
|
-
test('Public API', async () => {
|
|
18
|
-
const { unwrap } = await render(`
|
|
19
|
-
@use 'sass:meta';
|
|
20
|
-
@use '../text-area';
|
|
21
|
-
|
|
22
|
-
$_: get('mixin', meta.mixin-exists('text-area', 'text-area'));
|
|
23
|
-
`);
|
|
24
|
-
expect(unwrap('mixin')).toBe(true);
|
|
25
|
-
});
|
|
26
|
-
});
|
|
@@ -1,26 +0,0 @@
|
|
|
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
|
-
* @jest-environment node
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
'use strict';
|
|
11
|
-
|
|
12
|
-
const { SassRenderer } = require('@carbon/test-utils/scss');
|
|
13
|
-
|
|
14
|
-
const { render } = SassRenderer.create(__dirname);
|
|
15
|
-
|
|
16
|
-
describe('scss/components/text-input', () => {
|
|
17
|
-
test('Public API', async () => {
|
|
18
|
-
const { unwrap } = await render(`
|
|
19
|
-
@use 'sass:meta';
|
|
20
|
-
@use '../text-input';
|
|
21
|
-
|
|
22
|
-
$_: get('mixin', meta.mixin-exists('text-input', 'text-input'));
|
|
23
|
-
`);
|
|
24
|
-
expect(unwrap('mixin')).toBe(true);
|
|
25
|
-
});
|
|
26
|
-
});
|
|
@@ -1,26 +0,0 @@
|
|
|
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
|
-
* @jest-environment node
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
'use strict';
|
|
11
|
-
|
|
12
|
-
const { SassRenderer } = require('@carbon/test-utils/scss');
|
|
13
|
-
|
|
14
|
-
const { render } = SassRenderer.create(__dirname);
|
|
15
|
-
|
|
16
|
-
describe('scss/components/tile', () => {
|
|
17
|
-
test('Public API', async () => {
|
|
18
|
-
const { unwrap } = await render(`
|
|
19
|
-
@use 'sass:meta';
|
|
20
|
-
@use '../tile';
|
|
21
|
-
|
|
22
|
-
$_: get('mixin', meta.mixin-exists('tile', 'tile'));
|
|
23
|
-
`);
|
|
24
|
-
expect(unwrap('mixin')).toBe(true);
|
|
25
|
-
});
|
|
26
|
-
});
|
|
@@ -1,26 +0,0 @@
|
|
|
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
|
-
* @jest-environment node
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
'use strict';
|
|
11
|
-
|
|
12
|
-
const { SassRenderer } = require('@carbon/test-utils/scss');
|
|
13
|
-
|
|
14
|
-
const { render } = SassRenderer.create(__dirname);
|
|
15
|
-
|
|
16
|
-
describe('scss/components/time-picker', () => {
|
|
17
|
-
test('Public API', async () => {
|
|
18
|
-
const { unwrap } = await render(`
|
|
19
|
-
@use 'sass:meta';
|
|
20
|
-
@use '../time-picker';
|
|
21
|
-
|
|
22
|
-
$_: get('mixin', meta.mixin-exists('time-picker', 'time-picker'));
|
|
23
|
-
`);
|
|
24
|
-
expect(unwrap('mixin')).toBe(true);
|
|
25
|
-
});
|
|
26
|
-
});
|
|
@@ -1,27 +0,0 @@
|
|
|
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
|
-
* @jest-environment node
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
'use strict';
|
|
11
|
-
|
|
12
|
-
const { SassRenderer } = require('@carbon/test-utils/scss');
|
|
13
|
-
|
|
14
|
-
const { render } = SassRenderer.create(__dirname);
|
|
15
|
-
|
|
16
|
-
describe('scss/components/toggle', () => {
|
|
17
|
-
test('Public API', async () => {
|
|
18
|
-
const { unwrap } = await render(`
|
|
19
|
-
@use 'sass:map';
|
|
20
|
-
@use 'sass:meta';
|
|
21
|
-
@use '../toggle';
|
|
22
|
-
|
|
23
|
-
$_: get('mixin', meta.mixin-exists('toggle', 'toggle'));
|
|
24
|
-
`);
|
|
25
|
-
expect(unwrap('mixin')).toBe(true);
|
|
26
|
-
});
|
|
27
|
-
});
|
|
@@ -1,25 +0,0 @@
|
|
|
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
|
-
* @jest-environment node
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
'use strict';
|
|
11
|
-
|
|
12
|
-
const { SassRenderer } = require('@carbon/test-utils/scss');
|
|
13
|
-
|
|
14
|
-
const { render } = SassRenderer.create(__dirname);
|
|
15
|
-
|
|
16
|
-
describe('scss/components/tooltip', () => {
|
|
17
|
-
test('Public API', async () => {
|
|
18
|
-
const { unwrap } = await render(`
|
|
19
|
-
@use 'sass:meta';
|
|
20
|
-
@use '../tooltip/tooltip';
|
|
21
|
-
$_: get('mixin', meta.mixin-exists('tooltip', 'tooltip'));
|
|
22
|
-
`);
|
|
23
|
-
expect(unwrap('mixin')).toBe(true);
|
|
24
|
-
});
|
|
25
|
-
});
|
|
@@ -1,25 +0,0 @@
|
|
|
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
|
-
* @jest-environment node
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
'use strict';
|
|
11
|
-
|
|
12
|
-
const { SassRenderer } = require('@carbon/test-utils/scss');
|
|
13
|
-
|
|
14
|
-
const { render } = SassRenderer.create(__dirname);
|
|
15
|
-
|
|
16
|
-
describe('scss/components/treeview', () => {
|
|
17
|
-
test('Public API', async () => {
|
|
18
|
-
const { unwrap } = await render(`
|
|
19
|
-
@use 'sass:meta';
|
|
20
|
-
@use '../treeview';
|
|
21
|
-
$_: get('mixin', meta.mixin-exists('treeview', 'treeview'));
|
|
22
|
-
`);
|
|
23
|
-
expect(unwrap('mixin')).toBe(true);
|
|
24
|
-
});
|
|
25
|
-
});
|
|
@@ -1,27 +0,0 @@
|
|
|
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
|
-
* @jest-environment node
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
'use strict';
|
|
11
|
-
|
|
12
|
-
const { SassRenderer } = require('@carbon/test-utils/scss');
|
|
13
|
-
|
|
14
|
-
const { render } = SassRenderer.create(__dirname);
|
|
15
|
-
|
|
16
|
-
describe('scss/components/ui-shell', () => {
|
|
17
|
-
test('Public API', async () => {
|
|
18
|
-
const { unwrap } = await render(`
|
|
19
|
-
@use 'sass:map';
|
|
20
|
-
@use 'sass:meta';
|
|
21
|
-
@use '../ui-shell';
|
|
22
|
-
|
|
23
|
-
$_: get('mixin', meta.mixin-exists('ui-shell', 'ui-shell'));
|
|
24
|
-
`);
|
|
25
|
-
expect(unwrap('mixin')).toBe(true);
|
|
26
|
-
});
|
|
27
|
-
});
|
|
@@ -1,142 +0,0 @@
|
|
|
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
|
-
* @jest-environment node
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
'use strict';
|
|
11
|
-
|
|
12
|
-
const { SassRenderer } = require('@carbon/test-utils/scss');
|
|
13
|
-
const css = require('css');
|
|
14
|
-
|
|
15
|
-
const { render } = SassRenderer.create(__dirname);
|
|
16
|
-
|
|
17
|
-
const fonts = [
|
|
18
|
-
'mono',
|
|
19
|
-
'sans-arabic',
|
|
20
|
-
'sans-devanagari',
|
|
21
|
-
'sans-hebrew',
|
|
22
|
-
'sans-thai-looped',
|
|
23
|
-
'sans-thai',
|
|
24
|
-
'sans',
|
|
25
|
-
'serif',
|
|
26
|
-
];
|
|
27
|
-
const weights = [
|
|
28
|
-
'thin',
|
|
29
|
-
'extralight',
|
|
30
|
-
'light',
|
|
31
|
-
'regular',
|
|
32
|
-
'text',
|
|
33
|
-
'medium',
|
|
34
|
-
'semibold',
|
|
35
|
-
'bold',
|
|
36
|
-
];
|
|
37
|
-
|
|
38
|
-
describe('@carbon/styles/scss/fonts', () => {
|
|
39
|
-
it('should emit default fonts, weights, and styles', async () => {
|
|
40
|
-
const { result } = await render(`@use '../' as fonts;`);
|
|
41
|
-
const { stylesheet } = css.parse(result.css.toString());
|
|
42
|
-
const atRules = stylesheet.rules.filter((rule) => {
|
|
43
|
-
return rule.type === 'font-face';
|
|
44
|
-
});
|
|
45
|
-
const emitted = new Map();
|
|
46
|
-
|
|
47
|
-
for (const rule of atRules) {
|
|
48
|
-
const fontFamily = rule.declarations
|
|
49
|
-
.find((declaration) => {
|
|
50
|
-
return declaration.property === 'font-family';
|
|
51
|
-
})
|
|
52
|
-
.value.replace(/['"]/g, '');
|
|
53
|
-
|
|
54
|
-
if (!emitted.has(fontFamily)) {
|
|
55
|
-
emitted.set(fontFamily, {
|
|
56
|
-
weights: new Set(),
|
|
57
|
-
styles: new Set(),
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
const entry = emitted.get(fontFamily);
|
|
62
|
-
|
|
63
|
-
for (const declaration of rule.declarations) {
|
|
64
|
-
if (declaration.property === 'font-weight') {
|
|
65
|
-
entry.weights.add(declaration.value);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
if (declaration.property === 'font-style') {
|
|
69
|
-
entry.styles.add(declaration.value);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
expect(emitted.has('IBM Plex Mono')).toBe(true);
|
|
75
|
-
const mono = emitted.get('IBM Plex Mono');
|
|
76
|
-
expect(mono.weights).toEqual(new Set(['300', '400', '600']));
|
|
77
|
-
expect(mono.styles).toEqual(new Set(['normal', 'italic']));
|
|
78
|
-
|
|
79
|
-
expect(emitted.has('IBM Plex Sans')).toBe(true);
|
|
80
|
-
expect(emitted.get('IBM Plex Sans').weights).toEqual(
|
|
81
|
-
new Set(['300', '400', '600'])
|
|
82
|
-
);
|
|
83
|
-
expect(emitted.get('IBM Plex Sans').styles).toEqual(
|
|
84
|
-
new Set(['normal', 'italic'])
|
|
85
|
-
);
|
|
86
|
-
|
|
87
|
-
expect(emitted.has('IBM Plex Serif')).toBe(true);
|
|
88
|
-
expect(emitted.get('IBM Plex Serif').weights).toEqual(
|
|
89
|
-
new Set(['300', '400', '600'])
|
|
90
|
-
);
|
|
91
|
-
expect(emitted.get('IBM Plex Serif').styles).toEqual(
|
|
92
|
-
new Set(['normal', 'italic'])
|
|
93
|
-
);
|
|
94
|
-
});
|
|
95
|
-
|
|
96
|
-
it('should emit no @font-face blocks if $css--font-face is false', async () => {
|
|
97
|
-
const { result } = await render(`
|
|
98
|
-
@use '../../config' with (
|
|
99
|
-
$css--font-face: false,
|
|
100
|
-
);
|
|
101
|
-
@use '../' as fonts;
|
|
102
|
-
`);
|
|
103
|
-
expect(result.css.toString()).toBe('');
|
|
104
|
-
});
|
|
105
|
-
|
|
106
|
-
it('should not emit fonts set to false', async () => {
|
|
107
|
-
const { result } = await render(`
|
|
108
|
-
@use '../' as fonts with (
|
|
109
|
-
$fonts: (
|
|
110
|
-
IBM-Plex-Mono: false,
|
|
111
|
-
IBM-Plex-Sans: false,
|
|
112
|
-
IBM-Plex-Serif: false,
|
|
113
|
-
),
|
|
114
|
-
);
|
|
115
|
-
`);
|
|
116
|
-
expect(result.css.toString()).toBe('');
|
|
117
|
-
});
|
|
118
|
-
|
|
119
|
-
describe.each(fonts)('scss/fonts/_%s.scss', (font) => {
|
|
120
|
-
it('should export all font weights as mixins', async () => {
|
|
121
|
-
const weightMixins = weights.map((weight) => {
|
|
122
|
-
return `$_: get('${weight}', meta.mixin-exists('${weight}', '${font}'));`;
|
|
123
|
-
});
|
|
124
|
-
|
|
125
|
-
const { unwrap } = await render(`
|
|
126
|
-
@use 'sass:meta';
|
|
127
|
-
@use '../${font}';
|
|
128
|
-
|
|
129
|
-
${weightMixins.join('\n')}
|
|
130
|
-
$_: get('all', meta.mixin-exists('all', '${font}'));
|
|
131
|
-
$_: get('default', meta.mixin-exists('default', '${font}'));
|
|
132
|
-
`);
|
|
133
|
-
|
|
134
|
-
for (const weight of weights) {
|
|
135
|
-
expect(unwrap(weight)).toBe(true);
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
expect(unwrap('all')).toBe(true);
|
|
139
|
-
expect(unwrap('default')).toBe(true);
|
|
140
|
-
});
|
|
141
|
-
});
|
|
142
|
-
});
|
|
@@ -1,50 +0,0 @@
|
|
|
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
|
-
* @jest-environment node
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
'use strict';
|
|
11
|
-
|
|
12
|
-
const { SassRenderer } = require('@carbon/test-utils/scss');
|
|
13
|
-
const css = require('css');
|
|
14
|
-
|
|
15
|
-
const { render } = SassRenderer.create(__dirname);
|
|
16
|
-
|
|
17
|
-
describe('scss/utilities/custom-property', () => {
|
|
18
|
-
it('should support getting the property name from a value', async () => {
|
|
19
|
-
const { unwrap } = await render(`
|
|
20
|
-
@use '../../config' with (
|
|
21
|
-
$prefix: 'cds',
|
|
22
|
-
);
|
|
23
|
-
@use '../custom-property';
|
|
24
|
-
|
|
25
|
-
$_: get('name', custom-property.get-name('test'));
|
|
26
|
-
`);
|
|
27
|
-
expect(unwrap('name')).toBe('--cds-test');
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
it('should support emitting a declaration for a CSS Custom Property', async () => {
|
|
31
|
-
const { result } = await render(`
|
|
32
|
-
@use '../../config' with (
|
|
33
|
-
$prefix: 'cds',
|
|
34
|
-
);
|
|
35
|
-
@use '../custom-property';
|
|
36
|
-
|
|
37
|
-
.test {
|
|
38
|
-
@include custom-property.declaration(test, #000000);
|
|
39
|
-
}
|
|
40
|
-
`);
|
|
41
|
-
const { stylesheet } = css.parse(result.css.toString());
|
|
42
|
-
const selector = stylesheet.rules.find((rule) => {
|
|
43
|
-
return rule.selectors.includes('.test');
|
|
44
|
-
});
|
|
45
|
-
const [declaration] = selector.declarations;
|
|
46
|
-
|
|
47
|
-
expect(declaration.property).toBe('--cds-test');
|
|
48
|
-
expect(declaration.value).toBe('#000000');
|
|
49
|
-
});
|
|
50
|
-
});
|