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

chore(atomic): migrate atomic-icon #4998

Open
wants to merge 69 commits into
base: KIT-4022
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
6d9e506
update getAssetPath
y-lakhdar Feb 6, 2025
653a020
draft
y-lakhdar Feb 6, 2025
3731a81
add binding logic
y-lakhdar Feb 7, 2025
554ab34
update binding controller
y-lakhdar Feb 10, 2025
818d0a3
cleanup
y-lakhdar Feb 10, 2025
354de48
update vitest
y-lakhdar Feb 11, 2025
7452e1d
update vitest
y-lakhdar Feb 11, 2025
e3c68f3
revert watch
y-lakhdar Feb 11, 2025
32e9623
mock resourceUrl
y-lakhdar Feb 13, 2025
f30ea52
add mock
y-lakhdar Feb 13, 2025
628c157
Update packages/atomic/scripts/build.mjs
y-lakhdar Feb 13, 2025
b85f5e1
move mock in setup
y-lakhdar Feb 14, 2025
3eb9857
test atomic icon
y-lakhdar Feb 18, 2025
dbc513b
lint
y-lakhdar Feb 18, 2025
24924ca
artifacts
y-lakhdar Feb 18, 2025
ac50c2b
Merge branch 'KIT-3944' of github.com:coveo/ui-kit into KIT-3948
y-lakhdar Feb 18, 2025
e73ce02
Merge branch 'master' of github.com:coveo/ui-kit into KIT-3944
y-lakhdar Feb 19, 2025
d6f69ba
exit on error
y-lakhdar Feb 19, 2025
b6238f9
update tsconfig
y-lakhdar Feb 19, 2025
f520321
Merge branch 'KIT-3944' of github.com:coveo/ui-kit into KIT-3948
y-lakhdar Feb 19, 2025
ec6437a
lock
y-lakhdar Feb 19, 2025
ec2522e
build
y-lakhdar Feb 19, 2025
2aaa282
Merge branch 'master' of github.com:coveo/ui-kit into KIT-3944
y-lakhdar Feb 20, 2025
e520d8a
Merge branch 'KIT-3944' of github.com:coveo/ui-kit into KIT-3948
y-lakhdar Feb 20, 2025
8b6ec91
Add generated files
Feb 20, 2025
033fbb7
update storybook staticDir serving
y-lakhdar Feb 20, 2025
3e6b70e
Merge branch 'master' into KIT-3944
y-lakhdar Feb 21, 2025
f0a88df
Merge branch 'master' into KIT-3944
y-lakhdar Feb 21, 2025
69213d7
prettier
y-lakhdar Feb 21, 2025
746b588
Merge branch 'KIT-3944' of github.com:coveo/ui-kit into KIT-3944
y-lakhdar Feb 21, 2025
55c8a37
Merge branch 'master' into KIT-3944
y-lakhdar Feb 24, 2025
ff12021
staticDirs for localhost
y-lakhdar Feb 24, 2025
c5bb7d7
apply corrections
y-lakhdar Feb 24, 2025
79c649e
Merge branch 'KIT-3944' of github.com:coveo/ui-kit into KIT-3948
y-lakhdar Feb 24, 2025
0789c80
Merge branch 'master' of github.com:coveo/ui-kit into KIT-3948
y-lakhdar Feb 24, 2025
33ba558
fix build error
y-lakhdar Feb 25, 2025
8a7cefb
Merge branch 'master' of github.com:coveo/ui-kit into KIT-3948
y-lakhdar Feb 25, 2025
2e68b36
fix css
y-lakhdar Feb 25, 2025
978d689
clean css
y-lakhdar Feb 25, 2025
1eb2159
Merge branch 'master' of github.com:coveo/ui-kit into KIT-3948
y-lakhdar Feb 28, 2025
1483c78
Merge branch 'KIT-4010' of github.com:coveo/ui-kit into KIT-3948
y-lakhdar Feb 28, 2025
44d80af
remove dep
y-lakhdar Feb 28, 2025
85f5e74
apply pr corrections
y-lakhdar Feb 28, 2025
95d67fd
add mdx
y-lakhdar Feb 28, 2025
ac8c322
fix component error
y-lakhdar Mar 3, 2025
15b9379
fix css
y-lakhdar Mar 3, 2025
fe18102
Add generated files
Mar 3, 2025
5a3a64f
make css global
y-lakhdar Mar 3, 2025
9a02edd
Merge branch 'KIT-3948' of github.com:coveo/ui-kit into KIT-3948
y-lakhdar Mar 3, 2025
674472e
build
y-lakhdar Mar 3, 2025
cbfca94
simplify tests
y-lakhdar Mar 4, 2025
296ac85
add into light dom
y-lakhdar Mar 5, 2025
1417d3b
add injectStylesForNoShadowDOM decorator
y-lakhdar Mar 5, 2025
6b7f4a4
update id
y-lakhdar Mar 5, 2025
84cb316
add component error custom element
y-lakhdar Mar 5, 2025
be904b4
stories
y-lakhdar Mar 5, 2025
dca3d9a
simplify decorator
y-lakhdar Mar 5, 2025
69e4efd
update story
y-lakhdar Mar 6, 2025
0fcfb0e
Add generated files
Mar 6, 2025
601b95d
remove unnecessary style attribute
y-lakhdar Mar 6, 2025
4409c0d
Merge branch 'KIT-4022' of github.com:coveo/ui-kit into KIT-3948
y-lakhdar Mar 6, 2025
6543f72
clean merge
y-lakhdar Mar 6, 2025
68a4e61
build
y-lakhdar Mar 6, 2025
f89202a
Merge branch 'KIT-4032' into KIT-4022
y-lakhdar Mar 6, 2025
29cf7e6
Merge branch 'KIT-4022' into KIT-3948
y-lakhdar Mar 6, 2025
f905d8a
build
y-lakhdar Mar 6, 2025
45a02de
Merge branch 'KIT-4022' into KIT-3948
y-lakhdar Mar 6, 2025
70231bd
Add generated files
Mar 6, 2025
e2e4237
Merge branch 'KIT-4022' of github.com:coveo/ui-kit into KIT-3948
y-lakhdar Mar 6, 2025
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
Expand Up @@ -6,6 +6,7 @@ import {APP_INITIALIZER, ModuleWithProviders, NgModule, Provider} from '@angular

