Skip to content

Commit

Permalink
Merge branch 'master' into accordion-fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tishoyanchev committed Jun 16, 2023
2 parents 8661087 + 0948a94 commit 85df85e
Show file tree
Hide file tree
Showing 22 changed files with 483 additions and 132 deletions.
3 changes: 2 additions & 1 deletion examples/wrapper-components/react-javascript/src/App.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ export const IfxAccordionItem = /*@__PURE__*/createReactComponent<JSX.IfxAccordi
export const IfxAlert = /*@__PURE__*/createReactComponent<JSX.IfxAlert, HTMLIfxAlertElement>('ifx-alert');
export const IfxBadge = /*@__PURE__*/createReactComponent<JSX.IfxBadge, HTMLIfxBadgeElement>('ifx-badge');
export const IfxBreadcrumb = /*@__PURE__*/createReactComponent<JSX.IfxBreadcrumb, HTMLIfxBreadcrumbElement>('ifx-breadcrumb');
export const IfxBreadcrumbItem = /*@__PURE__*/createReactComponent<JSX.IfxBreadcrumbItem, HTMLIfxBreadcrumbItemElement>('ifx-breadcrumb-item');
export const IfxBreadcrumbItemLabel = /*@__PURE__*/createReactComponent<JSX.IfxBreadcrumbItemLabel, HTMLIfxBreadcrumbItemLabelElement>('ifx-breadcrumb-item-label');
export const IfxButton = /*@__PURE__*/createReactComponent<JSX.IfxButton, HTMLIfxButtonElement>('ifx-button');
export const IfxCard = /*@__PURE__*/createReactComponent<JSX.IfxCard, HTMLIfxCardElement>('ifx-card');
export const IfxCardHeadline = /*@__PURE__*/createReactComponent<JSX.IfxCardHeadline, HTMLIfxCardHeadlineElement>('ifx-card-headline');
Expand Down
18 changes: 15 additions & 3 deletions packages/components-vue/lib/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,25 @@ export const IfxAccordionItem = /*@__PURE__*/ defineContainer<JSX.IfxAccordionIt

export const IfxAlert = /*@__PURE__*/ defineContainer<JSX.IfxAlert>('ifx-alert', undefined, [
'color',
'icon'
'icon',
'ifxClose'
]);


export const IfxBadge = /*@__PURE__*/ defineContainer<JSX.IfxBadge>('ifx-badge', undefined);


export const IfxBreadcrumb = /*@__PURE__*/ defineContainer<JSX.IfxBreadcrumb>('ifx-breadcrumb', undefined, [
'breadcrumbs'
export const IfxBreadcrumb = /*@__PURE__*/ defineContainer<JSX.IfxBreadcrumb>('ifx-breadcrumb', undefined);


export const IfxBreadcrumbItem = /*@__PURE__*/ defineContainer<JSX.IfxBreadcrumbItem>('ifx-breadcrumb-item', undefined);


export const IfxBreadcrumbItemLabel = /*@__PURE__*/ defineContainer<JSX.IfxBreadcrumbItemLabel>('ifx-breadcrumb-item-label', undefined, [
'icon',
'url',
'target',
'breadcrumbMenuIconWrapper'
]);


Expand Down Expand Up @@ -104,6 +114,8 @@ export const IfxDropdownItem = /*@__PURE__*/ defineContainer<JSX.IfxDropdownItem
'icon',
'checkable',
'value',
'url',
'target',
'itemValues'
]);

Expand Down
2 changes: 2 additions & 0 deletions packages/components/.storybook/preview.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@

import {defineCustomElements} from '../loader';


defineCustomElements();

