Skip to content

Commit

Permalink
reviewed and updated tag
Browse files Browse the repository at this point in the history
  • Loading branch information
tishoyanchev committed Jul 17, 2023
1 parent abad9d5 commit 6e2b3ae
Show file tree
Hide file tree
Showing 17 changed files with 166 additions and 65 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<div>
<h1>Using Stencil web components in an Angular application</h1>

<h2>Tag</h2>
<ifx-tag>tag</ifx-tag>
<br />

<h2>Button</h2>
<div>
<ifx-button variant="solid" href="" target="_blank" color="primary" size="m" [disabled]="false" [icon]="false">
Expand Down
7 changes: 6 additions & 1 deletion examples/stencil-components/vanilla-cdn/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,13 @@

<div>
<h1>Using Stencil web components in an Vanilla JS</h1>
<h2>Button</h2>


<h2>Tag</h2>
<ifx-tag>tag</ifx-tag>
<br />

<h2>Button</h2>
<ifx-button variant="solid" href="" target="_blank" color="primary" size="m" disabled="false" icon="false">
Button
</ifx-button>
Expand Down
4 changes: 4 additions & 0 deletions examples/wrapper-components/react-javascript/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {

Expand All @@ -16,6 +17,9 @@ function App() {
<div>
<h1>Stencil Framework integration - React + JS</h1>

<h2>Tag</h2>
<Tag>Label Tag</Tag>

<h2>Search Bar</h2>
<SearchBar />
<br />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import React from 'react';
import { IfxTag } from '@infineon/infineon-design-system-react';

function Tag() {
return (
<div>
<IfxTag>Label Tag</IfxTag>
</div>
);
}

export default Tag;
57 changes: 31 additions & 26 deletions examples/wrapper-components/react-typescript/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<div>
<h1 className="header">Stencil Framework integration - React + TS </h1>
<h2>Search Bar</h2>
<SearchBar />
<br />

<h2>Button</h2>
<Button />
<br />

<h2>Progress Bar</h2>
<ProgressBar />
<br />

<h2>Text Field</h2>
<TextField />
<br />

<h2>Accordion</h2>
<Accordion />
<br />

<h2>Radio Button</h2>
<RadioButton />
<br />
<div>
<h1 className="header">Stencil Framework integration - React + TS </h1>

<h2>Tag</h2>
<Tag />
<br />

<h2>Search Bar</h2>
<SearchBar />
<br />

<h2>Button</h2>
<Button />
<br />

<h2>Progress Bar</h2>
<ProgressBar />
<br />

<h2>Text Field</h2>
<TextField />
<br />

<h2>Accordion</h2>
<Accordion />
<br />

<h2>Radio Button</h2>
<RadioButton />
<br />
</div>

)
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

import { IfxTag } from '@infineon/infineon-design-system-react';

function Tag() {
return (
<div>
<IfxTag>Label Tag</IfxTag>
</div>
);
}

export default Tag;
2 changes: 2 additions & 0 deletions examples/wrapper-components/vue-javascript/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<ProgressBar />
<Search />
<TextInput />
<Tag />
</template>


Expand All @@ -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'
</script>

Expand Down
20 changes: 20 additions & 0 deletions examples/wrapper-components/vue-javascript/src/components/Tag.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@


<template>
<div>
<h2>Tag</h2>
<div>
<ifx-tag>tag</ifx-tag>
</div>
<br />
<br />
</div>
</template>

<script setup>
</script>



3 changes: 2 additions & 1 deletion examples/wrapper-components/vue-typescript/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<ProgressBar />
<Search />
<TextInput />
<Tag />
</template>


Expand All @@ -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'
</script>

Expand Down
20 changes: 20 additions & 0 deletions examples/wrapper-components/vue-typescript/src/components/Tag.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@


<template>
<div>
<h2>Tag</h2>
<div>
<ifx-tag>tag</ifx-tag>
</div>
<br />
<br />
</div>
</template>

<script setup>
</script>



4 changes: 1 addition & 3 deletions packages/components-vue/lib/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -354,9 +354,7 @@ export const IfxTabs = /*@__PURE__*/ defineContainer<JSX.IfxTabs>('ifx-tabs', un
]);


export const IfxTag = /*@__PURE__*/ defineContainer<JSX.IfxTag>('ifx-tag', undefined, [
'label'
]);
export const IfxTag = /*@__PURE__*/ defineContainer<JSX.IfxTag>('ifx-tag', undefined);


export const IfxTextInput = /*@__PURE__*/ defineContainer<JSX.IfxTextInput, JSX.IfxTextInput["value"]>('ifx-text-input', undefined, [
Expand Down
7 changes: 0 additions & 7 deletions packages/components/src/components/tag/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,6 @@
<!-- Auto Generated Below -->


## Properties

| Property | Attribute | Description | Type | Default |
| -------- | --------- | ----------- | -------- | ----------- |
| `label` | `label` | | `string` | `undefined` |


----------------------------------------------

*Built with [StencilJS](https://stenciljs.com/)*
27 changes: 27 additions & 0 deletions packages/components/src/components/tag/tag.e2e.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { newE2EPage } from '@stencil/core/testing';

describe('ifx-tag', () => {
it('should render', async () => {
const page = await newE2EPage();
await page.setContent('<ifx-tag>Test Tag</ifx-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('<ifx-tag>Test Tag</ifx-tag>');
});

it('should have the correct container class', async () => {
const page = await newE2EPage();
await page.setContent('<ifx-tag>Test Tag</ifx-tag>');
});

it('should have the correct href attribute', async () => {
const page = await newE2EPage();
await page.setContent('<ifx-tag>Test Tag</ifx-tag>');

});
});
38 changes: 19 additions & 19 deletions packages/components/src/components/tag/tag.scss
Original file line number Diff line number Diff line change
@@ -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;
}



4 changes: 1 addition & 3 deletions packages/components/src/components/tag/tag.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@ export default {
args: {
label: "Tag label",
},
argTypes: {

},
}

const DefaultTemplate = (args) =>
`<ifx-tag label="${args.label}"/>`;
`<ifx-tag>${args.label}</ifx-tag>`;

export const Default = DefaultTemplate.bind({});
Default.argTypes = {
Expand Down
7 changes: 4 additions & 3 deletions packages/components/src/components/tag/tag.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
import { Component, h, Prop } from '@stencil/core';
import { Component, h } from '@stencil/core';

@Component({
tag: 'ifx-tag',
styleUrl: 'tag.scss',
shadow: true
})
export class Tag {
@Prop() label: string;

render() {
return (
<a href="javascript:void(null);" class="container">
<p class="label">{this.label}</p>
<p class="label">
<slot />
</p>
</a>
);
}
Expand Down
2 changes: 0 additions & 2 deletions packages/components/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@

<body>

<ifx-radio-button disabled="" value="false" error="true" size="m"></ifx-radio-button>


</body>

Expand Down

0 comments on commit 6e2b3ae

Please sign in to comment.