import {
AtomicComponentError,
AtomicIcon,
AtomicAriaLive,
AtomicAutomaticFacet,
AtomicAutomaticFacetGenerator,
Expand Down Expand Up @@ -50,7 +51,6 @@ AtomicFormatNumber,
AtomicFormatUnit,
AtomicGeneratedAnswer,
AtomicHtml,
AtomicIcon,
AtomicLayoutSection,
AtomicLoadMoreResults,
AtomicNoResults,
Expand Down Expand Up @@ -152,6 +152,7 @@ defineCustomElements(window);

const DECLARATIONS = [
AtomicComponentError,
AtomicIcon,
AtomicAriaLive,
AtomicAutomaticFacet,
AtomicAutomaticFacetGenerator,
Expand Down Expand Up @@ -196,7 +197,6 @@ AtomicFormatNumber,
AtomicFormatUnit,
AtomicGeneratedAnswer,
AtomicHtml,
AtomicIcon,
AtomicLayoutSection,
AtomicLoadMoreResults,
AtomicNoResults,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1005,28 +1005,6 @@ export class AtomicHtml {
export declare interface AtomicHtml extends Components.AtomicHtml {}


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


export declare interface AtomicIcon extends Components.AtomicIcon {}


@ProxyCmp({
inputs: ['maxWidth', 'minWidth', 'section']
})
Expand Down Expand Up @@ -3108,5 +3086,28 @@ export declare interface AtomicComponentError extends LitAtomicComponentError {

}

import type {AtomicComponentError as LitAtomicComponentError} from '@coveo/atomic/components';
@ProxyCmp({
inputs: ['icon']
})
@Component({
selector: 'atomic-icon',
changeDetection: ChangeDetectionStrategy.OnPush,
template: '<ng-content></ng-content>',
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
inputs: ['icon']
})
export class AtomicIcon {
protected readonly el: HTMLElement;
constructor(c: ChangeDetectorRef, el: ElementRef, protected z: NgZone) {
c.detach();
this.el = el.nativeElement;
proxyOutputs(this, this.el, []);
}
}

export declare interface AtomicIcon extends LitAtomicIcon {

}

import type {AtomicComponentError as LitAtomicComponentError, AtomicIcon as LitAtomicIcon} from '@coveo/atomic/components';
//#endregion Lit Declarations
19 changes: 18 additions & 1 deletion packages/atomic-react/src/components/commerce/components.ts
Original file line number Diff line number Diff line change
@@ -1 +1,18 @@
export {};
import {
AtomicComponentError as LitAtomicComponentError,
AtomicIcon as LitAtomicIcon,
} from '@coveo/atomic/components';
import {createComponent} from '@lit/react';
import React from 'react';

export const AtomicComponentError = createComponent({
tagName: 'atomic-component-error',
react: React,
elementClass: LitAtomicComponentError,
});

export const AtomicIcon = createComponent({
tagName: 'atomic-icon',
react: React,
elementClass: LitAtomicIcon,
});
19 changes: 18 additions & 1 deletion packages/atomic-react/src/components/search/components.ts
Original file line number Diff line number Diff line change
@@ -1 +1,18 @@
export {};
import {
AtomicComponentError as LitAtomicComponentError,
AtomicIcon as LitAtomicIcon,
} from '@coveo/atomic/components';
import {createComponent} from '@lit/react';
import React from 'react';

export const AtomicComponentError = createComponent({
tagName: 'atomic-component-error',
react: React,
elementClass: LitAtomicComponentError,
});

export const AtomicIcon = createComponent({
tagName: 'atomic-icon',
react: React,
elementClass: LitAtomicIcon,
});
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ export const AtomicCommerceSearchBoxRecentQueries = /*@__PURE__*/createReactComp
export const AtomicCommerceSortDropdown = /*@__PURE__*/createReactComponent<JSX.AtomicCommerceSortDropdown, HTMLAtomicCommerceSortDropdownElement>('atomic-commerce-sort-dropdown');
export const AtomicCommerceText = /*@__PURE__*/createReactComponent<JSX.AtomicCommerceText, HTMLAtomicCommerceTextElement>('atomic-commerce-text');
export const AtomicCommerceTimeframeFacet = /*@__PURE__*/createReactComponent<JSX.AtomicCommerceTimeframeFacet, HTMLAtomicCommerceTimeframeFacetElement>('atomic-commerce-timeframe-facet');
export const AtomicIcon = /*@__PURE__*/createReactComponent<JSX.AtomicIcon, HTMLAtomicIconElement>('atomic-icon');
export const AtomicLayoutSection = /*@__PURE__*/createReactComponent<JSX.AtomicLayoutSection, HTMLAtomicLayoutSectionElement>('atomic-layout-section');
export const AtomicNumericRange = /*@__PURE__*/createReactComponent<JSX.AtomicNumericRange, HTMLAtomicNumericRangeElement>('atomic-numeric-range');
export const AtomicProduct = /*@__PURE__*/createReactComponent<JSX.AtomicProduct, HTMLAtomicProductElement>('atomic-product');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export const AtomicFormatNumber = /*@__PURE__*/createReactComponent<JSX.AtomicFo
export const AtomicFormatUnit = /*@__PURE__*/createReactComponent<JSX.AtomicFormatUnit, HTMLAtomicFormatUnitElement>('atomic-format-unit');
export const AtomicGeneratedAnswer = /*@__PURE__*/createReactComponent<JSX.AtomicGeneratedAnswer, HTMLAtomicGeneratedAnswerElement>('atomic-generated-answer');
export const AtomicHtml = /*@__PURE__*/createReactComponent<JSX.AtomicHtml, HTMLAtomicHtmlElement>('atomic-html');
export const AtomicIcon = /*@__PURE__*/createReactComponent<JSX.AtomicIcon, HTMLAtomicIconElement>('atomic-icon');
export const AtomicLayoutSection = /*@__PURE__*/createReactComponent<JSX.AtomicLayoutSection, HTMLAtomicLayoutSectionElement>('atomic-layout-section');
export const AtomicLoadMoreResults = /*@__PURE__*/createReactComponent<JSX.AtomicLoadMoreResults, HTMLAtomicLoadMoreResultsElement>('atomic-load-more-results');
export const AtomicNoResults = /*@__PURE__*/createReactComponent<JSX.AtomicNoResults, HTMLAtomicNoResultsElement>('atomic-no-results');
Expand Down
37 changes: 0 additions & 37 deletions packages/atomic/src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1126,16 +1126,6 @@ export namespace Components {
*/
"value": string;
}
/**
* The `atomic-icon` component displays an SVG icon with a 1:1 aspect ratio.
* This component can display an icon from those available in the Atomic package, from a specific location, or as an inline SVG element.
*/
interface AtomicIcon {
/**
* The SVG icon to display. - Use a value that starts with `http://`, `https://`, `./`, or `../`, to fetch and display an icon from a given location. - Use a value that starts with `assets://`, to display an icon from the Atomic package. - Use a stringified SVG to display it directly.
*/
"icon": string;
}
interface AtomicInsightEditToggle {
"clickCallback": () => void;
"tooltip": string;
Expand Down Expand Up @@ -4476,16 +4466,6 @@ declare global {
prototype: HTMLAtomicHtmlElement;
new (): HTMLAtomicHtmlElement;
};
/**
* The `atomic-icon` component displays an SVG icon with a 1:1 aspect ratio.
* This component can display an icon from those available in the Atomic package, from a specific location, or as an inline SVG element.
*/
interface HTMLAtomicIconElement extends Components.AtomicIcon, HTMLStencilElement {
}
var HTMLAtomicIconElement: {
prototype: HTMLAtomicIconElement;
new (): HTMLAtomicIconElement;
};
interface HTMLAtomicInsightEditToggleElement extends Components.AtomicInsightEditToggle, HTMLStencilElement {
}
var HTMLAtomicInsightEditToggleElement: {
Expand Down Expand Up @@ -6128,7 +6108,6 @@ declare global {
"atomic-generated-answer": HTMLAtomicGeneratedAnswerElement;
"atomic-generated-answer-feedback-modal": HTMLAtomicGeneratedAnswerFeedbackModalElement;
"atomic-html": HTMLAtomicHtmlElement;
"atomic-icon": HTMLAtomicIconElement;
"atomic-insight-edit-toggle": HTMLAtomicInsightEditToggleElement;
"atomic-insight-facet": HTMLAtomicInsightFacetElement;
"atomic-insight-folded-result-list": HTMLAtomicInsightFoldedResultListElement;
Expand Down Expand Up @@ -7305,16 +7284,6 @@ declare namespace LocalJSX {
*/
"value": string;
}
/**
* The `atomic-icon` component displays an SVG icon with a 1:1 aspect ratio.
* This component can display an icon from those available in the Atomic package, from a specific location, or as an inline SVG element.
*/
interface AtomicIcon {
/**
* The SVG icon to display. - Use a value that starts with `http://`, `https://`, `./`, or `../`, to fetch and display an icon from a given location. - Use a value that starts with `assets://`, to display an icon from the Atomic package. - Use a stringified SVG to display it directly.
*/
"icon": string;
}
interface AtomicInsightEditToggle {
"clickCallback"?: () => void;
"tooltip"?: string;
Expand Down Expand Up @@ -9944,7 +9913,6 @@ declare namespace LocalJSX {
"atomic-generated-answer": AtomicGeneratedAnswer;
"atomic-generated-answer-feedback-modal": AtomicGeneratedAnswerFeedbackModal;
"atomic-html": AtomicHtml;
"atomic-icon": AtomicIcon;
"atomic-insight-edit-toggle": AtomicInsightEditToggle;
"atomic-insight-facet": AtomicInsightFacet;
"atomic-insight-folded-result-list": AtomicInsightFoldedResultList;
Expand Down Expand Up @@ -10339,11 +10307,6 @@ declare module "@stencil/core" {
* Use only with values for which you are certain the content is harmless.
*/
"atomic-html": LocalJSX.AtomicHtml & JSXBase.HTMLAttributes<HTMLAtomicHtmlElement>;
/**
* The `atomic-icon` component displays an SVG icon with a 1:1 aspect ratio.
* This component can display an icon from those available in the Atomic package, from a specific location, or as an inline SVG element.
*/
"atomic-icon": LocalJSX.AtomicIcon & JSXBase.HTMLAttributes<HTMLAtomicIconElement>;
"atomic-insight-edit-toggle": LocalJSX.AtomicInsightEditToggle & JSXBase.HTMLAttributes<HTMLAtomicInsightEditToggleElement>;
"atomic-insight-facet": LocalJSX.AtomicInsightFacet & JSXBase.HTMLAttributes<HTMLAtomicInsightFacetElement>;
"atomic-insight-folded-result-list": LocalJSX.AtomicInsightFoldedResultList & JSXBase.HTMLAttributes<HTMLAtomicInsightFoldedResultListElement>;
Expand Down
1 change: 1 addition & 0 deletions packages/atomic/src/components/commerce/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
// Export the class of the components migrated to Lit here, like this:
export {AtomicComponentError} from '../common/atomic-component-error/atomic-component-error';
export {AtomicIcon} from '../common/atomic-icon/atomic-icon';
1 change: 1 addition & 0 deletions packages/atomic/src/components/commerce/lazy-index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export default {
// Add entries as such when new components are added/moved to Lit.
'atomic-icon': async () => await import('../common/atomic-icon/atomic-icon'),
'atomic-component-error': async () =>
await import('../common/atomic-component-error/atomic-component-error'),
} as Record<string, () => Promise<unknown>>;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import {Canvas, ArgTypes, Meta, Title, Description} from '@storybook/blocks';
import * as AtomicIconStories from './atomic-icon.new.stories';

{/* Storybook provides a number of blocs to construct documentation pages */}
{/* https://storybook.js.org/docs/writing-docs/doc-blocks#available-blocks */}

<Meta of={ AtomicIconStories } />

<Title />
<Description />

<Canvas of={ AtomicIconStories.Default } />

## Properties
<ArgTypes />

Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const {decorator, play} = wrapInSearchInterface();

const meta: Meta = {
component: 'atomic-icon',
title: 'Atomic/Icon',
title: 'Atomic/Common',
id: 'atomic-icon',

render: renderComponent,
Expand Down

This file was deleted.

Loading
Loading