Skip to content

Commit

Permalink
chore(atomic): make tabs officially public (#4824)
Browse files Browse the repository at this point in the history
https://coveord.atlassian.net/browse/CDX-1603

GA !

---------

Co-authored-by: GitHub Actions Bot <>
Co-authored-by: Louis Bompart <[email protected]>
  • Loading branch information
alexprudhomme and louis-bompart authored Jan 8, 2025
1 parent 0f33d58 commit 9078d06
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ AtomicSmartSnippetFeedbackModal,
AtomicSmartSnippetSuggestions,
AtomicSortDropdown,
AtomicSortExpression,
AtomicTab,
AtomicTabManager,
AtomicTableElement,
AtomicText,
Expand Down Expand Up @@ -282,6 +283,7 @@ AtomicSmartSnippetFeedbackModal,
AtomicSmartSnippetSuggestions,
AtomicSortDropdown,
AtomicSortExpression,
AtomicTab,
AtomicTabManager,
AtomicTableElement,
AtomicText,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2974,6 +2974,28 @@ export class AtomicSortExpression {
export declare interface AtomicSortExpression extends Components.AtomicSortExpression {}


@ProxyCmp({
inputs: ['expression', 'label', 'name']
})
@Component({
selector: 'atomic-tab',
changeDetection: ChangeDetectionStrategy.OnPush,
template: '<ng-content></ng-content>',
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
inputs: ['expression', 'label', 'name'],
})
export class AtomicTab {
protected el: HTMLElement;
constructor(c: ChangeDetectorRef, r: ElementRef, protected z: NgZone) {
c.detach();
this.el = r.nativeElement;
}
}


export declare interface AtomicTab extends Components.AtomicTab {}


@ProxyCmp({
inputs: ['clearFiltersOnTabChange']
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ export const AtomicSmartSnippetFeedbackModal = /*@__PURE__*/createReactComponent
export const AtomicSmartSnippetSuggestions = /*@__PURE__*/createReactComponent<JSX.AtomicSmartSnippetSuggestions, HTMLAtomicSmartSnippetSuggestionsElement>('atomic-smart-snippet-suggestions');
export const AtomicSortDropdown = /*@__PURE__*/createReactComponent<JSX.AtomicSortDropdown, HTMLAtomicSortDropdownElement>('atomic-sort-dropdown');
export const AtomicSortExpression = /*@__PURE__*/createReactComponent<JSX.AtomicSortExpression, HTMLAtomicSortExpressionElement>('atomic-sort-expression');
export const AtomicTab = /*@__PURE__*/createReactComponent<JSX.AtomicTab, HTMLAtomicTabElement>('atomic-tab');
export const AtomicTabManager = /*@__PURE__*/createReactComponent<JSX.AtomicTabManager, HTMLAtomicTabManagerElement>('atomic-tab-manager');
export const AtomicTableElement = /*@__PURE__*/createReactComponent<JSX.AtomicTableElement, HTMLAtomicTableElementElement>('atomic-table-element');
export const AtomicText = /*@__PURE__*/createReactComponent<JSX.AtomicText, HTMLAtomicTextElement>('atomic-text');
Expand Down
32 changes: 28 additions & 4 deletions packages/atomic/src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3655,6 +3655,10 @@ export namespace Components {
*/
"tabsIncluded": string[] | string;
}
/**
* The `atomic-tab` component represents an individual tab within the `atomic-tab-manager` component.
* It must be used as a child of the `atomic-tab-manager` component to function correctly.
*/
interface AtomicTab {
/**
* The [constant query expression (`cq`)](https://docs.coveo.com/en/2830/searching-with-coveo/about-the-query-expression#constant-query-expression-cq) to apply when the tab is the active one.
Expand Down Expand Up @@ -3686,7 +3690,9 @@ export namespace Components {
"select": () => void;
}
/**
* @alpha
* The `atomic-tab-manager` component manages a collection of tabs,
* allowing users to switch between them. Each child `atomic-tab` represents an
* individual tab within the manager.
*/
interface AtomicTabManager {
/**
Expand Down Expand Up @@ -5998,6 +6004,10 @@ declare global {
prototype: HTMLAtomicSortExpressionElement;
new (): HTMLAtomicSortExpressionElement;
};
/**
* The `atomic-tab` component represents an individual tab within the `atomic-tab-manager` component.
* It must be used as a child of the `atomic-tab-manager` component to function correctly.
*/
interface HTMLAtomicTabElement extends Components.AtomicTab, HTMLStencilElement {
}
var HTMLAtomicTabElement: {
Expand All @@ -6017,7 +6027,9 @@ declare global {
new (): HTMLAtomicTabButtonElement;
};
/**
* @alpha
* The `atomic-tab-manager` component manages a collection of tabs,
* allowing users to switch between them. Each child `atomic-tab` represents an
* individual tab within the manager.
*/
interface HTMLAtomicTabManagerElement extends Components.AtomicTabManager, HTMLStencilElement {
}
Expand Down Expand Up @@ -9733,6 +9745,10 @@ declare namespace LocalJSX {
*/
"tabsIncluded"?: string[] | string;
}
/**
* The `atomic-tab` component represents an individual tab within the `atomic-tab-manager` component.
* It must be used as a child of the `atomic-tab-manager` component to function correctly.
*/
interface AtomicTab {
/**
* The [constant query expression (`cq`)](https://docs.coveo.com/en/2830/searching-with-coveo/about-the-query-expression#constant-query-expression-cq) to apply when the tab is the active one.
Expand Down Expand Up @@ -9764,7 +9780,9 @@ declare namespace LocalJSX {
"select": () => void;
}
/**
* @alpha
* The `atomic-tab-manager` component manages a collection of tabs,
* allowing users to switch between them. Each child `atomic-tab` represents an
* individual tab within the manager.
*/
interface AtomicTabManager {
/**
Expand Down Expand Up @@ -10942,11 +10960,17 @@ declare module "@stencil/core" {
* The `atomic-sort-expression` component defines a sort expression. This component must be inside an `atomic-sort-dropdown` component.
*/
"atomic-sort-expression": LocalJSX.AtomicSortExpression & JSXBase.HTMLAttributes<HTMLAtomicSortExpressionElement>;
/**
* The `atomic-tab` component represents an individual tab within the `atomic-tab-manager` component.
* It must be used as a child of the `atomic-tab-manager` component to function correctly.
*/
"atomic-tab": LocalJSX.AtomicTab & JSXBase.HTMLAttributes<HTMLAtomicTabElement>;
"atomic-tab-bar": LocalJSX.AtomicTabBar & JSXBase.HTMLAttributes<HTMLAtomicTabBarElement>;
"atomic-tab-button": LocalJSX.AtomicTabButton & JSXBase.HTMLAttributes<HTMLAtomicTabButtonElement>;
/**
* @alpha
* The `atomic-tab-manager` component manages a collection of tabs,
* allowing users to switch between them. Each child `atomic-tab` represents an
* individual tab within the manager.
*/
"atomic-tab-manager": LocalJSX.AtomicTabManager & JSXBase.HTMLAttributes<HTMLAtomicTabManagerElement>;
"atomic-tab-manager-bar": LocalJSX.AtomicTabManagerBar & JSXBase.HTMLAttributes<HTMLAtomicTabManagerBarElement>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ import {
import {Bindings} from '../../atomic-search-interface/atomic-search-interface';

/**
* @alpha
* The `atomic-tab-manager` component manages a collection of tabs,
* allowing users to switch between them. Each child `atomic-tab` represents an
* individual tab within the manager.
*
* @part button-container - The container for the tab button.
* @part button - The tab button.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import {Component, Prop, Element} from '@stencil/core';

/**
* @internal
* The `atomic-tab` component represents an individual tab within the `atomic-tab-manager` component.
* It must be used as a child of the `atomic-tab-manager` component to function correctly.
*/
@Component({
tag: 'atomic-tab',
Expand Down

0 comments on commit 9078d06

Please sign in to comment.