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(AILabel): Rename Slug to AILabel #16803

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
c01e8da
feat(AILabel): rename Slug to AILabel
tw15egan Jun 17, 2024
3cfd32e
docs(AILabel): update mdx file to use new name
tw15egan Jun 17, 2024
b940a8b
chore(AILabel): rename Slug folder to AILabel
tw15egan Jun 17, 2024
88bd878
chore(AILabel): more renaming, diplsyName updates, checkbox story
tw15egan Jun 17, 2024
1e01a06
chore(AILabel): move example stories to corresponding folders
tw15egan Jun 17, 2024
adf57f6
chore(AILabel): move DataTable, Form stories to appropriate locations:
tw15egan Jun 17, 2024
2cc3067
style(AILabel): fix styles when revert is active
tw15egan Jun 17, 2024
71504ef
chore(AISkeleton): rename AiSkeleton to AISkeleton
tw15egan Jun 17, 2024
6f7311d
chore(AILabel): rename more files, update test names
tw15egan Jun 17, 2024
ea5ec5b
chore(AILabel): add copyright banner, remove some playground controls
tw15egan Jun 18, 2024
841bda7
test(AILabel): update tests to use AILabel
tw15egan Jun 18, 2024
9531f4b
test(AILabel): add additional tests around aiTextLabel
tw15egan Jun 18, 2024
f14d0aa
Merge branch 'main' into rename-slug-to-ai-label
tw15egan Jun 27, 2024
de3eca6
fix(AILabel): deprecate aiTextLabel and SlugLabel
tw15egan Jun 27, 2024
249dcb3
test(AILabel): update textLabel test
tw15egan Jun 27, 2024
5815222
Merge branch 'main' into rename-slug-to-ai-label
tw15egan Jun 27, 2024
a377644
Merge branch 'main' into rename-slug-to-ai-label
tw15egan Jul 9, 2024
d342655
fix(AILabel): make changes based on review
tw15egan Jul 16, 2024
22be730
Merge branch 'main' into rename-slug-to-ai-label
tw15egan Jul 16, 2024
fb73875
fix(AILabel): update click target to 24px for mini, 2xs
tw15egan Jul 22, 2024
1c426e5
Merge branch 'main' into rename-slug-to-ai-label
tw15egan Jul 22, 2024
6255b25
feat(AILabel): add AILabel sass entrypoint
tw15egan Jul 22, 2024
65f6395
Merge branch 'main' into rename-slug-to-ai-label
tay1orjones Jul 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright IBM Corp. 2016, 2023
* Copyright IBM Corp. 2016, 2024
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
Expand All @@ -10,22 +10,22 @@
const { expect, test } = require('@playwright/test');
const { visitStory } = require('../../test-utils/storybook');

