diff --git a/src/components/icon/demo/index.tsx b/src/components/icon/demo/index.tsx index 903aba955..bba05ec90 100644 --- a/src/components/icon/demo/index.tsx +++ b/src/components/icon/demo/index.tsx @@ -1,4 +1,4 @@ -import { Component, Event, EventEmitter, h, Host, State } from "@stencil/core" +import { Component, Event, EventEmitter, Fragment, h, Host, State } from "@stencil/core" import { Color, Fill, Icon, Notice } from "../../../model" @Component({ tag: "smoothly-icon-demo", @@ -11,6 +11,8 @@ export class SmoothlyIconDemo { @State() display: { filter?: string; variant?: "outline" | "sharp" } = {} @State() props: { color?: Color + customColor?: string + customBackground?: string fill?: Fill flip?: "x" | "y" size?: "tiny" | "small" | "medium" | "large" | "xlarge" @@ -22,7 +24,7 @@ export class SmoothlyIconDemo { return (

Filter and Variants

- (this.display = e.detail)}> + (this.display = e.detail)}> Filter Variant @@ -32,12 +34,25 @@ export class SmoothlyIconDemo {

Props

- (this.props = e.detail)}> + { + this.props = e.detail + console.log("props", this.props) + }}> Color {Color.values.map(color => ( - - {color} + + + {color} ))} @@ -49,6 +64,46 @@ export class SmoothlyIconDemo { ))} + + Custom Color + {Color.values.flatMap(c => ( + + {["tint", "color", "shade", "contrast"].map(v => ( + + + {`rgb(var(--smoothly-${c}-${v}))`} + + ))} + + ))} + + + Custom Background + {Color.values.flatMap(c => ( + + {["tint", "color", "shade", "contrast"].map(v => ( + + + {`rgb(var(--smoothly-${c}-${v}))`} + + ))} + + ))} + Flip x @@ -82,6 +137,11 @@ export class SmoothlyIconDemo { tooltip={name} data-name={name} color={this.props.color} + style={{ + fill: this.props["customColor"] ? `rgb(var(${this.props["customColor"]}))` : "", + color: this.props["customColor"] ? `rgb(var(${this.props["customColor"]}))` : "", + background: this.props["customBackground"] ? `rgb(var(${this.props["customBackground"]}))` : "", + }} fill={this.props.fill} flip={this.props.flip} size={this.props.size}