Skip to content

Commit

Permalink
Merge branch 'master' into expressive-list
Browse files Browse the repository at this point in the history
  • Loading branch information
zvonimirfras authored Nov 12, 2024
2 parents d52ab50 + b858e05 commit a786eeb
Show file tree
Hide file tree
Showing 9 changed files with 61 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/icon/icon.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ export class IconDirective implements AfterViewInit, OnChanges {
"aria-label": this.ariaLabel,
"aria-labelledby": this.ariaLabelledBy,
"aria-hidden": this.ariaHidden,
focusable: this.isFocusable.toString()
focusable: this.isFocusable.toString(),
fill: icon.attrs.fill
});

const attrKeys = Object.keys(attributes);
Expand Down
1 change: 1 addition & 0 deletions src/link/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export * from "./link.directive";
export * from "./link-icon.directive";
export * from "./link.module";
8 changes: 8 additions & 0 deletions src/link/link-icon.directive.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { Directive, HostBinding } from "@angular/core";

@Directive({
selector: "[ibmLinkIcon], [cdsLinkIcon]"
})
export class LinkIconDirective {
@HostBinding("class.cds--link__icon") iconClass = true;
}
7 changes: 5 additions & 2 deletions src/link/link.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@ import { NgModule } from "@angular/core";
import { CommonModule } from "@angular/common";

import { Link } from "./link.directive";
import { LinkIconDirective } from "./link-icon.directive";

@NgModule({
declarations: [
Link
Link,
LinkIconDirective
],
exports: [
Link
Link,
LinkIconDirective
],
imports: [
CommonModule
Expand Down
23 changes: 22 additions & 1 deletion src/link/link.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
import { moduleMetadata, Meta } from "@storybook/angular";
import { LinkModule, Link } from "./";

import { IconModule } from "../icon";

export default {
title: "Components/Link",
decorators: [
moduleMetadata({
imports: [LinkModule]
imports: [LinkModule, IconModule]
})
],
component: Link
Expand All @@ -24,3 +26,22 @@ Basic.args = {
disabled: false,
inline: false
};

const IconTemplate = (args) => ({
props: args,
template: `
<a
href="#"
cdsLink
[disabled]="disabled"
[inline]="inline">
Link
<svg cdsLinkIcon cdsIcon="close" size="16"></svg>
</a>
`
});
export const WithIcon = IconTemplate.bind({});
WithIcon.args = {
disabled: false,
inline: false
};
8 changes: 8 additions & 0 deletions src/tiles/clickable-tile-icon.directive.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { Directive, HostBinding } from "@angular/core";

@Directive({
selector: "[cdsClickableTileIcon], [ibmClickableTileIcon]"
})
export class ClickableTileIconDirective {
@HostBinding("class.cds--tile--icon") icon = true;
}
12 changes: 11 additions & 1 deletion src/tiles/clickable-tile.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,18 @@

import { moduleMetadata, Meta } from "@storybook/angular";
import { LayerModule } from "../layer";
import { IconModule } from "../icon";
import { TilesModule, ClickableTile } from "./";

export default {
title: "Components/Tiles/Clickable",
decorators: [
moduleMetadata({
imports: [TilesModule, LayerModule]
imports: [
TilesModule,
LayerModule,
IconModule
]
})
],
component: ClickableTile
Expand All @@ -22,6 +27,11 @@ const Template = (args) => ({
[href]="href"
target="_blank">
Click the tile to open the Carbon Design System
<svg
cdsClickableTileIcon
cdsIcon="caret--right"
size="16">
</svg>
</cds-clickable-tile>
`
});
Expand Down
1 change: 1 addition & 0 deletions src/tiles/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from "./clickable-tile-icon.directive";
export * from "./clickable-tile.component";
export * from "./expandable-tile.component";
export * from "./expandable-tile-above.directive";
Expand Down
3 changes: 3 additions & 0 deletions src/tiles/tiles.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { CommonModule } from "@angular/common";

import { Tile } from "./tile.component";
import { ClickableTile } from "./clickable-tile.component";
import { ClickableTileIconDirective } from "./clickable-tile-icon.directive";
import { ExpandableTile } from "./expandable-tile.component";
import { ExpandableTileAboveFoldDirective } from "./expandable-tile-above.directive";
import { ExpandableTileBelowFoldDirective } from "./expandable-tile-below.directive";
Expand All @@ -16,6 +17,7 @@ import { LinkModule } from "carbon-components-angular/link";
declarations: [
Tile,
ClickableTile,
ClickableTileIconDirective,
ExpandableTileAboveFoldDirective,
ExpandableTileBelowFoldDirective,
ExpandableTile,
Expand All @@ -25,6 +27,7 @@ import { LinkModule } from "carbon-components-angular/link";
exports: [
Tile,
ClickableTile,
ClickableTileIconDirective,
ExpandableTileAboveFoldDirective,
ExpandableTileBelowFoldDirective,
ExpandableTile,
Expand Down

0 comments on commit a786eeb

Please sign in to comment.