{/* prettier-ignore */}
{/*
Copyright 2023 Comcast Cable Communications Management, LLC

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

SPDX-License-Identifier: Apache-2.0
\*/}

import { Meta, Title } from '@storybook/blocks';
import * as IconStories from './Icon.stories';

<Meta of={IconStories} />

<Title />

Renders icon paths and inline svgs

## Source

https://github.com/rdkcentral/Lightning-UI-Components/blob/develop/packages/@lightningjs/ui-components/src/components/Icon/Icon.js

## Usage

`Icon` requires three properties, `icon`, `w` and `h`

```js
import { Icon } from '@lightningjs/ui-components';

class Example extends lng.Component {
  static _template() {
    return {
      Icon: {
        type: Icon,
        w: 50,
        h: 50,
        icon: 'path/to/icon.png'
      }
    };
  }
}
```

A valid `icon` value can be any path to any [common image type](https://developer.mozilla.org/en-US/docs/Web/Media/Formats/Image_types) or an inline SVG.

## API

### Properties

| name  | type    | required | default   | description                                                                                                            |
| ----- | ------- | -------- | --------- | ---------------------------------------------------------------------------------------------------------------------- |
| color | string  | false    | undefined | icon color                                                                                                             |
| fixed | boolean | false    | false     | when `true`, icon width and height will not dynamically resize to the final texture's `finalW` and `finalH` properties |
| icon  | string  | true     | undefined | path to image or inline SVG XML                                                                                        |

### Style Properties

| name  | type   | description                                   |
| ----- | ------ | --------------------------------------------- |
| color | string | icon color (can only be applied on png icons) |
