mirror of
https://github.com/hashicorp/vault.git
synced 2026-04-29 02:01:35 -04:00
* license: update headers to IBM Corp. * `make proto` * update offset because source file changed Signed-off-by: Ryan Cragun <me@ryan.ec> Co-authored-by: Ryan Cragun <me@ryan.ec>
34 lines
1 KiB
JavaScript
34 lines
1 KiB
JavaScript
/**
|
|
* Copyright IBM Corp. 2016, 2025
|
|
* SPDX-License-Identifier: BUSL-1.1
|
|
*/
|
|
|
|
import Component from '@glimmer/component';
|
|
import { assert } from '@ember/debug';
|
|
|
|
/**
|
|
* @module Icon
|
|
* `Icon` components are used to display an icon.
|
|
*
|
|
* Flight icon documentation at https://helios.hashicorp.design/icons/usage-guidelines?tab=code#how-to-use-icons
|
|
* Flight icon library at https://helios.hashicorp.design/icons/library
|
|
*
|
|
* @example
|
|
* <Icon @name="heart" @size="24" />
|
|
*
|
|
* @param {string} name - The name of the SVG to render inline. Required.
|
|
* @param {string} [size=16] - size for flight icon, can be 16 or 24
|
|
*
|
|
*/
|
|
|
|
// TODO - deprecate and remove this after migrating all `<Icon />` instances to `<Hds::Icon />`
|
|
export default class IconComponent extends Component {
|
|
constructor(owner, args) {
|
|
super(owner, args);
|
|
|
|
const { name, size = '16' } = args;
|
|
|
|
assert('Icon component size argument must be either "16" or "24"', ['16', '24'].includes(size));
|
|
assert('Icon name argument must be provided', name);
|
|
}
|
|
}
|