Skip to content

Commit

Permalink
chore: add icon overview for patternhub (#2029)
Browse files Browse the repository at this point in the history
* chore: add icon overview for patternhub

* chore: add snapshot

* chore: update snapshots

---------

Co-authored-by: Maximilian Franzke <[email protected]>
  • Loading branch information
nmerget and mfranzke authored Jan 11, 2024
1 parent 6d70bc3 commit c57e94d
Show file tree
Hide file tree
Showing 37 changed files with 120 additions and 0 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions showcases/angular-showcase/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,11 @@ import { NavigationItemComponent } from './components/navigation-item/navigation
import { NavItemComponent } from './nav-item/nav-item.component';
import { MainNavigationComponent } from './components/main-navigation/main-navigation.component';
import { TextareaComponent } from './components/textarea/textarea.component';
import { IconComponent } from './components/icon/icon.component';

@NgModule({
declarations: [
IconComponent,
TooltipComponent,

PopoverComponent,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<app-default-component
title="DBIcon"
[variants]="variants"
[exampleTemplate]="exampleTemplate"
>
<ng-template
#exampleTemplate
let-exampleProps="exampleProps"
let-exampleName="exampleName"
let-exampleIndex="exampleIndex"
let-variantIndex="variantIndex"
>
<db-infotext icon="none" size="small" variant="informational">
{{ exampleName }}
</db-infotext>
<db-icon icon="account">{{ exampleName }}</db-icon>
</ng-template>
</app-default-component>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { Component } from '@angular/core';
import defaultComponentVariants from '../../../../../shared/icon.json';

@Component({
selector: 'app-icon',
templateUrl: './icon.component.html'
})
export class IconComponent {
variants = defaultComponentVariants;
}
2 changes: 2 additions & 0 deletions showcases/angular-showcase/src/app/utils/navigation-item.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { SectionComponent } from '../components/section/section.component';
import { CardComponent } from '../components/card/card.component';
import { DividerComponent } from '../components/divider/divider.component';
import { DrawerComponent } from '../components/drawer/drawer.component';
import { IconComponent } from '../components/icon/icon.component';

export type NavItem = {
path: string;
Expand Down Expand Up @@ -65,6 +66,7 @@ export const NAVIGATION_ITEMS: NavItem[] = [
path: '04',
label: '04 Data-Display',
subNavigation: getSortedNavigationItems([
{ path: '04/icon', label: 'Icon', component: IconComponent },
{
path: '04/tooltip',
label: 'Tooltip',
Expand Down
7 changes: 7 additions & 0 deletions showcases/e2e/icon/showcase-icon.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { test } from '@playwright/test';
// @ts-expect-error - required for playwright
import { getDefaultScreenshotTest } from '../default.ts';

test.describe('DBIcon', () => {
getDefaultScreenshotTest('04/icon');
});
27 changes: 27 additions & 0 deletions showcases/react-showcase/src/components/icon/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { DBIcon, DBInfotext } from '../../../../../output/react/src';
import DefaultComponent from '../index';
import defaultComponentVariants from '../../../../shared/icon.json';
import { type DBIconProps } from '../../../../../output/react/src/components/icon/model';
import { getVariants } from '../data';

const getIcon = ({ children }: DBIconProps) => (
<>
<DBInfotext icon="none" size="small" variant="informational">
{children}
</DBInfotext>
<DBIcon icon="account">{children}</DBIcon>
</>
);

const IconComponent = () => {
return (
<DefaultComponent
title={'DBIcon'}
variants={getVariants(
defaultComponentVariants,
getIcon
)}></DefaultComponent>
);
};

export default IconComponent;
6 changes: 6 additions & 0 deletions showcases/react-showcase/src/utils/navigation-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import InputComponent from '../components/input';
import LinkComponent from '../components/link';
import SectionComponent from '../components/section';
import TextareaComponent from '../components/textarea';
import IconComponent from '../components/icon';

export type NavigationItem = {
path: string;
Expand Down Expand Up @@ -82,6 +83,11 @@ export const NAVIGATION_ITEMS: NavigationItem[] = [
label: 'Infotext',
component: <InfotextComponent />
},
{
path: 'icon',
label: 'Icon',
component: <IconComponent />
},
{
path: 'tooltip',
label: 'Tooltip',
Expand Down
22 changes: 22 additions & 0 deletions showcases/shared/icon.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[
{
"name": "Tonality",
"examples": [
{
"name": "functional",
"className": "db-ui-functional",
"props": {}
},
{
"name": "regular (Default)",
"className": "db-ui-regular",
"props": {}
},
{
"name": "expressive",
"className": "db-ui-expressive",
"props": {}
}
]
}
]
20 changes: 20 additions & 0 deletions showcases/vue-showcase/src/components/icon/Icon.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<script setup lang="ts">
import DefaultComponent from "../DefaultComponent.vue";
import defaultComponentVariants from "../../../../shared/icon.json";
import { DBIcon, DBInfotext } from "../../../../../output/vue/vue3/src";
</script>

<template>
<DefaultComponent title="DBIcon" :variants="defaultComponentVariants">
<template
#example="{ exampleIndex, variantIndex, exampleName, exampleProps }"
>
<DBInfotext icon="none" size="small" variant="informational">
{{ exampleName }}</DBInfotext
>
<DBIcon icon="account">
{{ exampleName }}
</DBIcon>
</template>
</DefaultComponent>
</template>
6 changes: 6 additions & 0 deletions showcases/vue-showcase/src/utils/navigation-items.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import Infotext from '../components/infotext/Infotext.vue';
import Radio from '../components/radio/Radio.vue';
import Section from '../components/section/Section.vue';
import Textarea from '../components/textarea/Textarea.vue';
import Icon from '../components/icon/Icon.vue';

export type NavItem = {
path: string;
Expand Down Expand Up @@ -70,6 +71,11 @@ export const navigationItems: NavItem[] = [
label: 'Infotext',
component: Infotext
},
{
path: '/04/icon',
label: 'Icon',
component: Icon
},
{ path: '/04/tag', label: 'Tag', component: Tag },
{ path: '/04/accordion', label: 'Accordion', component: Accordion },
{
Expand Down

0 comments on commit c57e94d

Please sign in to comment.