From 86697f4b44df064af9a472d7cb69cb68c5ffe9d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Levert?= Date: Mon, 11 Dec 2023 17:43:34 -0500 Subject: [PATCH] feat: promoting search components to GA (#2909) Promoting Search to GA Updated stories for GA --------- Co-authored-by: Gavin Barron --- .../mgt-components/src/components/components.ts | 7 ++++++- .../mgt-search-box/mgt-search-box.scss | 5 +++++ .../mgt-search-box/mgt-search-box.ts | 7 ++----- .../{preview => }/mgt-search-box/strings.ts | 0 .../mgt-search-results/mgt-search-results.scss | 2 +- .../mgt-search-results/mgt-search-results.ts | 17 +++++++---------- .../{preview => }/mgt-search-results/strings.ts | 0 .../src/components/preview/index.ts | 2 -- .../preview/mgt-search-box/mgt-search-box.scss | 5 ----- packages/mgt-components/src/exports.ts | 3 ++- .../searchBox/searchBox.properties.stories.js | 4 ++-- .../searchBox/searchBox.stories.stories.js | 4 ++-- .../searchResults.properties.stories.js | 4 ++-- .../searchResults/searchResults.stories.js | 4 ++-- .../searchResults.style.stories.js | 4 ++-- 15 files changed, 33 insertions(+), 35 deletions(-) create mode 100644 packages/mgt-components/src/components/mgt-search-box/mgt-search-box.scss rename packages/mgt-components/src/components/{preview => }/mgt-search-box/mgt-search-box.ts (91%) rename packages/mgt-components/src/components/{preview => }/mgt-search-box/strings.ts (100%) rename packages/mgt-components/src/components/{preview => }/mgt-search-results/mgt-search-results.scss (98%) rename packages/mgt-components/src/components/{preview => }/mgt-search-results/mgt-search-results.ts (98%) rename packages/mgt-components/src/components/{preview => }/mgt-search-results/strings.ts (100%) delete mode 100644 packages/mgt-components/src/components/preview/mgt-search-box/mgt-search-box.scss rename stories/components/{preview => }/searchBox/searchBox.properties.stories.js (85%) rename stories/components/{preview => }/searchBox/searchBox.stories.stories.js (92%) rename stories/components/{preview => }/searchResults/searchResults.properties.stories.js (97%) rename stories/components/{preview => }/searchResults/searchResults.stories.js (90%) rename stories/components/{preview => }/searchResults/searchResults.style.stories.js (85%) diff --git a/packages/mgt-components/src/components/components.ts b/packages/mgt-components/src/components/components.ts index 17462fe0fe..dec27498b0 100644 --- a/packages/mgt-components/src/components/components.ts +++ b/packages/mgt-components/src/components/components.ts @@ -24,6 +24,8 @@ import './mgt-contact/mgt-contact'; import './mgt-messages/mgt-messages'; import './mgt-organization/mgt-organization'; import './mgt-profile/mgt-profile'; +import './mgt-search-box/mgt-search-box'; +import './mgt-search-results/mgt-search-results'; import './mgt-theme-toggle/mgt-theme-toggle'; import './sub-components/mgt-spinner/mgt-spinner'; @@ -49,7 +51,10 @@ export * from './mgt-contact/mgt-contact'; export * from './mgt-messages/mgt-messages'; export * from './mgt-organization/mgt-organization'; export * from './mgt-profile/mgt-profile'; +export * from './mgt-search-box/mgt-search-box'; +export * from './mgt-search-results/mgt-search-results'; export * from './mgt-theme-toggle/mgt-theme-toggle'; export * from './sub-components/mgt-spinner/mgt-spinner'; // include preview components here for ease of import into mgt-react -export * from './preview'; +// There are no preview components in this package at this time +// export * from './preview'; diff --git a/packages/mgt-components/src/components/mgt-search-box/mgt-search-box.scss b/packages/mgt-components/src/components/mgt-search-box/mgt-search-box.scss new file mode 100644 index 0000000000..b95be90a9c --- /dev/null +++ b/packages/mgt-components/src/components/mgt-search-box/mgt-search-box.scss @@ -0,0 +1,5 @@ +@import '../../styles/shared-styles'; + +:host fluent-search { + width: 100%; +} diff --git a/packages/mgt-components/src/components/preview/mgt-search-box/mgt-search-box.ts b/packages/mgt-components/src/components/mgt-search-box/mgt-search-box.ts similarity index 91% rename from packages/mgt-components/src/components/preview/mgt-search-box/mgt-search-box.ts rename to packages/mgt-components/src/components/mgt-search-box/mgt-search-box.ts index b599d1853c..34cd86846a 100644 --- a/packages/mgt-components/src/components/preview/mgt-search-box/mgt-search-box.ts +++ b/packages/mgt-components/src/components/mgt-search-box/mgt-search-box.ts @@ -9,10 +9,10 @@ import { CSSResult, html, TemplateResult } from 'lit'; import { property } from 'lit/decorators.js'; import { MgtBaseComponent } from '@microsoft/mgt-element'; import { fluentSearch } from '@fluentui/web-components'; -import { registerFluentComponents } from '../../../utils/FluentComponents'; +import { registerFluentComponents } from '../../utils/FluentComponents'; import { strings } from './strings'; import { styles } from './mgt-search-box-css'; -import { debounce } from '../../../utils/Utils'; +import { debounce } from '../../utils/Utils'; import { registerComponent } from '@microsoft/mgt-element'; export const registerMgtSearchBoxComponent = () => { @@ -96,9 +96,6 @@ export class MgtSearchBox extends MgtBaseComponent { constructor() { super(); - console.warn( - '🦒: is a preview component and may change prior to becoming generally available. See more information https://aka.ms/mgt/preview-components' - ); this.debounceDelay = 300; } diff --git a/packages/mgt-components/src/components/preview/mgt-search-box/strings.ts b/packages/mgt-components/src/components/mgt-search-box/strings.ts similarity index 100% rename from packages/mgt-components/src/components/preview/mgt-search-box/strings.ts rename to packages/mgt-components/src/components/mgt-search-box/strings.ts diff --git a/packages/mgt-components/src/components/preview/mgt-search-results/mgt-search-results.scss b/packages/mgt-components/src/components/mgt-search-results/mgt-search-results.scss similarity index 98% rename from packages/mgt-components/src/components/preview/mgt-search-results/mgt-search-results.scss rename to packages/mgt-components/src/components/mgt-search-results/mgt-search-results.scss index aded26d900..aebe1ab70b 100644 --- a/packages/mgt-components/src/components/preview/mgt-search-results/mgt-search-results.scss +++ b/packages/mgt-components/src/components/mgt-search-results/mgt-search-results.scss @@ -5,7 +5,7 @@ * ------------------------------------------------------------------------------------------- */ -@import '../../../styles/shared-styles'; +@import '../../styles/shared-styles'; $answer-border-radius: var(--answer-border-radius, 4px); $answer-box-shadow: var(--answer-box-shadow, 0 3.2px 7.2px rgb(0 0 0 / 13.2%), 0 0.6px 1.8px rgb(0 0 0 / 10.8%)); diff --git a/packages/mgt-components/src/components/preview/mgt-search-results/mgt-search-results.ts b/packages/mgt-components/src/components/mgt-search-results/mgt-search-results.ts similarity index 98% rename from packages/mgt-components/src/components/preview/mgt-search-results/mgt-search-results.ts rename to packages/mgt-components/src/components/mgt-search-results/mgt-search-results.ts index f5916bc393..83a833488d 100644 --- a/packages/mgt-components/src/components/preview/mgt-search-results/mgt-search-results.ts +++ b/packages/mgt-components/src/components/mgt-search-results/mgt-search-results.ts @@ -21,7 +21,7 @@ import { CollectionResponse } from '@microsoft/mgt-element'; -import { schemas } from '../../../graph/cacheStores'; +import { schemas } from '../../graph/cacheStores'; import { strings } from './strings'; import { styles } from './mgt-search-results-css'; import { @@ -46,14 +46,14 @@ import { getResponseInvalidationTime, sanitizeSummary, trimFileExtension -} from '../../../utils/Utils'; -import { getSvg, SvgIcon } from '../../../utils/SvgHelper'; +} from '../../utils/Utils'; +import { getSvg, SvgIcon } from '../../utils/SvgHelper'; import { fluentSkeleton, fluentButton, fluentTooltip, fluentDivider } from '@fluentui/web-components'; -import { registerFluentComponents } from '../../../utils/FluentComponents'; -import { CacheResponse } from '../../CacheResponse'; +import { registerFluentComponents } from '../../utils/FluentComponents'; +import { CacheResponse } from '../CacheResponse'; import { registerComponent } from '@microsoft/mgt-element'; -import { registerMgtFileComponent } from '../../mgt-file/mgt-file'; -import { registerMgtPersonComponent } from '../../mgt-person/mgt-person'; +import { registerMgtFileComponent } from '../mgt-file/mgt-file'; +import { registerMgtPersonComponent } from '../mgt-person/mgt-person'; /** * Object representing a thumbnail @@ -407,9 +407,6 @@ export class MgtSearchResults extends MgtTemplatedComponent { constructor() { super(); - console.warn( - '🦒: is a preview component and may change prior to becoming generally available. See more information https://aka.ms/mgt/preview-components' - ); } /** diff --git a/packages/mgt-components/src/components/preview/mgt-search-results/strings.ts b/packages/mgt-components/src/components/mgt-search-results/strings.ts similarity index 100% rename from packages/mgt-components/src/components/preview/mgt-search-results/strings.ts rename to packages/mgt-components/src/components/mgt-search-results/strings.ts diff --git a/packages/mgt-components/src/components/preview/index.ts b/packages/mgt-components/src/components/preview/index.ts index 2e7b75dd36..e69de29bb2 100644 --- a/packages/mgt-components/src/components/preview/index.ts +++ b/packages/mgt-components/src/components/preview/index.ts @@ -1,2 +0,0 @@ -export * from './mgt-search-box/mgt-search-box'; -export * from './mgt-search-results/mgt-search-results'; diff --git a/packages/mgt-components/src/components/preview/mgt-search-box/mgt-search-box.scss b/packages/mgt-components/src/components/preview/mgt-search-box/mgt-search-box.scss deleted file mode 100644 index 58f433622e..0000000000 --- a/packages/mgt-components/src/components/preview/mgt-search-box/mgt-search-box.scss +++ /dev/null @@ -1,5 +0,0 @@ -@import '../../../styles/shared-styles'; - -:host fluent-search { - width: 100%; -} diff --git a/packages/mgt-components/src/exports.ts b/packages/mgt-components/src/exports.ts index 573989c5d6..23edfe60a8 100644 --- a/packages/mgt-components/src/exports.ts +++ b/packages/mgt-components/src/exports.ts @@ -6,7 +6,8 @@ */ export * from './components/components'; -export * from './components/preview'; +// There are no preview components in this package at this time +// export * from './components/preview'; export * from './graph/types'; export * from './styles/theme-manager'; export * from './graph/entityType'; diff --git a/stories/components/preview/searchBox/searchBox.properties.stories.js b/stories/components/searchBox/searchBox.properties.stories.js similarity index 85% rename from stories/components/preview/searchBox/searchBox.properties.stories.js rename to stories/components/searchBox/searchBox.properties.stories.js index 87723706d4..5d07778148 100644 --- a/stories/components/preview/searchBox/searchBox.properties.stories.js +++ b/stories/components/searchBox/searchBox.properties.stories.js @@ -6,10 +6,10 @@ */ import { html } from 'lit'; -import { withCodeEditor } from '../../../../.storybook/addons/codeEditorAddon/codeAddon'; +import { withCodeEditor } from '../../../.storybook/addons/codeEditorAddon/codeAddon'; export default { - title: 'Preview / mgt-search-box / Properties', + title: 'Components / mgt-search-box / Properties', component: 'search-box', decorators: [withCodeEditor] }; diff --git a/stories/components/preview/searchBox/searchBox.stories.stories.js b/stories/components/searchBox/searchBox.stories.stories.js similarity index 92% rename from stories/components/preview/searchBox/searchBox.stories.stories.js rename to stories/components/searchBox/searchBox.stories.stories.js index 1b5fdbaf63..33154f14c4 100644 --- a/stories/components/preview/searchBox/searchBox.stories.stories.js +++ b/stories/components/searchBox/searchBox.stories.stories.js @@ -6,10 +6,10 @@ */ import { html } from 'lit'; -import { withCodeEditor } from '../../../../.storybook/addons/codeEditorAddon/codeAddon'; +import { withCodeEditor } from '../../../.storybook/addons/codeEditorAddon/codeAddon'; export default { - title: 'Preview / mgt-search-box', + title: 'Components / mgt-search-box', component: 'search-box', decorators: [withCodeEditor], tags: ['autodocs'], diff --git a/stories/components/preview/searchResults/searchResults.properties.stories.js b/stories/components/searchResults/searchResults.properties.stories.js similarity index 97% rename from stories/components/preview/searchResults/searchResults.properties.stories.js rename to stories/components/searchResults/searchResults.properties.stories.js index bba99be72c..a1cc7d9ef7 100644 --- a/stories/components/preview/searchResults/searchResults.properties.stories.js +++ b/stories/components/searchResults/searchResults.properties.stories.js @@ -6,10 +6,10 @@ */ import { html } from 'lit'; -import { withCodeEditor } from '../../../../.storybook/addons/codeEditorAddon/codeAddon'; +import { withCodeEditor } from '../../../.storybook/addons/codeEditorAddon/codeAddon'; export default { - title: 'Preview / mgt-search-results / Properties', + title: 'Components / mgt-search-results / Properties', component: 'search-results', decorators: [withCodeEditor] }; diff --git a/stories/components/preview/searchResults/searchResults.stories.js b/stories/components/searchResults/searchResults.stories.js similarity index 90% rename from stories/components/preview/searchResults/searchResults.stories.js rename to stories/components/searchResults/searchResults.stories.js index b0871e28e5..bbc4a18d66 100644 --- a/stories/components/preview/searchResults/searchResults.stories.js +++ b/stories/components/searchResults/searchResults.stories.js @@ -6,10 +6,10 @@ */ import { html } from 'lit'; -import { withCodeEditor } from '../../../../.storybook/addons/codeEditorAddon/codeAddon'; +import { withCodeEditor } from '../../../.storybook/addons/codeEditorAddon/codeAddon'; export default { - title: 'Preview / mgt-search-results', + title: 'Components / mgt-search-results', component: 'search-results', decorators: [withCodeEditor], tags: ['autodocs'], diff --git a/stories/components/preview/searchResults/searchResults.style.stories.js b/stories/components/searchResults/searchResults.style.stories.js similarity index 85% rename from stories/components/preview/searchResults/searchResults.style.stories.js rename to stories/components/searchResults/searchResults.style.stories.js index dbb4623b5e..4e7ad8ddf4 100644 --- a/stories/components/preview/searchResults/searchResults.style.stories.js +++ b/stories/components/searchResults/searchResults.style.stories.js @@ -6,10 +6,10 @@ */ import { html } from 'lit'; -import { withCodeEditor } from '../../../../.storybook/addons/codeEditorAddon/codeAddon'; +import { withCodeEditor } from '../../../.storybook/addons/codeEditorAddon/codeAddon'; export default { - title: 'Preview / mgt-search-results / Style', + title: 'Components / mgt-search-results / Style', component: 'search-results', decorators: [withCodeEditor] };