test.describe('@avt Slug', async () => {
test.describe('@avt AILabel', () => {
test('@avt-default-state', async ({ page }) => {
await visitStory(page, {
component: 'Slug',
id: 'experimental-unstable-slug--default',
component: 'AILabel',
id: 'components-ailabel--default',
globals: {
theme: 'white',
},
});
await expect(page).toHaveNoACViolations('Slug');
await expect(page).toHaveNoACViolations('AILabel');
});

test.slow('@avt-advanced-states open state', async ({ page }) => {
await visitStory(page, {
component: 'Slug',
id: 'experimental-unstable-slug--default',
component: 'AILabel',
id: 'components-ailabel--default',
globals: {
theme: 'white',
},
Expand All @@ -34,24 +34,24 @@ test.describe('@avt Slug', async () => {
await page.keyboard.press('Tab');
await page.keyboard.press('Tab');
await page.keyboard.press('Enter');
await expect(page).toHaveNoACViolations('Slug-open');
await expect(page).toHaveNoACViolations('AILabel-open');
});

test.slow('@avt-advanced-states ai form', async ({ page }) => {
await visitStory(page, {
component: 'Slug',
id: 'experimental-unstable-slug-form--form-example',
component: 'AILabel',
id: 'components-form--with-ai-label',
globals: {
theme: 'white',
},
});
await expect(page).toHaveNoACViolations('Slug-form');
await expect(page).toHaveNoACViolations('AILabel-form');
});

test('@avt-keyboard-nav - slug', async ({ page }) => {
await visitStory(page, {
component: 'Search',
id: 'experimental-unstable-slug--callout',
id: 'components-ailabel--callout',
globals: {
theme: 'white',
},
Expand All @@ -63,7 +63,7 @@ test.describe('@avt Slug', async () => {
await expect(slug).toBeVisible();
await expect(callout).toBeVisible();

// Tab to the Slug
// Tab to the AILabel
await page.keyboard.press('Tab');
await expect(slug).toBeFocused();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright IBM Corp. 2016, 2023
* Copyright IBM Corp. 2016, 2024
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
Expand All @@ -11,53 +11,53 @@ const { test } = require('@playwright/test'); // eslint-disable-line
const { themes } = require('../../test-utils/env');
const { snapshotStory } = require('../../test-utils/storybook'); // eslint-disable-line

test.describe('Slug', () => {
test.describe('AILabel', () => {
themes.forEach((theme) => {
test.describe(theme, () => {
test('default @vrt', async ({ page }) => {
await snapshotStory(page, {
component: 'Slug',
id: 'experimental-unstable-slug--default',
component: 'AILabel',
id: 'components-ailabel--default',
theme,
});
});

test('slug callout @vrt', async ({ page }) => {
test('AILabel callout @vrt', async ({ page }) => {
await snapshotStory(page, {
component: 'Slug',
id: 'experimental-unstable-slug--callout',
component: 'AILabel',
id: 'components-ailabel--callout',
theme,
});
});

test('slug inside form @vrt', async ({ page }) => {
test('AILabel inside form @vrt', async ({ page }) => {
await snapshotStory(page, {
component: 'Slug',
id: 'experimental-unstable-slug-form--form-example',
component: 'AILabel',
id: 'components-form--with-ai-label',
theme,
});
});

test('slug inside DataTable column @vrt', async ({ page }) => {
test('AILabel inside DataTable column @vrt', async ({ page }) => {
await snapshotStory(page, {
component: 'Slug',
id: 'experimental-unstable-slug-datatable--column-slug-sort',
component: 'AILabel',
id: 'components-datatable-withailabel--column-ai-label-sort',
theme,
});
});

test('slug inside DataTable row @vrt', async ({ page }) => {
test('AILabel inside DataTable row @vrt', async ({ page }) => {
await snapshotStory(page, {
component: 'Slug',
id: 'experimental-unstable-slug-datatable--slug-with-selection-and-expansion',
component: 'AILabel',
id: 'components-datatable-withailabel--ai-label-with-selection-and-expansion',
theme,
});
});

test('slug inside Tile @vrt', async ({ page }) => {
test('AILabel inside Tile @vrt', async ({ page }) => {
await snapshotStory(page, {
component: 'Slug',
id: 'experimental-unstable-slug-examples--tile',
component: 'AILabel',
id: 'components-tile--with-ai-label',
theme,
});
});
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Code generated by carbon-components-react. DO NOT EDIT.
//
// Copyright IBM Corp. 2018, 2023
//
// This source code is licensed under the Apache-2.0 license found in the
// LICENSE file in the root directory of this source tree.
//

@forward '@carbon/styles/scss/components/ai-label/ai-label';
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Code generated by carbon-components-react. DO NOT EDIT.
//
// Copyright IBM Corp. 2018, 2023
//
// This source code is licensed under the Apache-2.0 license found in the
// LICENSE file in the root directory of this source tree.
//

@forward '@carbon/styles/scss/components/ai-label';
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Code generated by carbon-components. DO NOT EDIT.
//
// Copyright IBM Corp. 2018, 2023
//
// This source code is licensed under the Apache-2.0 license found in the
// LICENSE file in the root directory of this source tree.
//

@forward '@carbon/styles/scss/components/ai-label/ai-label';
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Code generated by carbon-components. DO NOT EDIT.
//
// Copyright IBM Corp. 2018, 2023
//
// This source code is licensed under the Apache-2.0 license found in the
// LICENSE file in the root directory of this source tree.
//

@forward '@carbon/styles/scss/components/ai-label';
164 changes: 157 additions & 7 deletions packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,154 @@

exports[`Public API should only change with a semver change 1`] = `
Map {
"AILabel" => Object {
"$$typeof": Symbol(react.forward_ref),
"propTypes": Object {
"AILabelContent": Object {
"type": "node",
},
"aiText": Object {
"type": "string",
},
"aiTextLabel": [Function],
"align": Object {
"args": Array [
Array [
"top",
"top-left",
"top-start",
"top-right",
"top-end",
"bottom",
"bottom-left",
"bottom-start",
"bottom-right",
"bottom-end",
"left",
"left-bottom",
"left-end",
"left-top",
"left-start",
"right",
"right-bottom",
"right-end",
"right-top",
"right-start",
],
],
"type": "oneOf",
},
"aria-label": Object {
"type": "string",
},
"autoAlign": Object {
"type": "bool",
},
"children": Object {
"type": "node",
},
"className": Object {
"type": "string",
},
"kind": Object {
"args": Array [
Array [
"default",
"inline",
],
],
"type": "oneOf",
},
"onRevertClick": Object {
"type": "func",
},
"revertActive": Object {
"type": "bool",
},
"revertLabel": Object {
"type": "string",
},
"size": Object {
"args": Array [
Array [
"mini",
"2xs",
"xs",
"sm",
"md",
"lg",
"xl",
],
],
"type": "oneOf",
},
"slugLabel": [Function],
"textLabel": Object {
"type": "string",
},
},
"render": [Function],
},
"AILabelActions" => Object {
"$$typeof": Symbol(react.forward_ref),
"propTypes": Object {
"children": Object {
"type": "node",
},
"className": Object {
"type": "string",
},
},
"render": [Function],
},
"AILabelContent" => Object {
"$$typeof": Symbol(react.forward_ref),
"propTypes": Object {
"children": Object {
"type": "node",
},
"className": Object {
"type": "string",
},
},
"render": [Function],
},
"AISkeletonIcon" => Object {
"propTypes": Object {
"className": Object {
"type": "string",
},
"style": Object {
"type": "object",
},
},
},
"AISkeletonPlaceholder" => Object {
"propTypes": Object {
"className": Object {
"type": "string",
},
},
},
"AISkeletonText" => Object {
"propTypes": Object {
"className": Object {
"type": "string",
},
"heading": Object {
"type": "bool",
},
"lineCount": Object {
"type": "number",
},
"paragraph": Object {
"type": "bool",
},
"width": Object {
"type": "string",
},
},
},
"Accordion" => Object {
"propTypes": Object {
"align": Object {
Expand Down Expand Up @@ -10755,12 +10903,13 @@ Map {
"unstable__Slug" => Object {
"$$typeof": Symbol(react.forward_ref),
"propTypes": Object {
"aiText": Object {
"type": "string",
"AILabelContent": Object {
"type": "node",
},
"aiTextLabel": Object {
"aiText": Object {
"type": "string",
},
"aiTextLabel": [Function],
"align": Object {
"args": Array [
Array [
Expand Down Expand Up @@ -10788,6 +10937,9 @@ Map {
],
"type": "oneOf",
},
"aria-label": Object {
"type": "string",
},
"autoAlign": Object {
"type": "bool",
},
Expand Down Expand Up @@ -10829,10 +10981,8 @@ Map {
],
"type": "oneOf",
},
"slugContent": Object {
"type": "node",
},
"slugLabel": Object {
"slugLabel": [Function],
"textLabel": Object {
"type": "string",
},
},
Expand Down
9 changes: 9 additions & 0 deletions packages/react/scss/components/ai-label/_ai-label.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Code generated by @carbon/react. DO NOT EDIT.
//
// Copyright IBM Corp. 2018, 2023
//
// This source code is licensed under the Apache-2.0 license found in the
// LICENSE file in the root directory of this source tree.
//

@forward '@carbon/styles/scss/components/ai-label/ai-label';
Loading
Loading