diff --git a/examples/stencil-components/angular/src/app/app.component.html b/examples/stencil-components/angular/src/app/app.component.html index ae11aaef57..64f0ea335b 100644 --- a/examples/stencil-components/angular/src/app/app.component.html +++ b/examples/stencil-components/angular/src/app/app.component.html @@ -1,5 +1,10 @@

Using Stencil web components in an Angular application

+ +

Tag

+ tag +
+

Button

diff --git a/examples/stencil-components/vanilla-cdn/index.html b/examples/stencil-components/vanilla-cdn/index.html index 96827a7f7a..f975723f9e 100644 --- a/examples/stencil-components/vanilla-cdn/index.html +++ b/examples/stencil-components/vanilla-cdn/index.html @@ -16,8 +16,13 @@

Using Stencil web components in an Vanilla JS

-

Button

+ +

Tag

+ tag +
+ +

Button

Button diff --git a/examples/wrapper-components/react-javascript/src/App.js b/examples/wrapper-components/react-javascript/src/App.js index 6b1f304952..cce6421167 100644 --- a/examples/wrapper-components/react-javascript/src/App.js +++ b/examples/wrapper-components/react-javascript/src/App.js @@ -8,6 +8,7 @@ import Accordion from './components/Accordion/Accordion'; import RadioButton from './components/RadioButton/RadioButton'; import Checkbox from './components/Checkbox/Checkbox'; +import Tag from './components/Tag/Tag'; function App() { @@ -16,6 +17,9 @@ function App() {

Stencil Framework integration - React + JS

+

Tag

+ Label Tag +

Search Bar


diff --git a/examples/wrapper-components/react-javascript/src/components/Tag/Tag.js b/examples/wrapper-components/react-javascript/src/components/Tag/Tag.js new file mode 100644 index 0000000000..a3a2c94f01 --- /dev/null +++ b/examples/wrapper-components/react-javascript/src/components/Tag/Tag.js @@ -0,0 +1,12 @@ +import React from 'react'; +import { IfxTag } from '@infineon/infineon-design-system-react'; + +function Tag() { + return ( +
+ Label Tag +
+ ); +} + +export default Tag; \ No newline at end of file diff --git a/examples/wrapper-components/react-typescript/src/App.tsx b/examples/wrapper-components/react-typescript/src/App.tsx index f0a3fe8c86..fbd0e48537 100644 --- a/examples/wrapper-components/react-typescript/src/App.tsx +++ b/examples/wrapper-components/react-typescript/src/App.tsx @@ -5,37 +5,42 @@ import ProgressBar from './components/ProgressBar/ProgressBar'; import SearchBar from './components/SearchBar/SearchBar'; import Accordion from './components/Accordion/Accordion'; import RadioButton from './components/RadioButton/RadioButton'; +import Tag from './Components/Tag/Tag'; function App() { return ( -
-

Stencil Framework integration - React + TS

-

Search Bar

- -
- -

Button

-
- ) } diff --git a/examples/wrapper-components/react-typescript/src/components/Tag/Tag.tsx b/examples/wrapper-components/react-typescript/src/components/Tag/Tag.tsx new file mode 100644 index 0000000000..2fae0377f4 --- /dev/null +++ b/examples/wrapper-components/react-typescript/src/components/Tag/Tag.tsx @@ -0,0 +1,12 @@ + +import { IfxTag } from '@infineon/infineon-design-system-react'; + +function Tag() { + return ( +
+ Label Tag +
+ ); +} + +export default Tag; \ No newline at end of file diff --git a/examples/wrapper-components/vue-javascript/src/App.vue b/examples/wrapper-components/vue-javascript/src/App.vue index ef2382c086..f72dccb8d8 100644 --- a/examples/wrapper-components/vue-javascript/src/App.vue +++ b/examples/wrapper-components/vue-javascript/src/App.vue @@ -8,6 +8,7 @@ + @@ -19,6 +20,7 @@ import ProgressBar from './components/ProgressBar.vue' import Search from './components/Search.vue' import RadioButton from './components/RadioButton.vue' import TextInput from './components/TextInput.vue' +import Tag from './components/Tag.vue' diff --git a/examples/wrapper-components/vue-javascript/src/components/Tag.vue b/examples/wrapper-components/vue-javascript/src/components/Tag.vue new file mode 100644 index 0000000000..3f7d76a6a0 --- /dev/null +++ b/examples/wrapper-components/vue-javascript/src/components/Tag.vue @@ -0,0 +1,20 @@ + + + + + + + + \ No newline at end of file diff --git a/examples/wrapper-components/vue-typescript/src/App.vue b/examples/wrapper-components/vue-typescript/src/App.vue index 9b021b6228..604114dc68 100644 --- a/examples/wrapper-components/vue-typescript/src/App.vue +++ b/examples/wrapper-components/vue-typescript/src/App.vue @@ -9,6 +9,7 @@ + @@ -20,7 +21,7 @@ import ProgressBar from './components/ProgressBar.vue' import Search from './components/Search.vue' import RadioButton from './components/RadioButton.vue' import TextInput from './components/TextInput.vue' - +import Tag from './components/Tag.vue' diff --git a/examples/wrapper-components/vue-typescript/src/components/Tag.vue b/examples/wrapper-components/vue-typescript/src/components/Tag.vue new file mode 100644 index 0000000000..3f7d76a6a0 --- /dev/null +++ b/examples/wrapper-components/vue-typescript/src/components/Tag.vue @@ -0,0 +1,20 @@ + + + + + + + + \ No newline at end of file diff --git a/packages/components-vue/lib/components.ts b/packages/components-vue/lib/components.ts index 0e728ea8c8..d5f6428186 100644 --- a/packages/components-vue/lib/components.ts +++ b/packages/components-vue/lib/components.ts @@ -354,9 +354,7 @@ export const IfxTabs = /*@__PURE__*/ defineContainer('ifx-tabs', un ]); -export const IfxTag = /*@__PURE__*/ defineContainer('ifx-tag', undefined, [ - 'label' -]); +export const IfxTag = /*@__PURE__*/ defineContainer('ifx-tag', undefined); export const IfxTextInput = /*@__PURE__*/ defineContainer('ifx-text-input', undefined, [ diff --git a/packages/components/src/components/tag/readme.md b/packages/components/src/components/tag/readme.md index 670d10ddd7..a8c6acbc36 100644 --- a/packages/components/src/components/tag/readme.md +++ b/packages/components/src/components/tag/readme.md @@ -5,13 +5,6 @@ -## Properties - -| Property | Attribute | Description | Type | Default | -| -------- | --------- | ----------- | -------- | ----------- | -| `label` | `label` | | `string` | `undefined` | - - ---------------------------------------------- *Built with [StencilJS](https://stenciljs.com/)* diff --git a/packages/components/src/components/tag/tag.e2e.ts b/packages/components/src/components/tag/tag.e2e.ts new file mode 100644 index 0000000000..c9be6d08b4 --- /dev/null +++ b/packages/components/src/components/tag/tag.e2e.ts @@ -0,0 +1,27 @@ +import { newE2EPage } from '@stencil/core/testing'; + +describe('ifx-tag', () => { + it('should render', async () => { + const page = await newE2EPage(); + await page.setContent('Test Tag'); + + const element = await page.find('ifx-tag'); + expect(element).toHaveClass('hydrated'); + }); + + it('should display the correct label', async () => { + const page = await newE2EPage(); + await page.setContent('Test Tag'); + }); + + it('should have the correct container class', async () => { + const page = await newE2EPage(); + await page.setContent('Test Tag'); + }); + + it('should have the correct href attribute', async () => { + const page = await newE2EPage(); + await page.setContent('Test Tag'); + + }); +}); diff --git a/packages/components/src/components/tag/tag.scss b/packages/components/src/components/tag/tag.scss index a1bbb54c5d..6e490ae23a 100644 --- a/packages/components/src/components/tag/tag.scss +++ b/packages/components/src/components/tag/tag.scss @@ -1,32 +1,32 @@ @use "~@infineon/design-system-tokens/dist/tokens"; @use "../../global/font.scss"; -:host { - display: inline-block; -} - .container { - display: flex; + display: inline-flex; align-items: center; padding: tokens.$spacing-xxs tokens.$spacing-m; border: 1px solid tokens.$color-gray-300; border-radius: tokens.$border-radius-pill; text-decoration: none; -} -.container:hover { - border-color: tokens.$color-black; -} + &:hover { + border-color: tokens.$color-black; + } -.container:active { - border-color: tokens.$color-black; - background-color: tokens.$color-gray-100; + :active { + border-color: tokens.$color-black; + background-color: tokens.$color-gray-100; + } + + & .label { + margin: 0; + font-weight: tokens.$font-weight-regular; + font-size: tokens.$font-size-m; + line-height: 1.5rem; + color: tokens.$color-text-black; + } } -.label { - margin: 0; - font-weight: tokens.$font-weight-regular; - font-size: tokens.$font-size-m; - line-height: 1.5rem; - color: tokens.$color-text-black; -} \ No newline at end of file + + + diff --git a/packages/components/src/components/tag/tag.stories.ts b/packages/components/src/components/tag/tag.stories.ts index c8ccf24a33..00284a1625 100644 --- a/packages/components/src/components/tag/tag.stories.ts +++ b/packages/components/src/components/tag/tag.stories.ts @@ -5,13 +5,11 @@ export default { args: { label: "Tag label", }, - argTypes: { - }, } const DefaultTemplate = (args) => - ``; + `${args.label}`; export const Default = DefaultTemplate.bind({}); Default.argTypes = { diff --git a/packages/components/src/components/tag/tag.tsx b/packages/components/src/components/tag/tag.tsx index 27809f4b97..9da090e631 100644 --- a/packages/components/src/components/tag/tag.tsx +++ b/packages/components/src/components/tag/tag.tsx @@ -1,4 +1,4 @@ -import { Component, h, Prop } from '@stencil/core'; +import { Component, h } from '@stencil/core'; @Component({ tag: 'ifx-tag', @@ -6,12 +6,13 @@ import { Component, h, Prop } from '@stencil/core'; shadow: true }) export class Tag { - @Prop() label: string; render() { return ( -

{this.label}

+

+ +

); } diff --git a/packages/components/src/index.html b/packages/components/src/index.html index be18e15003..739cc801bc 100644 --- a/packages/components/src/index.html +++ b/packages/components/src/index.html @@ -21,8 +21,6 @@ - -