Skip to content

Commit 4196aea

Browse files
feat(tile): add experimental improved contrast tile (#12711)
* feat(tile): add experimental improved contrast tile closes #12464 * Update ExperimentalTile.stories.js * feat(tile): update feature flag and story * feat(tile): add experimental tile feature flag docs * feat(tile): add improved contrast to vrt * chore: move improved tile to experimental section in storybook * chore: docs Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
1 parent 0e42c3a commit 4196aea

File tree

21 files changed

+567
-1
lines changed

21 files changed

+567
-1
lines changed

e2e/components/Tile/Tile-test.e2e.js

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,80 @@ test.describe('Tile', () => {
101101
theme,
102102
});
103103
});
104+
105+
test('improved contrast clickable @vrt', async ({ page }) => {
106+
await snapshotStory(page, {
107+
component: 'Tile',
108+
id: 'components-tile-experimental-improved-contrast--clickable',
109+
theme,
110+
});
111+
});
112+
113+
test('improved contrast clickable with layer @vrt', async ({ page }) => {
114+
await snapshotStory(page, {
115+
component: 'Tile',
116+
id: 'components-tile-experimental-improved-contrast--clickable-with-layer',
117+
theme,
118+
});
119+
});
120+
121+
test('improved contrast selectable @vrt', async ({ page }) => {
122+
await snapshotStory(page, {
123+
component: 'Tile',
124+
id: 'components-tile-experimental-improved-contrast--selectable',
125+
theme,
126+
});
127+
});
128+
129+
test('improved contrast multi select @vrt', async ({ page }) => {
130+
await snapshotStory(page, {
131+
component: 'Tile',
132+
id: 'components-tile-experimental-improved-contrast--multi-select',
133+
theme,
134+
});
135+
});
136+
137+
test('improved contrast radio @vrt', async ({ page }) => {
138+
await snapshotStory(page, {
139+
component: 'Tile',
140+
id: 'components-tile-experimental-improved-contrast--radio',
141+
theme,
142+
});
143+
});
144+
145+
test('improved contrast radio with layer @vrt', async ({ page }) => {
146+
await snapshotStory(page, {
147+
component: 'Tile',
148+
id: 'components-tile-experimental-improved-contrast--radio-with-layer',
149+
theme,
150+
});
151+
});
152+
153+
test('improved contrast expandable @vrt', async ({ page }) => {
154+
await snapshotStory(page, {
155+
component: 'Tile',
156+
id: 'components-tile-experimental-improved-contrast--expandable',
157+
theme,
158+
});
159+
});
160+
161+
test('improved contrast expandable with interactive @vrt', async ({
162+
page,
163+
}) => {
164+
await snapshotStory(page, {
165+
component: 'Tile',
166+
id: 'components-tile-experimental-improved-contrast--expandable-with-interactive',
167+
theme,
168+
});
169+
});
170+
171+
test('improved contrast expandable with layer @vrt', async ({ page }) => {
172+
await snapshotStory(page, {
173+
component: 'Tile',
174+
id: 'components-tile-experimental-improved-contrast--expandable-with-layer',
175+
theme,
176+
});
177+
});
104178
});
105179
});
106180

packages/elements/src/__tests__/__snapshots__/PublicAPI-test.js.snap

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ Array [
4141
"borderSubtleSelected01",
4242
"borderSubtleSelected02",
4343
"borderSubtleSelected03",
44+
"borderTile01",
45+
"borderTile02",
46+
"borderTile03",
4447
"breakpoint",
4548
"breakpointDown",
4649
"breakpointUp",

packages/feature-flags/feature-flags.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,7 @@ feature-flags:
2222
description: >
2323
Enable the features and functionality for the v11 Release
2424
enabled: false
25+
- name: enable-experimental-tile-contrast
26+
description: >
27+
Enable the experimental tile improved contrast styles
28+
enabled: false
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
import { Story, Props, Source, Preview } from '@storybook/addon-docs';
2+
3+
# Tile
4+
5+
[Source code](https://github.com/carbon-design-system/carbon/tree/main/packages/react/src/components/Tile)
6+
&nbsp;|&nbsp;
7+
[Usage guidelines](https://www.carbondesignsystem.com/components/tile/usage)
8+
&nbsp;|&nbsp;
9+
[Accessibility](https://www.carbondesignsystem.com/components/tile/accessibility)
10+
11+
## Improved Contrast Tile
12+
13+
In Sass, you can enable the improved contrast tiles via a feature flag.
14+
15+
```scss
16+
@include feature-flags.enable('enable-experimental-tile-contrast');
17+
```
18+
19+
or if you have multiple feature flags you can enable them this way.
20+
21+
```scss
22+
@use '@carbon/react/scss/feature-flags' with (
23+
$feature-flags: (
24+
'enable-experimental-tile-contrast': true,
25+
)
26+
);
27+
```
28+
29+
<Preview>
30+
<div style={{ width: '1018px', maxWidth: '100%' }}>
31+
<Story id="experimental-improved-contrast-tile--clickable" />
32+
</div>
33+
<div style={{ width: '1018px', maxWidth: '100%' }}>
34+
<Story id="experimental-improved-contrast-tile--expandable" />
35+
</div>
36+
<div style={{ width: '1018px', maxWidth: '100%' }}>
37+
<Story id="experimental-improved-contrast-tile--multi-select" />
38+
</div>
39+
<div style={{ width: '1018px', maxWidth: '100%' }}>
40+
<Story id="experimental-improved-contrast-tile--radio" />
41+
</div>
42+
<div style={{ width: '1018px', maxWidth: '100%' }}>
43+
<Story id="experimental-improved-contrast-tile--selectable" />
44+
</div>
45+
</Preview>
46+
47+
## Component API
48+
49+
<Props />
50+
51+
## Feedback
52+
53+
Help us improve this component by providing feedback, asking questions on Slack,
54+
or updating this file on
55+
[GitHub](https://github.com/carbon-design-system/carbon/edit/main/packages/react/src/components/Tile/Tile.mdx).

0 commit comments

Comments
 (0)