export const parameters = {
Expand Down
31 changes: 31 additions & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,34 @@
# v18.2.3 (Fri Jun 16 2023)

#### 🐛 Bug Fix

- 159 restructuring breadcrumb [#172](https://github.com/Infineon/infineon-design-system-stencil/pull/172) ([@tishoyanchev](https://github.com/tishoyanchev))

#### Authors: 1

- Tisho Yanchev ([@tishoyanchev](https://github.com/tishoyanchev))

---

# v18.2.2 (Wed Jun 14 2023)

#### 🐛 Bug Fix

- Alert close event [#194](https://github.com/Infineon/infineon-design-system-stencil/pull/194) ([@tishoyanchev](https://github.com/tishoyanchev))

#### 🔩 Dependency Updates

- Bump vite from 4.3.8 to 4.3.9 in /examples/stencil-components/vanilla-cdn [#169](https://github.com/Infineon/infineon-design-system-stencil/pull/169) ([@dependabot[bot]](https://github.com/dependabot[bot]))
- Bump vite from 4.3.8 to 4.3.9 in /examples/wrapper-components/react-typescript [#168](https://github.com/Infineon/infineon-design-system-stencil/pull/168) ([@dependabot[bot]](https://github.com/dependabot[bot]))
- Bump vite from 4.3.8 to 4.3.9 in /examples/wrapper-components/vue-javascript [#167](https://github.com/Infineon/infineon-design-system-stencil/pull/167) ([@dependabot[bot]](https://github.com/dependabot[bot]))

#### Authors: 2

- [@dependabot[bot]](https://github.com/dependabot[bot])
- Tisho Yanchev ([@tishoyanchev](https://github.com/tishoyanchev))

---

# v18.2.1 (Tue Jun 13 2023)

#### 🐛 Bug Fix
Expand Down
133 changes: 63 additions & 70 deletions packages/components/src/components/alert/alert.scss
Original file line number Diff line number Diff line change
@@ -1,97 +1,90 @@
@use "~@infineon/design-system-tokens/dist/tokens";
@use "../../global/font.scss";


.alert-text {
font-size: 16px;
width: 100%;
padding: 12px 0px 12px 12px;
color: tokens.$color-text-black;

white-space: pre-wrap;
/* wraps text at spaces and within words */
word-wrap: break-word;
/* breaks text within a word if necessary */
overflow-wrap: anywhere;
/* breaks text at arbitrary points when needed */
}

.icon-wrapper {
position: relative;
min-width: 48px;
display: flex;
justify-content: center;
align-items: center;
background-color: tokens.$color-default-500;
}

.close-icon-wrapper {
display: flex;
align-items: center;
justify-content: center;
min-width: 40px;


& a {
line-height: 0;
color: tokens.$color-text-black;

}
}

.alert {
display: flex;
border: 1px solid tokens.$color-default-500;
border-radius: 1px;
color: tokens.$color-text-black;
background-color: tokens.$color-bg-white;
}

.alert-primary {
border: 1px solid tokens.$color-default-500;
& .close-icon-wrapper {
display: flex;
align-items: center;
justify-content: center;
min-width: 40px;

& a {
line-height: 0;
color: tokens.$color-text-black;
}
}

& .icon-wrapper {
position: relative;
min-width: 48px;
display: flex;
justify-content: center;
align-items: center;
background-color: tokens.$color-default-500;
color: tokens.$color-text-white;
}
}

.alert-secondary {
border: 1px solid tokens.$color-highlight-500;
& .alert-text {
font-size: 16px;
width: 100%;
padding: 12px 0px 12px 12px;
color: tokens.$color-text-black;

white-space: pre-wrap;
/* wraps text at spaces and within words */
word-wrap: break-word;
/* breaks text within a word if necessary */
overflow-wrap: anywhere;
/* breaks text at arbitrary points when needed */
}

& .icon-wrapper {
background-color: tokens.$color-highlight-500;
color: tokens.$color-text-white;
&.primary {
border: 1px solid tokens.$color-default-500;

& .icon-wrapper {
background-color: tokens.$color-default-500;
color: tokens.$color-text-white;
}
}
}

.alert-success {
border: 1px solid tokens.$color-success-500;
&.secondary {
border: 1px solid tokens.$color-highlight-500;

& .icon-wrapper {
background-color: tokens.$color-success-500;
color: tokens.$color-text-white;
& .icon-wrapper {
background-color: tokens.$color-highlight-500;
color: tokens.$color-text-white;
}
}
}

.alert-danger {
border: 1px solid tokens.$color-danger-500;
&.success {
border: 1px solid tokens.$color-success-500;

& .icon-wrapper {
background-color: tokens.$color-danger-500;
color: tokens.$color-text-white;
& .icon-wrapper {
background-color: tokens.$color-success-500;
color: tokens.$color-text-white;
}
}
}

.alert-warning {
border: 1px solid tokens.$color-warning-500;
&.danger {
border: 1px solid tokens.$color-danger-500;

& .icon-wrapper {
background-color: tokens.$color-danger-500;
color: tokens.$color-text-white;
}
}

& .icon-wrapper {
background-color: tokens.$color-warning-500;
color: tokens.$color-text-white;
&.warning {
border: 1px solid tokens.$color-warning-500;

& .icon-wrapper {
background-color: tokens.$color-warning-500;
color: tokens.$color-text-white;
}
}
}

// ifx-icon:empty {
// display: none;
// }
12 changes: 9 additions & 3 deletions packages/components/src/components/alert/alert.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, Prop, h } from '@stencil/core';
import { Component, Prop, h, Event, EventEmitter } from '@stencil/core';

@Component({
tag: 'ifx-alert',
Expand All @@ -9,10 +9,16 @@ import { Component, Prop, h } from '@stencil/core';
export class Alert {
@Prop() color: 'primary' | 'secondary' | 'success' | 'danger' | 'warning';
@Prop() icon: string;
@Event() ifxClose: EventEmitter;

handleClose() {
this.ifxClose.emit()
}


render() {
return (
<div class={`alert alert-${this.color}`}>
<div class={`alert ${this.color}`}>
{this.icon && (
<div class='icon-wrapper'>
<ifx-icon icon={this.icon} />
Expand All @@ -23,7 +29,7 @@ export class Alert {
<slot />
</div>
<div class="close-icon-wrapper">
<a href="#">
<a href="javascript:void(0);" onClick={this.handleClose.bind(this)}>
<ifx-icon icon='cross-16' />
</a>
</div>
Expand Down
7 changes: 7 additions & 0 deletions packages/components/src/components/alert/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@
| `icon` | `icon` | | `string` | `undefined` |


## Events

| Event | Description | Type |
| ---------- | ----------- | ------------------ |
| `ifxClose` | | `CustomEvent<any>` |


## Dependencies

### Depends on
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
@use "../../../node_modules/@infineon/design-system-tokens/dist/tokens";

.breadcrumb-item-label-container {
display: flex;
align-items: center;
gap: 8px;
text-decoration: none;
color: tokens.$color-text-black;

&.margin {
margin-left: 16px;
}

& ifx-icon:empty {
display: none;
}

& .label-icon-wrapper {
display: inline-flex;
}

& .menu-icon-wrapper {
display: flex;
justify-content: center;
align-items: center;
width: 16px;
height: 16px;

&.hide {
display: none;
}

& ifx-icon {
transition: .3s;
}

&.show {
& ifx-icon {
transition: .3s;
transform: rotate(180deg);
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { Component, h, Prop, Element, Event, EventEmitter } from '@stencil/core';

@Component({
tag: 'ifx-breadcrumb-item-label',
styleUrl: 'breadcrumb-item-label.scss',
shadow: true,
})
export class BreadcrumbItemLabel {
@Prop() icon: string;
@Prop() url: string;
@Prop() target: string = "_self"
@Element() el;
@Event() breadcrumbMenuIconWrapper: EventEmitter<CustomEvent>;

componentDidLoad() {
const container = this.el.shadowRoot.querySelector('.breadcrumb-item-label-container')
const menuWrapper = container.querySelector('.menu-icon-wrapper')
this.breadcrumbMenuIconWrapper.emit(menuWrapper)
}

render() {
return (
<a href={this.url} target={this.target} class="breadcrumb-item-label-container">
<ifx-icon icon={this.icon}></ifx-icon>
<span class="label-wrapper">
<slot />
</span>
<span class="menu-icon-wrapper">
<ifx-icon icon="chevron-down-12"></ifx-icon>
</span>
</a>
);
}
}
Loading

0 comments on commit 85df85e

Please sign in to comment.