Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(data-table): add data-table to sass modules style package #8844

Merged
merged 11 commits into from
Jun 14, 2021
Merged
9 changes: 9 additions & 0 deletions docs/migration/11.x-carbon-components.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,12 @@
| `$duration--slow-02` | |
| `@function motion` | |
| `@mixin motion` | |

### `src/globals/scss/_theme-tokens.scss`

| v10 | v11 |
| :---------------------------------- | :------ |
| `$data-table-heading-transform` | Removed |
| `$data-table-heading-border-bottom` | Removed |
| `$data-table-row-height` | Removed |
| `$data-table-zebra-color` | Removed |
85 changes: 85 additions & 0 deletions packages/styles/scss/components/__tests__/data-table-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
/**
* Copyright IBM Corp. 2018, 2018
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*
* @jest-environment node
*/

'use strict';

const { SassRenderer } = require('@carbon/test-utils/scss');

const { render } = SassRenderer.create(__dirname);

describe('scss/components/data-table', () => {
test('Public API', async () => {
const { unwrap } = await render(`
@use 'sass:map';
@use 'sass:meta';
@use '../data-table';

$_: get('mixin', meta.mixin-exists('data-table', 'data-table'));
$_: get('variables', map.keys(meta.module-variables('data-table')));
`);
expect(unwrap('mixin')).toBe(true);
expect(unwrap('variables')).toMatchInlineSnapshot(`
Array [
"data-table-column-hover",
]
`);
});
});

describe('scss/components/data-table/action', () => {
test('Public API', async () => {
const { unwrap } = await render(`
@use 'sass:map';
@use 'sass:meta';
@use '../data-table/action';

$_: get('mixin', meta.mixin-exists('data-table-action', 'action'));
`);
expect(unwrap('mixin')).toBe(true);
});
});

describe('scss/components/data-table/expandable', () => {
test('Public API', async () => {
const { unwrap } = await render(`
@use 'sass:map';
@use 'sass:meta';
@use '../data-table/expandable';

$_: get('mixin', meta.mixin-exists('data-table-expandable', 'expandable'));
`);
expect(unwrap('mixin')).toBe(true);
});
});

describe('scss/components/data-table/skeleton', () => {
test('Public API', async () => {
const { unwrap } = await render(`
@use 'sass:map';
@use 'sass:meta';
@use '../data-table/skeleton';

$_: get('mixin', meta.mixin-exists('data-table-skeleton', 'skeleton'));
`);
expect(unwrap('mixin')).toBe(true);
});
});

describe('scss/components/data-table/sort', () => {
test('Public API', async () => {
const { unwrap } = await render(`
@use 'sass:map';
@use 'sass:meta';
@use '../data-table/sort';

$_: get('mixin', meta.mixin-exists('data-table-sort', 'sort'));
`);
expect(unwrap('mixin')).toBe(true);
tay1orjones marked this conversation as resolved.
Show resolved Hide resolved
});
});
5 changes: 5 additions & 0 deletions packages/styles/scss/components/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,8 @@
@use 'link';
@use 'list';
@use 'loading';
@use 'data-table';
@use 'data-table/action';
@use 'data-table/expandable';
@use 'data-table/skeleton';
@use 'data-table/sort';
Loading